diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3217daf46a3..89dfd5bbe35 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/sdk - e1a2886f5628dfdf192225870a62a1d029da68fb + ba56a9974738e0462269bfbcd89360d8a5064402 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 02fae9a1a73..602c803f25d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 10.0.100-preview.1.25106.28 + 10.0.100-preview.1.25120.13 $(MicrosoftNETSdkPackageVersion) 10.0.0-preview.1.25080.5 10.0.0-preview.1.25080.5 diff --git a/external/Java.Interop b/external/Java.Interop index e288589d92a..57f7bc849f3 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit e288589d92afc9edd9070638ebed72f67e310117 +Subproject commit 57f7bc849f36ec7c3159cc7729c7276b8dcd3ca4 diff --git a/external/debugger-libs b/external/debugger-libs index d56643445cf..c0353072de4 160000 --- a/external/debugger-libs +++ b/external/debugger-libs @@ -1 +1 @@ -Subproject commit d56643445cfc6ed312cfc100be915be401396132 +Subproject commit c0353072de4a6cd4813964a0536c48df3e9ceb4e diff --git a/src/Mono.Android/Android.Runtime/ExtraDelegates.cs b/src/Mono.Android/Android.Runtime/ExtraDelegates.cs new file mode 100644 index 00000000000..26101d9a2ea --- /dev/null +++ b/src/Mono.Android/Android.Runtime/ExtraDelegates.cs @@ -0,0 +1,30 @@ +// There are built-in delegates for these, but we no longer generate them in Mono.Android.dll +// because bool is not a blittable type. But we still need them for pre-existing bindings. +using System; + +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PP_Z (IntPtr jnienv, IntPtr klass); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPL_Z (IntPtr jnienv, IntPtr klass, IntPtr p0); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPJ_Z (IntPtr jnienv, IntPtr klass, long p0); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate void _JniMarshal_PPLZ_V (IntPtr jnienv, IntPtr klass, IntPtr p0, bool p1); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPLL_Z (IntPtr jnienv, IntPtr klass, IntPtr p0, IntPtr p1); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPIL_Z (IntPtr jnienv, IntPtr klass, int p0, IntPtr p1); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPLII_Z (IntPtr jnienv, IntPtr klass, IntPtr p0, int p1, int p2); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPLLJ_Z (IntPtr jnienv, IntPtr klass, IntPtr p0, IntPtr p1, long p2); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPLIL_Z (IntPtr jnienv, IntPtr klass, IntPtr p0, int p1, IntPtr p2); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPLLL_Z (IntPtr jnienv, IntPtr klass, IntPtr p0, IntPtr p1, IntPtr p2); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate IntPtr _JniMarshal_PPIZI_L (IntPtr jnienv, IntPtr klass, int p0, bool p1, int p2); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate bool _JniMarshal_PPLZZL_Z (IntPtr jnienv, IntPtr klass, IntPtr p0, bool p1, bool p2, IntPtr p3); +[global::System.Runtime.InteropServices.UnmanagedFunctionPointer (global::System.Runtime.InteropServices.CallingConvention.Winapi)] +delegate void _JniMarshal_PPZIIII_V (IntPtr jnienv, IntPtr klass, bool p0, int p1, int p2, int p3, int p4); diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 093a6d6a8ac..6c409057f53 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -96,6 +96,7 @@ + diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 48c1ed3685b..5f3188499f7 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -41,7 +41,6 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo new Package { Id = "Microsoft.AspNetCore.Components.WebView", Version = "8.0.*" }, new Package { Id = "Microsoft.Extensions.FileProviders.Embedded", Version = "8.0.*" }, new Package { Id = "Microsoft.JSInterop", Version = "8.0.*" }, - new Package { Id = "System.Text.Json", Version = "8.0.*" }, }, Sources = { new BuildItem ("EmbeddedResource", "Resource.resx") { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj index 5109e4beef7..beb61d22655 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Xamarin.ProjectTools.csproj @@ -9,6 +9,8 @@ $(NoWarn);CA1305 <_IncludeMicrosoftBuildPackage>true annotations + + true @@ -28,7 +30,6 @@ - {E34BCFA0-CAA4-412C-AA1C-75DB8D67D157} diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsClassifier.cs b/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsClassifier.cs index 1507084dfc0..211baaf0948 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsClassifier.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsClassifier.cs @@ -208,7 +208,7 @@ public bool Matches (MethodDefinition method) return false; } - if (String.Compare (returnType, method.ReturnType.FullName, StringComparison.Ordinal) != 0) { + if (!TypeMatches (returnType, method.ReturnType.FullName)) { log.LogWarning ($"Method '{method.FullName}' doesn't match native callback signature (invalid return type: expected '{returnType}', found '{method.ReturnType.FullName}')"); return false; } @@ -223,7 +223,7 @@ public bool Matches (MethodDefinition method) parameterTypeName = pd.ParameterType.FullName; } - if (String.Compare (parameterTypeName, paramTypes[i], StringComparison.Ordinal) != 0) { + if (!TypeMatches (parameterTypeName, paramTypes[i])) { log.LogWarning ($"Method '{method.FullName}' doesn't match native callback signature, expected parameter type '{paramTypes[i]}' at position {i}, found '{parameterTypeName}'"); return false; } @@ -231,6 +231,29 @@ public bool Matches (MethodDefinition method) return true; } + + // Because these types are marshaled as different blittable types, + // we need to accept them as equivalent + static readonly (string Source, string Replacement)[] equivalent_types = [ + (Source: "System.Boolean", Replacement: "System.SByte"), + (Source: "System.Char", Replacement: "System.UInt16"), + ]; + + static bool TypeMatches (string type, string methodType) + { + if (String.Compare (type, methodType, StringComparison.Ordinal) == 0) + return true; + + foreach (var eq in equivalent_types) { + if (string.Compare (eq.Source, type, StringComparison.Ordinal) == 0 && string.Compare (eq.Replacement, methodType, StringComparison.Ordinal) == 0) + return true; + + if (string.Compare (eq.Source, methodType, StringComparison.Ordinal) == 0 && string.Compare (eq.Replacement, type, StringComparison.Ordinal) == 0) + return true; + } + + return false; + } } TypeDefinitionCache tdCache; diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj index 9586df6e7c1..fa1e6d9c76c 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj @@ -23,6 +23,8 @@ $(NoWarn);CA1310;CA1305 Nullable + + true