Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Configuration.Override.props.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
kept consistent with each other, lest Bad Things Happen™
-->
<!-- The default Android API level to bind in src/Mono.Android -->
<AndroidApiLevel>33</AndroidApiLevel>
<AndroidApiLevel>34</AndroidApiLevel>
<!-- The Xamarin.Android $(TargetFrameworkVersion) value that corresponds to $(AndroidApiLevel) -->
<AndroidFrameworkVersion>v13.0</AndroidFrameworkVersion>
<AndroidFrameworkVersion>v14.0</AndroidFrameworkVersion>
<!-- The default Android API "id" that corresponds to $(AndroidApiLevel) -->
<AndroidPlatformId>33</AndroidPlatformId>
<AndroidPlatformId>34</AndroidPlatformId>

<!--
Colon-separated list of ABIs to build the mono JIT for.
Expand Down
16 changes: 8 additions & 8 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<AndroidMinimumDotNetApiLevel Condition="'$(AndroidMinimumDotNetApiLevel)' == ''">21</AndroidMinimumDotNetApiLevel>
<AndroidFirstPlatformId Condition="'$(AndroidFirstPlatformId)' == ''">$(AndroidFirstApiLevel)</AndroidFirstPlatformId>
<!-- *Latest* *stable* API level binding that we support; used when building src/Xamarin.Android.Build.Tasks -->
<AndroidLatestStableApiLevel Condition="'$(AndroidLatestStableApiLevel)' == ''">33</AndroidLatestStableApiLevel>
<AndroidLatestStableApiLevel Condition="'$(AndroidLatestStableApiLevel)' == ''">34</AndroidLatestStableApiLevel>
<AndroidLatestStablePlatformId Condition="'$(AndroidLatestStablePlatformId)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestStablePlatformId>
<AndroidLatestStableFrameworkVersion Condition="'$(AndroidLatestStableFrameworkVersion)'==''">v13.0</AndroidLatestStableFrameworkVersion>
<AndroidLatestStableFrameworkVersion Condition="'$(AndroidLatestStableFrameworkVersion)'==''">v14.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>
<AndroidLatestUnstablePlatformId Condition="'$(AndroidLatestUnstablePlatformId)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestUnstablePlatformId>
<AndroidLatestUnstableFrameworkVersion Condition="'$(AndroidLatestUnstableFrameworkVersion)'==''">v14.0</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 Expand Up @@ -134,13 +134,13 @@
For some reason, the URL for platform-tools/build-tools 32.0.0 is prefixed with what appears to be a GIT commit hash or some other checksum...
Linux packages don't have any prefix, but this forces us to have *some* mechanism to handle this...
-->
<XABuildToolsPackagePrefixMacOS>5219cc671e844de73762e969ace287c29d2e14cd.</XABuildToolsPackagePrefixMacOS>
<XABuildToolsPackagePrefixWindows>210b77e4bc623bd4cdda4dae790048f227972bd2.</XABuildToolsPackagePrefixWindows>
<XABuildToolsPackagePrefixMacOS></XABuildToolsPackagePrefixMacOS>
<XABuildToolsPackagePrefixWindows></XABuildToolsPackagePrefixWindows>
<XABuildToolsPackagePrefixLinux></XABuildToolsPackagePrefixLinux>
<XABuildToolsPackagePrefix Condition=" '$(HostOS)' == 'Darwin' ">$(XABuildToolsPackagePrefixMacOS)</XABuildToolsPackagePrefix>
<XABuildToolsPackagePrefix Condition=" '$(HostOS)' == 'Windows' ">$(XABuildToolsPackagePrefixWindows)</XABuildToolsPackagePrefix>
<XABuildToolsVersion>32</XABuildToolsVersion>
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">32.0.0</XABuildToolsFolder>
<XABuildToolsVersion>34</XABuildToolsVersion>
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">34.0.0</XABuildToolsFolder>
<!-- build-tools 30, for DX tests -->
<XABuildTools30PackagePrefixMacOS>f6d24b187cc6bd534c6c37604205171784ac5621.</XABuildTools30PackagePrefixMacOS>
<XABuildTools30PackagePrefixWindows>91936d4ee3ccc839f0addd53c9ebf087b1e39251.</XABuildTools30PackagePrefixWindows>
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" },
{ "v14.0", "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-34.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-34.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 = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

XML_OUTPUT_DIR = .

Expand Down
2 changes: 2 additions & 0 deletions build-tools/automation/yaml-templates/commercial-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ steps:
- script: make all-tests CONFIGURATION=$(XA.Build.Configuration)
workingDirectory: ${{ parameters.xaSourcePath }}
displayName: make all-tests
env:
__XA_LOG_ERRORS__: icanhaz

# Restore needs to be executed first or MicroBuild targets won't be imported in time
- task: MSBuild@1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ steps:

- template: run-xaprepare.yaml
parameters:
arguments: --s=AndroidTestDependencies --android-sdk-platforms="19,21,26,32,33"
arguments: --s=AndroidTestDependencies --android-sdk-platforms="19,21,26,32,33,34"
xaSourcePath: ${{ parameters.xaSourcePath }}

- task: DotNetCoreCLI@2
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", framework: "v12.0"),
new AndroidPlatform (apiName: "Sv2", apiLevel: 32, platformID: "32", include: "v12.1", framework: "v12.1"),
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"),
};

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 @@ -68,6 +68,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-34-ext7_r01", apiLevel: "34", pkgRevision: "1"),

