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

[Mono.Android] Bind Android API-36 DP1. #9594

Merged
merged 11 commits into from
Dec 15, 2024
Merged

[Mono.Android] Bind Android API-36 DP1. #9594

merged 11 commits into from
Dec 15, 2024

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Dec 5, 2024

Context: https://developer.android.com/about/versions/16
Context: https://android-developers.googleblog.com/2024/11/the-first-developer-preview-android16.html

Android 16 Developer Preview 1 has been released. The Android 16
Developer Preview Program Overview Timeline and updates section
suggests the following timeline:

  • Nov/Dec: Developer Previews
  • Jan/Feb: Unstable Betas
  • Mar/Apr: Stable Betas
  • ???: Final

Currently, this will be usable in its preview form to main users who explicitly target net9.0-android36. Once we are shipping .NET 10 previews, it will be usable for users who explicitly target net10.0-android36. We will need to decide on our strategy for backporting this to .NET 9 service releases.

PublicApiAnalyzers reports 2 categories of API changes (PublicAPI.Shipped.txt):

  • NRT attribute changes (? -> !)
  • Method parameter name changes, technically a source breaking change, but something we've never tracked or fixed before

jpobst and others added 4 commits December 9, 2024 13:48
Commit e4a75a8 removed some make magic that ensured Mono.Android.dll
would be built multiple times for additional supported API levels.

A couple of MSBuild tasks used to build multiple versions of
Mono.Android.dll have been moved out of the `PackDotNet` target used by
the Windows build and into the Mono.Android build to fix this.

(cherry picked from commit c1d3e8e)
/>
<MSBuild
Condition=" '$(AndroidLatestUnstableApiLevel)' != '$(AndroidLatestStableApiLevel)' "
Projects="$(_Root)src\Mono.Android\Mono.Android.csproj"
Properties="TargetFramework=$(DotNetTargetFramework);AndroidApiLevel=$(AndroidLatestUnstableApiLevel);AndroidPlatformId=$(AndroidLatestUnstablePlatformId);DisableApiCompatibilityCheck=true"
Copy link
Member

Choose a reason for hiding this comment

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

We can add these DisableApiCompatibilityCheck=true properties back when building on Windows if necessary, but wanted to test again without them first

@pjcollins
Copy link
Member

@jpobst I think this is building correctly now, but there may be some ApiCompat things to look at

@jpobst
Copy link
Contributor Author

jpobst commented Dec 10, 2024

@pjcollins Fixed the ApiCompat thing, now it's back on a create-packs error. 😉

@jpobst jpobst marked this pull request as ready for review December 12, 2024 17:53
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.

Looks reasonable to me. 👍

<!-- Rename Namespaces -->
<attr api-since="36" path="/api/package[@name='android.app.appfunctions']" name="managedName">Android.App.AppFunctions</attr>
<attr api-since="36" path="/api/package[@name='android.app.appsearch.functions']" name="managedName">Android.App.AppSearch.Functions</attr>
<attr api-since="36" path="/api/package[@name='android.configinfrastructure.aconfig']" name="managedName">Android.ConfigInfrastructure.Aconfig</attr>
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if we have a past example, but if aconfig is short for "Android Config", should the C# namespace be Android.ConfigInfrastructure.AConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I researched this one to see what Google's intent is. I generally defer to the way they have named their types which in this case is indeed Aconfig:

https://developer.android.com/reference/android/configinfrastructure/aconfig/AconfigPackage?hl=en

@jonpryor
Copy link
Member

@jpobst: should this also update $(AndroidLatestUnstableApiLevel)/etc.?

<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">$(AndroidLatestStablePlatformId)</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">$(AndroidLatestStableFrameworkVersion)</AndroidLatestUnstableFrameworkVersion>

This would make it "reasonable" for me to add --preview-platform-version to WorkloadDependencies.json` in #9613.

@jonpryor
Copy link
Member

@jonpryor wrote:

should this also update $(AndroidLatestUnstableApiLevel)/etc.?

It did, I just didn't see it. Doh!

@jonpryor jonpryor merged commit 2dd4f74 into main Dec 15, 2024
58 checks passed
@jonpryor jonpryor deleted the api-36-dp1 branch December 15, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants