diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 40c32755968..cc93c1e68fc 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -48,6 +48,7 @@ param ( [switch]$useGlobalNuGetCache = $true, [switch]$dontUseGlobalNuGetCache = $false, [switch]$warnAsError = $true, + [string]$warnNotAsError = "", [switch][Alias('test')]$testDesktop, [string]$testDesktopBatch = "", [switch]$testCoreClr, @@ -149,6 +150,7 @@ function Print-Usage() { Write-Host " -compressAllMetadata Build product with compressed metadata" Write-Host " -buildnorealsig Build product with realsig- (default use realsig+, where necessary)" Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget" + Write-Host " -warnNotAsError Suppress specific warnings from being treated as errors (semi-colon delimited)" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -305,6 +307,8 @@ function BuildSolution([string] $solutionName, $packSolution) { $pack = if ($packSolution -eq $False) {""} else {$pack} + $msbuildWarnNotAsError = if ($warnAsError -and $warnNotAsError -ne "") { "/warnNotAsError:$warnNotAsError" } else { "" } + MSBuild $toolsetBuildProj ` $bl ` /p:Configuration=$configuration ` @@ -327,7 +331,8 @@ function BuildSolution([string] $solutionName, $packSolution) { /p:BuildNoRealsig=$buildnorealsig ` /v:$verbosity ` $suppressExtensionDeployment ` - @properties + @properties ` + $msbuildWarnNotAsError $env:BUILDING_USING_DOTNET=$BUILDING_USING_DOTNET_ORIG } diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3453cbc4a62..422144a0a65 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,6 +1,6 @@ - + https://github.com/dotnet/msbuild diff --git a/eng/Versions.props b/eng/Versions.props index a5802082fb8..8248454c00f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -19,7 +19,7 @@ 11 0 - 100 + 101 0 diff --git a/eng/build.sh b/eng/build.sh index d0d18712417..9a0ed19d046 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -40,6 +40,7 @@ usage() echo " --fromVMR Set when building from within the VMR" echo " --buildnorealsig Build product with realsig- (default use realsig+ where necessary)" echo " --tfm Override the default target framework" + echo " --warnNotAsError Suppress specific warnings from being treated as errors (semi-colon delimited)" echo "" echo "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -80,6 +81,7 @@ product_build=false from_vmr=false buildnorealsig=true properties="" +warn_not_as_error="" docker=false args="" @@ -189,6 +191,10 @@ while [[ $# > 0 ]]; do tfm=$2 shift ;; + --warnnotaserror) + warn_not_as_error=$2 + shift + ;; /p:*) properties+=("$1") ;; @@ -328,6 +334,11 @@ function BuildSolution { # do real build BuildMessage="Error building solution" + local msbuild_warn_not_as_error="" + if [[ "$warn_not_as_error" != "" && "$warn_as_error" == true ]]; then + msbuild_warn_not_as_error="/warnNotAsError:$warn_not_as_error" + fi + MSBuild $toolset_build_proj \ $bl \ /p:Configuration=$configuration \ @@ -347,7 +358,8 @@ function BuildSolution { /p:DotNetBuild=$product_build \ /p:DotNetBuildSourceOnly=$source_build \ /p:DotNetBuildFromVMR=$from_vmr \ - ${properties[@]+"${properties[@]}"} + ${properties[@]+"${properties[@]}"} \ + $msbuild_warn_not_as_error fi }