Skip to content

Commit 111ebca

Browse files
authored
[Java.Interop] Treat warnings as errors. (#925)
Turn on `$(TreatWarningsAsErrors)` for `Release` builds only. Also, Mono's `net6.0` (MSBuild 16) support causes warnings so we aren't going to enable it there. warning NETSDK1182: Targeting .NET 6.0 in Visual Studio 2019 is not supported. warning CS8032: An instance of analyzer System.Text.Json.SourceGeneration.JsonSourceGenerator cannot be created from…/System.Text.Json.SourceGeneration.dll : Could not resolve type with token 01000027 from typeref (expected class 'Microsoft.CodeAnalysis.IIncrementalGenerator' in assembly 'Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:Microsoft.CodeAnalysis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:Microsoft.CodeAnalysis.IIncrementalGenerator member:(null). […/src/Xamarin.Android.Tools.Bytecode/Xamarin.Android.Tools.Bytecode.csproj] We also saw these warnings on Windows before we moved to Visual Studio 2022 agents.
1 parent 7a32bb9 commit 111ebca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<!-- Note: MUST be imported *after* $(Configuration) is set! -->
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<!-- Mono's MSBuild does not support some implicit .NET6 source generator stuff -->
7+
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' And '$(MSBuildRuntimeType)' != 'Mono' ">true</TreatWarningsAsErrors>
68
<_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</_OutputPath>
79
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
810
</PropertyGroup>

0 commit comments

Comments
 (0)