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

Bump external/Java.Interop from 149d70f to f8d77fa #7638

Merged
merged 3 commits into from Dec 16, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 15, 2022

Bumps external/Java.Interop from 149d70f to f8d77fa.

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

I did a spot check on the "acceptable-breakages" errors. They all seem to be caused by xamarin/java.interop#1068. That is, they were methods that were marked deprecated in a later API than their declaring type.

This was causing them to use [ObsoletedOSPlatform ("androidXX.0")] instead of [Obsolete], resulting in us adding them to acceptable-breakages previously. Now that they are set back to pre-22 deprecations, they use [Obsolete] again and we no longer need them in acceptable-breakages.

We use [Obsolete] instead of [ObsoletedOSPlatform] when the type or member was marked obsolete in API-21 or earlier, as that means it is obsolete in all our .NET 6+ supported API levels, and thus the exact version is irrelevant.

Example:

This class was deprecated in API-21:
https://developer.android.com/reference/android/app/FragmentBreadCrumbs?hl=en#setParentTitle(java.lang.CharSequence,%20java.lang.CharSequence,%20android.view.View.OnClickListener)

// What we ship today
[Obsolete("This class is obsoleted in this android platform")]
[Register("android/app/FragmentBreadCrumbs", DoNotGenerateAcw=true)]
public class FragmentBreadCrumbs : ViewGroup, FragmentManager.IOnBackStackChangedListener, IJavaObject, IDisposable, IJavaPeerable
{
  [ObsoletedOSPlatform("android29.0")]
  [Register("setParentTitle", "(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/view/View$OnClickListener;)V", "GetSetParentTitle_Ljava_lang_CharSequence_Ljava_lang_CharSequence_Landroid_view_View_OnClickListener_Handler")]
  public virtual unsafe void SetParentTitle(ICharSequence title, ICharSequence shortTitle, View.IOnClickListener listener)
  { ... }
}
// What will be in main now
[Obsolete("This class is obsoleted in this android platform")]
[Register("android/app/FragmentBreadCrumbs", DoNotGenerateAcw=true)]
public class FragmentBreadCrumbs : ViewGroup, FragmentManager.IOnBackStackChangedListener, IJavaObject, IDisposable, IJavaPeerable
{
  [Obsolete("This class is obsoleted in this android platform")]
  [Register("setParentTitle", "(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/view/View$OnClickListener;)V", "GetSetParentTitle_Ljava_lang_CharSequence_Ljava_lang_CharSequence_Landroid_view_View_OnClickListener_Handler")]
  public virtual unsafe void SetParentTitle(ICharSequence title, ICharSequence shortTitle, View.IOnClickListener listener)
  { ... }
}

Other methods that were spot-checked:

