Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marking constant fields that will be removed in the next version as Obsolete error #568

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

gugavaro
Copy link
Contributor

@gugavaro gugavaro commented Feb 10, 2020

We are generating fields that have been marked as obsolete for a long time.
In the effort to remove all fields that now we believe should not be part of our API, we are marking then as obsolete Error=True so we can remove them in the next release.

Here are some scenarios these changes are addressing:

We should [Obsolete(error:true)] "interface proxy" types such as Android.Content.ComponentCallbacks2, which contains fields for the android.content.ComponentCallbacks2 interface and lives "alongside" the Android.Content.IComponentCallbacks2 interface. Additionally, all of these fields should be moved into the appropriate C# interface, e.g. every field within Android.Content.ComponentCallbacks2 should reside in the Android.Content.IComponentCallbacks2 type, using C#8 default interface members.
We should also [Obsolete(error:true)] all of the nested InterfaceConsts types, such as Android.OS.Binder.InterfaceConsts.
We should also [Obsolete(error:true)] all members which are already [Obsolete].

This PR should be combined with XA PR: dotnet/android#4248

@jonpryor jonpryor merged commit 8f30933 into master Feb 12, 2020
@jonpryor jonpryor deleted the gugavaro_ji_deprecatedfields branch February 12, 2020 21:20
jonpryor pushed a commit that referenced this pull request Feb 19, 2020
Context: #509
Context: dotnet/android#4248

We are generating fields that have been marked as `[Obsolete]` for a
long time.

In the effort to remove all fields that now we believe should not be
part of our API, we are marking them as `[Obsolete(..., error:true)]`
so we can remove them in a future release.

Here are some scenarios these changes are addressing:

We should `[Obsolete(error:true)]` *fields* on "interface proxy" types
such as [`Android.Content.ComponentCallbacks2`][0], which contains
fields for the [`android.content.ComponentCallbacks2`][1] interface
and lives "alongside" the [Android.Content.IComponentCallbacks2][2]
interface.  Additionally, all of these fields should *eventually* be
moved into the appropriate C# interface via Default Interface Members,
e.g. every field within `Android.Content.ComponentCallbacks2` should
*instead* reside in the `Android.Content.IComponentCallbacks2` type.

TODO:

  * We should `[Obsolete(error:true)]` the interface proxy types
    themselves.

  * We also `[Obsolete(error:true)]` all of the nested
    `InterfaceConsts` types, such as
    `Android.OS.Binder.InterfaceConsts`.

  * We should also `[Obsolete(error:true)]` all members which are
    already [Obsolete].

[0]: https://docs.microsoft.com/en-us/dotnet/api/android.content.componentcallbacks2?view=xamarin-android-sdk-9
[1]: https://developer.android.com/reference/android/content/ComponentCallbacks2
[2]: https://docs.microsoft.com/en-us/dotnet/api/android.content.icomponentcallbacks2?view=xamarin-android-sdk-9
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants