From a06b5fd5699c2fe62c07c8f41c61251b3c49bd97 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 09:16:37 -0700 Subject: [PATCH 1/8] Pass thru command line args to RepoTasks build --- eng/build.ps1 | 5 ++++- eng/build.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/build.ps1 b/eng/build.ps1 index 15fe87ac6f77..5d58d01abc5a 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -250,6 +250,8 @@ if ($BuildManaged -or ($All -and (-not $NoBuildManaged))) { } } +$CommandLineArguments = $MSBuildArguments + if ($NoBuildDeps) { $MSBuildArguments += "/p:BuildProjectReferences=false" } $RunBuild = if ($NoBuild) { $false } else { $true } @@ -478,7 +480,8 @@ try { /p:Restore=$RunRestore ` /p:Build=true ` /clp:NoSummary ` - @ToolsetBuildArguments + @ToolsetBuildArguments ` + @CommandLineArguments } if (-not $OnlyBuildRepoTasks) { diff --git a/eng/build.sh b/eng/build.sh index a27eaad468f3..8e194d159679 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -249,6 +249,8 @@ while [[ $# -gt 0 ]]; do shift done +commandline_args=$msbuild_args + if [ "$build_all" = true ]; then msbuild_args[${#msbuild_args[*]}]="-p:BuildAllProjects=true" fi @@ -396,7 +398,8 @@ if [ "$build_repo_tasks" = true ]; then -p:Restore=$run_restore \ -p:Build=true \ -clp:NoSummary \ - ${toolset_build_args[@]+"${toolset_build_args[@]}"} + ${toolset_build_args[@]+"${toolset_build_args[@]}"} \ + ${commandline_args[@]+"${commandline_args[@]}"} fi if [ "$only_build_repo_tasks" != true ]; then From 7f0d7c9e29f189621214701b97028eafc1f43ad2 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 09:28:14 -0700 Subject: [PATCH 2/8] Fixup --- eng/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/build.sh b/eng/build.sh index 8e194d159679..028491f5d2e3 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -249,7 +249,8 @@ while [[ $# -gt 0 ]]; do shift done -commandline_args=$msbuild_args +commandline_args=("${msbuild_args[@]}") + if [ "$build_all" = true ]; then msbuild_args[${#msbuild_args[*]}]="-p:BuildAllProjects=true" From f3d14b23ffc1cb2c7a15eee0039c49a2844e5379 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 09:32:56 -0700 Subject: [PATCH 3/8] Fixup --- eng/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/build.sh b/eng/build.sh index 028491f5d2e3..a13659d810f0 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -249,7 +249,9 @@ while [[ $# -gt 0 ]]; do shift done -commandline_args=("${msbuild_args[@]}") +if [ ${#msbuild_args[@]} -ne 0 ]; then + commandline_args=("${msbuild_args[@]}") +fi if [ "$build_all" = true ]; then From b3fdc2b36cfbb2a9585460242629c192dd5311ed Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 09:46:38 -0700 Subject: [PATCH 4/8] Spacing --- eng/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/build.sh b/eng/build.sh index a13659d810f0..183edba6fbde 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -253,7 +253,6 @@ if [ ${#msbuild_args[@]} -ne 0 ]; then commandline_args=("${msbuild_args[@]}") fi - if [ "$build_all" = true ]; then msbuild_args[${#msbuild_args[*]}]="-p:BuildAllProjects=true" fi From d560d5251931635fbbda08bf18ed32f922a99a3f Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 10:28:58 -0700 Subject: [PATCH 5/8] Append --- eng/build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index 183edba6fbde..6c2d59c058b3 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -392,6 +392,11 @@ InitializeToolset restore=$_tmp_restore= +if [ ${#commandline_args[@]} -gt 0 ]; then + # Append array1 to array2 + toolset_build_args+=("${commandline_args[@]}") +fi + if [ "$build_repo_tasks" = true ]; then MSBuild $_InitializeToolset \ -p:RepoRoot="$repo_root" \ @@ -400,8 +405,7 @@ if [ "$build_repo_tasks" = true ]; then -p:Restore=$run_restore \ -p:Build=true \ -clp:NoSummary \ - ${toolset_build_args[@]+"${toolset_build_args[@]}"} \ - ${commandline_args[@]+"${commandline_args[@]}"} + ${toolset_build_args[@]+"${toolset_build_args[@]}"} fi if [ "$only_build_repo_tasks" != true ]; then From ef709f5a28d4c898c7c0d27c46d28de0da3ec3f7 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 10:29:55 -0700 Subject: [PATCH 6/8] Remove comment --- eng/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/build.sh b/eng/build.sh index 6c2d59c058b3..fec0637dbfaa 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -393,7 +393,6 @@ InitializeToolset restore=$_tmp_restore= if [ ${#commandline_args[@]} -gt 0 ]; then - # Append array1 to array2 toolset_build_args+=("${commandline_args[@]}") fi From e3cf2ba2315f66b12b00ed6d5d7d9f7b3a69f501 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 10:43:29 -0700 Subject: [PATCH 7/8] Fixup --- eng/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/build.sh b/eng/build.sh index fec0637dbfaa..3227c0c699c4 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -249,6 +249,8 @@ while [[ $# -gt 0 ]]; do shift done +commandline_args=() + if [ ${#msbuild_args[@]} -ne 0 ]; then commandline_args=("${msbuild_args[@]}") fi From c134b5691800e92070a6aa3b020c006a7e383e0f Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Thu, 20 Mar 2025 10:56:02 -0700 Subject: [PATCH 8/8] Consistency --- eng/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/build.sh b/eng/build.sh index 3227c0c699c4..eb45d4052eb6 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -251,7 +251,7 @@ done commandline_args=() -if [ ${#msbuild_args[@]} -ne 0 ]; then +if [ ${#msbuild_args[@]} -gt 0 ]; then commandline_args=("${msbuild_args[@]}") fi