summaryrefslogtreecommitdiff
path: root/init-tools.cmd
diff options
context:
space:
mode:
authorWes Haggard <Wes.Haggard@microsoft.com>2017-10-24 16:36:03 -0700
committerWes Haggard <Wes.Haggard@microsoft.com>2017-10-30 13:05:18 -0700
commitf75e211ded5c832611f140c0f4ed710425c73772 (patch)
treeaa08168c14a4994f2818f7095be8ea2eef6d44ea /init-tools.cmd
parente65f405f21e468384277417517d78c58b2112162 (diff)
downloadcoreclr-f75e211ded5c832611f140c0f4ed710425c73772.tar.gz
coreclr-f75e211ded5c832611f140c0f4ed710425c73772.tar.bz2
coreclr-f75e211ded5c832611f140c0f4ed710425c73772.zip
Align init-tools scripts with other source-build repos
Diffstat (limited to 'init-tools.cmd')
-rw-r--r--init-tools.cmd18
1 files changed, 13 insertions, 5 deletions
diff --git a/init-tools.cmd b/init-tools.cmd
index c99d743c20..f658d4e48a 100644
--- a/init-tools.cmd
+++ b/init-tools.cmd
@@ -27,10 +27,18 @@ if exist "%BUILD_TOOLS_SEMAPHORE%" (
if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
-:: Download Nuget.exe
-if NOT exist "%PACKAGES_DIR%NuGet.exe" (
- if NOT exist "%PACKAGES_DIR%" mkdir "%PACKAGES_DIR%"
- powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%NuGet.exe')
+if exist "%DotNetBuildToolsDir%" (
+ echo Using tools from '%DotNetBuildToolsDir%'.
+ mklink /j "%TOOLRUNTIME_DIR%" "%DotNetBuildToolsDir%"
+
+ if not exist "%DOTNET_CMD%" (
+ echo ERROR: Ensure that '%DotNetBuildToolsDir%' contains the .NET Core SDK at '%DOTNET_PATH%'
+ exit /b 1
+ )
+
+ echo Done initializing tools.
+ echo Using tools from '%DotNetBuildToolsDir%'. > "%BUILD_TOOLS_SEMAPHORE%"
+ exit /b 0
)
echo Running %0 > "%INIT_TOOLS_LOG%"
@@ -41,7 +49,7 @@ if exist "%DOTNET_CMD%" goto :afterdotnetrestore
echo %__MsgPrefix%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.blob.core.windows.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
+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%"