You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Java.Interop] Use PublicApiAnalyzers to ensure we do not break API (#1170)
Fixes: #1169
Context: dotnet/android@76ab8b2dotnet/android@76ab8b2c mentions:
> Now that we are in the .NET `TargetFramework` world we also need
> to ensure we do not *add* any new API to a Target Framework once it
> has shipped. A `TargetFramework` is 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.)
This prevents an issue where a user on `.NET 8.0.300` uses a method
that isn't available to their coworker or CI on `.NET 8.0.100`.
This logical argument also applies to `Java.Interop.dll`.
Enable Microsoft's [PublicApiAnalyzers][0] for `Java.Interop.dll`.
([PublicApiAnalyzers documentation][1].) This ensures that we don't
add new API once we've shipped `Java.Interop.dll` for a given
.NET version.
Update `build-tools/jnienv-gen` so that `JniEnvironment.g.cs` enables
nullable reference types. This allows us to *avoid* disabling RS0041.
Co-authored-by: Jonathan Pryor <jonpryor@vt.edu>
[0]: https://github.com/dotnet/roslyn-analyzers/tree/ace28a1039d09626a94d3b0f8ce69e547ca2bcbf/src/PublicApiAnalyzers
[1]: https://github.com/dotnet/roslyn-analyzers/blob/ace28a1039d09626a94d3b0f8ce69e547ca2bcbf/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md
0 commit comments