jOOQ / jOOR

jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.
http://www.jooq.org/products
Apache License 2.0
2.8k stars 377 forks source link

Multi compile java9 #119

Open davsclaus opened 2 years ago

davsclaus commented 2 years ago

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 to Reflect 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)

davsclaus commented 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

davsclaus commented 2 years ago

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.

lukaseder commented 2 years ago

Thanks, @davsclaus. I'll check it out next week.