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 if [[ $ID == "rhel" ]]; then
20 # remove the last version digit
21 VERSION_ID=${VERSION_ID%.*}
23 __HostDistroRid="$ID.$VERSION_ID-$__Arch"
24 if [[ $ID == "alpine" ]]; then
25 __HostDistroRid="linux-musl-$__Arch"
27 elif [ -e /etc/redhat-release ]; then
28 local redhatRelease=$(</etc/redhat-release)
29 if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
30 __HostDistroRid="rhel.6-$__Arch"
34 if [ "$__HostOS" == "FreeBSD" ]; then
35 __freebsd_version=`sysctl -n kern.osrelease | cut -f1 -d'.'`
36 __HostDistroRid="freebsd.$__freebsd_version-$__Arch"
39 if [ "$__HostDistroRid" == "" ]; then
40 echo "WARNING: Cannot determine runtime id for current distro."
44 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
47 # Use uname to determine what the OS is.
81 echo "Unsupported OS $OSName detected, configuring as if for Linux"
100 unprocessedBuildArgs="$unprocessedBuildArgs $1"
101 __Arch=$(echo $1| cut -d'=' -f 2)
104 -portablebuild=false)
105 unprocessedBuildArgs="$unprocessedBuildArgs $1"
109 unprocessedBuildArgs="$unprocessedBuildArgs $1"
114 # Portable builds target the base RID
115 if [ $__IsPortableBuild == 1 ]; then
116 if [ "$__BuildOS" == "Linux" ]; then
117 export __DistroRid="linux-$__Arch"
118 elif [ "$__BuildOS" == "OSX" ]; then
119 export __DistroRid="osx-$__Arch"
120 elif [ "$__BuildOS" == "FreeBSD" ]; then
121 export __DistroRid="freebsd-$__Arch"
124 # init the host distro name
126 export __DistroRid="$__HostDistroRid"
129 $__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=$__DistroRid -UseSharedCompilation=false -BuildNugetPackage=false -MsBuildEventLogging="/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log" $unprocessedBuildArgs
132 echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
136 echo "Done building packages."