From f8eb0fabec5b6434aec1847c9de02510d2485df9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 3 Dec 2020 13:00:20 +0100 Subject: [PATCH 1/4] [illink] Do not always preserve CharSequence Part of https://github.com/xamarin/xamarin-android/issues/5167 Added dynamic dependency where needed. Removed API from `BuildReleaseArm64False` test: Type Android.Runtime.CharSequence - Method public static SIGERR ToLocalJniHandle (System.Collections.Generic.IEnumerable`1) --- src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml | 1 - src/Mono.Android.Export/CallbackCode.cs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml b/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml index 4e27871023c..0093d322641 100644 --- a/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml +++ b/src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml @@ -3,7 +3,6 @@ - diff --git a/src/Mono.Android.Export/CallbackCode.cs b/src/Mono.Android.Export/CallbackCode.cs index c438a757503..6942414b682 100644 --- a/src/Mono.Android.Export/CallbackCode.cs +++ b/src/Mono.Android.Export/CallbackCode.cs @@ -26,6 +26,7 @@ class DynamicInvokeTypeInfo // NewArray(T[]) static readonly MethodInfo jnienv_newarray = GetTArrayToIntPtr (JNIEnv.NewArray); static readonly MethodInfo jnienv_getarray = GetIntPtrToTArray (JNIEnv.GetArray); + [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.CharSequence", "Mono.Android")] static readonly MethodInfo charsequence_tojnihandle = GetEnumerableCharToIntPtrMethodInfo (CharSequence.ToLocalJniHandle); static readonly MethodInfo jnienv_tojnihandle = GetObjectToIntPtrMethodInfo (JNIEnv.ToLocalJniHandle); static readonly MethodInfo jnienv_newstring = GetStringToIntPtrMethodInfo (JNIEnv.NewString); From 9572a0ddc74f2ddd70beb00b9fe188162a10b7a9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 3 Dec 2020 15:03:56 +0100 Subject: [PATCH 2/4] Fix build --- src/Mono.Android.Export/CallbackCode.cs | 1 + src/Mono.Android/Properties/AssemblyInfo.cs.in | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Mono.Android.Export/CallbackCode.cs b/src/Mono.Android.Export/CallbackCode.cs index 6942414b682..ab50637a297 100644 --- a/src/Mono.Android.Export/CallbackCode.cs +++ b/src/Mono.Android.Export/CallbackCode.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; diff --git a/src/Mono.Android/Properties/AssemblyInfo.cs.in b/src/Mono.Android/Properties/AssemblyInfo.cs.in index 3010a83ebfd..6c9971f494b 100644 --- a/src/Mono.Android/Properties/AssemblyInfo.cs.in +++ b/src/Mono.Android/Properties/AssemblyInfo.cs.in @@ -27,6 +27,7 @@ using System.Runtime.CompilerServices; [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Size))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SizeF))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SystemColors))] +[assembly: InternalsVisibleTo("Mono.Android.Export, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] [assembly: InternalsVisibleTo("Mono.Android-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] [assembly: InternalsVisibleTo("Java.Interop-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] [assembly: InternalsVisibleTo("Mono.Android-TestsMultiDex, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] From 995c95f26f21030d7b93ac5737edaa7b46a71272 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 4 Dec 2020 10:53:11 +0100 Subject: [PATCH 3/4] Remove forgotten code --- src/Mono.Android.Export/CallbackCode.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Mono.Android.Export/CallbackCode.cs b/src/Mono.Android.Export/CallbackCode.cs index ab50637a297..8814718d63e 100644 --- a/src/Mono.Android.Export/CallbackCode.cs +++ b/src/Mono.Android.Export/CallbackCode.cs @@ -27,7 +27,6 @@ class DynamicInvokeTypeInfo // NewArray(T[]) static readonly MethodInfo jnienv_newarray = GetTArrayToIntPtr (JNIEnv.NewArray); static readonly MethodInfo jnienv_getarray = GetIntPtrToTArray (JNIEnv.GetArray); - [DynamicDependency ("ToLocalJniHandle", "Android.Runtime.CharSequence", "Mono.Android")] static readonly MethodInfo charsequence_tojnihandle = GetEnumerableCharToIntPtrMethodInfo (CharSequence.ToLocalJniHandle); static readonly MethodInfo jnienv_tojnihandle = GetObjectToIntPtrMethodInfo (JNIEnv.ToLocalJniHandle); static readonly MethodInfo jnienv_newstring = GetStringToIntPtrMethodInfo (JNIEnv.NewString); From c7ea6d9d519633a94819725a6b03ad642920a894 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 4 Dec 2020 10:54:29 +0100 Subject: [PATCH 4/4] Revert "Fix build" This reverts commit 9572a0ddc74f2ddd70beb00b9fe188162a10b7a9. --- src/Mono.Android.Export/CallbackCode.cs | 1 - src/Mono.Android/Properties/AssemblyInfo.cs.in | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Mono.Android.Export/CallbackCode.cs b/src/Mono.Android.Export/CallbackCode.cs index 8814718d63e..c438a757503 100644 --- a/src/Mono.Android.Export/CallbackCode.cs +++ b/src/Mono.Android.Export/CallbackCode.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; diff --git a/src/Mono.Android/Properties/AssemblyInfo.cs.in b/src/Mono.Android/Properties/AssemblyInfo.cs.in index 6c9971f494b..3010a83ebfd 100644 --- a/src/Mono.Android/Properties/AssemblyInfo.cs.in +++ b/src/Mono.Android/Properties/AssemblyInfo.cs.in @@ -27,7 +27,6 @@ using System.Runtime.CompilerServices; [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Size))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SizeF))] [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SystemColors))] -[assembly: InternalsVisibleTo("Mono.Android.Export, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] [assembly: InternalsVisibleTo("Mono.Android-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] [assembly: InternalsVisibleTo("Java.Interop-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] [assembly: InternalsVisibleTo("Mono.Android-TestsMultiDex, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]