-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaCallableWrapperGenerator uses XML? #540
Comments
Just some notes that were raised:
|
More recent random thoughts… We're now ".NET", not Xamarin.Android, and as part of that migration we now use the .NET linker in the Release configuration. The .NET linker runs a pipeline of linker steps, which .NET Android controls via the A thought of ours, to "force" cleanup of the .NET Android Debug builds also need to do "linker-like" things, such as If these ideas pan out, it means that this idea is moot: there wouldn't need to be an XML intermediary, because Java Callable Wrapper generation would be a linker step which could run before |
Context: #540 Refactor `Java.Interop.Tools.JavaCallableWrappers` to be more maintainable and modular. Adopts the same architecture as `generator`: using a `CecilImporter` to import data from a compiled assembly into an intermediate model. Java code is then generated from the intermediate model. Refactoring and updating this code should make it not only more maintainable, but also easier to extend with potential upcoming features we are considering: - Moving `jcw-gen` into the `ILLink` pipeline - [Sanity-check Java Callable Wrappers][0] - Possibly creating a Kotlin backend [0]: dotnet/android#4278
Context: https://xamarinhq.slack.com/archives/C03CEGRUW/p1574437340441800
Java.Interop.Tools.JavaCallableWrappers.JavaCallableWrapperGenerator
reads assemblies viaMono.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: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 asgenerator
'sapi.xml
files, and then update the linker to generate this XML file as part of it's operation.This would allow
JavaCallableWrapperGenerator
to not useMono.Cecil
in order to operate, which may be desirable.The text was updated successfully, but these errors were encountered: