From e5d0cb977889a8c7a5b1bfb415a5bdb1ddcb04c4 Mon Sep 17 00:00:00 2001 From: Dan Siegel Date: Fri, 23 Aug 2024 07:04:13 -0600 Subject: [PATCH] ci: enable warnings as errors --- build/templates/package-validation.yml | 2 +- build/templates/template-validation.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/templates/package-validation.yml b/build/templates/package-validation.yml index 15739de6..c2d88822 100644 --- a/build/templates/package-validation.yml +++ b/build/templates/package-validation.yml @@ -188,7 +188,7 @@ steps: { # Build the app pushd $testName - & dotnet build $testName.sln "/bl:$(System.ArtifactsDirectory)/$testName.$(Agent.OS).$dotnetVersion.binlog" + & dotnet build $testName.sln "/bl:$(System.ArtifactsDirectory)/$testName.$(Agent.OS).$dotnetVersion.binlog" /p:TreatWarningsAsErrors=true /p:NoWarn=NU1507;CS1591 if ($LASTEXITCODE -ne 0) { echo "Build failed for $testName" diff --git a/build/templates/template-validation.yml b/build/templates/template-validation.yml index 726e7b75..3cd9abe5 100644 --- a/build/templates/template-validation.yml +++ b/build/templates/template-validation.yml @@ -63,11 +63,11 @@ steps: if ('${{ parameters.templateName }}' -eq 'unoapp-uwp') { $msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe - & $msbuild /r "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" + & $msbuild /r "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" /p:TreatWarningsAsErrors=true /p:NoWarn=NU1507;CS1591 } else { - & dotnet build "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" + & dotnet build "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" /p:TreatWarningsAsErrors=true /p:NoWarn=NU1507;CS1591 } if ($LASTEXITCODE -ne 0)