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] Backport API-34 to .NET 7. #8150

Closed
wants to merge 7 commits into from
Closed

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Jun 27, 2023

Backport API-34 to the .NET 7 maintenance branch.

Note that main no longer builds Classic Xamarin.Android, but those changes are extensive and will not be ported back to .NET 7. This causes some issues that have been hacked around in this PR.

  • Building a "proper" Classic Mono.Android API-34 would require extra work that we want to avoid (metadata changes around covariant return types, which .NET supports but Classic does not.)
  • Attempting to skip building a Classic Mono.Android API-34 causes issues because other build artifacts still rely on it being built.
  • Therefore we build a "dummy" Classic Mono.Android API-34 that has had all new API stripped out (see metadata-classic) and some #ifdef to facilitate this.
  • As we will never ship a Classic Mono.Android out of this branch, this is fine.
  • Needed to backport [Mono.Android] Generate API docs for .NET Android #8007 to build API-34 docs, which were previously built from the Classic Mono.Android.

@jpobst jpobst force-pushed the net7-api-34 branch 3 times, most recently from 4dc1cdf to 84e1903 Compare June 29, 2023 14:55
jpobst and others added 2 commits June 29, 2023 13:58
Context: android/ndk#1299
Context: https://developer.android.com/tools/releases/build-tools

Similar to the Android NDK (android/ndk#1299), `aapt2` from the
Android SDK build-tools package is also a native binary.

`aapt2` from build-tools_r32 only contains an x64 slice:

	% file aapt2
	aapt2: Mach-O 64-bit executable x86_64

`aapt2` in build-tools_r33 and build-tools_r34 contains both x64
and arm64 slices:

	% file aapt2
	aapt2: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
	aapt2 (for architecture x86_64):	Mach-O 64-bit executable x86_64
	aapt2 (for architecture arm64):	Mach-O 64-bit executable arm64

Update `$(XABuildToolsVersion)`=34, so that we redistribute this
newer `aapt2` binary.  This will remove *a* place that Rosetta 2 is
required to use .NET Android.

(cherry picked from commit 0698891)
Comment on lines 24 to 34
"android-34": {
"description": "Preview support for Android API-34.",
"packs": [
"Microsoft.Android.Ref.34",
"Microsoft.Android.Runtime.34.android-arm",
"Microsoft.Android.Runtime.34.android-arm64",
"Microsoft.Android.Runtime.34.android-x86",
"Microsoft.Android.Runtime.34.android-x64"
],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ],
"extends" : [ "android" ]
Copy link
Member

Choose a reason for hiding this comment

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

I think we might actually not need the android-34 workload at all? We can rely on the .Ref and .Runtime packs to just be restored like NuGet packages.

So, I think we can just remove these lines?

@jpobst jpobst closed this Jul 10, 2023
@jpobst jpobst deleted the net7-api-34 branch July 10, 2023 19:20
@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.

4 participants