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)"
15 source init-distro-rid.sh
17 local passedRootfsDir=""
19 # Only pass ROOTFS_DIR if __DoCrossArchBuild is specified.
20 if (( ${__CrossBuild} == 1 )); then
21 passedRootfsDir=${ROOTFS_DIR}
24 initDistroRidGlobal ${__BuildOS} ${__BuildArch} ${__IsPortableBuild} ${passedRootfsDir}
27 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
31 # Use uname to determine what the OS is.
65 echo "Unsupported OS $OSName detected, configuring as if for Linux"
74 # TODO: get rid of argument processing entirely once we remove the
75 # uses of -Arg=Value style in buildpipeline.
87 __BuildArch=$(echo $1| cut -d'=' -f 2)
88 buildArgs="$buildArgs /p:__BuildArch=$__BuildArch"
91 __Type=$(echo $1| cut -d'=' -f 2)
92 buildArgs="$buildArgs /p:__BuildType=$__Type"
94 -OfficialBuildId=*|-officialbuildid=*)
95 __Id=$(echo $1| cut -d'=' -f 2)
96 buildArgs="$buildArgs /p:OfficialBuildId=$__Id"
98 -__DoCrossArchBuild=*)
99 __CrossBuild=$(echo $1| cut -d'=' -f 2)
100 buildArgs="$buildArgs /p:__DoCrossArchBuild=$__CrossBuild"
102 -portablebuild=false)
103 buildArgs="$buildArgs /p:PortableBuild=false"
109 unprocessedBuildArgs="$unprocessedBuildArgs $1"
116 if [ "${__DistroRid}" = "linux-musl-arm64" ]; then
117 # ArchGroup is generally determined from parsing {}-{}; however, linux-musl-arm64
118 # will break this logic. To work around this, pass ArchGroup explicitely.
120 export ArchGroup=arm64
122 # Currently the decision tree in src/.nuget/dirs.props will incorrectly
123 # reparse the already calculated __DistroRid. For linux-musl-arm64 use
124 # the hack/hook to specifically bypass this logic.
125 export OutputRID=${__DistroRid}
128 logFile=$__ProjectRoot/bin/Logs/build-packages.binlog
129 $__ProjectRoot/eng/common/build.sh -r -b -projects $__ProjectRoot/src/.nuget/packages.builds \
130 -verbosity minimal -bl:$logFile \
131 /p:__BuildOS=$__BuildOS /p:ArcadeBuild=true \
132 /p:PortableBuild=true /p:__DistroRid=$__DistroRid \
133 $buildArgs $unprocessedBuildArgs
136 echo "ERROR: An error occurred while building packages; See log for more details:"
141 echo "Done building packages."