mirror of
https://github.com/ilammy/msvc-dev-cmd.git
synced 2026-09-06 21:57:19 +08:00
Export setupMSVCDevCmd to allow library usage (#47)
This commit is contained in:
@@ -70,7 +70,8 @@ function filterPathValue(path) {
|
|||||||
return paths.filter(unique).join(';')
|
return paths.filter(unique).join(';')
|
||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
/** See https://github.com/ilammy/msvc-dev-cmd#inputs */
|
||||||
|
function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre) {
|
||||||
if (process.platform != 'win32') {
|
if (process.platform != 'win32') {
|
||||||
core.info('This is not a Windows virtual environment, bye!')
|
core.info('This is not a Windows virtual environment, bye!')
|
||||||
return
|
return
|
||||||
@@ -79,12 +80,6 @@ function main() {
|
|||||||
// Add standard location of "vswhere" to PATH, in case it's not there.
|
// Add standard location of "vswhere" to PATH, in case it's not there.
|
||||||
process.env.PATH += path.delimiter + VSWHERE_PATH
|
process.env.PATH += path.delimiter + VSWHERE_PATH
|
||||||
|
|
||||||
var arch = core.getInput('arch')
|
|
||||||
const sdk = core.getInput('sdk')
|
|
||||||
const toolset = core.getInput('toolset')
|
|
||||||
const uwp = core.getInput('uwp')
|
|
||||||
const spectre = core.getInput('spectre')
|
|
||||||
|
|
||||||
// There are all sorts of way the architectures are called. In addition to
|
// There are all sorts of way the architectures are called. In addition to
|
||||||
// values supported by Microsoft Visual C++, recognize some common aliases.
|
// values supported by Microsoft Visual C++, recognize some common aliases.
|
||||||
let arch_aliases = {
|
let arch_aliases = {
|
||||||
@@ -177,6 +172,17 @@ function main() {
|
|||||||
|
|
||||||
core.info(`Configured Developer Command Prompt`)
|
core.info(`Configured Developer Command Prompt`)
|
||||||
}
|
}
|
||||||
|
exports.setupMSVCDevCmd = setupMSVCDevCmd
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
var arch = core.getInput('arch')
|
||||||
|
const sdk = core.getInput('sdk')
|
||||||
|
const toolset = core.getInput('toolset')
|
||||||
|
const uwp = core.getInput('uwp')
|
||||||
|
const spectre = core.getInput('spectre')
|
||||||
|
|
||||||
|
setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre)
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user