Linux Port of offline build

This commit is contained in:
Bryan Thornbury 2015-12-18 01:39:50 +00:00 committed by piotrp
parent 7c722b3fe4
commit 344d010610
2 changed files with 32 additions and 20 deletions

View file

@ -4,7 +4,8 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
# $1 is passed to package to enable deb or pkg packaging
# Set OFFLINE environment variable to build offline
set -e
SOURCE="${BASH_SOURCE[0]}"
@ -27,12 +28,19 @@ do
debug)
export CONFIGURATION=Debug
;;
offline)
export OFFLINE=true
;;
*)
esac
done
[ -z "$CONFIGURATION" ] && CONFIGURATION=Debug
if [ ! -z "$OFFLINE" ]; then
header " - Offline Build - "
fi
# 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

View file

@ -25,30 +25,34 @@ fi
[ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug
# Download DNX to copy into stage2
header "Downloading DNX $DNX_VERSION"
DNX_URL="https://api.nuget.org/packages/$DNX_FLAVOR.$DNX_VERSION.nupkg"
DNX_ROOT="$DNX_DIR/bin"
rm -rf $DNX_DIR
mkdir -p $DNX_DIR
curl -o $DNX_DIR/dnx.zip $DNX_URL --silent
unzip -qq $DNX_DIR/dnx.zip -d $DNX_DIR
chmod a+x $DNX_ROOT/dnu $DNX_ROOT/dnx
if [[ ! -z "$OFFLINE" ]]; then
header "Skipping Stage 0, Dnx, and Packages download: Offline Build"
else
# Download DNX to copy into stage2
header "Downloading DNX $DNX_VERSION"
DNX_URL="https://api.nuget.org/packages/$DNX_FLAVOR.$DNX_VERSION.nupkg"
DNX_ROOT="$DNX_DIR/bin"
rm -rf $DNX_DIR
mkdir -p $DNX_DIR
curl -o $DNX_DIR/dnx.zip $DNX_URL --silent
unzip -qq $DNX_DIR/dnx.zip -d $DNX_DIR
chmod a+x $DNX_ROOT/dnu $DNX_ROOT/dnx
# Ensure the latest stage0 is installed
$DIR/install.sh
# Ensure the latest stage0 is installed
$DIR/install.sh
# And put the stage0 on the PATH
export PATH=$REPOROOT/artifacts/$RID/stage0/bin:$PATH
# And put the stage0 on the PATH
export PATH=$REPOROOT/artifacts/$RID/stage0/bin:$PATH
# Intentionally clear the DOTNET_TOOLS path, we want to use the default installed version
unset DOTNET_TOOLS
# Intentionally clear the DOTNET_TOOLS path, we want to use the default installed version
unset DOTNET_TOOLS
DOTNET_PATH=$(which dotnet)
PREFIX="$(cd -P "$(dirname "$DOTNET_PATH")/.." && pwd)"
DOTNET_PATH=$(which dotnet)
PREFIX="$(cd -P "$(dirname "$DOTNET_PATH")/.." && pwd)"
header "Restoring packages"
$DNX_ROOT/dnu restore "$REPOROOT" --quiet --runtime "$RID" --no-cache
header "Restoring packages"
$DNX_ROOT/dnu restore "$REPOROOT" --quiet --runtime "$RID" --no-cache
fi
header "Building corehost"