Skip to content

Commit 7004467

Browse files
authored
[Mono.Android] NoWarn CA1416, CA1422 code analyzer warnings (#7591)
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.
1 parent 2a26c1e commit 7004467

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Mono.Android/Mono.Android.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<NoWarn>$(NoWarn);CS1572;CS1573;CS1574;CS1584;CS1587;CS1591;CS1658;</NoWarn>
4444
</PropertyGroup>
4545

46+
<PropertyGroup Condition=" '$(_EnableCodeAnalyzerPlatformWarnings)' == '' ">
47+
<NoWarn>$(NoWarn);CA1422;CA1416</NoWarn>
48+
</PropertyGroup>
49+
4650
<PropertyGroup>
4751
<JavaCallableWrapperAbsAssembly>$([System.IO.Path]::GetFullPath ('$(OutputPath)$(AssemblyName).dll'))</JavaCallableWrapperAbsAssembly>
4852
</PropertyGroup>

0 commit comments

Comments
 (0)