Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:"
Expand Down Expand Up @@ -210,7 +210,7 @@ function Process-Arguments() {
$script:restore = $true
}

if ($sourceBuild) {
if ($productBuild) {
$script:msbuildEngine = "dotnet"
}

Expand Down Expand Up @@ -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 { "" }

Expand All @@ -287,9 +284,9 @@ function BuildSolution() {
/p:IbcOptimizationDataDir=$ibcDir `
/p:VisualStudioIbcDrop=$ibcDropName `
/p:VisualStudioDropAccessToken=$officialVisualStudioDropAccessToken `
/p:DotNetBuildRepo=$productBuild `
$suppressExtensionDeployment `
$msbuildWarnAsError `
$buildFromSource `
$generateDocumentationFile `
$roslynUseHardLinks `
@properties
Expand Down
19 changes: 10 additions & 9 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -80,6 +81,7 @@ prepare_machine=false
warn_as_error=false
properties=""
source_build=false
product_build=false
solution_to_build="Compilers.slnf"

args=""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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 \
Expand Down