@@ -58,8 +58,6 @@ source "$REPOROOT/scripts/common/_prettyprint.sh"
5858BUILD=1
5959
6060LINUX_PORTABLE_INSTALL_ARGS=
61- ALL_LINUX_INSTALLERS_TARGET=
62- GENERATE_INSTALLERS_TARGET=
6361CUSTOM_BUILD_ARGS=
6462
6563# Set nuget package cache under the repo
@@ -84,7 +82,7 @@ while [[ $# > 0 ]]; do
8482 --nobuild)
8583 BUILD=0
8684 ;;
87- --architecture)
85+ -a|- -architecture)
8886 ARCHITECTURE=$2
8987 shift
9088 ;;
@@ -100,31 +98,19 @@ while [[ $# > 0 ]]; do
10098 LINUX_PORTABLE_INSTALL_ARGS=" --runtime-id linux-x64"
10199 CUSTOM_BUILD_ARGS=" /p:Rid=\" linux-x64\" /p:OSName=\" linux\" /p:IslinuxPortable=\" true\" "
102100 ;;
103- --all-linux-installers)
104- ALL_LINUX_INSTALLERS_TARGET=" /t:BuildAndPublishAllLinuxDistrosNativeInstallers"
105- ;;
106- --generate-installers)
107- GENERATE_INSTALLERS_TARGET=" /t:GenerateInstallersAndCopyOutOfSandBox"
108- ;;
109101 --stage0)
110102 STAGE0_SOURCE_DIR=$2
111103 shift
112104 ;;
113105 --help)
114- echo " Usage: $0 [--configuration <CONFIGURATION>] [--skip-prereqs] [--nopackage] [--docker <IMAGENAME> ] [--help]"
106+ echo " Usage: $0 [--configuration <CONFIGURATION>] [--architecture <ARCHITECTURE>] [-- skip-prereqs] [--nopackage] [--nobuild ] [--help]"
115107 echo " "
116108 echo " Options:"
117109 echo " --configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
110+ echo " --architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
118111 echo " --skip-prereqs Skip checks for pre-reqs in dotnet_install"
119112 echo " --nopackage Skip packaging targets"
120113 echo " --nobuild Skip building, showing the command that would be used to build"
121- echo " --docker <IMAGENAME> Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME"
122- echo " --linux-portable Builds the Linux portable .NET Tools instead of a distro-specific version."
123- echo " --all-linux-installers Builds and publishes all the Linux distros' native installers; outer call"
124- echo " Note: used primarily for 'AllLinuxDistrosNativeInstallers' VSO build."
125- echo " --generate-installers Builds and publishes all the Linux distros' native installers; inner call"
126- echo " Note: used primarily for 'AllLinuxDistrosNativeInstallers' VSO build."
127- echo " --stage0 Set the stage0 source directory. The default is to download it from Azure."
128114 echo " --help Display this help message"
129115 exit 0
130116 ;;
@@ -137,6 +123,15 @@ while [[ $# > 0 ]]; do
137123 shift
138124done
139125
126+ # The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target
127+ # therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'.
128+ argsnotargets=( )
129+ for element in ${args[@]} do
130+ if [[ $element != /t:* ]]; then
131+ argsnotargets+=($element )
132+ fi
133+ done
134+
140135# Create an install directory for the stage 0 CLI
141136[ -z " $DOTNET_INSTALL_DIR " ] && export DOTNET_INSTALL_DIR=$REPOROOT /.dotnet_stage0/$ARCHITECTURE
142137[ -d " $DOTNET_INSTALL_DIR " ] || mkdir -p $DOTNET_INSTALL_DIR
179174# Disable first run since we want to control all package sources
180175export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
181176
182- echo " ${args[@]} "
183-
184177if [ $BUILD -eq 1 ]; then
185- dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $args
186- dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $ALL_LINUX_INSTALLERS_TARGET $GENERATE_INSTALLERS_TARGET $ args
178+ dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $argsnotargets
179+ dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args
187180else
188181 echo " Not building due to --nobuild"
189- echo " Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $ALL_LINUX_INSTALLERS_TARGET $GENERATE_INSTALLERS_TARGET $ args '"
182+ echo " Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args '"
190183fi
0 commit comments