diff --git a/extensions/sql-database-projects/src/models/project.ts b/extensions/sql-database-projects/src/models/project.ts index 325ab9b41b..e67b3840df 100644 --- a/extensions/sql-database-projects/src/models/project.ts +++ b/extensions/sql-database-projects/src/models/project.ts @@ -832,7 +832,8 @@ export class Project implements ISqlProject { public getSystemDacpacUri(dacpac: string): Uri { const versionFolder = this.getSystemDacpacFolderName(); - return Uri.parse(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', versionFolder, dacpac)); + const systemDacpacLocation = this.isSdkStyleProject ? '$(SystemDacpacsLocation)' : '$(NETCoreTargetsPath)'; + return Uri.parse(path.join(systemDacpacLocation, 'SystemDacpacs', versionFolder, dacpac)); } public getSystemDacpacSsdtUri(dacpac: string): Uri { diff --git a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectBaseline.xml b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectBaseline.xml index 1d1473d482..af7c18e586 100644 --- a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectBaseline.xml +++ b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectBaseline.xml @@ -29,7 +29,7 @@ - + False master diff --git a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithBuildRemoveBaseline.xml b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithBuildRemoveBaseline.xml index d01d6e2baa..e8d80206c2 100644 --- a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithBuildRemoveBaseline.xml +++ b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithBuildRemoveBaseline.xml @@ -25,7 +25,7 @@ - + False master diff --git a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithFilesSpecifiedBaseline.xml b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithFilesSpecifiedBaseline.xml index d7eecc0273..c37d196b56 100644 --- a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithFilesSpecifiedBaseline.xml +++ b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithFilesSpecifiedBaseline.xml @@ -38,7 +38,7 @@ - + False master diff --git a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithGlobsSpecifiedBaseline.xml b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithGlobsSpecifiedBaseline.xml index 88a388508a..e2a7a92347 100644 --- a/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithGlobsSpecifiedBaseline.xml +++ b/extensions/sql-database-projects/src/test/baselines/openSdkStyleSqlProjectWithGlobsSpecifiedBaseline.xml @@ -28,7 +28,7 @@ - + False master diff --git a/extensions/sql-database-projects/src/test/buildHelper.test.ts b/extensions/sql-database-projects/src/test/buildHelper.test.ts index f2a2b557fd..5c689fd5c6 100644 --- a/extensions/sql-database-projects/src/test/buildHelper.test.ts +++ b/extensions/sql-database-projects/src/test/buildHelper.test.ts @@ -30,10 +30,10 @@ describe('BuildHelper: Build Helper tests', function (): void { const resultArg = buildHelper.constructBuildArguments('dummy\\project path\\more space in path', 'dummy\\dll path', true); if (os.platform() === 'win32') { - should(resultArg).equal(' build "dummy\\\\project path\\\\more space in path" /p:NetCoreBuild=true'); + should(resultArg).equal(' build "dummy\\\\project path\\\\more space in path" /p:NetCoreBuild=true /p:SystemDacpacsLocation=="dummy\\\\dll path"'); } else { - should(resultArg).equal(' build "dummy/project path/more space in path" /p:NetCoreBuild=true'); + should(resultArg).equal(' build "dummy/project path/more space in path" /p:NetCoreBuild=true /p:SystemDacpacsLocation="dummy/dll path"'); } }); diff --git a/extensions/sql-database-projects/src/tools/buildHelper.ts b/extensions/sql-database-projects/src/tools/buildHelper.ts index f4992b732b..3436b12cb9 100644 --- a/extensions/sql-database-projects/src/tools/buildHelper.ts +++ b/extensions/sql-database-projects/src/tools/buildHelper.ts @@ -83,8 +83,12 @@ export class BuildHelper { public constructBuildArguments(projectPath: string, buildDirPath: string, isSdkStyleProject: boolean): string { projectPath = utils.getQuotedPath(projectPath); buildDirPath = utils.getQuotedPath(buildDirPath); + + // Right now SystemDacpacsLocation and NETCoreTargetsPath get set to the same thing, but separating them out for if we move + // the system dacpacs somewhere else and also so that the variable name makes more sense if building from the commandline, + // since SDK style projects don't to specify the targets path, just where the system dacpacs are if (isSdkStyleProject) { - return ` build ${projectPath} /p:NetCoreBuild=true`; + return ` build ${projectPath} /p:NetCoreBuild=true /p:SystemDacpacsLocation=${buildDirPath}`; } else { return ` build ${projectPath} /p:NetCoreBuild=true /p:NETCoreTargetsPath=${buildDirPath}`; }