From a088299eeeaf3afe90eafd59724051f003e4195a Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sat, 20 Apr 2019 16:24:09 +1200 Subject: [PATCH] Support command line build in VS2019 (#2048) --- Build/build.ps1 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 85541c09..6f2ee8bd 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -195,10 +195,24 @@ function EnsureNuGetPackage($packageName, $packagePath, $packageVersion) function GetMsBuildPath() { $path = & $vswherePath\tools\vswhere.exe -latest -products * -requires Microsoft.Component.MSBuild -property installationPath - if (!($path)) { + if (!($path)) + { throw "Could not find Visual Studio install path" } - return join-path $path 'MSBuild\15.0\Bin\MSBuild.exe' + + $msBuildPath = join-path $path 'MSBuild\15.0\Bin\MSBuild.exe' + if (Test-Path $msBuildPath) + { + return $msBuildPath + } + + $msBuildPath = join-path $path 'MSBuild\Current\Bin\MSBuild.exe' + if (Test-Path $msBuildPath) + { + return $msBuildPath + } + + throw "Could not find MSBuild path" } function NetCliTests($build)