forked from dotnet/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·37 lines (31 loc) · 1.33 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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/scripts/common/_common.sh"
source "$REPOROOT/scripts/build/process-args.sh"
# splitting build from package is required to work around dotnet/coreclr#2215
# once that is fixed, we should remove the NOPACKAGE flag and do the full build either in
# or out of docker.
if [ ! -z "$BUILD_IN_DOCKER" ]; then
export BUILD_COMMAND="/opt/code/scripts/build/build.sh NOPACKAGE"
$REPOROOT/scripts/docker/dockerbuild.sh
else
$REPOROOT/scripts/build/build.sh NOPACKAGE
fi
if [ ! -z "$PACKAGE_IN_DOCKER" ]; then
export BUILD_COMMAND="/opt/code/scripts/package/package-native.sh"
$REPOROOT/scripts/docker/dockerbuild.sh
else
$REPOROOT/scripts/package/package.sh
fi