Open davsclaus opened 2 years ago
This prototype is working with Apache Camel where we can now compile multiple files in the same unit, which means they can have dependency between them, such as creating or injecting new instances:
foo -> bar <- baz
Today I made a prototype of this PR as a local copy in Apache Camel to try and test it for Camel. https://issues.apache.org/jira/browse/CAMEL-17784
This is working, and I can even have it hot-reload if I modify the .java source code and have jOOR able to re-compile and from Camel point of view then use the updated classes.
Thanks, @davsclaus. I'll check it out next week.
Here is a first cut prototype for compiling multiple files in one go, which allows these classes to be dependent on each other.
The code can surely be polished, and I was only focusing on making the Compile to work for multiple files, and not as much on a nice end user API.
I tried to avoid changing in existing files. I only added a
compileUnit
method toReflect
which gives access to do the multiple compiler.We can likely find another API to avoid any changes to existing, if desired.
We need this for Apache Camel so I would like to help more if @lukaseder would consider accepting this function in his excellent library. (cc @lburgazzoli)