-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmsbuild.js
More file actions
26 lines (22 loc) · 805 Bytes
/
Copy pathmsbuild.js
File metadata and controls
26 lines (22 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const MsBuild = require(`msbuild`);
const msbuild = new MsBuild();
module.exports = {
build: (solution, configuration, clean) => {
msbuild.getMSBuildPath = () => (process.env.MSBUILD_PATH
? process.env.MSBUILD_PATH
: `C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe`);
if (!process.env.MSBUILD_PATH) {
console.log(`----------------------------`);
console.warn(`* Using default MSBuild path *`);
console.log(`----------------------------`);
console.log();
}
msbuild.sourcePath = solution;
msbuild.configuration = configuration;
msbuild.overrideParams.push(`/p:Platform=Any CPU`);
if (clean) {
msbuild.overrideParams.push(`/t:Clean,Build`);
}
msbuild.build();
},
};