mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
fix SDK style projects not being able to find system dacpacs (#18218)
* fix SDK style projects not being able to find system dacpacs * fix tests
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<None Include="folder1\Script.PostDeployment2.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\150\master.dacpac">
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(SystemDacpacsLocation)\SystemDacpacs\150\master.dacpac">
|
||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||
</ArtifactReference>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<Build Remove="file1.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\150\master.dacpac">
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(SystemDacpacsLocation)\SystemDacpacs\150\master.dacpac">
|
||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||
</ArtifactReference>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<None Include="folder1\Script.PostDeployment2.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\150\master.dacpac">
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(SystemDacpacsLocation)\SystemDacpacs\150\master.dacpac">
|
||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||
</ArtifactReference>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<None Include="..\other\folder2\Script.PostDeployment2.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(NETCoreTargetsPath)\SystemDacpacs\150\master.dacpac">
|
||||
<ArtifactReference Condition="'$(NetCoreBuild)' == 'true'" Include="$(SystemDacpacsLocation)\SystemDacpacs\150\master.dacpac">
|
||||
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
|
||||
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
|
||||
</ArtifactReference>
|
||||
|
||||
@@ -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"');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user