2015-12-28 11:47:21 -08:00
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
# Set OFFLINE environment variable to build offline
set -e
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 ) "
source " $DIR /../common/_common.sh "
2016-02-09 15:07:36 -08:00
2015-12-28 11:47:21 -08:00
source " $REPOROOT /scripts/build/generate-version.sh "
2016-02-09 15:07:36 -08:00
" $REPOROOT /scripts/clean/clear-nuget-cache.sh "
2016-01-12 15:27:02 -08:00
header " Building dotnet tools version $DOTNET_CLI_VERSION - $CONFIGURATION "
2015-12-28 11:47:21 -08:00
header "Checking Pre-Reqs"
$REPOROOT /scripts/test/check-prereqs.sh
2016-01-12 15:54:05 -08:00
header "Adjusting file descriptors limit, if necessary"
# Increases the file descriptors limit for this bash. It prevents an issue we were hitting during restore
FILE_DESCRIPTOR_LIMIT = $( ulimit -n )
2016-01-22 10:40:01 -08:00
if [ $FILE_DESCRIPTOR_LIMIT -lt 1024 ]
2016-01-12 15:54:05 -08:00
then
2016-01-22 10:40:01 -08:00
info "Increasing file description limit to 1024"
ulimit -n 1024
2016-01-12 15:54:05 -08:00
fi
2015-12-28 11:47:21 -08:00
header "Restoring Tools and Packages"
if [ ! -z " $OFFLINE " ] ; then
info "Skipping Tools and Package Download: Offline build"
else
$REPOROOT /scripts/obtain/install-tools.sh
fi
2016-02-09 15:07:36 -08:00
header "Cleaning out .ni's from Stage0"
find ".dotnet_stage0" -name '*.ni.*' -delete
$REPOROOT /scripts/build/restore-packages.sh
2015-12-28 11:47:21 -08:00
header "Compiling"
$REPOROOT /scripts/compile/compile.sh
2016-01-06 02:27:16 -08:00
header "Setting Stage2 as PATH, DOTNET_HOME, and DOTNET_TOOLS"
export DOTNET_HOME = $STAGE2_DIR && export DOTNET_TOOLS = $STAGE2DIR && export PATH = $STAGE2_DIR /bin:$PATH
2015-12-18 16:39:43 -08:00
2016-01-23 12:55:03 -08:00
header "Testing"
$REPOROOT /scripts/test/test.sh
2015-12-28 11:47:21 -08:00
header "Validating Dependencies"
$REPOROOT /scripts/test/validate-dependencies.sh