-:: 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.
+ if NOT exist "%BUILD_TOOLS_SEMAPHORE_DIR%" mkdir "%BUILD_TOOLS_SEMAPHORE_DIR%"
+ echo Using tools from '%DotNetBuildToolsDir%'. > "%BUILD_TOOLS_SEMAPHORE%"
+ exit /b 0