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 "BuildArch can be x64, x86, arm, arm64 (default is x64)"
8 echo "BuildType can be release, checked, debug (default is debug)"
16 if [ "$__HostOS" == "Linux" ]; then
17 if [ -e /etc/os-release ]; then
18 source /etc/os-release
19 __HostDistroRid="$ID.$VERSION_ID-$__Arch"
20 elif [ -e /etc/redhat-release ]; then
21 local redhatRelease=$(</etc/redhat-release)
22 if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
23 __HostDistroRid="rhel.6-$__Arch"
28 if [ "$__HostDistroRid" == "" ]; then
29 echo "WARNING: Can not determine runtime id for current distro."
33 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
36 # Use uname to determine what the OS is.
70 echo "Unsupported OS $OSName detected, configuring as if for Linux"
89 unprocessedBuildArgs="$unprocessedBuildArgs $1"
90 __Arch=$(echo $1| cut -d'=' -f 2)
94 unprocessedBuildArgs="$unprocessedBuildArgs $1"
98 unprocessedBuildArgs="$unprocessedBuildArgs $1"
103 # Portable builds target the base RID
104 if [ $__IsPortableBuild == 1 ]; then
105 if [ "$__BuildOS" == "Linux" ]; then
106 export __DistroRid="linux-$__Arch"
107 elif [ "$__BuildOS" == "OSX" ]; then
108 export __DistroRid="osx-$__Arch"
111 # init the host distro name
113 export __DistroRid="$__HostDistroRid"
116 $__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=$__DistroRid -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
119 echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
123 echo "Done building packages."