[generator] Honor 'api-since' attribute to fill ApiAvailableSince property. #644
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.
Today,
generatorprovides the ability to assign versions to each bound member that is exposed in itsRegisterattributeApiSincefield, a la:This is populated via the internal
apiversions=option, which reads in a Google provided file containing the api version each member for appeared in. Unfortunately we have found that Google's support of this file isn't guaranteed. Sometimes it is missing, other times it changes randomly, causingApiCompatbreakage.This PR provides an alternate way to set this
ApiSincefield in theapi.xml. The attributeapi-sincein now honored onpackage,class/interface,method, andfieldelements:This allows it to be set via
metadataor any external tooling that modifiesapi.xml.Note that members will inherit version from parent types and parent package definitions, but can also override them as necessary. For example a package added in api 7 containing a class added in api 9:
Like previously, this feature is probably only useful for
Mono.Android.dllpurposes, but it is a little more accessible now.