diff --git a/.gitignore b/.gitignore index b287bb498..646218a36 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ TestResults/ # CMake generated files cmake/ + +# stage0 install directory +.dotnet_stage0 diff --git a/build.sh b/build.sh index 07ea531fd..b9da2fb08 100755 --- a/build.sh +++ b/build.sh @@ -3,22 +3,6 @@ # $1 is passed to package to enable deb or pkg packaging set -e -for i in "$@" - do - lowerI="$(echo $i | awk '{print tolower($0)}')" - case $lowerI in - release) - export CONFIGURATION=Release - ;; - debug) - export CONFIGURATION=Debug - ;; - *) - esac - done - -[ -z "$CONFIGURATION" ] && CONFIGURATION=Debug - SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" @@ -29,6 +13,27 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/scripts/_common.sh" +for i in "$@" +do + lowerI="$(echo $i | awk '{print tolower($0)}')" + case $lowerI in + release) + export CONFIGURATION=Release + ;; + debug) + export CONFIGURATION=Debug + ;; + *) + esac +done + +[ -z "$CONFIGURATION" ] && CONFIGURATION=Debug + +# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot +export DOTNET_INSTALL_DIR=$DIR/.dotnet_stage0/$RID +[ -d $DOTNET_INSTALL_DIR ] || mkdir -p $DOTNET_INSTALL_DIR +export PATH=$DOTNET_INSTALL_DIR/bin:$PATH + # UTC Timestamp of the last commit is used as the build number. This is for easy synchronization of build number between Windows, OSX and Linux builds. LAST_COMMIT_TIMESTAMP=$(git log -1 --format=%ct) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index b6ce64ee1..c9f782326 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -3,6 +3,14 @@ param( $ErrorActionPreference="Stop" +# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot +$env:DOTNET_INSTALL_DIR="$PSScriptRoot\.dotnet_stage0\win7-x64" +if (!(Test-Path $env:DOTNET_INSTALL_DIR)) +{ + mkdir $env:DOTNET_INSTALL_DIR | Out-Null +} +$env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$env:PATH" + if (!$env:DOTNET_BUILD_VERSION) { # Get the timestamp of the most recent commit $timestamp = git log -1 --format=%ct diff --git a/scripts/ci_build.cmd b/scripts/ci_build.cmd index 477a82231..091b21ad6 100644 --- a/scripts/ci_build.cmd +++ b/scripts/ci_build.cmd @@ -1,8 +1,5 @@ @echo off -pushd %~dp0.. -set DOTNET_INSTALL_DIR=%CD%\artifacts\win7-x64\stage0 -popd CALL %~dp0..\build.cmd %* exit /b %errorlevel% diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index 64771d8a3..8d3b95b7c 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -14,7 +14,6 @@ source "$SCRIPT_DIR/_common.sh" # Tell install scripts to skip pre-req check since the CI has the pre-reqs but not ldconfig it seems # Also, install to a directory under the repo root since we don't have permission to work elsewhere export DOTNET_INSTALL_SKIP_PREREQS=1 -export DOTNET_INSTALL_DIR=$SCRIPT_DIR/../artifacts/$RID/stage0 # Some things depend on HOME and it may not be set. We should fix those things, but until then, we just patch a value in if [ -z "$HOME" ]; then diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 2cc51c9d0..66983cd34 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -80,13 +80,7 @@ if (Test-Path "$InstallDir\$DotNetFileName") { del -for "$InstallDir\$DotNetFileName" } -say "The .NET Tools have been installed to $InstallDir!" +say "The .NET Tools have been installed to $InstallDir\cli!" -$binPath = "$InstallDir\bin" -if (Test-Path $binPath) { - # New layout - say "Add '$InstallDir\bin' to your PATH to use dotnet" -} else { - # Old layout (temporary) - say "Add '$InstallDir' to your PATH to use dotnet" -} +# New layout +say "Add '$InstallDir\cli\bin' to your PATH to use dotnet" diff --git a/scripts/install.sh b/scripts/install.sh index 3d0a04d5b..0312512a2 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -37,13 +37,8 @@ MY_NAME=$(basename ${BASH_SOURCE[0]}) MY_TARGET=$DOTNET_TOOLS/bin/$MY_NAME if [ ! -e "$MY_TARGET" ]; then - # try the old layout - MY_TARGET=$DOTNET_TOOLS/$MY_NAME - if [ ! -e "$MY_TARGET" ]; then - echo "error: the tool $MY_TARGET cannot be found" 1>&2 - exit 1 - fi - echo "warning: this version of the dotnet tools is using the old layout!" 1>&2 + echo "error: the tool $MY_TARGET cannot be found" 1>&2 + exit 1 fi if [ ! -x "$MY_TARGET" ]; then