Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
"Size": 3036
},
"classes.dex": {
"Size": 22456
"Size": 22484
},
"lib/arm64-v8a/lib__Microsoft.Android.Resource.Designer.dll.so": {
"Size": 18288
},
"lib/arm64-v8a/lib_Java.Interop.dll.so": {
"Size": 86264
"Size": 86688
},
"lib/arm64-v8a/lib_Mono.Android.dll.so": {
"Size": 115072
"Size": 117712
},
"lib/arm64-v8a/lib_Mono.Android.Runtime.dll.so": {
"Size": 22432
"Size": 22384
},
"lib/arm64-v8a/lib_System.Console.dll.so": {
"Size": 24400
"Size": 24392
},
"lib/arm64-v8a/lib_System.Linq.dll.so": {
"Size": 25368
"Size": 25336
},
"lib/arm64-v8a/lib_System.Private.CoreLib.dll.so": {
"Size": 628960
"Size": 628216
},
"lib/arm64-v8a/lib_System.Runtime.dll.so": {
"Size": 20056
Expand All @@ -38,16 +38,16 @@
"Size": 20024
},
"lib/arm64-v8a/libarc.bin.so": {
"Size": 18832
"Size": 18872
},
"lib/arm64-v8a/libmono-component-marshal-ilgen.so": {
"Size": 36440
},
"lib/arm64-v8a/libmonodroid.so": {
"Size": 1524624
"Size": 1524752
},
"lib/arm64-v8a/libmonosgen-2.0.so": {
"Size": 3101160
"Size": 3101112
},
"lib/arm64-v8a/libSystem.Globalization.Native.so": {
"Size": 71976
Expand All @@ -62,10 +62,10 @@
"Size": 165000
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 18064
"Size": 19536
},
"META-INF/BNDLTOOL.RSA": {
"Size": 1223
"Size": 1221
},
"META-INF/BNDLTOOL.SF": {
"Size": 3266
Expand Down Expand Up @@ -98,5 +98,5 @@
"Size": 1904
}
},
"PackageSize": 3074581
"PackageSize": 3078677
}
17 changes: 11 additions & 6 deletions src/Xamarin.Android.Build.Tasks/Utilities/XAJavaTypeScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
using System.IO;

using System.Linq;
using Java.Interop.Tools.Cecil;
using Microsoft.Android.Build.Tasks;
using Microsoft.Build.Framework;
Expand All @@ -17,6 +17,7 @@ class XAJavaTypeScanner
// Names of assemblies which don't have Mono.Android.dll references, or are framework assemblies, but which must
// be scanned for Java types.
static readonly HashSet<string> SpecialAssemblies = new HashSet<string> (StringComparer.OrdinalIgnoreCase) {
"Java.Interop.dll",
"Mono.Android.dll",
"Mono.Android.Runtime.dll",
};
Expand All @@ -37,11 +38,15 @@ public XAJavaTypeScanner (AndroidTargetArch targetArch, TaskLoggingHelper log, T
public List<TypeDefinition> GetJavaTypes (ICollection<ITaskItem> inputAssemblies, XAAssemblyResolver resolver)
{
var types = new List<TypeDefinition> ();
foreach (ITaskItem asmItem in inputAssemblies) {
if (!ShouldScan (asmItem)) {
log.LogDebugMessage ($"[{targetArch}] Skipping Java type scanning in assembly '{asmItem.ItemSpec}'");
continue;
}
var inputItems = inputAssemblies
.Where (a => ShouldScan (a))
.ToList ();
var monoAndroid = inputItems.FirstOrDefault (a => Path.GetFileName (a.ItemSpec) == "Mono.Android.dll");
if (monoAndroid != null) {
inputItems.Remove (monoAndroid);
inputItems.Insert (0, monoAndroid);
}
foreach (ITaskItem asmItem in inputItems) {
log.LogDebugMessage ($"[{targetArch}] Scanning assembly '{asmItem.ItemSpec}' for Java types");

AndroidTargetArch arch = MonoAndroidHelper.GetTargetArch (asmItem);
Expand Down
11 changes: 11 additions & 0 deletions tests/Mono.Android-Tests/Java.Lang/ObjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using Android.Runtime;
using Android.Widget;

using Java.Interop;

using NUnit.Framework;

namespace Java.LangTests
Expand Down Expand Up @@ -83,6 +85,15 @@ public void NestedDisposeInvocations ()
value.Dispose ();
value.Dispose ();
}

[Test]
public void java_lang_Object_Is_Java_Lang_Object ()
{
Console.WriteLine ($"# jonp: java_lang_Object_Is_Java_Lang_Object!");
var jloType = global::Java.Interop.JniEnvironment.Runtime.TypeManager.GetType (new JniTypeSignature ("java/lang/Object"));
Assert.AreSame (typeof (Java.Lang.Object), jloType,
$"`java/lang/Object` is typemap'd to `{jloType}`, not `Java.Lang.Object, Mono.Android`!");
}
}

/*
Expand Down
Loading