Skip to content

Commit

Permalink
[Mono.Android] Bind Android API-Baklava DP1 (#9594)
Browse files Browse the repository at this point in the history
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.

  * [API-Baklava Developer Preview 1 vs. API-35][0]

The Android 15 Developer Preview [Timeline and updates][1] section
suggests the following timeline:

  * Nov/Dec: Developer Previews
  * Jan/Feb: Unstable Betas
  * March: Stable Beta with a [Platform Stability milestone][2]
    (final API-36 expected in Beta 3)
  * ???: 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`):

  - Nullable Reference Type attribute changes (`?` -> `!`)
  - Method parameter name changes, technically a source breaking
    change, but something we've never tracked or fixed before.

Add `Microsoft.Android*36*`runtime packages for API-36 support.

[0]: https://developer.android.com/sdk/api_diff/b-dp1/changes
[1]: https://developer.android.com/about/versions/16/overview#timeline
[2]: https://web.archive.org/web/20241210003040/https://developer.android.com/about/versions/16/overview#platform-stability

Co-authored-by: Peter Collins <pecolli@microsoft.com>
  • Loading branch information
jpobst and pjcollins authored Dec 15, 2024
1 parent 894ecea commit 2dd4f74
Show file tree
Hide file tree
Showing 16 changed files with 247,040 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<AndroidLatestStablePlatformId Condition="'$(AndroidLatestStablePlatformId)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestStablePlatformId>
<AndroidLatestStableFrameworkVersion Condition="'$(AndroidLatestStableFrameworkVersion)'==''">v15.0</AndroidLatestStableFrameworkVersion>
<!-- *Latest* *unstable* API level binding that we support; this can be the same as *stable* -->
<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">$(AndroidLatestStablePlatformId)</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">$(AndroidLatestStableFrameworkVersion)</AndroidLatestUnstableFrameworkVersion>
<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">36</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">Baklava</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v15.0.99</AndroidLatestUnstableFrameworkVersion>
<!-- The default API level used for $(TargetPlatformVersion) -->
<AndroidDefaultTargetDotnetApiLevel Condition=" '$(AndroidDefaultTargetDotnetApiLevel)' == '' ">$(AndroidLatestStableApiLevel)</AndroidDefaultTargetDotnetApiLevel>
<!-- The API level and TargetFrameworkVersion for the default Mono.Android.dll build -->
Expand Down Expand Up @@ -65,7 +65,7 @@
<MicrosoftAndroidRefPackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Ref.$(AndroidApiLevel)\$(AndroidPackVersion)\ref\$(DotNetTargetFramework)\</MicrosoftAndroidRefPackDir>
<MicrosoftAndroidSdkPackDir>$(BuildOutputDirectory)lib\packs\$(MicrosoftAndroidSdkPackName)\$(AndroidPackVersion)\</MicrosoftAndroidSdkPackDir>
<MicrosoftAndroidSdkOutDir>$(MicrosoftAndroidSdkPackDir)\tools\</MicrosoftAndroidSdkOutDir>
<MicrosoftAndroidSdkAnalysisOutDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Ref.$(AndroidApiLevel)\$(AndroidPackVersion)\analyzers\dotnet\cs\</MicrosoftAndroidSdkAnalysisOutDir>
<MicrosoftAndroidSdkAnalysisOutDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Ref.$(AndroidLatestStableApiLevel)\$(AndroidPackVersion)\analyzers\dotnet\cs\</MicrosoftAndroidSdkAnalysisOutDir>
<MakeConcurrency Condition=" '$(MakeConcurrency)' == '' And '$(HostCpuCount)' != '' ">-j$(HostCpuCount)</MakeConcurrency>
<ManagedRuntime Condition=" '$(ManagedRuntime)' == '' And '$(OS)' != 'Windows_NT' ">mono</ManagedRuntime>
<ManagedRuntimeArgs Condition=" '$(ManagedRuntimeArgs)' == '' And '$(ManagedRuntime)' == 'mono' ">--debug=casts</ManagedRuntimeArgs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public sealed class CheckApiCompatibility : Task
{ "v13.0", "v12.1" },
{ "v14.0", "v13.0" },
{ "v15.0", "v14.0" },
{ "v15.0.99", "v15.0" },
};

static readonly string assemblyToValidate = "Mono.Android.dll";
Expand Down
3 changes: 2 additions & 1 deletion build-tools/api-merge/merge-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
<File Path="api-33.xml.in" Level="33" />
<File Path="api-34.xml.in" Level="34" />
<File Path="api-35.xml.in" Level="35" />
<File Path="api-Baklava.xml.in" Level="36" />
</Inputs>
<Outputs>
<File Path="api-35.xml" LastLevel="35" />
<File Path="api-Baklava.xml" LastLevel="36" />
</Outputs>
</Configuration>
2 changes: 1 addition & 1 deletion build-tools/automation/yaml-templates/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ variables:
- name: IsRelOrTargetingRel
value: $[or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['System.PullRequest.TargetBranch'], 'release/'))]
- name: DefaultTestSdkPlatforms # Comma-separated SDK Platform(s) to install on test agents (no spaces)
value: 35
value: 35,Baklava
- name: ExcludedNightlyNUnitCategories
value: 'cat != SystemApplication & cat != TimeZoneInfo & cat != Localization'
- name: RunMAUITestJob
Expand Down
2 changes: 1 addition & 1 deletion build-tools/create-android-api/create-android-api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

<PropertyGroup>
<ApiMerge>..\..\bin\Build$(Configuration)\api-merge.dll</ApiMerge>
<_ConfigurationFile>..\..\bin\Build$(Configuration)\merge-configuration.xml</_ConfigurationFile>
<_ConfigurationFile>..\api-merge\merge-configuration.xml</_ConfigurationFile>
<_ConfigurationInputBaseDirectory>..\..\bin\Build$(Configuration)\api\</_ConfigurationInputBaseDirectory>
<_ConfigurationOutputBaseDirectory>..\..\bin\Build$(Configuration)\api\</_ConfigurationOutputBaseDirectory>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ endif

leeroy:
$(call DOTNET_BINLOG,leeroy) $(SOLUTION) $(_MSBUILD_ARGS)
$(call DOTNET_BINLOG,monoandroid-preview) $(SOLUTION) -t:BuildExtraApiLevels
$(call DOTNET_BINLOG,setup-workload) -t:ConfigureLocalWorkload build-tools/create-packs/Microsoft.Android.Sdk.proj
12 changes: 8 additions & 4 deletions build-tools/scripts/DotNet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@
<MSBuild Projects="$(_Root)build-tools\create-packs\Microsoft.Android.Sdk.proj" Targets="ConfigureLocalWorkload" />
</Target>

<Target Name="PackDotNet">
<!-- Build extra versions of Mono.Android.dll if necessary -->
<!-- Build Mono.Android.dll for additional API levels if necessary -->
<Target Name="BuildExtraApiLevels">
<MSBuild
Condition=" '$(AndroidDefaultTargetDotnetApiLevel)' != '$(AndroidLatestStableApiLevel)' "
Projects="$(_Root)src\Mono.Android\Mono.Android.csproj"
Properties="TargetFramework=$(DotNetTargetFramework);AndroidApiLevel=$(AndroidDefaultTargetDotnetApiLevel);AndroidPlatformId=$(AndroidDefaultTargetDotnetApiLevel);DisableApiCompatibilityCheck=true"
Properties="AndroidApiLevel=$(AndroidDefaultTargetDotnetApiLevel);AndroidPlatformId=$(AndroidDefaultTargetDotnetApiLevel)"
/>
<MSBuild
Condition=" '$(AndroidLatestUnstableApiLevel)' != '$(AndroidLatestStableApiLevel)' "
Projects="$(_Root)src\Mono.Android\Mono.Android.csproj"
Properties="TargetFramework=$(DotNetTargetFramework);AndroidApiLevel=$(AndroidLatestUnstableApiLevel);AndroidPlatformId=$(AndroidLatestUnstablePlatformId);DisableApiCompatibilityCheck=true"
Properties="AndroidApiLevel=$(AndroidLatestUnstableApiLevel);AndroidPlatformId=$(AndroidLatestUnstablePlatformId);AndroidFrameworkVersion=$(AndroidLatestUnstableFrameworkVersion)"
/>
</Target>

<Target Name="PackDotNet"
DependsOnTargets="BuildExtraApiLevels">
<MSBuild Projects="$(_Root)build-tools\create-packs\Microsoft.Android.Sdk.proj" Targets="CreateAllPacks" />
<MSBuild Projects="$(_Root)build-tools\create-packs\Microsoft.Android.Sdk.proj" Targets="ExtractWorkloadPacks" />
<!-- Clean up old, previously restored packages -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class BuildAndroidPlatforms
new AndroidPlatform (apiName: "Tiramisu", apiLevel: 33, platformID: "33", include: "v13.0", framework: "v13.0"),
new AndroidPlatform (apiName: "UpsideDownCake", apiLevel: 34, platformID: "34", include: "v14.0", framework: "v14.0"),
new AndroidPlatform (apiName: "VanillaIceCream", apiLevel: 35, platformID: "35", include: "v15.0", framework: "v15.0"),
new AndroidPlatform (apiName: "Baklava", apiLevel: 36, platformID: "Baklava", include: "v15.0.99", framework: "v15.0.99", stable: false),
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public AndroidToolchain ()
// https://dl-ssl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml
// * system images
//
// Note "isLatestStable" is a bad name, it's actually "xaprepare should install this API by default"
Components = new List<AndroidToolchainComponent> {
new AndroidPlatformComponent ("android-2.3.3_r02", apiLevel: "10", pkgRevision: "2"),
new AndroidPlatformComponent ("android-15_r05", apiLevel: "15", pkgRevision: "5"),
Expand All @@ -72,6 +73,7 @@ public AndroidToolchain ()
new AndroidPlatformComponent ("platform-33-ext3_r03", apiLevel: "33", pkgRevision: "3"),
new AndroidPlatformComponent ("platform-34-ext7_r02", apiLevel: "34", pkgRevision: "2"),
new AndroidPlatformComponent ("platform-35_r01", apiLevel: "35", pkgRevision: "1", isLatestStable: true),
new AndroidPlatformComponent ("platform-Baklava_r01", apiLevel: "Baklava", pkgRevision: "1", isLatestStable: true),

new AndroidToolchainComponent ("sources-34_r01",
destDir: Path.Combine ("sources", "android-34"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,4 @@
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
</ItemGroup>
<ItemGroup>
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
</Project>
Loading

0 comments on commit 2dd4f74

Please sign in to comment.