Skip to content

JavaCallableWrapperGenerator uses XML? #540

@jonpryor

Description

@jonpryor

Context: https://xamarinhq.slack.com/archives/C03CEGRUW/p1574437340441800

Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator reads assemblies via Mono.Cecil in order to write Java Callable Wrappers.

Is this actually desirable?

One of the impacts to this decision is that the Xamarin.Android linker can't fully link; it must preserve [Register] custom attributes so that the Java Callable Wrappers can be generated, and then a later linker step must be run to remove all of the [Register] attributes:

i wonder if the linker could generate a file of "here's the remaining things that need java stubs (with Register data)", then[JavaCallableWrapperGenerator] could work from that file instead of needing to Cecil the assembly, and then linker could remove [Register] at the same time, so we don't need to do that Cecil either
cut out 2 full cecil loads and enumerations

There have also been mutterings of migrating parts of the <GenerateJavaStubs/> task to use System.Reflection.Metadata from Cecil, or to make it suitable for use with Incremental Builds.

It may be desirable to have JavaCallableWrapperGenerator instead process an XML description of the types to generate, possibly using the same XML format as generator's api.xml files, and then update the linker to generate this XML file as part of it's operation.

This would allow JavaCallableWrapperGenerator to not use Mono.Cecil in order to operate, which may be desirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    callable-wrappersIssues with Java Callable Wrappers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions