mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
change afterClean to beforeBuild for removing the generated assests.json (#13736)
* change afterClean to beforeBuild for removing the generated assests.json * fix merge conflict * rename files
This commit is contained in:
@@ -201,7 +201,7 @@ export class Project {
|
||||
await fs.copyFile(this.projectFilePath, this.projectFilePath + '_backup');
|
||||
await this.updateImportToSupportRoundTrip();
|
||||
await this.updatePackageReferenceInProjFile();
|
||||
await this.updateAfterCleanTargetInProjFile();
|
||||
await this.updateBeforeBuildTargetInProjFile();
|
||||
await this.updateSystemDatabaseReferencesInProjFile();
|
||||
}
|
||||
} else if (this.containsSSDTOnlySystemDatabaseReferences()) {
|
||||
@@ -232,21 +232,21 @@ export class Project {
|
||||
await this.updateImportedTargetsToProjFile(constants.NetCoreCondition, constants.NetCoreTargets, undefined);
|
||||
}
|
||||
|
||||
private async updateAfterCleanTargetInProjFile(): Promise<void> {
|
||||
private async updateBeforeBuildTargetInProjFile(): Promise<void> {
|
||||
// Search if clean target already present, update it
|
||||
for (let i = 0; i < this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Target).length; i++) {
|
||||
const afterCleanNode = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Target)[i];
|
||||
const name = afterCleanNode.getAttribute(constants.Name);
|
||||
if (name === constants.AfterCleanTarget) {
|
||||
return await this.createCleanFileNode(afterCleanNode);
|
||||
const beforeBuildNode = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.Target)[i];
|
||||
const name = beforeBuildNode.getAttribute(constants.Name);
|
||||
if (name === constants.BeforeBuildTarget) {
|
||||
return await this.createCleanFileNode(beforeBuildNode);
|
||||
}
|
||||
}
|
||||
|
||||
// If clean target not found, create new
|
||||
const afterCleanNode = this.projFileXmlDoc.createElement(constants.Target);
|
||||
afterCleanNode.setAttribute(constants.Name, constants.AfterCleanTarget);
|
||||
this.projFileXmlDoc.documentElement.appendChild(afterCleanNode);
|
||||
await this.createCleanFileNode(afterCleanNode);
|
||||
const beforeBuildNode = this.projFileXmlDoc.createElement(constants.Target);
|
||||
beforeBuildNode.setAttribute(constants.Name, constants.BeforeBuildTarget);
|
||||
this.projFileXmlDoc.documentElement.appendChild(beforeBuildNode);
|
||||
await this.createCleanFileNode(beforeBuildNode);
|
||||
}
|
||||
|
||||
private async createCleanFileNode(parentNode: any): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user