Add [SupportedOSPlatform] attributes to assemblies using ApiSince. #773
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.
Context: dotnet/android#5338
.NET 5 provides a new attribute
[SupportedOSPlatform]
to specify when an API is not available on all platforms or platform versions. This is used to build analyzers to give users warnings if they are trying to use an API when it will not be available on their target platform. This is fundamentally the same as our existingApiSince
, except tooling has actually been built to consume the information.As such, we need
generator
support to put this information intoMono.Android.dll
.Some interesting notes:
#ifdef
every attribute.[Conditional ("NEVER")]
so the attributes will not actually get compiled into the resulting pre-NET5.0 assembly.