Skip to content

Commit

Permalink
switch to repo-local stage0
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Nov 16, 2015
1 parent 6e3ade1 commit 06c6663
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ TestResults/

# CMake generated files
cmake/

# stage0 install directory
.dotnet_stage0
37 changes: 21 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 )"
Expand All @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions scripts/ci_build.cmd
Original file line number Diff line number Diff line change
@@ -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%
1 change: 0 additions & 1 deletion scripts/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ if (Test-Path "$InstallDir\$DotNetFileName") {
del -for "$InstallDir\$DotNetFileName"
}

say "The .NET Tools have been installed to $InstallDir!"

$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"
}
say "The .NET Tools have been installed to $InstallDir\cli!"

# New layout
say "Add '$InstallDir\cli\bin' to your PATH to use dotnet"
9 changes: 2 additions & 7 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06c6663

Please sign in to comment.