Skip to content

Commit a403249

Browse files
committed
update buildtools deps to dotnet/corefx@96ae037
1 parent 858eddf commit a403249

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

BuildToolsVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.25-prerelease-00404-01
1+
1.0.25-prerelease-00517-05

DotnetCLIVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0-rc2-002665
1+
1.0.0-preview2-002733

init-tools.cmd

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
77
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
88
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
99
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
10-
set /P BUILDTOOLS_VERSION=< %~dp0BuildToolsVersion.txt
10+
set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt"
1111
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
1212
set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
1313
set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json
14-
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "dnxcore50": { } } }
14+
set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" }, "frameworks": { "netcoreapp1.0": { } } }
1515
set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed
1616

1717
:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
@@ -29,40 +29,45 @@ if exist "%BUILD_TOOLS_SEMAPHORE%" (
2929
if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
3030

3131
if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
32-
echo %PROJECT_JSON_CONTENTS% > %PROJECT_JSON_FILE%
33-
echo Running %0 > %INIT_TOOLS_LOG%
32+
echo %PROJECT_JSON_CONTENTS% > "%PROJECT_JSON_FILE%"
33+
echo Running %0 > "%INIT_TOOLS_LOG%"
3434

3535
if exist "%DOTNET_CMD%" goto :afterdotnetrestore
3636

3737
echo Installing dotnet cli...
3838
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
39-
set /p DOTNET_VERSION=< %~dp0DotnetCLIVersion.txt
39+
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
4040
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
41-
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
41+
set DOTNET_REMOTE_PATH=https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
4242
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
43-
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> %INIT_TOOLS_LOG%
44-
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); 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%
43+
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
44+
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%"
4545
if NOT exist "%DOTNET_LOCAL_PATH%" (
4646
echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
47-
goto :EOF
47+
exit /b 1
4848
)
4949

5050
:afterdotnetrestore
5151

5252
if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
5353
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
54-
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
55-
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
54+
echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
55+
call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%"
5656
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
5757
echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
58-
goto :EOF
58+
exit /b 1
5959
)
6060

6161
:afterbuildtoolsrestore
6262

6363
echo Initializing BuildTools ...
64-
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
65-
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
64+
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
65+
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
66+
set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
67+
if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
68+
echo ERROR: An error occured when trying to initialize the tools. Please check '%INIT_TOOLS_LOG%' for more details.
69+
exit /b %INIT_TOOLS_ERRORLEVEL%
70+
)
6671

6772
:: Create sempahore file
6873
echo Done initializing tools.

init-tools.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ __DOTNET_TOOLS_VERSION=$(cat $__scriptpath/DotnetCLIVersion.txt)
1212
__BUILD_TOOLS_PATH=$__PACKAGES_DIR/Microsoft.DotNet.BuildTools/$__BUILD_TOOLS_PACKAGE_VERSION/lib
1313
__PROJECT_JSON_PATH=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION
1414
__PROJECT_JSON_FILE=$__PROJECT_JSON_PATH/project.json
15-
__PROJECT_JSON_CONTENTS="{ \"dependencies\": { \"Microsoft.DotNet.BuildTools\": \"$__BUILD_TOOLS_PACKAGE_VERSION\" }, \"frameworks\": { \"dnxcore50\": { } } }"
15+
__PROJECT_JSON_CONTENTS="{ \"dependencies\": { \"Microsoft.DotNet.BuildTools\": \"$__BUILD_TOOLS_PACKAGE_VERSION\" }, \"frameworks\": { \"netcoreapp1.0\": { } } }"
1616

1717
OSName=$(uname -s)
1818
case $OSName in
@@ -24,14 +24,12 @@ case $OSName in
2424

2525
Linux)
2626
OS=Linux
27-
source /etc/os-release
28-
if [ "$ID" == "centos" -o "$ID" == "rhel" ]; then
29-
__DOTNET_PKG=dotnet-dev-centos-x64
30-
elif [ "$ID" == "ubuntu" -o "$ID" == "debian" ]; then
31-
__DOTNET_PKG=dotnet-dev-ubuntu-x64
27+
if [ ! -e /etc/os-release ]; then
28+
echo "Cannot determine Linux distribution, asuming Ubuntu 14.04."
29+
__DOTNET_PKG=dotnet-dev-ubuntu.14.04-x64
3230
else
33-
echo "Unsupported Linux distribution '$ID' detected. Downloading ubuntu-x64 tools."
34-
__DOTNET_PKG=dotnet-dev-ubuntu-x64
31+
source /etc/os-release
32+
__DOTNET_PKG="dotnet-dev-$ID.$VERSION_ID-x64"
3533
fi
3634
;;
3735

@@ -47,24 +45,18 @@ if [ ! -e $__PROJECT_JSON_FILE ]; then
4745
echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log
4846
if [ ! -e $__DOTNET_PATH ]; then
4947
echo "Installing dotnet cli..."
50-
__DOTNET_LOCATION="https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
48+
__DOTNET_LOCATION="https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
5149
# curl has HTTPS CA trust-issues less often than wget, so lets try that first.
5250
echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log
5351
which curl > /dev/null 2> /dev/null
5452
if [ $? -ne 0 ]; then
5553
mkdir -p "$__DOTNET_PATH"
5654
wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
5755
else
58-
curl -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
56+
curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
5957
fi
6058
cd $__DOTNET_PATH
6159
tar -xf $__DOTNET_PATH/dotnet.tar
62-
if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then
63-
find $__DOTNET_PATH -name *.ni.* | xargs rm 2>/dev/null
64-
cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin
65-
cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/bin/dnx
66-
cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__DOTNET_PATH/runtime/coreclr
67-
fi
6860

6961
cd $__scriptpath
7062
fi
@@ -82,6 +74,10 @@ if [ ! -e $__PROJECT_JSON_FILE ]; then
8274
echo "Initializing BuildTools..."
8375
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
8476
$__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log
77+
if [ "$?" != "0" ]; then
78+
echo "ERROR: An error occured when trying to initialize the tools. Please check '$__init_tools_log' for more details."
79+
exit 1
80+
fi
8581
echo "Done initializing tools."
8682
else
8783
echo "Tools are already initialized"

0 commit comments

Comments
 (0)