From bf0ce38e45de7a39bf7fb0fb7b442a7f282bc9cf Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 12 Feb 2025 10:03:31 -0600 Subject: [PATCH] [Xamarin.Android.Build.Tasks] move .NET 8 support to `android-net8` workload Context: https://github.com/dotnet/android/pull/9777 The problem with #9777, is it increases our install size by something like ~700MB with the following packs: * Microsoft.Android.Sdk.[platform] x 1 (current platform) * Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.[RID] x 4 RIDs * Microsoft.NETCore.App.Runtime.Mono.[RID] x 4 RIDs Some of .NET MAUI's CI machines are extremely tight on disk space, and we promptly filled the disk! Let's move these packs to a new `android-net8` workload, which can be installed separately. dotnet/android-libraries could simply install: dotnet workload install android-net8 Which would provision both `android` and `android-net8` workloads. --- build-tools/create-packs/Directory.Build.targets | 1 + .../WorkloadManifest.in.json | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets index afeb3bb1922..ab4909ff9cd 100644 --- a/build-tools/create-packs/Directory.Build.targets +++ b/build-tools/create-packs/Directory.Build.targets @@ -124,6 +124,7 @@ <_NuGetSources Include="$(OutputPath.TrimEnd('\'))" /> <_PreviewPacks Condition=" '$(AndroidLatestStableApiLevel)' != '$(AndroidLatestUnstableApiLevel)' " Include="$(XamarinAndroidSourcePath)bin\Build$(Configuration)\nuget-unsigned\Microsoft.Android.Ref.$(AndroidLatestUnstableApiLevel).*.nupkg" /> <_InstallArguments Include="android" /> + <_InstallArguments Include="android-net8" /> <_InstallArguments Include="android-$(AndroidLatestUnstableApiLevel)" Condition=" '@(_PreviewPacks->Count())' != '0' " /> <_InstallArguments Include="--skip-manifest-update" /> <_InstallArguments Include="--skip-sign-check" /> diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 0ee9fe4f021..50fc5a22030 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -6,7 +6,6 @@ "packs": [ "Microsoft.Android.Sdk.net10", "Microsoft.Android.Sdk.net9", - "Microsoft.Android.Sdk.net8", "Microsoft.Android.Ref.35", "Microsoft.Android.Runtime.Mono.35.android-arm", "Microsoft.Android.Runtime.Mono.35.android-arm64", @@ -15,15 +14,23 @@ "Microsoft.Android.Templates" ], "platforms": [ "win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ], - "extends" : [ - "microsoft-net-runtime-android-net8", - "microsoft-net-runtime-android-aot-net8", + "extends" : [ "microsoft-net-runtime-android-net9", "microsoft-net-runtime-android-aot-net9", "microsoft-net-runtime-android", "microsoft-net-runtime-android-aot" ] }, + "android-net8": { + "description": ".NET SDK Workload for building .NET 8 Android applications.", + "packs": [ "Microsoft.Android.Sdk.net8" ], + "platforms": [ "win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ], + "extends" : [ + "android", + "microsoft-net-runtime-android-net8", + "microsoft-net-runtime-android-aot-net8" + ] + }, "android-36": { "description": "Preview support for Android API-36.", "packs": [