diff options
author | Steve MacLean <stmaclea@microsoft.com> | 2019-03-01 23:07:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 23:07:35 -0500 |
commit | 42bc2de2c63fe0c95a582e642ff97b2fe0d4bb7e (patch) | |
tree | 17cb448a25ea78394faba09f2f4b1b0b2b961183 /init-tools.cmd | |
parent | c1801e85024add717f518feb6a9caed60d54500f (diff) | |
download | coreclr-42bc2de2c63fe0c95a582e642ff97b2fe0d4bb7e.tar.gz coreclr-42bc2de2c63fe0c95a582e642ff97b2fe0d4bb7e.tar.bz2 coreclr-42bc2de2c63fe0c95a582e642ff97b2fe0d4bb7e.zip |
Use arcade's version of dotnet to build (#22755)
* Use arcade dotnet
* Add cmake_msbuild.cmd
Move msbuild.cmd to cmake_msbuild.bat
Document intent that this file is only used to resolve
Windows cmake dependency on desktop msbuild.exe
Remove one instance of msbuild.cmd
* Fix inittools.cmd
* Remove spurious setup_vs_tools.cmd calls
Diffstat (limited to 'init-tools.cmd')
-rw-r--r-- | init-tools.cmd | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/init-tools.cmd b/init-tools.cmd index e1aaf87487..f7f7ff9395 100644 --- a/init-tools.cmd +++ b/init-tools.cmd @@ -4,7 +4,7 @@ setlocal set INIT_TOOLS_LOG=%~dp0init-tools.log if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools -set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\ +set DOTNET_PATH=%~dp0.dotnet\ if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt" @@ -72,15 +72,14 @@ echo "init-tools.cmd: Setting arch to %_Arch% for build tools" :ArchSet echo Installing dotnet cli... -if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%" -set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-%_Arch%.zip -set DOTNET_REMOTE_PATH=https://dotnetcli.azureedge.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME% -set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME% -echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%" -powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; $proxyCredentialsRequired = $false; do { try { $wc = New-Object Net.WebClient; if ($proxyCredentialsRequired) { [Net.WebRequest]::DefaultWebProxy.Credentials = [Net.CredentialCache]::DefaultNetworkCredentials; } $wc.DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $we = $_.Exception.InnerException -as [Net.WebException]; $proxyCredentialsRequired = ($we -ne $null -and ([Net.HttpWebResponse]$we.Response).StatusCode -eq [Net.HttpStatusCode]::ProxyAuthenticationRequired); Start-Sleep -Seconds (5 * $retryCount); $retryCount++; } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> "%INIT_TOOLS_LOG%" -if NOT exist "%DOTNET_LOCAL_PATH%" ( - echo ERROR: Could not install dotnet cli correctly. 1>&2 - goto :error +set PS_DOTNET_INSTALL_SCRIPT=". %~dp0eng\configure-toolset.ps1; . %~dp0eng\common\tools.ps1; InitializeBuildTool" +if NOT exist "%DOTNET_CMD%" ( + echo running: powershell -NoProfile -ExecutionPolicy unrestricted -Command %PS_DOTNET_INSTALL_SCRIPT% + powershell -NoProfile -ExecutionPolicy unrestricted -Command %PS_DOTNET_INSTALL_SCRIPT% + if NOT exist "%DOTNET_CMD%" ( + echo ERROR: Could not install dotnet cli correctly. 1>&2 + goto :error + ) ) :afterdotnetrestore |