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"
32 if [[ $redhatRelease == "CentOS Linux release 7."* ]]; then
33 __HostDistroRid="rhel.7-$__Arch"
37 if [ "$__HostOS" == "FreeBSD" ]; then
38 __freebsd_version=`sysctl -n kern.osrelease | cut -f1 -d'.'`
39 __HostDistroRid="freebsd.$__freebsd_version-$__Arch"
42 if [ "$__HostDistroRid" == "" ]; then
43 echo "WARNING: Cannot determine runtime id for current distro."
47 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
50 # Use uname to determine what the OS is.
84 echo "Unsupported OS $OSName detected, configuring as if for Linux"
103 unprocessedBuildArgs="$unprocessedBuildArgs $1"
104 __Arch=$(echo $1| cut -d'=' -f 2)
107 -portablebuild=false)
108 unprocessedBuildArgs="$unprocessedBuildArgs $1"
112 unprocessedBuildArgs="$unprocessedBuildArgs $1"
117 # Portable builds target the base RID
118 if [ $__IsPortableBuild == 1 ]; then
119 if [ "$__BuildOS" == "Linux" ]; then
120 export __DistroRid="linux-$__Arch"
121 elif [ "$__BuildOS" == "OSX" ]; then
122 export __DistroRid="osx-$__Arch"
123 elif [ "$__BuildOS" == "FreeBSD" ]; then
124 export __DistroRid="freebsd-$__Arch"
127 # init the host distro name
129 export __DistroRid="$__HostDistroRid"
132 $__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
135 echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
139 echo "Done building packages."