[generator] Add api flag "no-alternatives" to skip generating interface member alternatives. #601
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: #509
In #600 we began cleaning up our existing "alternative" hacks for bindings that use the new C#8 DIM features. However, as we add new API interfaces we will continue to generate new
[Obsolete]
"alternative" classes. We do not need to add new already-obsolete API to our bindings.This PR creates a new attribute for
<interface>
elements called@no-alternatives
. When this attribute is set totrue
we will not generate the alternative classes for this interface.This will be used in
Mono.Android.dll
like this:This will keep any new interfaces added in API-30 from creating
[Obsolete]
alternative classes.This diff https://gist.github.com/jpobst/27f4109aceb8d74b257cefa773704cac shows the difference between
Mono.Android.dll
master - API-R
and what this PR will do. Note the diff is reversed to work around an issue inmono-api-html
. Basically it shows that we will keep 3 new alternative classes in API-R from being created.