new AndroidToolchainComponent ("sources-31_r01",
destDir: Path.Combine ("platforms", $"android-31", "src"),
Expand Down
2 changes: 1 addition & 1 deletion external/Java.Interop
5 changes: 5 additions & 0 deletions src/Mono.Android.Export/Mono.Android.Export.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
<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=" '$(TargetFramework)' != 'monoandroid10' And '$(AndroidApiLevel)' == '$(AndroidLatestStableApiLevel)' ">
<BuildDependsOn>
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
}
}
24 changes: 24 additions & 0 deletions src/Mono.Android/Java.Lang.Invoke/MethodType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Linq;

namespace Java.Lang.Invoke
{
#if ANDROID_34
// A new interface (Java.Lang.Invoke.ITypeDescriptor.IOfMethod) was added to the MethodType class in API-34.
// The existing methods have covariant return types so they cannot fulfill the interface contract,
// and we cannot change them without breaking API. Create new versions of these interface
// methods that can fulfill the contract.
public sealed partial class MethodType
{
Java.Lang.Object[]? ITypeDescriptor.IOfMethod.ParameterArray ()
=> ParameterArray ();

System.Collections.IList? ITypeDescriptor.IOfMethod.ParameterList ()
=> (Android.Runtime.JavaList<Java.Lang.Class>?)ParameterList ();

// Helper method needed to cast Object to Class for an explicitly implemented method:
// Java.Lang.Invoke.ITypeDescriptor.IOfMethod.InsertParameterTypes (int p0, params Java.Lang.Object[]? p1)
Java.Lang.Invoke.MethodType? InsertParameterTypes (int num, params Java.Lang.Object []? ptypesToInsert)
=> InsertParameterTypes (num, ptypesToInsert?.Cast<Java.Lang.Class> ().ToArray ());
}
#endif
}
10 changes: 10 additions & 0 deletions src/Mono.Android/Java.Lang/Class.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Android.Runtime;
using Java.Interop;
using Java.Lang.Invoke;

namespace Java.Lang {

Expand Down Expand Up @@ -28,5 +29,14 @@ public static Class FromType (System.Type type)

return Java.Lang.Object.GetObject<Class> (JNIEnv.FindClass (type), JniHandleOwnership.TransferGlobalRef)!;
}

