5 echo "Builds the NuGet packages from the binaries that were built in the Build product binaries step."
6 echo "Usage: build-packages [arch] [configuration]"
7 echo "arch can be x64, x86, arm, arm64 (default is x64)"
8 echo "configuration can be release, checked, debug (default is debug)"
13 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
14 build_packages_log=$__ProjectRoot/build-packages.log
15 binclashlog=$__ProjectRoot/binclash.log
16 binclashloggerdll=$__ProjectRoot/Tools/Microsoft.DotNet.Build.Tasks.dll
17 RuntimeOS=ubuntu.$VERSION_ID
19 __MSBuildPath=$__ProjectRoot/Tools/MSBuild.exe
27 echo -e "Running build-packages.sh $allargs" > $build_packages_log
29 if [ "$allargs" == "-h" ] || [ "$allargs" == "--help" ]; then
38 lowerI="$(echo $1 | awk '{print tolower($0)}')"
72 # Use uname to determine what the OS is.
100 echo "Unsupported OS $OSName detected, configuring as if for Linux"
105 if [ "$__BuildOS" == "Linux" ]; then
107 if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then
108 export __DistroName=ubuntu
109 elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then
110 export __DistroName=rhel
111 elif [ "$(cat /etc/*-release | grep -cim1 rhel)" -eq 1 ]; then
112 export __DistroName=rhel
113 elif [ "$(cat /etc/*-release | grep -cim1 debian)" -eq 1 ]; then
114 export __DistroName=debian
116 export __DistroName=""
120 __IntermediatesDir="$__ProjectRoot/bin/obj/$__BuildOS.$__BuildArch.$__BuildType"
122 # Ensure that MSBuild is available
123 echo "Running init-tools.sh"
124 $__ProjectRoot/init-tools.sh
126 echo "Generating nuget packages for "$__BuildOS
129 $__ProjectRoot/Tools/corerun "$__MSBuildPath" /nologo "$__ProjectRoot/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds" /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$binclashlog" /t:Build /p:__BuildOS=$__BuildOS /p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__IntermediatesDir=$__IntermediatesDir /p:BuildNugetPackage=false /p:UseSharedCompilation=false
131 if [ $? -ne 0 ]; then
132 echo -e "\nAn error occurred. Aborting build-packages.sh ." >> $build_packages_log
133 echo "ERROR: An error occurred while building packages, see $build_packages_log for more details."
137 # Build the JIT packages
138 $__ProjectRoot/Tools/corerun "$__MSBuildPath" /nologo "$__ProjectRoot/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds" /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$binclashlog" /t:Build /p:__BuildOS=$__BuildOS /p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__IntermediatesDir=$__IntermediatesDir /p:BuildNugetPackage=false /p:UseSharedCompilation=false
140 if [ $? -ne 0 ]; then
141 echo -e "\nAn error occurred. Aborting build-packages.sh ." >> $build_packages_log
142 echo "ERROR: An error occurred while building packages, see $build_packages_log for more details."
146 echo "Done building packages."
147 echo -e "\nDone building packages." >> $build_packages_log