mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-01-31 19:26:36 +08:00
Allow users to set %VSINSTALLDIR%
and update `KNOWN_VISUAL_STUDIO_INSTALLATIONS`. Fixes #29
This commit is contained in:
parent
4aba115fa5
commit
d01f5f519f
12
dist/main/index.js
generated
vendored
12
dist/main/index.js
generated
vendored
@ -75079,14 +75079,18 @@ const child_process_1 = __nccwpck_require__(2081);
|
|||||||
const fs_1 = __nccwpck_require__(7147);
|
const fs_1 = __nccwpck_require__(7147);
|
||||||
// Keep in sync with https://github.com/actions/virtual-environments
|
// Keep in sync with https://github.com/actions/virtual-environments
|
||||||
const KNOWN_VISUAL_STUDIO_INSTALLATIONS = [
|
const KNOWN_VISUAL_STUDIO_INSTALLATIONS = [
|
||||||
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise',
|
'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise',
|
||||||
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise',
|
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise',
|
||||||
'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise' // 'windows-2022'
|
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise' // 'windows-2016' (deprecated and removed)
|
||||||
];
|
];
|
||||||
const VCVARSALL_SUBPATH = '\\VC\\Auxiliary\\Build\\vcvarsall.bat';
|
if (process.env['VSINSTALLDIR']) {
|
||||||
|
// if VSINSTALLDIR is set, make it the first known installation
|
||||||
|
KNOWN_VISUAL_STUDIO_INSTALLATIONS.unshift(process.env['VSINSTALLDIR'].replace(/\\$/, ''));
|
||||||
|
}
|
||||||
|
const VCVARSALL_SUBPATH = 'VC\\Auxiliary\\Build\\vcvarsall.bat';
|
||||||
function findVcvarsallPath() {
|
function findVcvarsallPath() {
|
||||||
for (const installation of KNOWN_VISUAL_STUDIO_INSTALLATIONS) {
|
for (const installation of KNOWN_VISUAL_STUDIO_INSTALLATIONS) {
|
||||||
const candidate = `${installation}${VCVARSALL_SUBPATH}`;
|
const candidate = `${installation}\\${VCVARSALL_SUBPATH}`;
|
||||||
if (fs_1.existsSync(candidate)) {
|
if (fs_1.existsSync(candidate)) {
|
||||||
return candidate;
|
return candidate;
|
||||||
}
|
}
|
||||||
|
16
src/msvc.ts
16
src/msvc.ts
@ -4,15 +4,21 @@ import {existsSync} from 'fs'
|
|||||||
|
|
||||||
// Keep in sync with https://github.com/actions/virtual-environments
|
// Keep in sync with https://github.com/actions/virtual-environments
|
||||||
const KNOWN_VISUAL_STUDIO_INSTALLATIONS = [
|
const KNOWN_VISUAL_STUDIO_INSTALLATIONS = [
|
||||||
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise', // 'windows-2016'
|
'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise', // 'windows-2022' and 'windows-latest'
|
||||||
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise', // 'windows-2019' and 'windows-latest'
|
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise', // 'windows-2019'
|
||||||
'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise' // 'windows-2022'
|
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise' // 'windows-2016' (deprecated and removed)
|
||||||
]
|
]
|
||||||
const VCVARSALL_SUBPATH = '\\VC\\Auxiliary\\Build\\vcvarsall.bat'
|
if (process.env['VSINSTALLDIR']) {
|
||||||
|
// if VSINSTALLDIR is set, make it the first known installation
|
||||||
|
KNOWN_VISUAL_STUDIO_INSTALLATIONS.unshift(
|
||||||
|
process.env['VSINSTALLDIR'].replace(/\\$/, '')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const VCVARSALL_SUBPATH = 'VC\\Auxiliary\\Build\\vcvarsall.bat'
|
||||||
|
|
||||||
function findVcvarsallPath(): string {
|
function findVcvarsallPath(): string {
|
||||||
for (const installation of KNOWN_VISUAL_STUDIO_INSTALLATIONS) {
|
for (const installation of KNOWN_VISUAL_STUDIO_INSTALLATIONS) {
|
||||||
const candidate = `${installation}${VCVARSALL_SUBPATH}`
|
const candidate = `${installation}\\${VCVARSALL_SUBPATH}`
|
||||||
if (existsSync(candidate)) {
|
if (existsSync(candidate)) {
|
||||||
return candidate
|
return candidate
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user