From 5cc62c2e92a3bd956fa1cf4751d091a0e2e2923b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 25 Aug 2020 03:56:03 -0500 Subject: [PATCH 1/5] vs2019 in getBuildTools --- src/constants.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 70aee07..bde4966 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -33,6 +33,13 @@ export const PYTHON = process.arch === 'x64' export const BUILD_TOOLS = getBuildTools(); function getBuildTools() { + const vs2019 = { + installerName: 'vs_BuildTools.exe', + // tslint:disable-next-line + installerUrl: 'https://download.visualstudio.microsoft.com/download/pr/befdb1f9-8676-4693-b031-65ee44835915/fc7680c10773759e4522f5c1ca2ce07fd01f61d7b9efa68b346c0b0da6a0b125/vs_BuildTools.exe', + logName: null, + version: 2019 + }; const vs2017 = { installerName: 'vs_BuildTools.exe', installerUrl: 'https://download.visualstudio.microsoft.com/download/pr/11503713/e64d79b40219aea618ce2fe10ebd5f0d/vs_BuildTools.exe', @@ -45,8 +52,9 @@ function getBuildTools() { logName: 'build-tools-log.txt', version: 2015 }; - - if (process.env.npm_config_vs2017) { + if (process.env.npm_config_vs2019) { + return vs2019; + } else if (process.env.npm_config_vs2017) { return vs2017; } else if (process.env.npm_config_vs2015) { return vs2015; From dd5ee592d7e6e81792f1c0939aeb4b340e54fecb Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 25 Aug 2020 04:02:19 -0500 Subject: [PATCH 2/5] extraArgs for 2019 --- src/utils/get-build-tools-parameters.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/get-build-tools-parameters.ts b/src/utils/get-build-tools-parameters.ts index 143cd87..3bd3ac2 100644 --- a/src/utils/get-build-tools-parameters.ts +++ b/src/utils/get-build-tools-parameters.ts @@ -18,7 +18,8 @@ export function getBuildToolsExtraParameters() { } } - if (!!process.env.npm_config_include_arm64_tools && BUILD_TOOLS.version === 2017) { + const WillowVS2017OrLater = [2017, 2019]; + if (!!process.env.npm_config_include_arm64_tools && WillowVS2017OrLater.includes(BUILD_TOOLS.version)) { extraArgs += ' --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64'; } From 3c1ddf0907a61f7d7fa73d1dc717816789c80260 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 25 Aug 2020 04:15:57 -0500 Subject: [PATCH 3/5] 2019 in launch installer --- ps1/launch-installer.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ps1/launch-installer.ps1 b/ps1/launch-installer.ps1 index 8ea7edb..6de7eaf 100644 --- a/ps1/launch-installer.ps1 +++ b/ps1/launch-installer.ps1 @@ -33,7 +33,8 @@ function runInstaller { cd $BuildToolsInstallerPath - if ($VisualStudioVersion -eq "2017") { + $WillowVS2017OrLater = "2017", "2019" + if ( $WillowVS2017OrLater -contains $VisualStudioVersion) { $params = "--norestart", "--quiet", "--includeRecommended", "--add", "Microsoft.VisualStudio.Workload.VCTools" ./vs_BuildTools.exe $params } else { From 9841a7e5f9ebfe3ffdc6775fb590a1bbd861fe47 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 25 Aug 2020 04:22:44 -0500 Subject: [PATCH 4/5] 2019 in get-build-tools-installer-path-tests --- .../get-build-tools-installer-path-test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/__tests__/utils/get-build-tools-installer-path-test.ts b/__tests__/utils/get-build-tools-installer-path-test.ts index d86ec8f..a99cde2 100644 --- a/__tests__/utils/get-build-tools-installer-path-test.ts +++ b/__tests__/utils/get-build-tools-installer-path-test.ts @@ -40,4 +40,22 @@ describe('getBuildToolsInstallerPath', () => { delete process.env.npm_config_vs2017; }); + + it('gets the correct information (2019)', () => { + process.env.npm_config_vs2019 = 'true'; + + jest.resetModules(); + + const { getBuildToolsInstallerPath } = require('../../src/utils/get-build-tools-installer-path'); + + expect(getBuildToolsInstallerPath()).toEqual({ + directory: 'C:\\workDir', + fileName: 'vs_BuildTools.exe', + logPath: null, + path: 'C:\\workDir\\vs_BuildTools.exe', + url: 'https://download.visualstudio.microsoft.com/download/pr/befdb1f9-8676-4693-b031-65ee44835915/fc7680c10773759e4522f5c1ca2ce07fd01f61d7b9efa68b346c0b0da6a0b125/vs_BuildTools.exe', + }); + + delete process.env.npm_config_vs2017; + }); }); From 2407a5748e46e01aba090a7fd471917a06e9fa35 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 25 Aug 2020 04:24:20 -0500 Subject: [PATCH 5/5] 2019 in installation-success-test --- __tests__/utils/installation-success-test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/__tests__/utils/installation-success-test.ts b/__tests__/utils/installation-success-test.ts index 8f58452..65dcf3a 100644 --- a/__tests__/utils/installation-success-test.ts +++ b/__tests__/utils/installation-success-test.ts @@ -103,5 +103,9 @@ describe('installation-success', () => { it('VS2017 successful intallation', () => { testLog('vs2017-success', 75, true, 2017); }); + + it('VS2019 successful intallation', () => { + testLog('vs2019-success', 75, true, 2019); + }); }); });