From eb05ae525c98ce1e1433e996c1d06f0cdc334f84 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Tue, 15 Oct 2019 17:41:47 -0700 Subject: [PATCH 01/27] Don't hardcode the path to v141 platform toolset --- vnext/local-cli/runWindows/utils/msbuildtools.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index 7149f6af4d6..16f489798c3 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -65,11 +65,17 @@ class MSBuildTools { // Set platform toolset for VS 2019 if (this.version === '16.0') { + const v141path = child_process + .execSync('"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" -requires Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 -property installationPath') + .toString().split(EOL)[0] + + '\\MSBuild\\Microsoft\\VC\\v150\\'; + args.push('/p:PlatformToolset=v141'); args.push('/p:VisualStudioVersion=16.0'); args.push( - '/p:VCTargetsPath=C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Microsoft\\VC\\v150\\', + '/p:VCTargetsPath=' + v141path, ); + } if (config) { @@ -85,6 +91,8 @@ class MSBuildTools { return; } + console.log('MSBuild args: ' + args.join(' ')); + const progressName = 'Building Solution'; const spinner = newSpinner(progressName); await commandWithProgress( From 5259e65b49ff7d0131cc7d731ca7bd3438b03776 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Tue, 15 Oct 2019 18:03:13 -0700 Subject: [PATCH 02/27] fix linting --- .../runWindows/utils/msbuildtools.js | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index 16f489798c3..7577cff3c49 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -5,7 +5,6 @@ */ // @ts-check 'use strict'; - const EOL = require('os').EOL; const fs = require('fs'); const path = require('path'); @@ -65,17 +64,21 @@ class MSBuildTools { // Set platform toolset for VS 2019 if (this.version === '16.0') { - const v141path = child_process - .execSync('"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" -requires Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 -property installationPath') - .toString().split(EOL)[0] - + '\\MSBuild\\Microsoft\\VC\\v150\\'; + const results = + child_process + .execSync( + '"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" -requires Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 -property installationPath', + ) + .toString() + .split(EOL)[0] + '\\MSBuild\\Microsoft\\VC\\v150\\'; + + console.warn('v141Path = ' + results); args.push('/p:PlatformToolset=v141'); args.push('/p:VisualStudioVersion=16.0'); - args.push( - '/p:VCTargetsPath=' + v141path, - ); + args.push('/p:VCTargetsPath=' + results); + console.warn(args.join(' ')); } if (config) { @@ -91,8 +94,6 @@ class MSBuildTools { return; } - console.log('MSBuild args: ' + args.join(' ')); - const progressName = 'Building Solution'; const spinner = newSpinner(progressName); await commandWithProgress( From e8526cea4a320ced006ca853be24e45ad164bebc Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Tue, 15 Oct 2019 18:17:55 -0700 Subject: [PATCH 03/27] Change files --- ...eact-native-windows-2019-10-15-18-17-54-v141path.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 change/react-native-windows-2019-10-15-18-17-54-v141path.json diff --git a/change/react-native-windows-2019-10-15-18-17-54-v141path.json b/change/react-native-windows-2019-10-15-18-17-54-v141path.json new file mode 100644 index 00000000000..68e72d8c7b0 --- /dev/null +++ b/change/react-native-windows-2019-10-15-18-17-54-v141path.json @@ -0,0 +1,9 @@ +{ + "type": "none", + "comment": "Don't hardcode the path to v141 platform toolset", + "packageName": "react-native-windows", + "email": "asklar@winse.microsoft.com", + "commit": "5259e65b49ff7d0131cc7d731ca7bd3438b03776", + "date": "2019-10-16T01:17:54.674Z", + "file": "F:\\rnw\\change\\react-native-windows-2019-10-15-18-17-54-v141path.json" +} \ No newline at end of file From b842623ee5257bd996f82add1718eb872e738a3f Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Wed, 16 Oct 2019 17:23:30 -0700 Subject: [PATCH 04/27] Support 2017/2019 installs and side-by-side installs --- vnext/local-cli/runWindows/utils/build.js | 9 +- .../runWindows/utils/msbuildtools.js | 100 +++++++++++------- 2 files changed, 69 insertions(+), 40 deletions(-) diff --git a/vnext/local-cli/runWindows/utils/build.js b/vnext/local-cli/runWindows/utils/build.js index 102abe2b70f..ae883f8ad0c 100644 --- a/vnext/local-cli/runWindows/utils/build.js +++ b/vnext/local-cli/runWindows/utils/build.js @@ -29,10 +29,10 @@ async function buildSolution(slnFile, buildType, buildArch, verbose) { await msBuildTools.buildProject(slnFile, buildType, buildArch, null, verbose); } -async function nugetRestore(nugetPath, slnFile, verbose) { +async function nugetRestore(nugetPath, slnFile, verbose, msbuildVersion) { const text = 'Restoring NuGets'; const spinner = newSpinner(text); - + console.log(nugetPath); await commandWithProgress( spinner, text, @@ -43,6 +43,8 @@ async function nugetRestore(nugetPath, slnFile, verbose) { '-NonInteractive', '-Verbosity', verbose ? 'normal' : 'quiet', + '-MSBuildVersion', + msbuildVersion, ], verbose, ); @@ -68,7 +70,8 @@ async function restoreNuGetPackages(options, slnFile, verbose) { } ensureNugetSpinner.succeed('Found NuGet Binary'); - await nugetRestore(nugetPath, slnFile, verbose); + const msbuildTools = MSBuildTools.findAvailableVersion(); + await nugetRestore(nugetPath, slnFile, verbose, msbuildTools.installationVersion); } function getSolutionFile(options) { diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index 7577cff3c49..954d59efe76 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -24,16 +24,20 @@ const { const MSBUILD_VERSIONS = ['16.0', '15.0', '14.0', '12.0', '4.0']; class MSBuildTools { - constructor(version, localPath) { + // version is something like 16.0 for 2019 + // localPath is the path to MSBuild.exe (x86) + // installationVersion is the full version e.g. 16.3.29411.108 + constructor(version, localPath, installationVersion) { this.version = version; this.path = localPath; + this.installationVersion = installationVersion; } cleanProject(slnFile) { const cmd = `"${path.join( this.path, 'msbuild.exe', - )}" "${slnFile}" t/:Clean`; + )}" "${slnFile}" /t:Clean`; const results = child_process .execSync(cmd) .toString() @@ -64,21 +68,12 @@ class MSBuildTools { // Set platform toolset for VS 2019 if (this.version === '16.0') { - const results = - child_process - .execSync( - '"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe" -requires Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 -property installationPath', - ) - .toString() - .split(EOL)[0] + '\\MSBuild\\Microsoft\\VC\\v150\\'; - - console.warn('v141Path = ' + results); - + // we are guaranteed to have Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 + const vsPath = path.resolve(this.path, '../../..'); + const targetsPath = path.join(vsPath, 'MSBuild\\Microsoft\\VC\\v150\\'); args.push('/p:PlatformToolset=v141'); args.push('/p:VisualStudioVersion=16.0'); - args.push('/p:VCTargetsPath=' + results); - - console.warn(args.join(' ')); + args.push('/p:VCTargetsPath=' + targetsPath); } if (config) { @@ -94,6 +89,8 @@ class MSBuildTools { return; } + console.log(`Running MSBuild with args ${args.join(' ')}`); + const progressName = 'Building Solution'; const spinner = newSpinner(progressName); await commandWithProgress( @@ -106,9 +103,7 @@ class MSBuildTools { } } -function checkMSBuildVersion(version) { - let toolsPath = null; - +function VSWhere(requires, version, property) { // This path is maintained and VS has promised to keep it valid. const vsWherePath = path.join( process.env['ProgramFiles(x86)'], @@ -119,23 +114,12 @@ function checkMSBuildVersion(version) { if (fs.existsSync(vsWherePath)) { const vsPath = child_process .execSync( - `"${vsWherePath}" -latest -products * Microsoft.Component.MSBuild -property installationPath`, + `"${vsWherePath}" -version [${version},${Number(version) + + 1}) -products * -requires ${requires} -property ${property}`, ) .toString() .split(EOL)[0]; - - // VS 2019 changed path naming convention - const vsVersion = version === '16.0' ? 'Current' : version; - - // look for the specified version of msbuild - const msBuildPath = path.join( - vsPath, - 'MSBuild', - vsVersion, - 'Bin/MSBuild.exe', - ); - - toolsPath = fs.existsSync(msBuildPath) ? path.dirname(msBuildPath) : null; + return vsPath; } else { const query = `reg query HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\${version} /s /v MSBuildToolsPath`; // Try to get the MSBuild path using registry @@ -156,25 +140,67 @@ function checkMSBuildVersion(version) { } catch (e) { toolsPath = null; } + return toolsPath; } +} + +function checkMSBuildVersion(version) { + let toolsPath = null; + if (process.argv.indexOf('--logging') >= 0) { + console.log('Searching for MSBuild version ' + version); + } + + const requiresUWP = 'Microsoft.Component.MSBuild Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141'; + const vsPath = VSWhere(requiresUWP, version, 'installationPath'); + const installationVersion = VSWhere( + requiresUWP, + version, + 'installationVersion', + ); + // VS 2019 changed path naming convention + const vsVersion = version === '16.0' ? 'Current' : version; + + // look for the specified version of msbuild + const msBuildPath = path.join( + vsPath, + 'MSBuild', + vsVersion, + 'Bin/MSBuild.exe', + ); + + toolsPath = fs.existsSync(msBuildPath) ? path.dirname(msBuildPath) : null; // We found something so return MSBuild Tools. if (toolsPath) { - newSuccess(`Found MSBuild v${version} at ${toolsPath}`); - return new MSBuildTools(version, toolsPath); + newSuccess( + `Found MSBuild v${version} at ${toolsPath} (${installationVersion})`, + ); + return new MSBuildTools(version, toolsPath, installationVersion); } else { return null; } } module.exports.findAvailableVersion = function() { - const versions = MSBUILD_VERSIONS.map(checkMSBuildVersion); + const versions = + process.env.VisualStudioVersion != null + ? [checkMSBuildVersion(process.env.VisualStudioVersion)] + : MSBUILD_VERSIONS.map(checkMSBuildVersion); const msbuildTools = versions.find(Boolean); if (!msbuildTools) { - throw new Error('MSBuild tools not found'); + if (process.env.VisualStudioVersion != null) { + throw new Error( + `MSBuild tools not found for version ${ + process.env.VisualStudioVersion + } (from environment). Make sure all components have been installed (e.g. UWP v141 support)`, + ); + } else { + throw new Error( + 'MSBuild tools not found. Make sure all components have been installed (e.g. UWP v141 support)', + ); + } } - return msbuildTools; }; From c3fa7293043a15df9861f33641c9e1a3c83b445a Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Wed, 16 Oct 2019 18:23:13 -0700 Subject: [PATCH 05/27] eslint --- vnext/local-cli/runWindows/utils/build.js | 7 ++++++- vnext/local-cli/runWindows/utils/msbuildtools.js | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vnext/local-cli/runWindows/utils/build.js b/vnext/local-cli/runWindows/utils/build.js index ae883f8ad0c..d9717a30166 100644 --- a/vnext/local-cli/runWindows/utils/build.js +++ b/vnext/local-cli/runWindows/utils/build.js @@ -71,7 +71,12 @@ async function restoreNuGetPackages(options, slnFile, verbose) { ensureNugetSpinner.succeed('Found NuGet Binary'); const msbuildTools = MSBuildTools.findAvailableVersion(); - await nugetRestore(nugetPath, slnFile, verbose, msbuildTools.installationVersion); + await nugetRestore( + nugetPath, + slnFile, + verbose, + msbuildTools.installationVersion, + ); } function getSolutionFile(options) { diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index 954d59efe76..7efbcba175b 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -122,6 +122,7 @@ function VSWhere(requires, version, property) { return vsPath; } else { const query = `reg query HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\${version} /s /v MSBuildToolsPath`; + let toolsPath = null; // Try to get the MSBuild path using registry try { const output = child_process.execSync(query).toString(); @@ -150,7 +151,8 @@ function checkMSBuildVersion(version) { console.log('Searching for MSBuild version ' + version); } - const requiresUWP = 'Microsoft.Component.MSBuild Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141'; + const requiresUWP = + 'Microsoft.Component.MSBuild Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141'; const vsPath = VSWhere(requiresUWP, version, 'installationPath'); const installationVersion = VSWhere( requiresUWP, From e59d5bfd7a9314de38a3c6a69525e2fe8332dd6c Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Wed, 16 Oct 2019 18:40:39 -0700 Subject: [PATCH 06/27] pass verbose to msbuildtools functions --- vnext/local-cli/runWindows/utils/build.js | 4 ++-- .../local-cli/runWindows/utils/msbuildtools.js | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/vnext/local-cli/runWindows/utils/build.js b/vnext/local-cli/runWindows/utils/build.js index d9717a30166..57f237abbc5 100644 --- a/vnext/local-cli/runWindows/utils/build.js +++ b/vnext/local-cli/runWindows/utils/build.js @@ -25,7 +25,7 @@ async function buildSolution(slnFile, buildType, buildArch, verbose) { ); } - const msBuildTools = MSBuildTools.findAvailableVersion(); + const msBuildTools = MSBuildTools.findAvailableVersion(verbose); await msBuildTools.buildProject(slnFile, buildType, buildArch, null, verbose); } @@ -70,7 +70,7 @@ async function restoreNuGetPackages(options, slnFile, verbose) { } ensureNugetSpinner.succeed('Found NuGet Binary'); - const msbuildTools = MSBuildTools.findAvailableVersion(); + const msbuildTools = MSBuildTools.findAvailableVersion(verbose); await nugetRestore( nugetPath, slnFile, diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index 7efbcba175b..645b916d96d 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -145,9 +145,9 @@ function VSWhere(requires, version, property) { } } -function checkMSBuildVersion(version) { +function checkMSBuildVersion(version, verbose) { let toolsPath = null; - if (process.argv.indexOf('--logging') >= 0) { + if (verbose) { console.log('Searching for MSBuild version ' + version); } @@ -183,11 +183,13 @@ function checkMSBuildVersion(version) { } } -module.exports.findAvailableVersion = function() { +module.exports.findAvailableVersion = function(verbose) { const versions = process.env.VisualStudioVersion != null - ? [checkMSBuildVersion(process.env.VisualStudioVersion)] - : MSBUILD_VERSIONS.map(checkMSBuildVersion); + ? [checkMSBuildVersion(process.env.VisualStudioVersion, verbose)] + : MSBUILD_VERSIONS.map(function(value) { + return checkMSBuildVersion(value, verbose); + }); const msbuildTools = versions.find(Boolean); if (!msbuildTools) { @@ -206,9 +208,11 @@ module.exports.findAvailableVersion = function() { return msbuildTools; }; -module.exports.findAllAvailableVersions = function() { +module.exports.findAllAvailableVersions = function(verbose) { console.log(chalk.green('Searching for available MSBuild versions...')); - return MSBUILD_VERSIONS.map(checkMSBuildVersion).filter(item => !!item); + return MSBUILD_VERSIONS.map(function(value) { + return checkMSBuildVersion(value, verbose); + }).filter(item => !!item); }; module.exports.getAllAvailableUAPVersions = function() { From 36e45701b1c16acfc266011fce29b7e825a27bf7 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 11:51:38 -0700 Subject: [PATCH 07/27] require v141 tools but not UWP since that doesn't seem necessary --- .../runWindows/utils/msbuildtools.js | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index 645b916d96d..eeb0952f56d 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -60,20 +60,13 @@ class MSBuildTools { '/p:AppxBundle=Never', ]; + args.push('/p:PlatformToolset=v141'); + // Set platform toolset for VS 2017 (this way we can keep the base sln file working for VS 2015) if (this.version === '15.0') { - args.push('/p:PlatformToolset=v141'); args.push('/p:VisualStudioVersion=15.0'); - } - - // Set platform toolset for VS 2019 - if (this.version === '16.0') { - // we are guaranteed to have Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 - const vsPath = path.resolve(this.path, '../../..'); - const targetsPath = path.join(vsPath, 'MSBuild\\Microsoft\\VC\\v150\\'); - args.push('/p:PlatformToolset=v141'); + } else if (this.version === '16.0') { args.push('/p:VisualStudioVersion=16.0'); - args.push('/p:VCTargetsPath=' + targetsPath); } if (config) { @@ -128,15 +121,15 @@ function VSWhere(requires, version, property) { const output = child_process.execSync(query).toString(); let toolsPathOutput = /MSBuildToolsPath\s+REG_SZ\s+(.*)/i.exec(output); if (toolsPathOutput) { - toolsPathOutput = toolsPathOutput[1]; + let toolsPathOutputStr = toolsPathOutput[1]; // Win10 on .NET Native uses x86 arch compiler, if using x64 Node, use x86 tools if ( version === '15.0' || - (version === '14.0' && toolsPath.indexOf('amd64') > -1) + (version === '14.0' && toolsPathOutputStr.indexOf('amd64') > -1) ) { - toolsPathOutput = path.resolve(toolsPathOutput, '..'); + toolsPathOutputStr = path.resolve(toolsPathOutputStr, '..'); } - toolsPath = toolsPathOutput; + toolsPath = toolsPathOutputStr; } } catch (e) { toolsPath = null; @@ -151,11 +144,21 @@ function checkMSBuildVersion(version, verbose) { console.log('Searching for MSBuild version ' + version); } - const requiresUWP = - 'Microsoft.Component.MSBuild Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141'; - const vsPath = VSWhere(requiresUWP, version, 'installationPath'); + // https://aka.ms/vs/workloads + const requires16 = [ + 'Microsoft.Component.MSBuild', + 'Microsoft.VisualStudio.Component.VC.v141.x86.x64', + ]; + const requires15 = [ + 'Microsoft.Component.MSBuild', + 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', + ]; + + const requires = version === '16.0' ? requires16 : requires15; + + const vsPath = VSWhere(requires.join(' '), version, 'installationPath'); const installationVersion = VSWhere( - requiresUWP, + requires.join(' '), version, 'installationVersion', ); @@ -197,11 +200,11 @@ module.exports.findAvailableVersion = function(verbose) { throw new Error( `MSBuild tools not found for version ${ process.env.VisualStudioVersion - } (from environment). Make sure all components have been installed (e.g. UWP v141 support)`, + } (from environment). Make sure all required components have been installed (e.g. v141 support)`, ); } else { throw new Error( - 'MSBuild tools not found. Make sure all components have been installed (e.g. UWP v141 support)', + 'MSBuild tools not found. Make sure all required components have been installed (e.g. v141 support)', ); } } From 4d0205d289e600e83f78c54a07dc1bfdc33d5b81 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 13:58:46 -0700 Subject: [PATCH 08/27] print out VS component list --- .ado/templates/e2e-test-job.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 6c0b7e41a47..22570d5a666 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -34,6 +34,11 @@ jobs: inputs: script: npm install -g react-native-cli + - task: CmdLine@2 + displayName: VS Component list + inputs: + script: "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" export --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet --config %temp%\vsconfig && type %temp%\vsconfig + - task: CmdLine@2 displayName: Modify package.json to use unforked RN inputs: From f9cd55879e7b23e85c7ac23f2652251edfa4d833 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 14:01:17 -0700 Subject: [PATCH 09/27] bump --- .ado/templates/e2e-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 22570d5a666..b62be736881 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -37,7 +37,7 @@ jobs: - task: CmdLine@2 displayName: VS Component list inputs: - script: "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" export --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet --config %temp%\vsconfig && type %temp%\vsconfig + script: "C:\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" export --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet --config %temp%\vsconfig && type %temp%\vsconfig - task: CmdLine@2 displayName: Modify package.json to use unforked RN From c3d1218c7bac783cab83b04625d643da11a0ae32 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 14:15:50 -0700 Subject: [PATCH 10/27] bump --- .ado/templates/e2e-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index b62be736881..1b1f1f1d226 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -37,7 +37,7 @@ jobs: - task: CmdLine@2 displayName: VS Component list inputs: - script: "C:\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" export --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet --config %temp%\vsconfig && type %temp%\vsconfig + script: "C:\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" export --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet --config %temp%\\vsconfig && type %temp%\\vsconfig - task: CmdLine@2 displayName: Modify package.json to use unforked RN From 75568e1e84c85a6ee639228eaf9d2aeddc1d62b5 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 14:19:22 -0700 Subject: [PATCH 11/27] dump --- .ado/templates/e2e-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 1b1f1f1d226..3c4506eb715 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -37,7 +37,7 @@ jobs: - task: CmdLine@2 displayName: VS Component list inputs: - script: "C:\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" export --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet --config %temp%\\vsconfig && type %temp%\\vsconfig + script: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" export --installpath "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise" --quiet --config %temp%\\vsconfig && type %temp%\\vsconfig - task: CmdLine@2 displayName: Modify package.json to use unforked RN From 02e7472803fdd600cd8e57e0f18430504018ac60 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 14:24:10 -0700 Subject: [PATCH 12/27] bump --- .ado/templates/e2e-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 3c4506eb715..7dfd60e7ced 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -37,7 +37,7 @@ jobs: - task: CmdLine@2 displayName: VS Component list inputs: - script: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe" export --installpath "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise" --quiet --config %temp%\\vsconfig && type %temp%\\vsconfig + script: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe\" export --installpath \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\" --quiet --config %temp%\\vsconfig && type %temp%\\vsconfig" - task: CmdLine@2 displayName: Modify package.json to use unforked RN From 0028d0e72729a7a62a5904e7b402a6144598440e Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 14:45:51 -0700 Subject: [PATCH 13/27] bump --- .ado/templates/e2e-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 7dfd60e7ced..25d2d79d382 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -37,7 +37,7 @@ jobs: - task: CmdLine@2 displayName: VS Component list inputs: - script: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe\" export --installpath \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\" --quiet --config %temp%\\vsconfig && type %temp%\\vsconfig" + script: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe\" export --installpath \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\" --quiet --config %temp%\\vsconfig && (timeout 30 > NUL) && type %temp%\\vsconfig" - task: CmdLine@2 displayName: Modify package.json to use unforked RN From a03bba61b2e7199e7c3db3557019291c6dcfdd9e Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 15:09:20 -0700 Subject: [PATCH 14/27] bump --- .ado/VSComponentList.ps1 | 3 +++ .ado/templates/e2e-test-job.yml | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .ado/VSComponentList.ps1 diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 new file mode 100644 index 00000000000..a5de98fb54f --- /dev/null +++ b/.ado/VSComponentList.ps1 @@ -0,0 +1,3 @@ +$p = Start-Process -PassThru 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -ArgumentList "export --installpath `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise`" --quiet --config $env:temp\vsconfig" +$p.WaitForExit() +gc $env:temp\vsconfig \ No newline at end of file diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 25d2d79d382..393846a3d8a 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -23,6 +23,12 @@ jobs: submodules: false # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch + - task: PowerShell@2 + displayName: VS Component list + inputs: + targetType: filePath + filePath: $(Build.SourcesDirectory)/.ado/VSComponentList.ps1 + - task: PowerShell@2 displayName: "Remove WebDriverIO Workaround" inputs: @@ -34,11 +40,6 @@ jobs: inputs: script: npm install -g react-native-cli - - task: CmdLine@2 - displayName: VS Component list - inputs: - script: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installer.exe\" export --installpath \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\" --quiet --config %temp%\\vsconfig && (timeout 30 > NUL) && type %temp%\\vsconfig" - - task: CmdLine@2 displayName: Modify package.json to use unforked RN inputs: From 456dc75d4a57e7a6578a520f1840c2b19a179105 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 15:13:16 -0700 Subject: [PATCH 15/27] bump --- .ado/VSComponentList.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index a5de98fb54f..c9ecb4f818b 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -1,3 +1,4 @@ $p = Start-Process -PassThru 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -ArgumentList "export --installpath `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise`" --quiet --config $env:temp\vsconfig" $p.WaitForExit() +Sleep 30 gc $env:temp\vsconfig \ No newline at end of file From 3f503044894e266992d509a3197a1a3f0cc53922 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 15:22:50 -0700 Subject: [PATCH 16/27] bump --- .ado/VSComponentList.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index c9ecb4f818b..7126d00523c 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -1,4 +1,7 @@ -$p = Start-Process -PassThru 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -ArgumentList "export --installpath `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise`" --quiet --config $env:temp\vsconfig" +$installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' +$installationPath = . $installerPath\vswhere.exe -latest -property installationPath + +$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $env:temp\vsconfig" -Wait $p.WaitForExit() Sleep 30 gc $env:temp\vsconfig \ No newline at end of file From 91c83a0978fe428c86cd2ddbbaac21c5be193240 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 15:28:59 -0700 Subject: [PATCH 17/27] bump --- .ado/VSComponentList.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index 7126d00523c..8722dbbacf2 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -1,7 +1,9 @@ $installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' $installationPath = . $installerPath\vswhere.exe -latest -property installationPath -$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $env:temp\vsconfig" -Wait +$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $env:temp\vsconfig" -Wait -RedirectStandardOutput $env:temp\out -RedirectStandardError $env:temp\err $p.WaitForExit() Sleep 30 +gc $env:temp\out +gc $env:temp\err gc $env:temp\vsconfig \ No newline at end of file From 0ee6a70316bac10f699be34b99e1bde949c3e2e0 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 15:33:30 -0700 Subject: [PATCH 18/27] bump --- .ado/VSComponentList.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index 8722dbbacf2..37abb045565 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -1,9 +1,7 @@ $installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' $installationPath = . $installerPath\vswhere.exe -latest -property installationPath -$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $env:temp\vsconfig" -Wait -RedirectStandardOutput $env:temp\out -RedirectStandardError $env:temp\err +$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config .\vsconfig" -Wait $p.WaitForExit() Sleep 30 -gc $env:temp\out -gc $env:temp\err -gc $env:temp\vsconfig \ No newline at end of file +gc .\vsconfig \ No newline at end of file From f92ffce84f5060dfd4b395cc686661f9278ec897 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 15:37:51 -0700 Subject: [PATCH 19/27] bump --- .ado/VSComponentList.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index 37abb045565..288fb44c153 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -3,5 +3,10 @@ $installationPath = . $installerPath\vswhere.exe -latest -property installationP $p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config .\vsconfig" -Wait $p.WaitForExit() -Sleep 30 +while (!(Test-Path .\vsconfig)) +{ + Sleep 5 + Write-Host "Waiting for vsconfig file..." +} + gc .\vsconfig \ No newline at end of file From aa9761107184c47bcdd2f28aac4311266f8da170 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 16:00:53 -0700 Subject: [PATCH 20/27] bump --- .ado/VSComponentList.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index 288fb44c153..cb2b5083328 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -1,9 +1,11 @@ $installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' $installationPath = . $installerPath\vswhere.exe -latest -property installationPath - -$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config .\vsconfig" -Wait +$vsconfig = "$env:temp\vsconfig" +Write-Host "VSConfig will be at $vsconfig" +$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" $p.WaitForExit() -while (!(Test-Path .\vsconfig)) +$x = [Datetime]::Now.AddSeconds(60) +while (!(Test-Path .\vsconfig) -and ([datetime]::Now -lt $x)) { Sleep 5 Write-Host "Waiting for vsconfig file..." From 6ebc1024afdaa9181f877fa24b745a1cc32831a6 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 16:05:01 -0700 Subject: [PATCH 21/27] bump --- .ado/VSComponentList.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index cb2b5083328..25f3b4dbc3b 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -11,4 +11,4 @@ while (!(Test-Path .\vsconfig) -and ([datetime]::Now -lt $x)) Write-Host "Waiting for vsconfig file..." } -gc .\vsconfig \ No newline at end of file +gc $vsconfig \ No newline at end of file From 8bfe689d3dde5bc9ffbe2555d96158d57c9824ad Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 16:05:56 -0700 Subject: [PATCH 22/27] bump --- .ado/VSComponentList.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index 25f3b4dbc3b..8867de6e51c 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -5,7 +5,7 @@ Write-Host "VSConfig will be at $vsconfig" $p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" $p.WaitForExit() $x = [Datetime]::Now.AddSeconds(60) -while (!(Test-Path .\vsconfig) -and ([datetime]::Now -lt $x)) +while (!(Test-Path $vsconfig) -and ([datetime]::Now -lt $x)) { Sleep 5 Write-Host "Waiting for vsconfig file..." From fd46b522006320d3fb34611ff55e0586862898fa Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 16:15:06 -0700 Subject: [PATCH 23/27] bump --- .ado/VSComponentList.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index 8867de6e51c..d268f47ea42 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -1,8 +1,14 @@ +$dir = $env:temp +if ($env:Agent_TempDirectory -ne $null) +{ + $dir = $env:Agent_TempDirectory +} +Write-Output "hello" | Out-File $dir\foobar.txt $installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' $installationPath = . $installerPath\vswhere.exe -latest -property installationPath -$vsconfig = "$env:temp\vsconfig" +$vsconfig = "$dir\vsconfig" Write-Host "VSConfig will be at $vsconfig" -$p = Start-Process -PassThru $installerPath\vs_installer.exe -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" +$p = Start-Process -PassThru $installerPath\vs_installer.exe -RedirectStandardError $dir\err -RedirectStandardOutput $dir\out -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" $p.WaitForExit() $x = [Datetime]::Now.AddSeconds(60) while (!(Test-Path $vsconfig) -and ([datetime]::Now -lt $x)) @@ -11,4 +17,6 @@ while (!(Test-Path $vsconfig) -and ([datetime]::Now -lt $x)) Write-Host "Waiting for vsconfig file..." } +gc $dir\err +gc $dir\out gc $vsconfig \ No newline at end of file From 92217475640d636c308fe9aa7550ca3b0632fd85 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 16:25:54 -0700 Subject: [PATCH 24/27] run shell instead of installer --- .ado/VSComponentList.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index d268f47ea42..d45dfb9507f 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -8,7 +8,7 @@ $installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' $installationPath = . $installerPath\vswhere.exe -latest -property installationPath $vsconfig = "$dir\vsconfig" Write-Host "VSConfig will be at $vsconfig" -$p = Start-Process -PassThru $installerPath\vs_installer.exe -RedirectStandardError $dir\err -RedirectStandardOutput $dir\out -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" +$p = Start-Process -PassThru $installerPath\vs_installershell.exe -RedirectStandardError $dir\err -RedirectStandardOutput $dir\out -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" $p.WaitForExit() $x = [Datetime]::Now.AddSeconds(60) while (!(Test-Path $vsconfig) -and ([datetime]::Now -lt $x)) @@ -17,6 +17,6 @@ while (!(Test-Path $vsconfig) -and ([datetime]::Now -lt $x)) Write-Host "Waiting for vsconfig file..." } -gc $dir\err -gc $dir\out -gc $vsconfig \ No newline at end of file +Get-Content $dir\err +Get-Content $dir\out +Get-Content $vsconfig \ No newline at end of file From 35449a4e2226b8610770998caeb351b7979a3fb5 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 16:58:31 -0700 Subject: [PATCH 25/27] bump --- .ado/VSComponentList.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.ado/VSComponentList.ps1 b/.ado/VSComponentList.ps1 index d45dfb9507f..bd27aca3c19 100644 --- a/.ado/VSComponentList.ps1 +++ b/.ado/VSComponentList.ps1 @@ -3,12 +3,14 @@ if ($env:Agent_TempDirectory -ne $null) { $dir = $env:Agent_TempDirectory } -Write-Output "hello" | Out-File $dir\foobar.txt + $installerPath = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\' $installationPath = . $installerPath\vswhere.exe -latest -property installationPath $vsconfig = "$dir\vsconfig" Write-Host "VSConfig will be at $vsconfig" -$p = Start-Process -PassThru $installerPath\vs_installershell.exe -RedirectStandardError $dir\err -RedirectStandardOutput $dir\out -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" + +Invoke-WebRequest -Uri 'https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe' -OutFile $dir\vs_enterprise.exe +$p = Start-Process -PassThru $dir\vs_enterprise.exe -RedirectStandardError $dir\err -RedirectStandardOutput $dir\out -ArgumentList "export --installpath `"$installationPath`" --quiet --config $vsconfig" $p.WaitForExit() $x = [Datetime]::Now.AddSeconds(60) while (!(Test-Path $vsconfig) -and ([datetime]::Now -lt $x)) From d28395672b70bcfb879b554cb70de44a2e28c663 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 17:24:09 -0700 Subject: [PATCH 26/27] install UWP v141 in the lab --- .ado/templates/e2e-test-job.yml | 6 ------ .ado/windows-vs-pr.yml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 393846a3d8a..6c0b7e41a47 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -23,12 +23,6 @@ jobs: submodules: false # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch - - task: PowerShell@2 - displayName: VS Component list - inputs: - targetType: filePath - filePath: $(Build.SourcesDirectory)/.ado/VSComponentList.ps1 - - task: PowerShell@2 displayName: "Remove WebDriverIO Workaround" inputs: diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml index aa4a649d5c8..602a9f187cb 100644 --- a/.ado/windows-vs-pr.yml +++ b/.ado/windows-vs-pr.yml @@ -473,7 +473,7 @@ jobs: vmImage: windows-2019 BuildPlatform: x64 UseRNFork: true - vsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64 + vsComponents: Microsoft.VisualStudio.Component.VC.v141.x86.x64, Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 - job: RNWNugetPR displayName: Build and Pack Nuget From 1d1541d6739337afc9f1c271df394b085996f078 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Thu, 17 Oct 2019 19:55:01 -0700 Subject: [PATCH 27/27] per-arch v141 package stuff --- vnext/local-cli/runWindows/utils/build.js | 4 +- .../runWindows/utils/msbuildtools.js | 51 ++++++++++++++----- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/vnext/local-cli/runWindows/utils/build.js b/vnext/local-cli/runWindows/utils/build.js index 57f237abbc5..48354bfccf2 100644 --- a/vnext/local-cli/runWindows/utils/build.js +++ b/vnext/local-cli/runWindows/utils/build.js @@ -25,7 +25,7 @@ async function buildSolution(slnFile, buildType, buildArch, verbose) { ); } - const msBuildTools = MSBuildTools.findAvailableVersion(verbose); + const msBuildTools = MSBuildTools.findAvailableVersion(buildArch, verbose); await msBuildTools.buildProject(slnFile, buildType, buildArch, null, verbose); } @@ -70,7 +70,7 @@ async function restoreNuGetPackages(options, slnFile, verbose) { } ensureNugetSpinner.succeed('Found NuGet Binary'); - const msbuildTools = MSBuildTools.findAvailableVersion(verbose); + const msbuildTools = MSBuildTools.findAvailableVersion('x86', verbose); await nugetRestore( nugetPath, slnFile, diff --git a/vnext/local-cli/runWindows/utils/msbuildtools.js b/vnext/local-cli/runWindows/utils/msbuildtools.js index eeb0952f56d..e955dda5910 100644 --- a/vnext/local-cli/runWindows/utils/msbuildtools.js +++ b/vnext/local-cli/runWindows/utils/msbuildtools.js @@ -138,7 +138,31 @@ function VSWhere(requires, version, property) { } } -function checkMSBuildVersion(version, verbose) { +function getVC141Component(version, buildArch) { + if (version === '16.0') { + switch (buildArch.toLowerCase()) { + case 'x86': + case 'x64': + return 'Microsoft.VisualStudio.Component.VC.v141.x86.x64'; + case 'arm': + return 'Microsoft.VisualStudio.Component.VC.v141.ARM'; + case 'arm64': + return 'Microsoft.VisualStudio.Component.VC.v141.ARM64'; + } + } else { + switch (buildArch.toLowerCase()) { + case 'x86': + case 'x64': + return 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'; + case 'arm': + return 'Microsoft.VisualStudio.Component.VC.Tools.ARM'; + case 'arm64': + return 'Microsoft.VisualStudio.Component.VC.Tools.ARM64'; + } + } +} + +function checkMSBuildVersion(version, buildArch, verbose) { let toolsPath = null; if (verbose) { console.log('Searching for MSBuild version ' + version); @@ -147,11 +171,13 @@ function checkMSBuildVersion(version, verbose) { // https://aka.ms/vs/workloads const requires16 = [ 'Microsoft.Component.MSBuild', - 'Microsoft.VisualStudio.Component.VC.v141.x86.x64', + getVC141Component(version, buildArch), + 'Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141', ]; const requires15 = [ 'Microsoft.Component.MSBuild', - 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', + getVC141Component(version, buildArch), + 'Microsoft.VisualStudio.ComponentGroup.UWP.VC', ]; const requires = version === '16.0' ? requires16 : requires15; @@ -186,12 +212,18 @@ function checkMSBuildVersion(version, verbose) { } } -module.exports.findAvailableVersion = function(verbose) { +module.exports.findAvailableVersion = function(buildArch, verbose) { const versions = process.env.VisualStudioVersion != null - ? [checkMSBuildVersion(process.env.VisualStudioVersion, verbose)] + ? [ + checkMSBuildVersion( + process.env.VisualStudioVersion, + buildArch, + verbose, + ), + ] : MSBUILD_VERSIONS.map(function(value) { - return checkMSBuildVersion(value, verbose); + return checkMSBuildVersion(value, buildArch, verbose); }); const msbuildTools = versions.find(Boolean); @@ -211,13 +243,6 @@ module.exports.findAvailableVersion = function(verbose) { return msbuildTools; }; -module.exports.findAllAvailableVersions = function(verbose) { - console.log(chalk.green('Searching for available MSBuild versions...')); - return MSBUILD_VERSIONS.map(function(value) { - return checkMSBuildVersion(value, verbose); - }).filter(item => !!item); -}; - module.exports.getAllAvailableUAPVersions = function() { const results = [];