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

[Xamarin.Android.Build.Tasks] Emit warnings if using deprecated bindings fallback flags. #8511

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Nov 16, 2023

Context: #6436
Context: #8339

Previously we have added the following temporary "fallback flags" for bindings-related changes:

  • $(_AndroidUseJavaLegacyResolver)
  • $(_AndroidEmitLegacyInterfaceInvokers)

Because the intent is to remove the old, deprecated code, we need to warn users of these flags that they will be removed in a future version of .NET.

Also fix a typo that prevented $(_AndroidEmitLegacyInterfaceInvokers) from being able to be set.

I don't know that it's worth having unit tests for this, locally this produces:

c:\code\xamarin-android\bin\Debug\lib\packs\Microsoft.Android.Sdk.Windows\34.99.0\tools\Xamarin.Android.Bindings.Core.targets(37,5): warning XA1037: The '_AndroidUseJavaLegacyResolver' MSBuild property is deprecated and will be removed in .NET 10. See https://aka.ms/net-android-deprecations for more details. [C:\Users\jopobst\Desktop\project-reference\binding\binding.csproj]
c:\code\xamarin-android\bin\Debug\lib\packs\Microsoft.Android.Sdk.Windows\34.99.0\tools\Xamarin.Android.Bindings.Core.targets(42,5): warning XA1037: The '_AndroidEmitLegacyInterfaceInvokers' MSBuild property is deprecated and will be removed in .NET 10. See https://aka.ms/net-android-deprecations for more details. [C:\Users\jopobst\Desktop\project-reference\binding\binding.csproj]

@jpobst jpobst force-pushed the net9-bindings-warnings branch from 599d269 to a110495 Compare November 16, 2023 22:35
@dotnet dotnet deleted a comment from azure-pipelines bot Nov 27, 2023
@jpobst jpobst force-pushed the net9-bindings-warnings branch from a110495 to b52749c Compare November 27, 2023 23:13
@jpobst jpobst marked this pull request as ready for review November 29, 2023 19:37
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth updating a test somewhere that the warnings actually appear? Maybe we already have some tests that use these properties?

@jpobst
Copy link
Contributor Author

jpobst commented Nov 29, 2023

As these were intended as temporary fallback properties, there are no tests that use them.

My opinion is that testing for these warnings is probably not worth it.

@jonpryor jonpryor merged commit f38a76c into main Nov 30, 2023
47 checks passed
@jonpryor jonpryor deleted the net9-bindings-warnings branch November 30, 2023 17:36
grendello added a commit that referenced this pull request Nov 30, 2023
* main:
  Bump to xamarin/android-api-docs@3f64bdd (#8539)
  [Xamarin.Android.Build.Tasks] Emit XA1038 for deprecated properties (#8511)
  Rename ThirdPartyNotices.txt to THIRD-PARTY-NOTICES.TXT (#8546)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 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