Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not pass /warnaserror to msbuild #32152

Merged
merged 1 commit into from
Jan 4, 2019
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
8 changes: 7 additions & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ param (
[switch]$deployExtensions,
[switch]$prepareMachine,
[switch]$useGlobalNuGetCache = $true,
[switch]$warnAsError = $true,
[switch]$warnAsError = $false,

# Test actions
[switch]$test32,
Expand Down Expand Up @@ -91,6 +91,7 @@ function Print-Usage() {
Write-Host " -skipAnalyzers Do not run analyzers during build operations"
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 ""
Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild."
}
Expand Down Expand Up @@ -158,6 +159,10 @@ function BuildSolution() {
# Do not set the property to true explicitly, since that would override value projects might set.
$suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" }

# Setting /p:TreatWarningsAsErrors=true is a workaround for https://github.com/Microsoft/msbuild/issues/3062.
# We don't pass /warnaserror to msbuild ($warnAsError is set to $false by default above), but set
# /p:TreatWarningsAsErrors=true so that compiler reported warnings, other than IDE0055 are treated as errors.
# Warnings reported from other msbuild tasks are not treated as errors for now.
MSBuild $toolsetBuildProj `
$bl `
/p:Configuration=$configuration `
Expand All @@ -177,6 +182,7 @@ function BuildSolution() {
/p:QuietRestore=$quietRestore `
/p:QuietRestoreBinaryLog=$binaryLog `
/p:TestTargetFrameworks=$testTargetFrameworks `
/p:TreatWarningsAsErrors=true `
$suppressExtensionDeployment `
@properties
}
Expand Down
10 changes: 10 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ usage()
echo " --bootstrap Build using a bootstrap compilers"
echo " --skipAnalyzers Do not run analyzers during build operations"
echo " --prepareMachine Prepare machine for CI run, clean up processes after build"
echo " --warnAsError Treat all warnings as errors"
echo ""
echo "Command line arguments starting with '/p:' are passed through to MSBuild."
}
Expand Down Expand Up @@ -61,6 +62,7 @@ ci=false
bootstrap=false
skip_analyzers=false
prepare_machine=false
warn_as_error=false
properties=""

docker=false
Expand Down Expand Up @@ -125,6 +127,9 @@ while [[ $# > 0 ]]; do
--preparemachine)
prepare_machine=true
;;
--warnaserror)
warn_as_error=true
;;
--docker)
docker=true
shift
Expand Down Expand Up @@ -245,6 +250,10 @@ function BuildSolution {
mono_tool=""
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.
# Warnings reported from other msbuild tasks are not treated as errors for now.
MSBuild $toolset_build_proj \
$bl \
/p:Configuration=$configuration \
Expand All @@ -261,6 +270,7 @@ function BuildSolution {
/p:ContinuousIntegrationBuild=$ci \
/p:QuietRestore=$quiet_restore \
/p:QuietRestoreBinaryLog="$binary_log" \
/p:TreatWarningsAsErrors=true \
$test_runtime \
$mono_tool \
$properties
Expand Down