Skip to content

Commit

Permalink
[Mono.Android] Bind API-UpsideDownCake Developer Preview 1 (#7796)
Browse files Browse the repository at this point in the history
Context: https://developer.android.com/about/versions/14

Android 14 [Developer Preview 1][0] was released on 2023-Feb-08:

  * [API diff vs. API-33][1]

The Android 14 Preview [Timeline, milestones, and updates][2] section
suggests the following timeline:

  * February: Developer Preview 1
  * March: Developer Preview 2
  * April: Beta 1
  * May: Beta 2
  * June: Beta 3 with "First [Platform Stability][3] milestone
    including final APIs and behaviors.  Play publishing also opens."
  * July: Beta 4+
  * ???: Final release

~~ Acceptable Breakages ~~

  * Type `Dalvik.SystemInterop.DexFile` was un-deprecated.
    A new nested [`DexFile.OptimizationInfo`][4] class was added.

~~ TODO ~~

We need to update `Mono.Android.dll` API compatibility to work with
the .NET Android versioning scheme, *not* the Classic Xamarin.Android
versioning scheme.

[0]: https://android-developers.googleblog.com/2023/02/first-developer-preview-android14.html
[1]: https://web.archive.org/web/20230216110929/https://developer.android.com/sdk/api_diff/u-dp1/changes
[2]: https://web.archive.org/web/20230228205527/https://developer.android.com/about/versions/14/overview#timeline
[3]: https://web.archive.org/web/20230228205527/https://developer.android.com/about/versions/14/overview#platform_stability
[4]: https://developer.android.com/reference/dalvik/system/DexFile.OptimizationInfo?hl=en
  • Loading branch information
jpobst authored Mar 28, 2023
1 parent 16806ca commit e9f3143
Show file tree
Hide file tree
Showing 16 changed files with 37,585 additions and 14 deletions.
6 changes: 3 additions & 3 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)'==''">v13.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)' == ''">Tiramisu</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v13.0</AndroidLatestUnstableFrameworkVersion>
<AndroidLatestUnstableApiLevel Condition="'$(AndroidLatestUnstableApiLevel)' == ''">34</AndroidLatestUnstableApiLevel>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">UpsideDownCake</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v13.0.99</AndroidLatestUnstableFrameworkVersion>
<!-- The default API level used for $(TargetPlatformVersion) -->
<AndroidDefaultTargetDotnetApiLevel Condition=" '$(AndroidDefaultTargetDotnetApiLevel)' == '' ">33</AndroidDefaultTargetDotnetApiLevel>
<!-- The API level and TargetFrameworkVersion for the default Mono.Android.dll build -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public sealed class CheckApiCompatibility : Task
{ "v12.0", "v11.0" },
{ "v12.1", "v12.0" },
{ "v13.0", "v12.1" },
{ "v13.0.99", "v13.0" },
};

static readonly string assemblyToValidate = "Mono.Android.dll";
Expand Down
2 changes: 2 additions & 0 deletions build-tools/api-merge/merge-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<File Path="api-31.xml.in" Level="31" />
<File Path="api-32.xml.in" Level="32" />
<File Path="api-33.xml.in" Level="33" />
<File Path="api-UpsideDownCake.xml.in" Level="34" />
</Inputs>
<Outputs>
<File Path="api-19.xml" LastLevel="19" />
Expand All @@ -39,5 +40,6 @@
<File Path="api-31.xml" LastLevel="31" />
<File Path="api-32.xml" LastLevel="32" />
<File Path="api-33.xml" LastLevel="33" />
<File Path="api-UpsideDownCake.xml" LastLevel="34" />
</Outputs>
</Configuration>
2 changes: 1 addition & 1 deletion build-tools/api-xml-adjuster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ API_XML_TOOL = $(BUILDBIN)/api-xml-adjuster.exe
RUNTIME = mono --debug
RUN_CLASS_PARSE = $(RUNTIME) $(CLASS_PARSE)
RUN_API_XML_TOOL = $(RUNTIME) $(API_XML_TOOL)
API_LEVELS = 33
API_LEVELS = 33 UpsideDownCake

