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 == "alpine" || $ID == "rhel" ]]; then
20 # remove the last version digit
21 VERSION_ID=${VERSION_ID%.*}
23 __HostDistroRid="$ID.$VERSION_ID-$__Arch"
24 elif [ -e /etc/redhat-release ]; then
25 local redhatRelease=$(</etc/redhat-release)
26 if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
27 __HostDistroRid="rhel.6-$__Arch"
31 if [ "$__HostOS" == "FreeBSD" ]; then
32 __freebsd_version=`sysctl -n kern.osrelease | cut -f1 -d'.'`
33 __HostDistroRid="freebsd.$__freebsd_version-$__Arch"
36 if [ "$__HostDistroRid" == "" ]; then
37 echo "WARNING: Cannot determine runtime id for current distro."
41 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44 # Use uname to determine what the OS is.
78 echo "Unsupported OS $OSName detected, configuring as if for Linux"
97 unprocessedBuildArgs="$unprocessedBuildArgs $1"
98 __Arch=$(echo $1| cut -d'=' -f 2)
101 -portablebuild=false)
102 unprocessedBuildArgs="$unprocessedBuildArgs $1"
106 unprocessedBuildArgs="$unprocessedBuildArgs $1"
111 # Portable builds target the base RID
112 if [ $__IsPortableBuild == 1 ]; then
113 if [ "$__BuildOS" == "Linux" ]; then
114 export __DistroRid="linux-$__Arch"
115 elif [ "$__BuildOS" == "OSX" ]; then
116 export __DistroRid="osx-$__Arch"
119 # init the host distro name
121 export __DistroRid="$__HostDistroRid"
124 $__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
127 echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
131 echo "Done building packages."