diff --git a/build/SandBoxAndPackage.proj b/build/SandBoxAndPackage.proj index 98bfb6582..1387402eb 100644 --- a/build/SandBoxAndPackage.proj +++ b/build/SandBoxAndPackage.proj @@ -51,7 +51,7 @@ $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --configuration $(BuildConfiguration) $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --docker $(DockerFolder) $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --skip-prereqs - $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --generate-installers + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) /t:GenerateInstallersAndCopyOutOfSandBox $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) /p:RelativeSandBoxPackageOutputFolder=$(RelativeSandBoxPackageOutputFolder) 0 2>&1 diff --git a/run-build.ps1 b/run-build.ps1 index 77dda05f4..385ea1c8d 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -16,7 +16,7 @@ param( if($Help) { - Write-Output "Usage: .\run-build.ps1 [-Configuration ] [-Architecture ] [-NoPackage] [-Help]" + Write-Output "Usage: .\run-build.ps1 [-Configuration ] [-Architecture ] [-NoPackage] [-NoBuild] [-Help]" Write-Output "" Write-Output "Options:" Write-Output " -Configuration Build the specified Configuration (Debug or Release, default: Debug)" @@ -27,6 +27,17 @@ if($Help) exit 0 } +# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target +# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'. +$ExtraParametersNoTargets = "" +foreach ($param in $ExtraParameters.split()) +{ + if((-not $param.StartsWith("/t")) -and (-not $param.StartsWith("/T"))) + { + $ExtraParametersNoTargets += " {0}" -f $param + } +} + $env:CONFIGURATION = $Configuration; $RepoRoot = "$PSScriptRoot" if(!$env:NUGET_PACKAGES){ @@ -86,7 +97,7 @@ if ($NoBuild) } else { - dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $ExtraParameters + dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $ExtraParametersNoTargets dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters if($LASTEXITCODE -ne 0) { throw "Failed to build" } } diff --git a/run-build.sh b/run-build.sh index 42eab5877..cce2ed49f 100755 --- a/run-build.sh +++ b/run-build.sh @@ -58,8 +58,6 @@ source "$REPOROOT/scripts/common/_prettyprint.sh" BUILD=1 LINUX_PORTABLE_INSTALL_ARGS= -ALL_LINUX_INSTALLERS_TARGET= -GENERATE_INSTALLERS_TARGET= CUSTOM_BUILD_ARGS= # Set nuget package cache under the repo @@ -84,7 +82,7 @@ while [[ $# > 0 ]]; do --nobuild) BUILD=0 ;; - --architecture) + -a|--architecture) ARCHITECTURE=$2 shift ;; @@ -100,31 +98,21 @@ while [[ $# > 0 ]]; do LINUX_PORTABLE_INSTALL_ARGS="--runtime-id linux-x64" CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:IslinuxPortable=\"true\"" ;; - --all-linux-installers) - ALL_LINUX_INSTALLERS_TARGET="/t:BuildAndPublishAllLinuxDistrosNativeInstallers" - ;; - --generate-installers) - GENERATE_INSTALLERS_TARGET="/t:GenerateInstallersAndCopyOutOfSandBox" - ;; --stage0) STAGE0_SOURCE_DIR=$2 shift ;; --help) - echo "Usage: $0 [--configuration ] [--skip-prereqs] [--nopackage] [--docker ] [--help]" + echo "Usage: $0 [--configuration ] [--architecture ] [--skip-prereqs] [--nopackage] [--nobuild ] [--docker ] [--stage0 ] [--help]" echo "" echo "Options:" echo " --configuration Build the specified Configuration (Debug or Release, default: Debug)" + echo " --architecture Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)" echo " --skip-prereqs Skip checks for pre-reqs in dotnet_install" echo " --nopackage Skip packaging targets" echo " --nobuild Skip building, showing the command that would be used to build" echo " --docker Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME" - echo " --linux-portable Builds the Linux portable .NET Tools instead of a distro-specific version." - echo " --all-linux-installers Builds and publishes all the Linux distros' native installers; outer call" - echo " Note: used primarily for 'AllLinuxDistrosNativeInstallers' VSO build." - echo " --generate-installers Builds and publishes all the Linux distros' native installers; inner call" - echo " Note: used primarily for 'AllLinuxDistrosNativeInstallers' VSO build." - echo " --stage0 Set the stage0 source directory. The default is to download it from Azure." + echo " --stage0 Set the stage0 source directory. The default is to download it from Azure." echo " --help Display this help message" exit 0 ;; @@ -137,6 +125,16 @@ while [[ $# > 0 ]]; do shift done +# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target +# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'. +argsnotargets=( ) +for arg in ${args[@]} +do + if [[ $arg != '/t'* ]] && [[ $arg != '/T'* ]]; then + argsnotargets+=($arg) + fi +done + # Create an install directory for the stage 0 CLI [ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$ARCHITECTURE [ -d "$DOTNET_INSTALL_DIR" ] || mkdir -p $DOTNET_INSTALL_DIR @@ -179,12 +177,10 @@ fi # Disable first run since we want to control all package sources export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -echo "${args[@]}" - if [ $BUILD -eq 1 ]; then - dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $args - 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 + dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $argsnotargets + dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args else echo "Not building due to --nobuild" - 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'" + echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args'" fi