Merge pull request #7628 from wtgodbe/HelixFinal
[platform/upstream/coreclr.git] / build-packages.sh
1 #!/usr/bin/env bash
2
3 usage()
4 {
5     echo "Builds the NuGet packages from the binaries that were built in the Build product binaries step."
6     echo "Usage: build-packages -BuildArch -BuildType"
7     echo "arch can be x64, x86, arm, arm64 (default is x64)"
8     echo "configuration can be release, checked, debug (default is debug)"
9     echo
10     exit 1
11 }
12
13 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
14
15 unprocessedBuildArgs=
16
17 while :; do
18     if [ $# -le 0 ]; then
19         break
20     fi
21
22     case "$1" in
23         -\?|-h|--help)
24         usage
25         exit 1
26         ;;
27         -BuildArch=*)
28         unprocessedBuildArgs="$unprocessedBuildArgs $1"
29         __Arch=$(echo $1| cut -d'=' -f 2)
30         ;;
31         *)
32         unprocessedBuildArgs="$unprocessedBuildArgs $1"
33     esac
34     shift
35 done
36
37 $__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
38 if [ $? -ne 0 ]
39 then
40     echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
41     exit 1
42 fi
43
44 echo "Done building packages."
45 exit 0