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..eb45d4052eb6 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -249,6 +249,12 @@ while [[ $# -gt 0 ]]; do shift done +commandline_args=() + +if [ ${#msbuild_args[@]} -gt 0 ]; then + commandline_args=("${msbuild_args[@]}") +fi + if [ "$build_all" = true ]; then msbuild_args[${#msbuild_args[*]}]="-p:BuildAllProjects=true" fi @@ -388,6 +394,10 @@ InitializeToolset restore=$_tmp_restore= +if [ ${#commandline_args[@]} -gt 0 ]; then + toolset_build_args+=("${commandline_args[@]}") +fi + if [ "$build_repo_tasks" = true ]; then MSBuild $_InitializeToolset \ -p:RepoRoot="$repo_root" \