From 1f059f340cc085ef12b8687e2fcac609d63b4e45 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Thu, 14 Apr 2022 19:14:43 -0500 Subject: [PATCH] [source-build] Expose CleanWhileBuilding msbuild option in build.sh (#13642) --- .../templates/job/source-build-build-tarball.yml | 2 +- src/SourceBuild/tarball/content/build.sh | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml index 7ce2ad732..24b93ffc4 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml @@ -132,7 +132,7 @@ jobs: customBuildArgs="$customBuildArgs --poison" fi - docker run --rm -v $(tarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh ${customBuildArgs} $(additionalBuildArgs) -- /p:CleanWhileBuilding=true + docker run --rm -v $(tarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh --clean-while-building ${customBuildArgs} $(additionalBuildArgs) displayName: Build Tarball - script: | diff --git a/src/SourceBuild/tarball/content/build.sh b/src/SourceBuild/tarball/content/build.sh index 29ca1644b..39e5fbd11 100755 --- a/src/SourceBuild/tarball/content/build.sh +++ b/src/SourceBuild/tarball/content/build.sh @@ -5,11 +5,12 @@ IFS=$'\n\t' usage() { echo "usage: $0 [options]" echo "options:" + echo " --clean-while-building cleans each repo after building (reduces disk space usage)" echo " --online build using online sources" - echo " --with-packages use the specified directory of previously-built packages" - echo " --with-sdk use the SDK in the specified directory for bootstrapping" echo " --poison build with poisoning checks" echo " --run-smoke-test don't build; run smoke tests" + echo " --with-packages use the specified directory of previously-built packages" + echo " --with-sdk use the SDK in the specified directory for bootstrapping" echo "use -- to send the remaining arguments to MSBuild" echo "" } @@ -29,9 +30,8 @@ while :; do lowerI="$(echo $1 | awk '{print tolower($0)}')" case $lowerI in - --run-smoke-test) - alternateTarget=true - MSBUILD_ARGUMENTS+=( "/t:RunSmokeTest" ) + --clean-while-building) + MSBUILD_ARGUMENTS+=( "/p:CleanWhileBuilding=true") ;; --online) MSBUILD_ARGUMENTS+=( "/p:BuildWithOnlineSources=true") @@ -39,6 +39,10 @@ while :; do --poison) MSBUILD_ARGUMENTS+=( "/p:EnablePoison=true") ;; + --run-smoke-test) + alternateTarget=true + MSBUILD_ARGUMENTS+=( "/t:RunSmokeTest" ) + ;; --with-packages) CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR="$(cd -P "$2" && pwd)" if [ ! -d "$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR" ]; then