You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[XABT] Move scanning for ACW map JLOs to FindJavaObjectsStep. (#9930)
Context: ea399ed
Context: 25d1f00
Context: https://github.com/xamarin/monodroid/commit/a04b73b30e5bbd81b3773865c313a8084f0a21d1
Context: dotnet/java-interop@bc44f08
Building on ea399ed, move the process of scanning for
`Java.Lang.Object` and `Java.Lang.Throwable` subclasses needed for
the `acw-map.txt` generation task to the `FindJavaObjectsStep`
"linker step".
For an example of what `acw-map.txt` is for, see 25d1f00 and see the
"`<R8/>` and `acw-map.txt` parsing" section.
This process currently captures `interface` types, which
`JavaCallableWrappers` doesn't support. Expanding the Java Callable
Wrapper serialization format (dotnet/java-interop@bc44f085) to allow
interfaces and other `acw-map.txt`-needed data it didn't already
support resulted in a lot of extra processing and waste.
Instead, expand the `.jlo.xml` file to have two sections, one for JCW
needed data and one for `acw-map.txt` needed data:
<api>
<jcw-types>
<type name="MainActivity"
package="crc645107ba1b8b6ee4d3"
application_java_class="android.app.Application"
mono_runtime_initialization="mono.MonoPackageManager.LoadApplication (context);"
extends_type="android.app.Activity"
partial_assembly_qualified_name="tempbuild.MainActivity, tempbuild">
<constructors>
<constructor name="MainActivity"
method="n_.ctor:()V:"
jni_signature="()V"
managed_parameters=""
retval="void"
is_dynamically_registered="True" />
</constructors>
<methods>
<method name="clone"
method="n_clone:()Ljava/lang/Object;:GetCloneHandler"
jni_signature="()Ljava/lang/Object;"
retval="java.lang.Object" />
<method name="onCreate"
method="n_onCreate:(Landroid/os/Bundle;)V:GetOnCreate_Landroid_os_Bundle_Handler"\
jni_signature="(Landroid/os/Bundle;)V"
params="android.os.Bundle p0"
retval="void"
super_call="p0"
activate_call="p0" />
</methods>
</type>
</jcw-types>
<acw-types partial-assembly-name="tempbuild" module-name="tempbuild.dll">
<type
assembly-qualified-name="tempbuild.MainActivity, tempbuild, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
compat-jni-name="tempbuild.MainActivity"
java-key="crc645107ba1b8b6ee4d3.MainActivity"
managed-key="tempbuild.MainActivity"
partial-assembly-qualified-name="tempbuild.MainActivity, tempbuild" />
</acw-types>
</api>
Additionally, for assemblies that cannot contain `Java.Lang.Object`
subclasses that we do not need to scan (e.g. `System.Runtime.dll`),
we no longer write an "empty" XML file like this:
<types was_scanned="False" />
Instead, we now write an actual empty (0 byte) file to disk, which
saves build time when deserializing.
As with ea399ed, this temporarily leaves the old `acw-map.txt`
generation code in place, guarded behind the
`$(_AndroidJLOCheckedBuild)` MSBuild property. This property generates
the `acw-map.txt` file in both the new and old way, and emits a build
error if there are differences. (A consistent sort was added so that
both maps are sorted the same.)
TODO: re-evaluate `acw-map.txt` semantics: does it *need* interfaces?
0 commit comments