Bumps [external/Java.Interop](https://github.com/xamarin/java.interop) from `149d70f` to `f8d77fa`.
- [Release notes](https://github.com/xamarin/java.interop/releases)
- [Commits](xamarin/java.interop@149d70f...f8d77fa)

---
updated-dependencies:
- dependency-name: external/Java.Interop
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot requested a review from jonpryor as a code owner December 15, 2022 02:08
@dependabot dependabot bot added dependencies Pull requests that update a dependency file. submodules Pull requests that update Submodules code labels Dec 15, 2022
@jpobst jpobst force-pushed the dependabot/submodules/external/Java.Interop-f8d77fa branch from 87a9e30 to b4a446c Compare December 15, 2022 16:17
@jonpryor
Copy link
Member

Context: 4da27921d79e48e84bcc31d04e218a86324766fc
Context: https://github.com/xamarin/Java.Interop/commit/d3ea180cd4f557e1c40ea908beb2d2398f7e5b48
Context: https://github.com/xamarin/Java.Interop/commit/15c8879761c38eef6973677361f2464b0ff751ac

Changes: https://github.com/xamarin/java.interop/compare/149d70fea4ad4147e28d60343b6ee774b5413334...f8d77faf55347a58030a694332ba97f0dee88246

  * xamarin/java.interop@f8d77faf: [generator] Better support deprecated property getter/setters. (xamarin/java.interop#1062)
  * xamarin/java.interop@5e6209ea: [generator] Obsolete&SupportedOSPlatform attributes on enum members (xamarin/java.interop#1066)
  * xamarin/java.interop@15c88797: [generator] Use decl type's @deprecated-since if < member's (xamarin/java.interop#1068)
  * xamarin/java.interop@525a45d5: [Java.Interop.Dynamic-Tests] Use Microsoft.CSharp NuGet package (xamarin/java.interop#1067)

Background: member deprecations can be "historically weird" in Android.
For example, in API-21 [`android/app/ActionBar.TabListener`][0] was
deprecated:

	@Deprecated
	/* partial */ interface TabListener {
	    void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft);
	    // …
	}

The type being deprecated means that its members are *implicitly*
deprecated.

In API-29 the members were *explicitly* deprecated:

	@Deprecated
	/* partial */ interface TabListener {
	    @Deprecated
	    void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft);
	    // …
	}

Before xamarin/Java.Interop@d3ea180c, this resulted in the binding:

	[Obsolete]
	partial interface ITabListener {
	    [Obsolete]
	    void OnTabReselected(ActionBar.Tab? tab, FragmentTransaction? ft);
	    // …
	}

Commit xamarin/Java.Interop@d3ea180c added support for
`[ObsoletedOSPlatform]` to `generator`, which *changed* the binding to:

	[Obsolete] // because it was deprecated in our min-supported API-21
	partial interface ITabListener {
	    [ObsoletedOSPlatform ("android29.0")]
	    void OnTabReselected(ActionBar.Tab? tab, FragmentTransaction? ft);
	    // …
	}

This resulted in *lots* of changes in commit 4da27921 to
`tests/api-compatibility/acceptable-breakages-vReference-net7.0.txt`
because `[Obsolete]` was were replaced by `[ObsoletedOSPlatform]`:

	CannotRemoveAttribute : Attribute 'System.ObsoleteAttribute' exists on 'Android.App.ActionBar.ITabListener.OnTabReselected(Android.App.ActionBar.Tab, Android.App.FragmentTransaction)' in the contract but not the implementation

Commit xamarin/Java.Interop@15c88797 updates type members to have the
same deprecation status as their declaring type, when the member was
deprecated *after* the type was deprecated.  This means we *now*
bind `ITabListener` as:

	[Obsolete] // because it was deprecated in our min-supported API-21
	partial interface ITabListener {
	    [Obsolete]
	    void OnTabReselected(ActionBar.Tab? tab, FragmentTransaction? ft);
	    // …
	}

which matches the state of things pre- xamarin/Java.Interop@d3ea180c,
which means we no longer need to ignore all those
`CannotRemoveAttribute` messages.  xamarin/Java.Interop@15c88797 thus
"unintentionally partially reverts" 4da27921 (yay?), simply because
the prior state of affairs in which a member was deprecated *after*
the declaring type, while valid, didn't make any sense.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Pobst <jonathan.pobst@microsoft.com>

[0]: https://developer.android.com/reference/android/app/ActionBar.TabListener

@jonpryor jonpryor merged commit c893add into main Dec 16, 2022
@jonpryor jonpryor deleted the dependabot/submodules/external/Java.Interop-f8d77fa branch December 16, 2022 14:58
grendello added a commit to grendello/xamarin-android that referenced this pull request Jan 4, 2023
* main:
  [Xamarin.Android.Build.Tasks] use %(TrimmerRootAssembly.RootMode) All (xamarin#7651)
  Bump to dotnet/installer@47a747f 8.0.100-alpha.1.22616.7 (xamarin#7647)
  Bump to dotnet/installer@167a4ed 8.0.100-alpha.1.22611.1 (xamarin#7630)
  Bump to xamarin/java.interop@f8d77fa (xamarin#7638)
  [ci] Fix Designer test paths (xamarin#7635)
  [Xamarin.Android.Build.Tasks] perf improvements for LlvmIrGenerator (xamarin#7626)
  [Xamarin.Android.Build.Tasks] AutoImport `*.webp` files (xamarin#7601)
  Localized file check-in by OneLocBuild Task (xamarin#7632)
  Bump $(ProductVersion) to 13.2.99
  Bump to xamarin/monodroid@c0c933b7 (xamarin#7633)
  [Xamarin.Android.Build.Tasks] Fix aapt_rules.txt corruption (xamarin#7587)
  [Xamarin.Android.Build.Tasks] Add XA1031 error (xamarin#7448)
  Bump to xamarin/java.interop@149d70f (xamarin#7625)
  [CODEOWNERS] More updates to CODEOWNERS (xamarin#7628)
  [Xamarin.Android.Build.Tasks] avoid `File.Exists()` check (xamarin#7621)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file. submodules Pull requests that update Submodules code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants