Skip to content
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

Multi compile java9 #119

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

davsclaus
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants