Skip to content

Commit

Permalink
[Mono.Android] NoWarn CA1416, CA1422 code analyzer warnings (#7591)
Browse files Browse the repository at this point in the history
Context: #7590

Building our repo generates around 3400 warnings per single
.NET build, similar to:

	warning CA1416: This call site is reachable on: 'Android' 21.0 and later. 'Double' is only supported on: .
	warning CA1422: This call site is reachable on: 'Android' 21.0 and later. 'Double' is obsoleted on: 'Android' 33.0 and later.

Since printing each message to the console needs to be synchronized,
that means the build might be slower than necessary, since we generate
over 10k of these messages per CI build.

Disable the warnings by default. They can be enabled by setting the
`$(_EnableCodeAnalyzerPlatformWarnings)` MSBuild property to any value.

TODO: Fix #7590 so that we don't need to `$(NoWarn)` these warnings.
  • Loading branch information
grendello authored Nov 30, 2022
1 parent 2a26c1e commit 7004467
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<NoWarn>$(NoWarn);CS1572;CS1573;CS1574;CS1584;CS1587;CS1591;CS1658;</NoWarn>
</PropertyGroup>

<PropertyGroup Condition=" '$(_EnableCodeAnalyzerPlatformWarnings)' == '' ">
<NoWarn>$(NoWarn);CA1422;CA1416</NoWarn>
</PropertyGroup>

<PropertyGroup>
<JavaCallableWrapperAbsAssembly>$([System.IO.Path]::GetFullPath ('$(OutputPath)$(AssemblyName).dll'))</JavaCallableWrapperAbsAssembly>
</PropertyGroup>
Expand Down

0 comments on commit 7004467

Please sign in to comment.