diff --git a/Documentation/guides/building-apps/build-properties.md b/Documentation/guides/building-apps/build-properties.md index be7378f3c1a..cf3b5100649 100644 --- a/Documentation/guides/building-apps/build-properties.md +++ b/Documentation/guides/building-apps/build-properties.md @@ -430,6 +430,7 @@ documentation on [D8 and R8][d8-r8]. [dex]: https://source.android.com/devices/tech/dalvik/dalvik-bytecode [d8-r8]: https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/D8andR8.md + ## AndroidEnableDesugar A boolean property that diff --git a/external/Java.Interop b/external/Java.Interop index 3c83179668c..38c8a827e78 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit 3c83179668cf8b6848626be14ddccc3f742a92d3 +Subproject commit 38c8a827e78ffe9c80ad2313a9e0e0d4f8215184 diff --git a/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets b/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets index d023fe0acc2..e4fd97abeea 100644 --- a/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets +++ b/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets @@ -108,6 +108,7 @@ It is shared between "legacy" binding projects and .NET 5 projects. ToolPath="$(_BindingsToolsLocation)" ToolExe="$(BindingsGeneratorToolExe)" LangVersion="$(LangVersion)" + EmitLegacyInterfaceInvokers="$(_AndroidEmitLegacyInterfaceInvokers)" EnableBindingStaticAndDefaultInterfaceMethods="$(AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods)" EnableBindingNestedInterfaceTypes="$(AndroidBoundInterfacesContainTypes)" EnableBindingInterfaceConstants="$(AndroidBoundInterfacesContainConstants)" diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets index 46a750a585b..3aeea8cf67b 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets @@ -39,6 +39,7 @@ true true true + <_AndroidEmitLegacyInterfaceInvokers Condition=" '$(AndroidEmitLegacyInterfaceInvokers)' == '' ">false true obsolete diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs index 9744f864c4c..bb76b585a1d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs @@ -48,6 +48,8 @@ public class BindingsGenerator : AndroidDotnetToolTask public string LangVersion { get; set; } + public bool EmitLegacyInterfaceInvokers { get; set; } + public bool EnableBindingStaticAndDefaultInterfaceMethods { get; set; } public bool EnableBindingNestedInterfaceTypes { get; set; } public bool EnableBindingInterfaceConstants { get; set; } @@ -209,6 +211,10 @@ protected override string GenerateCommandLineCommands () if (SupportsCSharp8) { var features = new List (); + if (EmitLegacyInterfaceInvokers) { + features.Add ("emit-legacy-interface-invokers"); + } + if (EnableBindingInterfaceConstants) features.Add ("interface-constants"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc index 18b995352c6..1dbc7d0c32b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc @@ -8,61 +8,61 @@ "Size": 1024 }, "assemblies/Java.Interop.dll": { - "Size": 61886 + "Size": 61350 }, "assemblies/Mono.Android.dll": { - "Size": 88044 + "Size": 90818 }, "assemblies/Mono.Android.Runtime.dll": { - "Size": 5509 + "Size": 5514 }, "assemblies/rc.bin": { - "Size": 1395 + "Size": 1512 }, "assemblies/System.Console.dll": { - "Size": 6400 + "Size": 6536 }, "assemblies/System.Linq.dll": { - "Size": 9199 + "Size": 7118 }, "assemblies/System.Private.CoreLib.dll": { - "Size": 550507 + "Size": 550324 }, "assemblies/System.Runtime.dll": { - "Size": 2621 + "Size": 2614 }, "assemblies/System.Runtime.InteropServices.dll": { - "Size": 3858 + "Size": 3851 }, "assemblies/UnnamedProject.dll": { - "Size": 2933 + "Size": 2932 }, "classes.dex": { - "Size": 377064 + "Size": 377956 }, "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { "Size": 97080 }, "lib/arm64-v8a/libmonodroid.so": { - "Size": 325320 + "Size": 334784 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3189360 + "Size": 3193200 }, "lib/arm64-v8a/libSystem.IO.Compression.Native.so": { "Size": 723560 }, "lib/arm64-v8a/libSystem.Native.so": { - "Size": 93920 + "Size": 93952 }, "lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": { "Size": 154904 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 11576 + "Size": 11648 }, "META-INF/BNDLTOOL.RSA": { - "Size": 1213 + "Size": 1221 }, "META-INF/BNDLTOOL.SF": { "Size": 3037 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc index 1a0ecbe1e38..25f7dfca7a9 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc @@ -11,13 +11,13 @@ "Size": 7112 }, "assemblies/Java.Interop.dll": { - "Size": 70036 + "Size": 69472 }, "assemblies/Mono.Android.dll": { - "Size": 471216 + "Size": 447387 }, "assemblies/Mono.Android.Runtime.dll": { - "Size": 5506 + "Size": 5514 }, "assemblies/mscorlib.dll": { "Size": 3852 @@ -206,13 +206,13 @@ "Size": 42282 }, "classes.dex": { - "Size": 3513140 + "Size": 3514468 }, "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { "Size": 97080 }, "lib/arm64-v8a/libmonodroid.so": { - "Size": 325320 + "Size": 334784 }, "lib/arm64-v8a/libmonosgen-2.0.so": { "Size": 3193200 @@ -227,7 +227,7 @@ "Size": 154904 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 102840 + "Size": 102888 }, "META-INF/android.support.design_material.version": { "Size": 12 @@ -1916,5 +1916,5 @@ "Size": 325240 } }, - "PackageSize": 7973902 + "PackageSize": 7949326 } \ No newline at end of file