diff --git a/eng/build.ps1 b/eng/build.ps1 index fb1afbc1c24b4..87bbcb3ad7599 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -43,7 +43,7 @@ param ( [switch]$prepareMachine, [switch]$useGlobalNuGetCache = $true, [switch]$warnAsError = $false, - [switch]$sourceBuild = $false, + [switch][Alias('pb')]$productBuild = $false, [switch]$oop64bit = $true, [switch]$lspEditor = $false, [string]$solution = "Roslyn.sln", @@ -112,7 +112,7 @@ function Print-Usage() { Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -useGlobalNuGetCache Use global NuGet cache." Write-Host " -warnAsError Treat all warnings as errors" - Write-Host " -sourceBuild Simulate building source-build" + Write-Host " -productBuild Build the repository in product-build mode" Write-Host " -solution Solution to build (default is Roslyn.sln)" Write-Host "" Write-Host "Official build settings:" @@ -210,7 +210,7 @@ function Process-Arguments() { $script:restore = $true } - if ($sourceBuild) { + if ($productBuild) { $script:msbuildEngine = "dotnet" } @@ -260,9 +260,6 @@ function BuildSolution() { # Workaround for some machines in the AzDO pool not allowing long paths $ibcDir = $RepoRoot - # Set DotNetBuildSourceOnly to 'true' if we're simulating building for source-build. - $buildFromSource = if ($sourceBuild) { "/p:DotNetBuildSourceOnly=true" } else { "" } - $generateDocumentationFile = if ($skipDocumentation) { "/p:GenerateDocumentationFile=false" } else { "" } $roslynUseHardLinks = if ($ci) { "/p:ROSLYNUSEHARDLINKS=true" } else { "" } @@ -287,9 +284,9 @@ function BuildSolution() { /p:IbcOptimizationDataDir=$ibcDir ` /p:VisualStudioIbcDrop=$ibcDropName ` /p:VisualStudioDropAccessToken=$officialVisualStudioDropAccessToken ` + /p:DotNetBuildRepo=$productBuild ` $suppressExtensionDeployment ` $msbuildWarnAsError ` - $buildFromSource ` $generateDocumentationFile ` $roslynUseHardLinks ` @properties diff --git a/eng/build.sh b/eng/build.sh index 87c1f7a03f11e..87d913982711d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -37,7 +37,8 @@ usage() echo " --skipDocumentation Skip generation of XML documentation files" echo " --prepareMachine Prepare machine for CI run, clean up processes after build" echo " --warnAsError Treat all warnings as errors" - echo " --sourceBuild Simulate building for source-build" + echo " --sourceBuild Build the repository in source-only mode" + echo " --productBuild Build the repository in product-build mode." echo " --solution Solution to build (default is Compilers.slnf)" echo "" echo "Command line arguments starting with '/p:' are passed through to MSBuild." @@ -80,6 +81,7 @@ prepare_machine=false warn_as_error=false properties="" source_build=false +product_build=false solution_to_build="Compilers.slnf" args="" @@ -173,8 +175,12 @@ while [[ $# > 0 ]]; do --warnaserror) warn_as_error=true ;; - --sourcebuild|-sb) + --sourcebuild|--source-build|-sb) source_build=true + product_build=true + ;; + --productbuild|--product-build|-pb) + product_build=true ;; --solution) solution_to_build=$2 @@ -281,12 +287,6 @@ function BuildSolution { roslyn_use_hard_links="/p:ROSLYNUSEHARDLINKS=true" fi - local source_build_args="" - if [[ "$source_build" == true ]]; then - source_build_args="/p:DotNetBuildSourceOnly=true \ - /p:DotNetBuildRepo=true" - fi - # Setting /p:TreatWarningsAsErrors=true is a workaround for https://github.com/Microsoft/msbuild/issues/3062. # We don't pass /warnaserror to msbuild (warn_as_error is set to false by default above), but set # /p:TreatWarningsAsErrors=true so that compiler reported warnings, other than IDE0055 are treated as errors. @@ -308,7 +308,8 @@ function BuildSolution { /p:ContinuousIntegrationBuild=$ci \ /p:TreatWarningsAsErrors=true \ /p:TestRuntimeAdditionalArguments=$test_runtime_args \ - $source_build_args \ + /p:DotNetBuildSourceOnly=$source_build \ + /p:DotNetBuildRepo=$product_build \ $test_runtime \ $mono_tool \ $generate_documentation_file \