XML_OUTPUT_DIR = .

Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ variables:
- name: ExcludedNUnitCategories
value: '& cat != DotNetIgnore & cat != HybridAOT & cat != MkBundle & cat != MonoSymbolicate & cat != PackagesConfig & cat != StaticProject & cat != SystemApplication'
- name: DefaultTestSdkPlatforms # Comma-separated SDK Platform(s) to install on test agents (no spaces)
value: 33
value: 33,UpsideDownCake
- ${{ if eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}:
- group: AzureDevOps-Artifact-Feeds-Pats
- group: DotNet-MSRC-Storage
Expand Down
6 changes: 2 additions & 4 deletions build-tools/automation/guardian/PoliCheck.Exclusions.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<PoliCheckExclusions>
<!-- Each of these exclusions is a folder name - if \[name]\ exists in the file path, it will be skipped -->
<Exclusion Type="FolderPathFull">LICENSE-DATA|NREFACTORY|LOCALIZE</Exclusion>
<Exclusion Type="FolderPathStart">src\Mono.Android\Profiles</Exclusion>
<!-- Each of these exclusions is a folder name - if any folder or file starts with "\[name]", it will be skipped -->
<!--<Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>-->
<!-- Each of these file types will be completely skipped for the entire scan -->
<!--<Exclusion Type="FileType">.ABC|.XYZ</Exclusion>-->
<!-- The specified file names will be skipped during the scan regardless which folder they are in -->
<Exclusion Type="FileName">REMAINING-INT-CONSTS.TXT|TAIWANCALENDAR.XML|XAMARIN-ANDROID-SDK-9.XML|SQLITE3.C|MAP.CSV|METHODMAP.EXT.CSV|EXTERNALWHITELIST.CSV|SYMBOLARCHIVEWHITELIST.CSV|POLICHECK.EXCLUSIONS.xml
|API-10.PARAMS.TXT|API-15.PARAMS.TXT|API-16.PARAMS.TXT|API-17.PARAMS.TXT|API-18.PARAMS.TXT|API-19.PARAMS.TXT|API-20.PARAMS.TXT|API-21.PARAMS.TXT|API-22.PARAMS.TXT|API-23.PARAMS.TXT|API-24.PARAMS.TXT
|API-25.PARAMS.TXT|API-26.PARAMS.TXT|API-27.PARAMS.TXT|API-28.PARAMS.TXT|API-29.PARAMS.TXT|API-30.PARAMS.TXT|API-31.PARAMS.TXT|API-32.PARAMS.TXT|API-33.PARAMS.TXT
</Exclusion>
<Exclusion Type="FileName">REMAINING-INT-CONSTS.TXT|TAIWANCALENDAR.XML|XAMARIN-ANDROID-SDK-9.XML|SQLITE3.C|MAP.CSV|METHODMAP.EXT.CSV|EXTERNALWHITELIST.CSV|SYMBOLARCHIVEWHITELIST.CSV|POLICHECK.EXCLUSIONS.xml</Exclusion>
</PoliCheckExclusions>
2 changes: 1 addition & 1 deletion build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<Target Name="_FindFrameworkDirs">
<ItemGroup>
<_FrameworkDirs Include="@(AndroidApiInfo->'$(FrameworkSrcDir)%(Identity)\')" />
<_FrameworkDirsThatExist Condition="Exists('%(Identity)')" Include="@(_FrameworkDirs)" />
<_FrameworkDirsThatExist Condition="Exists('%(Identity)')" Include="@(_FrameworkDirs)" Exclude="$(FrameworkSrcDir)v13.0.99\" />
<_EarlierFrameworkDir Include="@(_FrameworkDirsThatExist)" Exclude="$(_LatestStableFrameworkDir)" />
</ItemGroup>
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class BuildAndroidPlatforms
new AndroidPlatform (apiName: "S", apiLevel: 31, platformID: "31", include: "v12.0"),
new AndroidPlatform (apiName: "Sv2", apiLevel: 32, platformID: "32", include: "v12.1"),
new AndroidPlatform (apiName: "Tiramisu", apiLevel: 33, platformID: "33", include: "v13.0", framework: "v13.0"),
new AndroidPlatform (apiName: "UpsideDownCake", apiLevel: 34, platformID: "UpsideDownCake", include: "v13.0.99",framework: "v13.0.99", stable: false),
};

