mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
support building msbuild sdk style projects (#17675)
* support building msbuild sdk style projects * fixes after merge
This commit is contained in:
@@ -223,7 +223,7 @@ export class ProjectsController {
|
|||||||
const options: ShellCommandOptions = {
|
const options: ShellCommandOptions = {
|
||||||
commandTitle: 'Build',
|
commandTitle: 'Build',
|
||||||
workingDirectory: project.projectFolderPath,
|
workingDirectory: project.projectFolderPath,
|
||||||
argument: this.buildHelper.constructBuildArguments(project.projectFilePath, this.buildHelper.extensionBuildDirPath)
|
argument: this.buildHelper.constructBuildArguments(project.projectFilePath, this.buildHelper.extensionBuildDirPath, project.isSdkStyleProject)
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ describe('BuildHelper: Build Helper tests', function (): void {
|
|||||||
it('Should get correct build arguments', function (): void {
|
it('Should get correct build arguments', function (): void {
|
||||||
// update settings and validate
|
// update settings and validate
|
||||||
const buildHelper = new BuildHelper();
|
const buildHelper = new BuildHelper();
|
||||||
const resultArg = buildHelper.constructBuildArguments('dummy\\project path\\more space in path', 'dummy\\dll path');
|
const resultArg = buildHelper.constructBuildArguments('dummy\\project path\\more space in path', 'dummy\\dll path', false);
|
||||||
|
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === 'win32') {
|
||||||
should(resultArg).equal(' build "dummy\\\\project path\\\\more space in path" /p:NetCoreBuild=true /p:NETCoreTargetsPath="dummy\\\\dll path"');
|
should(resultArg).equal(' build "dummy\\\\project path\\\\more space in path" /p:NetCoreBuild=true /p:NETCoreTargetsPath="dummy\\\\dll path"');
|
||||||
@@ -24,6 +24,19 @@ describe('BuildHelper: Build Helper tests', function (): void {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Should get correct build arguments for sdk style projects', function (): void {
|
||||||
|
// update settings and validate
|
||||||
|
const buildHelper = new BuildHelper();
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
should(resultArg).equal(' build "dummy/project path/more space in path" /p:NetCoreBuild=true');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('Should get correct build folder', async function (): Promise<void> {
|
it('Should get correct build folder', async function (): Promise<void> {
|
||||||
const buildHelper = new BuildHelper();
|
const buildHelper = new BuildHelper();
|
||||||
await buildHelper.createBuildDirFolder();
|
await buildHelper.createBuildDirFolder();
|
||||||
|
|||||||
@@ -80,10 +80,14 @@ export class BuildHelper {
|
|||||||
return this.extensionBuildDir;
|
return this.extensionBuildDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public constructBuildArguments(projectPath: string, buildDirPath: string): string {
|
public constructBuildArguments(projectPath: string, buildDirPath: string, isNetCoreSdkStyleProject: boolean): string {
|
||||||
projectPath = utils.getQuotedPath(projectPath);
|
projectPath = utils.getQuotedPath(projectPath);
|
||||||
buildDirPath = utils.getQuotedPath(buildDirPath);
|
buildDirPath = utils.getQuotedPath(buildDirPath);
|
||||||
|
if (isNetCoreSdkStyleProject) {
|
||||||
|
return ` build ${projectPath} /p:NetCoreBuild=true`;
|
||||||
|
} else {
|
||||||
return ` build ${projectPath} /p:NetCoreBuild=true /p:NETCoreTargetsPath=${buildDirPath}`;
|
return ` build ${projectPath} /p:NetCoreBuild=true /p:NETCoreTargetsPath=${buildDirPath}`;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user