#if ANDROID_34
// A new interface (Java.Lang.Invoke.ITypeDescriptor.IOfField) was added to this class in API-34.
// The new required ComponentType () method conflicts with our ComponentType property created from
// the existing getComponentType method. Explicitly implement this method, which Android has documented
// as equivalent to the existing getComponentType method.
Java.Lang.Object? ITypeDescriptor.IOfField.ComponentType ()
=> ComponentType;
#endif
}
}
2 changes: 2 additions & 0 deletions src/Mono.Android/Java.Nio/CharBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Java.Nio
{
#if NET || !ANDROID_34
public partial class CharBuffer
{
// FIXME: these are generator limitation workaround: it should resolve
Expand All @@ -19,5 +20,6 @@ Java.Lang.IAppendable Java.Lang.IAppendable.Append(Java.Lang.ICharSequence? csq,
return Append (csq, start, end)!;
}
}
#endif
}

2 changes: 1 addition & 1 deletion src/Mono.Android/Java.Nio/FileChannel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if ANDROID_24
#if ANDROID_24 && (NET || !ANDROID_34)

using System;

Expand Down
4 changes: 3 additions & 1 deletion src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@
<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" />
<Compile Include="Android.Runtime\DynamicMethodNameCounter.cs" />
<Compile Include="Android.Runtime\IJavaObjectValueMarshaler.cs" />
<Compile Include="Java.Lang.Invoke\MethodType.cs" />
</ItemGroup>

<Import Project="..\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems" Label="Shared" Condition="Exists('..\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems')" />
Expand Down Expand Up @@ -396,7 +398,7 @@
<PropertyGroup Condition=" '$(TargetFramework)' != 'monoandroid10' And '$(AndroidApiLevel)' &lt; '$(AndroidDefaultTargetDotnetApiLevel)' ">
<BuildDependsOn></BuildDependsOn>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'monoandroid10' And '$(AndroidApiLevel)' &gt;= '$(AndroidDefaultTargetDotnetApiLevel)' ">
<BuildDependsOn>
$(BuildDependsOn);
Expand Down
5 changes: 3 additions & 2 deletions src/Mono.Android/Mono.Android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
SourceFiles="$(_ApiXmlLocation)api-$(AndroidPlatformId).xml"
DestinationFolder="$(IntermediateOutputPath)mcw\"
/>

</Target>

<!-- Runs 'generator' -->
Expand Down Expand Up @@ -166,6 +165,8 @@
<_Out>-o "$(IntermediateOutputPath)mcw"</_Out>
<_Codegen>--codegen-target=XAJavaInterop1</_Codegen>
<_Fixup>--fixup=metadata</_Fixup>
<_Fixup Condition=" '$(TargetFramework)' == 'monoandroid10' ">$(_Fixup) --fixup=metadata-classic</_Fixup>
<_Fixup Condition=" '$(TargetFramework)' != 'monoandroid10' ">$(_Fixup) --fixup=metadata-net</_Fixup>
<_Enums1>--preserve-enums --enumflags=enumflags --enumfields=map.csv --enummethods=methodmap.csv</_Enums1>
<_Enums2>--enummetadata=$(IntermediateOutputPath)mcw\enummetadata</_Enums2>
<_Annotations Condition=" '$(_AnnotationsZip)' != '' ">"--annotations=$(_AnnotationsZip)"</_Annotations>
Expand Down Expand Up @@ -264,7 +265,7 @@
</ItemGroup>
<Target
Name="_CheckApiCompatibility"
Condition=" '$(DisableApiCompatibilityCheck)' != 'True' "
Condition=" '$(DisableApiCompatibilityCheck)' != 'True' AND '$(TargetFramework)' != 'monoandroid10' "
AfterTargets="CopyFilesToOutputDirectory"

Inputs="$(TargetPath);@(ApiCompatibilityFiles)"
Expand Down
Loading