public static readonly Dictionary<string, uint> NdkMinimumAPIMap = new Dictionary<string, uint> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public AndroidToolchain ()
new AndroidPlatformComponent ("platform-31_r01", apiLevel: "31", pkgRevision: "1"),
new AndroidPlatformComponent ("platform-32_r01", apiLevel: "32", pkgRevision: "1"),
new AndroidPlatformComponent ("platform-33_r01", apiLevel: "33", pkgRevision: "1"),
new AndroidPlatformComponent ("platform-UpsideDownCake_r01", apiLevel: "UpsideDownCake", pkgRevision: "1"),

new AndroidToolchainComponent ("sources-33_r01",
destDir: Path.Combine ("sources", "android-33"),
Expand Down
13 changes: 9 additions & 4 deletions src/Mono.Android.Runtime/Mono.Android.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<!-- Only build the .NET 6+ version of 'Mono.Android.Export.dll' for the latest stable Android version. -->
<PropertyGroup Condition=" '$(AndroidApiLevel)' != '$(AndroidLatestStableApiLevel)' ">
<!-- Only build the .NET 6+ version of 'Mono.Android.Runtime.dll' for the latest stable Android version. -->
<PropertyGroup Condition=" '$(TargetFramework)' != 'monoandroid10' And '$(AndroidApiLevel)' &lt; '$(AndroidDefaultTargetDotnetApiLevel)' ">
<BuildDependsOn></BuildDependsOn>
</PropertyGroup>


<!-- Do not build classic for API versions above 33 -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'monoandroid10' And '$(AndroidApiLevel)' &gt; '33'">
<BuildDependsOn></BuildDependsOn>
</PropertyGroup>

<!-- Copy .NET ref/runtime assemblies to bin/$(Configuration)/dotnet/packs folder -->
<PropertyGroup Condition=" '$(AndroidApiLevel)' == '$(AndroidLatestStableApiLevel)' ">
<PropertyGroup Condition=" '$(TargetFramework)' != 'monoandroid10' And '$(AndroidApiLevel)' &gt;= '$(AndroidDefaultTargetDotnetApiLevel)' ">
<BuildDependsOn>
$(BuildDependsOn);
_CopyToPackDirs;
Expand Down
17 changes: 17 additions & 0 deletions src/Mono.Android/Android.Graphics/PathIterator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using Android.Runtime;

namespace Android.Graphics
{ partial class PathIterator
{

#if ANDROID_34
// This implements an interface method that should be marked as 'default' but isn't.
// https://developer.android.com/reference/java/util/Iterator#remove()
public void Remove ()
{
throw new Java.Lang.UnsupportedOperationException ();
}
#endif
}
}
6 changes: 6 additions & 0 deletions src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<Compile Include="..\..\external\Java.Interop\src\Java.Interop.Tools.JavaCallableWrappers\Java.Interop.Tools.JavaCallableWrappers\Crc64.Table.cs">
<Link>Crc64.Table.cs</Link>
</Compile>
<Compile Include="Android.Graphics\PathIterator.cs" />
<Compile Include="Android.Icu\ListFormatter.cs" />
<Compile Include="Android.Icu\RelativeDateTimeFormatter.cs" />
<Compile Include="Android.Icu\DateIntervalFormat.cs" />
Expand Down Expand Up @@ -412,6 +413,11 @@
<BuildDependsOn></BuildDependsOn>
</PropertyGroup>

<!-- Do not build classic for API versions above 33 -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'monoandroid10' And '$(AndroidApiLevel)' &gt; '33'">
<BuildDependsOn></BuildDependsOn>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'monoandroid10' And '$(AndroidApiLevel)' &gt;= '$(AndroidDefaultTargetDotnetApiLevel)' ">
<BuildDependsOn>
$(BuildDependsOn);
Expand Down
Loading

0 comments on commit e9f3143

Please sign in to comment.