Skip to content

Commit d8610e2

Browse files
committed
msvc-dev-cmd v1.10.0
2 parents 7defe92 + 9f8ae83 commit d8610e2

File tree

8 files changed

+981
-1079
lines changed

8 files changed

+981
-1079
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ jobs:
5858
dumpbin /headers hello.exe
5959
audit:
6060
name: npm audit
61-
runs-on: windows-latest
61+
runs-on: ubuntu-latest
6262
steps:
6363
- name: Check out source code
6464
uses: actions/checkout@v2
6565
- run: npm install
66-
- run: npm audit --audit-level=moderate
66+
- run: npm audit --audit-level=moderate --production
67+
- run: npm audit --audit-level=critical
6768
alias-arch:
6869
name: arch aliases
6970
runs-on: windows-latest

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
hello.exe
2424
audit:
2525
name: npm audit
26-
runs-on: windows-latest
26+
runs-on: ubuntu-latest
2727
steps:
2828
- name: Check out source code
2929
uses: actions/checkout@v2
30-
- run: npm audit --audit-level=moderate
30+
- run: npm audit --audit-level=moderate --production
31+
- run: npm audit --audit-level=critical

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656

5757
- `arch` – target architecture
5858
- native compilation:
59-
- `x64` (default) or its synonyms: `amd64`, `win64`, `x86_64`
59+
- `x64` (default) or its synonyms: `amd64`, `win64`, `x86_64`, `x86-64`
6060
- `x86` or its synonyms: `win32`
6161
- cross-compilation: `x86_amd64`, `x86_arm`, `x86_arm64`, `amd64_x86`, `amd64_arm`, `amd64_arm64`
6262
- `sdk` – Windows SDK to use

index.js

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ const path = require('path')
55
const process = require('process')
66

77
const PROGRAM_FILES_X86 = process.env['ProgramFiles(x86)']
8+
const PROGRAM_FILES = [process.env['ProgramFiles(x86)'], process.env['ProgramFiles']]
9+
810

911
const EDITIONS = ['Enterprise', 'Professional', 'Community']
10-
const VERSIONS = ['2019', '2017']
12+
const VERSIONS = ['2022', '2019', '2017']
1113

1214
const VSWHERE_PATH = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\Installer`
1315

@@ -32,13 +34,15 @@ function findVcvarsall() {
3234

3335
// If that does not work, try the standard installation locations,
3436
// starting with the latest and moving to the oldest.
35-
for (const ver of VERSIONS) {
36-
for (const ed of EDITIONS) {
37-
path = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
38-
core.info(`Trying standard location: ${path}`)
39-
if (fs.existsSync(path)) {
40-
core.info(`Found standard location: ${path}`)
41-
return path
37+
for (const prog_files of PROGRAM_FILES) {
38+
for (const ver of VERSIONS) {
39+
for (const ed of EDITIONS) {
40+
path = `${prog_files}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
41+
core.info(`Trying standard location: ${path}`)
42+
if (fs.existsSync(path)) {
43+
core.info(`Found standard location: ${path}`)
44+
return path
45+
}
4246
}
4347
}
4448
}
@@ -70,7 +74,8 @@ function filterPathValue(path) {
7074
return paths.filter(unique).join(';')
7175
}
7276

73-
function main() {
77+
/** See https://github.com/ilammy/msvc-dev-cmd#inputs */
78+
function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre) {
7479
if (process.platform != 'win32') {
7580
core.info('This is not a Windows virtual environment, bye!')
7681
return
@@ -79,12 +84,6 @@ function main() {
7984
// Add standard location of "vswhere" to PATH, in case it's not there.
8085
process.env.PATH += path.delimiter + VSWHERE_PATH
8186

82-
var arch = core.getInput('arch')
83-
const sdk = core.getInput('sdk')
84-
const toolset = core.getInput('toolset')
85-
const uwp = core.getInput('uwp')
86-
const spectre = core.getInput('spectre')
87-
8887
// There are all sorts of way the architectures are called. In addition to
8988
// values supported by Microsoft Visual C++, recognize some common aliases.
9089
let arch_aliases = {
@@ -177,6 +176,17 @@ function main() {
177176

178177
core.info(`Configured Developer Command Prompt`)
179178
}
179+
exports.setupMSVCDevCmd = setupMSVCDevCmd
180+
181+
function main() {
182+
var arch = core.getInput('arch')
183+
const sdk = core.getInput('sdk')
184+
const toolset = core.getInput('toolset')
185+
const uwp = core.getInput('uwp')
186+
const spectre = core.getInput('spectre')
187+
188+
setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre)
189+
}
180190

181191
try {
182192
main()

node_modules/.package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@actions/core/package.json

Lines changed: 17 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)