summaryrefslogtreecommitdiff
path: root/init-tools.cmd
diff options
context:
space:
mode:
authorWes Haggard <Wes.Haggard@microsoft.com>2018-03-27 16:56:11 -0700
committerWes Haggard <Wes.Haggard@microsoft.com>2018-03-28 11:04:36 -0700
commite1233230a1b756babe568a58755407188e78df5e (patch)
tree66dc63b228c39fe1e2d770c8f5eaddf23b39eb20 /init-tools.cmd
parent65bf37cbbb7290c9f52402fa380b1d3a8dae6b83 (diff)
downloadcoreclr-e1233230a1b756babe568a58755407188e78df5e.tar.gz
coreclr-e1233230a1b756babe568a58755407188e78df5e.tar.bz2
coreclr-e1233230a1b756babe568a58755407188e78df5e.zip
Sync init-tools scripts with what is in source-build
Diffstat (limited to 'init-tools.cmd')
-rw-r--r--init-tools.cmd31
1 files changed, 15 insertions, 16 deletions
diff --git a/init-tools.cmd b/init-tools.cmd
index a5750290c4..ec21fe808d 100644
--- a/init-tools.cmd
+++ b/init-tools.cmd
@@ -21,7 +21,7 @@ if [%1]==[force] (
:: If semaphore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
- echo %__MsgPrefix%Tools are already initialized.
+ echo Tools are already initialized.
goto :EOF
)
@@ -37,6 +37,7 @@ if exist "%DotNetBuildToolsDir%" (
)
echo Done initializing tools.
+ if NOT exist "%BUILD_TOOLS_SEMAPHORE_DIR%" mkdir "%BUILD_TOOLS_SEMAPHORE_DIR%"
echo Using tools from '%DotNetBuildToolsDir%'. > "%BUILD_TOOLS_SEMAPHORE%"
exit /b 0
)
@@ -46,26 +47,26 @@ echo Running %0 > "%INIT_TOOLS_LOG%"
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
if exist "%DOTNET_CMD%" goto :afterdotnetrestore
-echo %__MsgPrefix%Installing dotnet cli...
+echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-x64.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 %__MsgPrefix%Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
-powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $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%"
+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 %__MsgPrefix%ERROR: Could not install dotnet cli correctly. 1>&2
+ echo ERROR: Could not install dotnet cli correctly. 1>&2
goto :error
)
:afterdotnetrestore
if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
-echo %__MsgPrefix%Restoring BuildTools version %BUILDTOOLS_VERSION%...
-echo %__MsgPrefix%Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
+echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
+echo Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
- %__MsgPrefix%echo ERROR: Could not restore build tools correctly. 1>&2
+ echo ERROR: Could not restore build tools correctly. 1>&2
goto :error
)
@@ -74,8 +75,8 @@ if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
:: Ask init-tools to also restore ILAsm
set /p ILASMCOMPILER_VERSION=< "%~dp0ILAsmVersion.txt"
-echo %__MsgPrefix%Initializing BuildTools...
-echo %__MsgPrefix%Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
+echo Initializing BuildTools...
+echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
@@ -84,14 +85,12 @@ if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
)
:: Create semaphore file
-echo %__MsgPrefix%Done initializing tools.
-if NOT exist "%BUILD_TOOLS_SEMAPHORE_DIR%" (
- mkdir "%BUILD_TOOLS_SEMAPHORE_DIR%"
-)
-echo %__MsgPrefix%Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"
+echo Done initializing tools.
+if NOT exist "%BUILD_TOOLS_SEMAPHORE_DIR%" mkdir "%BUILD_TOOLS_SEMAPHORE_DIR%"
+echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"
exit /b 0
:error
-echo %__MsgPrefix%Please check the detailed log that follows. 1>&2
+echo Please check the detailed log that follows. 1>&2
type "%INIT_TOOLS_LOG%" 1>&2
exit /b 1