cleaning up bootstrap story

This commit is contained in:
Andrew Stanton-Nurse 2015-10-15 09:41:31 -07:00
parent 9da2475e2f
commit cdd7248a8d
14 changed files with 57 additions and 101 deletions

View file

@ -1,6 +1,55 @@
@echo off
REM Build 'dotnet' using a version of 'dotnet' hosted on the DNX
REM The output of this is independent of DNX
call "%~dp0scripts\dotnet" publish --framework dnxcore50 --runtime win7-x64 --output "%~dp0artifacts\published" "%~dp0src\Microsoft.DotNet.Cli"
call "%~dp0scripts\dotnet" publish --framework dnxcore50 --runtime win7-x64 --output "%~dp0artifacts\published" "%~dp0src\Microsoft.DotNet.Tools.Compiler"
call "%~dp0scripts\dotnet" publish --framework dnxcore50 --runtime win7-x64 --output "%~dp0artifacts\published" "%~dp0src\Microsoft.DotNet.Tools.Publish"
where dnvm >nul 2>nul
if %errorlevel% == 0 goto have_dnvm
REM download dnvm
echo Installing dnvm (DNX is needed to bootstrap currently) ...
powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';$wc=New-Object System.Net.WebClient;$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;Invoke-Expression ($wc.DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
:have_dnvm
echo Installing and use-ing the latest CoreCLR x64 DNX ...
call dnvm install -u latest -r coreclr -arch x64 -alias dotnet_bootstrap
if errorlevel 1 goto fail
call dnvm use dotnet_bootstrap -r coreclr -arch x64
if errorlevel 1 goto fail
rd /s /q %~dp0artifacts\bootstrap
if errorlevel 1 goto fail
echo Running 'dnu restore' to restore packages for DNX-hosted projects
call dnu restore "%~dp0src\Microsoft.DotNet.Cli"
if errorlevel 1 goto fail
call dnu restore "%~dp0src\Microsoft.DotNet.Tools.Compiler"
if errorlevel 1 goto fail
call dnu restore "%~dp0src\Microsoft.DotNet.Tools.Publish"
if errorlevel 1 goto fail
echo Building basic dotnet tools using DNX-hosted version
echo Building dotnet.exe ...
call "%~dp0scripts\bootstrap\dotnet-publish" --framework dnxcore50 --runtime win7-x64 --output "%~dp0artifacts\bootstrap" "%~dp0src\Microsoft.DotNet.Cli"
if errorlevel 1 goto fail
echo Building dotnet-compile.exe ...
call "%~dp0scripts\bootstrap\dotnet-publish" --framework dnxcore50 --runtime win7-x64 --output "%~dp0artifacts\bootstrap" "%~dp0src\Microsoft.DotNet.Tools.Compiler"
if errorlevel 1 goto fail
echo Building dotnet-publish.exe ...
call "%~dp0scripts\bootstrap\dotnet-publish" --framework dnxcore50 --runtime win7-x64 --output "%~dp0artifacts\bootstrap" "%~dp0src\Microsoft.DotNet.Tools.Publish"
if errorlevel 1 goto fail
echo Bootstrapped 'dotnet' command is available in %~dp0artifacts\bootstrap
goto end
:fail
echo Bootstrapping failed...
exit /B 1
:end

View file

@ -14,4 +14,4 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Makes development easier
export PATH=$PATH:$DIR
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.Compiler" run "$@"
exec "dnx" -p "$DIR/../../src/Microsoft.DotNet.Tools.Compiler" run "$@"

View file

@ -5,7 +5,7 @@ SET ERRORLEVEL=
REM makes testing easier for now
set PATH=%PATH%;%~dp0
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.Compiler run %*
dnx %DOTNET_OPTIONS% -p %~dp0..\..\src\Microsoft.DotNet.Tools.Compiler run %*
exit /b %ERRORLEVEL%
ENDLOCAL

View file

@ -14,4 +14,4 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# Makes development easier
export PATH=$PATH:$DIR
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.Publish" run "$@"
exec "dnx" -p "$DIR/../../src/Microsoft.DotNet.Tools.Publish" run "$@"

View file

@ -5,7 +5,7 @@ SET ERRORLEVEL=
REM makes testing easier for now
set PATH=%PATH%;%~dp0
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.Publish run %*
dnx %DOTNET_OPTIONS% -p %~dp0..\..\src\Microsoft.DotNet.Tools.Publish run %*
exit /b %ERRORLEVEL%
ENDLOCAL

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# work around restore timeouts on Mono
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50
# Makes development easier
export PATH=$PATH:$DIR
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Cli" run "$@"

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# work around restore timeouts on Mono
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50
# Makes development easier
export PATH=$PATH:$DIR
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.DependencyResolver" run "$@"

View file

@ -1,11 +0,0 @@
@Echo OFF
SETLOCAL
SET ERRORLEVEL=
REM makes testing easier for now
set PATH=%PATH%;%~dp0
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.DependencyResolver run %*
exit /b %ERRORLEVEL%
ENDLOCAL

View file

@ -1 +0,0 @@
exec "dnu" "restore" "$@"

View file

@ -1,8 +0,0 @@
@Echo OFF
SETLOCAL
SET ERRORLEVEL=
dnu restore %*
exit /b %ERRORLEVEL%
ENDLOCAL

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# work around restore timeouts on Mono
[ -z "$MONO_THREADS_PER_CPU" ] && export MONO_THREADS_PER_CPU=50
# Makes development easier
export PATH=$PATH:$DIR
exec "dnx" -p "$DIR/../src/Microsoft.DotNet.Tools.Run" run "$@"

View file

@ -1,11 +0,0 @@
@Echo OFF
SETLOCAL
SET ERRORLEVEL=
REM makes testing easier for now
set PATH=%PATH%;%~dp0
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Tools.Run run %*
exit /b %ERRORLEVEL%
ENDLOCAL

View file

@ -1,11 +0,0 @@
@Echo OFF
SETLOCAL
SET ERRORLEVEL=
REM makes testing easier for now
set PATH=%PATH%;%~dp0
dnx %DOTNET_OPTIONS% -p %~dp0..\src\Microsoft.DotNet.Cli run %*
exit /b %ERRORLEVEL%
ENDLOCAL

View file

@ -20,7 +20,7 @@
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.Framework.CommandLineUtils.Sources": {
"Microsoft.Extensions.CommandLineUtils.Sources": {
"type": "build",
"version": "1.0.0-*"
}