update windows bootstrap script
This commit is contained in:
parent
13e279e146
commit
b81465c868
1 changed files with 19 additions and 43 deletions
|
@ -13,66 +13,47 @@ popd
|
||||||
set RID=win7-x64
|
set RID=win7-x64
|
||||||
set TFM=dnxcore50
|
set TFM=dnxcore50
|
||||||
set DNX_DIR=%REPOROOT%\artifacts\%RID%\dnx
|
set DNX_DIR=%REPOROOT%\artifacts\%RID%\dnx
|
||||||
set STAGE0_DIR=%REPOROOT%\artifacts\%RID%\stage0
|
|
||||||
set STAGE1_DIR=%REPOROOT%\artifacts\%RID%\stage1
|
set STAGE1_DIR=%REPOROOT%\artifacts\%RID%\stage1
|
||||||
set STAGE2_DIR=%REPOROOT%\artifacts\%RID%\stage2
|
set STAGE2_DIR=%REPOROOT%\artifacts\%RID%\stage2
|
||||||
set START_PATH=%PATH%
|
set START_PATH=%PATH%
|
||||||
|
|
||||||
where dnvm >nul 2>nul
|
call %~dp0dnvm2.cmd upgrade -a dotnet_stage0
|
||||||
if %errorlevel% == 0 goto have_dnvm
|
if errorlevel 1 goto fail
|
||||||
echo DNVM must be installed to bootstrap dotnet
|
|
||||||
exit /B 1
|
|
||||||
|
|
||||||
:have_dnvm
|
REM Gross! But CMD has no other way to do this :(
|
||||||
if not exist %DNX_DIR% mkdir %DNX_DIR%
|
where dotnet > %temp%\dotnet-cli-build-temp.tmp
|
||||||
set DNX_HOME=%DNX_DIR%
|
set /P DOTNET_PATH=<%temp%\dotnet-cli-build-temp.tmp
|
||||||
set DNX_USER_HOME=%DNX_DIR%
|
pushd %DOTNET_PATH%\..
|
||||||
set DNX_GLOBAL_HOME=%DNX_DIR%
|
set STAGE0_DIR=%CD%
|
||||||
|
set DNX_ROOT=%STAGE0_DIR%\dnx
|
||||||
echo Installing and use-ing the latest CoreCLR x64 DNX ...
|
|
||||||
call dnvm install -nonative -u latest -r coreclr -arch x64 -alias dotnet_bootstrap
|
|
||||||
pushd "%DNX_DIR%"
|
|
||||||
cd "runtimes\dnx-*"
|
|
||||||
set DNX_ROOT=%CD%\bin
|
|
||||||
popd
|
popd
|
||||||
if errorlevel 1 goto fail
|
|
||||||
|
|
||||||
call dnvm use dotnet_bootstrap -r coreclr -arch x64
|
|
||||||
if errorlevel 1 goto fail
|
|
||||||
|
|
||||||
if exist %STAGE1_DIR% rd /s /q %STAGE1_DIR%
|
if exist %STAGE1_DIR% rd /s /q %STAGE1_DIR%
|
||||||
|
|
||||||
echo Running 'dnu restore' to restore packages for DNX-hosted projects
|
echo Running 'dotnet restore' to restore packages
|
||||||
call dnu restore "%REPOROOT%"
|
call dotnet restore "%REPOROOT%"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
echo Building basic dotnet tools using older dotnet SDK version
|
echo Building basic dotnet tools using older dotnet SDK version
|
||||||
|
|
||||||
set DOTNET_HOME=%STAGE0_DIR%
|
|
||||||
set DOTNET_USER_HOME=%STAGE0_DIR%
|
|
||||||
set DOTNET_GLOBAL_HOME=%STAGE0_DIR%
|
|
||||||
|
|
||||||
call %~dp0dnvm2 upgrade
|
|
||||||
if errorlevel 1 goto fail
|
|
||||||
|
|
||||||
echo Building stage1 dotnet.exe ...
|
echo Building stage1 dotnet.exe ...
|
||||||
dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
|
dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
echo Building stage1 dotnet-compile.exe ...
|
echo Building stage1 dotnet-compile.exe ...
|
||||||
dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler"
|
dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
echo Building stage1 dotnet-compile-csc.exe ...
|
echo Building stage1 dotnet-compile-csc.exe ...
|
||||||
dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler.Csc"
|
dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Compiler.Csc"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
echo Building stage1 dotnet-publish.exe ...
|
echo Building stage1 dotnet-publish.exe ...
|
||||||
dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish"
|
dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Publish"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
echo Building stage1 dotnet-publish.exe ...
|
echo Building stage1 dotnet-publish.exe ...
|
||||||
dotnet-publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen"
|
dotnet publish --framework %TFM% --runtime %RID% --output "%STAGE1_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Tools.Resgen"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
echo Re-building dotnet tools with the bootstrapped version
|
echo Re-building dotnet tools with the bootstrapped version
|
||||||
|
@ -108,26 +89,21 @@ if errorlevel 1 goto fail
|
||||||
REM Copy DNX in to stage2
|
REM Copy DNX in to stage2
|
||||||
xcopy /s /q %DNX_ROOT% %STAGE2_DIR%\dnx\
|
xcopy /s /q %DNX_ROOT% %STAGE2_DIR%\dnx\
|
||||||
|
|
||||||
REM Clean up some things we don't need
|
REM Copy the dotnet-restore script
|
||||||
rd /s /q %STAGE2_DIR%\dnx\lib\Microsoft.Dnx.DesignTimeHost
|
|
||||||
rd /s /q %STAGE2_DIR%\dnx\lib\Microsoft.Dnx.Project
|
|
||||||
del %STAGE2_DIR%\dnx\dnu.cmd
|
|
||||||
|
|
||||||
REM Copy and CHMOD the dotnet-restore script
|
|
||||||
copy %~dp0dotnet-restore.cmd %STAGE2_DIR%\dotnet-restore.cmd
|
copy %~dp0dotnet-restore.cmd %STAGE2_DIR%\dotnet-restore.cmd
|
||||||
|
|
||||||
# Smoke-test the output
|
REM Smoke-test the output
|
||||||
set PATH=%STAGE2_DIR%;%START_PATH%
|
set PATH=%STAGE2_DIR%;%START_PATH%
|
||||||
|
|
||||||
del "%REPOROOT%\test\TestApp\project.lock.json"
|
del "%REPOROOT%\test\TestApp\project.lock.json"
|
||||||
dotnet restore "%REPOROOT%\test\TestApp" --runtime "%RID%"
|
dotnet restore "%REPOROOT%\test\TestApp" --runtime "%RID%" --quiet
|
||||||
dotnet publish "%REPOROOT%\test\TestApp" --framework "%TFM%" --runtime "%RID%" --output "%REPOROOT%\artifacts\%RID%\smoketest"
|
dotnet publish "%REPOROOT%\test\TestApp" --framework "%TFM%" --runtime "%RID%" --output "%REPOROOT%\artifacts\%RID%\smoketest"
|
||||||
|
|
||||||
"%REPOROOT%/artifacts/%RID%/smoketest/TestApp"
|
"%REPOROOT%/artifacts/%RID%/smoketest/TestApp"
|
||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
|
|
||||||
REM Check that a compiler error is reported
|
REM Check that a compiler error is reported
|
||||||
dotnet compile "%REPOROOT%\test\compile\failing\SimpleCompilerError" --framework "%TFM%"
|
dotnet compile "%REPOROOT%\test\compile\failing\SimpleCompilerError" --framework "%TFM%" >nul
|
||||||
if %errorlevel% == 0 goto fail
|
if %errorlevel% == 0 goto fail
|
||||||
|
|
||||||
echo Bootstrapped dotnet to %STAGE2_DIR%
|
echo Bootstrapped dotnet to %STAGE2_DIR%
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue