[Mono.Android] Use PublicApiAnalyzers to ensure we do not break API.#8171
Merged
[Mono.Android] Use PublicApiAnalyzers to ensure we do not break API.#8171
Conversation
0ff8261 to
5c21133
Compare
pjcollins
approved these changes
Jul 10, 2023
Contributor
|
I want to point out that This PR (#8171) does not fundamentally change things vs. 07e7477. I just want to point this out so that we don't remove |
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Jul 14, 2023
* main: [ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189) Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188) [Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Jul 14, 2023
* main: [ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189) Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188) [Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171) [Xamarin.Android.Build.Tasks] per-RID assemblies & typemaps (dotnet#8164) [AndroidDependenciesTests] Test both manifest types (dotnet#8186) [AndroidDependenciesTests] Use platform-tools 34.0.4 (dotnet#8184)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Jul 14, 2023
* main: [ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189) Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188) [Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Jul 17, 2023
* main: LLVM IR code generator refactoring and updates (dotnet#8140) [ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189) Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188) [Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171) [Xamarin.Android.Build.Tasks] per-RID assemblies & typemaps (dotnet#8164) [AndroidDependenciesTests] Test both manifest types (dotnet#8186) [AndroidDependenciesTests] Use platform-tools 34.0.4 (dotnet#8184)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7421
Enable Microsoft's PublicApiAnalyzers for
Mono.Android.dll.We currently have
ApiCompat, which ensures that we do not break backwards compatibility between Android API levels, but now that we are in the .NETTargetFrameworkworld we also need to ensure we do not add any new API to a TF once it has shipped. ATargetFrameworkis essentially a contract that we cannot change. (Imagine if you had different minor versions of .NET on your local machine and CI machine, what works on one should work on the other.)Running the
PublicApiAnalyzeradds about 25 seconds to a local build. One can use our existing$(DisableApiCompatibilityCheck)property we have to also disable them to facilitate faster local build if desired.Additionally, disable
RS0041("Public members should not use oblivious types"). We should look at gettingAndroid.Runtime.JniEnv.g.csproperly annotated with NRT and then we could enable this analyzer.