Skip to content

[build] Hush a couple of code analyzer warnings for Mono.Android #7591

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

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

grendello
Copy link
Contributor

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.

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.
@grendello grendello requested a review from jonpryor as a code owner November 29, 2022 17:28
@jonpryor jonpryor merged commit 7004467 into dotnet:main Nov 30, 2022
grendello added a commit to grendello/xamarin-android that referenced this pull request Dec 1, 2022
* main:
  Bump external/Java.Interop from `984711a` to `3a9f770` (dotnet#7592)
  [Mono.Android] NoWarn CA1416, CA1422 code analyzer warnings (dotnet#7591)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants