From 6e07cbeff467a027b14870f57a8b8a18357b243e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 16:48:32 -0800 Subject: [PATCH] [bootstrap] Specify full path for dirs.proj --- scripts/bootstrap.ps1 | 60 +++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 3e886b26a6..ab7838127c 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -37,39 +37,31 @@ if (!(Test-Path $vcpkgSourcesPath)) return } -try +$msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath +$msbuildExe = $msbuildExeWithPlatformToolset[0] +$platformToolset = $msbuildExeWithPlatformToolset[1] +$windowsSDK = & $scriptsDir\getWindowsSDK.ps1 + +$arguments = ( +"`"/p:VCPKG_VERSION=-$gitHash`"", +"`"/p:DISABLE_METRICS=$disableMetrics`"", +"/p:Configuration=Release", +"/p:Platform=x86", +"/p:PlatformToolset=$platformToolset", +"/p:TargetPlatformVersion=$windowsSDK", +"/m", +"$vcpkgSourcesPath\dirs.proj") -join " " + +# vcpkgInvokeCommandClean cmd "/c echo %PATH%" +$ec = vcpkgInvokeCommandClean $msbuildExe $arguments + +if ($ec -ne 0) { - Push-Location $vcpkgSourcesPath - $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath - $msbuildExe = $msbuildExeWithPlatformToolset[0] - $platformToolset = $msbuildExeWithPlatformToolset[1] - $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 - - $arguments = ( - "`"/p:VCPKG_VERSION=-$gitHash`"", - "`"/p:DISABLE_METRICS=$disableMetrics`"", - "/p:Configuration=Release", - "/p:Platform=x86", - "/p:PlatformToolset=$platformToolset", - "/p:TargetPlatformVersion=$windowsSDK", - "/m", - "dirs.proj") -join " " - - # vcpkgInvokeCommandClean cmd "/c echo %PATH%" - $ec = vcpkgInvokeCommandClean $msbuildExe $arguments - - if ($ec -ne 0) - { - Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." - return - } - - Write-Verbose("Placing vcpkg.exe in the correct location") - - Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRootDir\vcpkg.exe | Out-Null - Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRootDir\scripts\vcpkgmetricsuploader.exe | Out-Null -} -finally -{ - Pop-Location + Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." + return } + +Write-Verbose("Placing vcpkg.exe in the correct location") + +Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRootDir\vcpkg.exe | Out-Null +Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRootDir\scripts\vcpkgmetricsuploader.exe | Out-Null