From cdd7248a8dc3eae165e1a1d8574aa20b9144932e Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Thu, 15 Oct 2015 09:41:31 -0700 Subject: [PATCH] cleaning up bootstrap story --- bootstrap.cmd | 55 ++++++++++++++++++- scripts/{ => bootstrap}/dotnet-compile | 2 +- scripts/{ => bootstrap}/dotnet-compile.cmd | 2 +- scripts/{ => bootstrap}/dotnet-publish | 2 +- scripts/{ => bootstrap}/dotnet-publish.cmd | 2 +- scripts/dotnet | 17 ------ scripts/dotnet-resolve-references | 17 ------ scripts/dotnet-resolve-references.cmd | 11 ---- scripts/dotnet-restore | 1 - scripts/dotnet-restore.cmd | 8 --- scripts/dotnet-run | 17 ------ scripts/dotnet-run.cmd | 11 ---- scripts/dotnet.cmd | 11 ---- .../project.json | 2 +- 14 files changed, 57 insertions(+), 101 deletions(-) rename scripts/{ => bootstrap}/dotnet-compile (89%) mode change 100755 => 100644 rename scripts/{ => bootstrap}/dotnet-compile.cmd (61%) rename scripts/{ => bootstrap}/dotnet-publish (89%) rename scripts/{ => bootstrap}/dotnet-publish.cmd (61%) delete mode 100755 scripts/dotnet delete mode 100644 scripts/dotnet-resolve-references delete mode 100644 scripts/dotnet-resolve-references.cmd delete mode 100755 scripts/dotnet-restore delete mode 100644 scripts/dotnet-restore.cmd delete mode 100644 scripts/dotnet-run delete mode 100644 scripts/dotnet-run.cmd delete mode 100644 scripts/dotnet.cmd diff --git a/bootstrap.cmd b/bootstrap.cmd index dda509d78..a89daa802 100644 --- a/bootstrap.cmd +++ b/bootstrap.cmd @@ -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" \ No newline at end of file +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 \ No newline at end of file diff --git a/scripts/dotnet-compile b/scripts/bootstrap/dotnet-compile old mode 100755 new mode 100644 similarity index 89% rename from scripts/dotnet-compile rename to scripts/bootstrap/dotnet-compile index 1ac15c8b0..467ea0b80 --- a/scripts/dotnet-compile +++ b/scripts/bootstrap/dotnet-compile @@ -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 "$@" diff --git a/scripts/dotnet-compile.cmd b/scripts/bootstrap/dotnet-compile.cmd similarity index 61% rename from scripts/dotnet-compile.cmd rename to scripts/bootstrap/dotnet-compile.cmd index 4335fa1f6..62c6c39d0 100644 --- a/scripts/dotnet-compile.cmd +++ b/scripts/bootstrap/dotnet-compile.cmd @@ -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 diff --git a/scripts/dotnet-publish b/scripts/bootstrap/dotnet-publish similarity index 89% rename from scripts/dotnet-publish rename to scripts/bootstrap/dotnet-publish index ec38aa1e8..47c4043a9 100644 --- a/scripts/dotnet-publish +++ b/scripts/bootstrap/dotnet-publish @@ -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 "$@" diff --git a/scripts/dotnet-publish.cmd b/scripts/bootstrap/dotnet-publish.cmd similarity index 61% rename from scripts/dotnet-publish.cmd rename to scripts/bootstrap/dotnet-publish.cmd index a8d262426..823b89fae 100644 --- a/scripts/dotnet-publish.cmd +++ b/scripts/bootstrap/dotnet-publish.cmd @@ -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 diff --git a/scripts/dotnet b/scripts/dotnet deleted file mode 100755 index f9febfed4..000000000 --- a/scripts/dotnet +++ /dev/null @@ -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 "$@" \ No newline at end of file diff --git a/scripts/dotnet-resolve-references b/scripts/dotnet-resolve-references deleted file mode 100644 index 11384f83d..000000000 --- a/scripts/dotnet-resolve-references +++ /dev/null @@ -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 "$@" diff --git a/scripts/dotnet-resolve-references.cmd b/scripts/dotnet-resolve-references.cmd deleted file mode 100644 index 57f555ac2..000000000 --- a/scripts/dotnet-resolve-references.cmd +++ /dev/null @@ -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 diff --git a/scripts/dotnet-restore b/scripts/dotnet-restore deleted file mode 100755 index b642f4122..000000000 --- a/scripts/dotnet-restore +++ /dev/null @@ -1 +0,0 @@ -exec "dnu" "restore" "$@" \ No newline at end of file diff --git a/scripts/dotnet-restore.cmd b/scripts/dotnet-restore.cmd deleted file mode 100644 index 88cb4c56c..000000000 --- a/scripts/dotnet-restore.cmd +++ /dev/null @@ -1,8 +0,0 @@ -@Echo OFF -SETLOCAL -SET ERRORLEVEL= - -dnu restore %* - -exit /b %ERRORLEVEL% -ENDLOCAL \ No newline at end of file diff --git a/scripts/dotnet-run b/scripts/dotnet-run deleted file mode 100644 index 2f8f826ce..000000000 --- a/scripts/dotnet-run +++ /dev/null @@ -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 "$@" diff --git a/scripts/dotnet-run.cmd b/scripts/dotnet-run.cmd deleted file mode 100644 index d92f8ed36..000000000 --- a/scripts/dotnet-run.cmd +++ /dev/null @@ -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 diff --git a/scripts/dotnet.cmd b/scripts/dotnet.cmd deleted file mode 100644 index dc014d3f4..000000000 --- a/scripts/dotnet.cmd +++ /dev/null @@ -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 \ No newline at end of file diff --git a/src/Microsoft.DotNet.Tools.Publish/project.json b/src/Microsoft.DotNet.Tools.Publish/project.json index bf4a36d8c..fd2795d77 100644 --- a/src/Microsoft.DotNet.Tools.Publish/project.json +++ b/src/Microsoft.DotNet.Tools.Publish/project.json @@ -20,7 +20,7 @@ "type": "build", "version": "1.0.0-*" }, - "Microsoft.Framework.CommandLineUtils.Sources": { + "Microsoft.Extensions.CommandLineUtils.Sources": { "type": "build", "version": "1.0.0-*" }