You've already forked setup-msbuild
mirror of
https://github.com/microsoft/setup-msbuild.git
synced 2025-09-08 22:04:07 +07:00
Compare commits
6 Commits
v1.2
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
06fb09037a | |||
1ff57057b5 | |||
0e7c76c8f5 | |||
3ac564e2a5 | |||
d3ea839497 | |||
0a09b7fae9 |
18
action-types.yml
Normal file
18
action-types.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# See https://github.com/krzema12/github-actions-typing
|
||||||
|
inputs:
|
||||||
|
vswhere-path:
|
||||||
|
type: string
|
||||||
|
vs-version:
|
||||||
|
type: string
|
||||||
|
vs-prerelease:
|
||||||
|
type: boolean
|
||||||
|
msbuild-architecture:
|
||||||
|
type: enum
|
||||||
|
name: Architecture
|
||||||
|
allowed-values:
|
||||||
|
- x86
|
||||||
|
- x64
|
||||||
|
- arm64
|
||||||
|
outputs:
|
||||||
|
msbuildPath:
|
||||||
|
type: string
|
@ -15,7 +15,7 @@ inputs:
|
|||||||
description: 'Enable searching for pre-release versions of Visual Studio/MSBuild'
|
description: 'Enable searching for pre-release versions of Visual Studio/MSBuild'
|
||||||
required: false
|
required: false
|
||||||
msbuild-architecture:
|
msbuild-architecture:
|
||||||
description: 'The preferred processor architecture of MSBuild. Can be either "x86" or "x64". "x64" is only available from Visual Studio version 17.0 and later.'
|
description: 'The preferred processor architecture of MSBuild. Can be either "x86", "x64", or "arm64". "x64" is only available from Visual Studio version 17.0 and later.'
|
||||||
required: false
|
required: false
|
||||||
default: 'x86'
|
default: 'x86'
|
||||||
outputs:
|
outputs:
|
||||||
|
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -1652,7 +1652,7 @@ const IS_WINDOWS = process.platform === 'win32';
|
|||||||
const VS_VERSION = core.getInput('vs-version') || 'latest';
|
const VS_VERSION = core.getInput('vs-version') || 'latest';
|
||||||
const VSWHERE_PATH = core.getInput('vswhere-path');
|
const VSWHERE_PATH = core.getInput('vswhere-path');
|
||||||
const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false';
|
const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false';
|
||||||
const MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86';
|
let MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86';
|
||||||
// if a specific version of VS is requested
|
// if a specific version of VS is requested
|
||||||
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest ';
|
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest ';
|
||||||
if (ALLOW_PRERELEASE === 'true') {
|
if (ALLOW_PRERELEASE === 'true') {
|
||||||
@ -1703,6 +1703,10 @@ function run() {
|
|||||||
core.debug(`Found installation path: ${installationPath}`);
|
core.debug(`Found installation path: ${installationPath}`);
|
||||||
// x64 and arm64 only exist in one possible location, so no fallback probing
|
// x64 and arm64 only exist in one possible location, so no fallback probing
|
||||||
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
|
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
|
||||||
|
// x64 is actually amd64 so change to that
|
||||||
|
if (MSBUILD_ARCH === 'x64') {
|
||||||
|
MSBUILD_ARCH = 'amd64';
|
||||||
|
}
|
||||||
let toolPath = path.join(installationPath, `MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`);
|
let toolPath = path.join(installationPath, `MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`);
|
||||||
core.debug(`Checking for path: ${toolPath}`);
|
core.debug(`Checking for path: ${toolPath}`);
|
||||||
if (!fs.existsSync(toolPath)) {
|
if (!fs.existsSync(toolPath)) {
|
||||||
|
92
package-lock.json
generated
92
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-msbuild",
|
"name": "setup-msbuild",
|
||||||
"version": "1.2.0",
|
"version": "1.3.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "setup-msbuild",
|
"name": "setup-msbuild",
|
||||||
"version": "1.2.0",
|
"version": "1.3.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
@ -302,12 +302,6 @@
|
|||||||
"node": ">=0.1.95"
|
"node": ">=0.1.95"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@cnakazawa/watch/node_modules/minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/@jest/console": {
|
"node_modules/@jest/console": {
|
||||||
"version": "24.9.0",
|
"version": "24.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz",
|
||||||
@ -3977,12 +3971,6 @@
|
|||||||
"uglify-js": "^3.1.4"
|
"uglify-js": "^3.1.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/handlebars/node_modules/minimist": {
|
|
||||||
"version": "1.2.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/handlebars/node_modules/source-map": {
|
"node_modules/handlebars/node_modules/source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
@ -5383,12 +5371,6 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/json5/node_modules/minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/jsprim": {
|
"node_modules/jsprim": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
|
||||||
@ -5668,10 +5650,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimist": {
|
"node_modules/minimist": {
|
||||||
"version": "0.0.8",
|
"version": "1.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mixin-deep": {
|
"node_modules/mixin-deep": {
|
||||||
"version": "1.3.2",
|
"version": "1.3.2",
|
||||||
@ -5699,13 +5684,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mkdirp": {
|
"node_modules/mkdirp": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||||
"deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
|
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "^1.2.6"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"mkdirp": "bin/cmd.js"
|
"mkdirp": "bin/cmd.js"
|
||||||
@ -6885,12 +6869,6 @@
|
|||||||
"node": "6.* || 8.* || >= 10.*"
|
"node": "6.* || 8.* || >= 10.*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sane/node_modules/minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/sax": {
|
"node_modules/sax": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||||
@ -8428,14 +8406,6 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"exec-sh": "^0.3.2",
|
"exec-sh": "^0.3.2",
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@jest/console": {
|
"@jest/console": {
|
||||||
@ -11431,12 +11401,6 @@
|
|||||||
"wordwrap": "^1.0.0"
|
"wordwrap": "^1.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": {
|
|
||||||
"version": "1.2.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"source-map": {
|
"source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
@ -12561,14 +12525,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jsprim": {
|
"jsprim": {
|
||||||
@ -12794,9 +12750,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "1.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"mixin-deep": {
|
"mixin-deep": {
|
||||||
@ -12821,12 +12777,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "^1.2.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
@ -13751,14 +13707,6 @@
|
|||||||
"micromatch": "^3.1.4",
|
"micromatch": "^3.1.4",
|
||||||
"minimist": "^1.1.1",
|
"minimist": "^1.1.1",
|
||||||
"walker": "~1.0.5"
|
"walker": "~1.0.5"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sax": {
|
"sax": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-msbuild",
|
"name": "setup-msbuild",
|
||||||
"version": "1.2.0",
|
"version": "1.3.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Helps set up specific MSBuild tool into PATH for later usage.",
|
"description": "Helps set up specific MSBuild tool into PATH for later usage.",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
@ -9,7 +9,7 @@ const IS_WINDOWS = process.platform === 'win32'
|
|||||||
const VS_VERSION = core.getInput('vs-version') || 'latest'
|
const VS_VERSION = core.getInput('vs-version') || 'latest'
|
||||||
const VSWHERE_PATH = core.getInput('vswhere-path')
|
const VSWHERE_PATH = core.getInput('vswhere-path')
|
||||||
const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false'
|
const ALLOW_PRERELEASE = core.getInput('vs-prerelease') || 'false'
|
||||||
const MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86'
|
let MSBUILD_ARCH = core.getInput('msbuild-architecture') || 'x86'
|
||||||
|
|
||||||
// if a specific version of VS is requested
|
// if a specific version of VS is requested
|
||||||
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest '
|
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest '
|
||||||
@ -73,6 +73,10 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
// x64 and arm64 only exist in one possible location, so no fallback probing
|
// x64 and arm64 only exist in one possible location, so no fallback probing
|
||||||
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
|
if (MSBUILD_ARCH === 'x64' || MSBUILD_ARCH === 'arm64') {
|
||||||
|
// x64 is actually amd64 so change to that
|
||||||
|
if (MSBUILD_ARCH === 'x64') {
|
||||||
|
MSBUILD_ARCH = 'amd64'
|
||||||
|
}
|
||||||
let toolPath = path.join(
|
let toolPath = path.join(
|
||||||
installationPath,
|
installationPath,
|
||||||
`MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`
|
`MSBuild\\Current\\Bin\\${MSBUILD_ARCH}\\MSBuild.exe`
|
||||||
|
Reference in New Issue
Block a user