-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support incremental build for Javac #535
Support incremental build for Javac #535
Conversation
org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/VirtualClassFile.java
Outdated
Show resolved
Hide resolved
I think you can already merge the 1st commit ( 585db98 ) if you think it's good enough. For the 2nd one, we should spend some a bit more time reviewing it to evaluate whether we can find some idea that doesn't require change in JDT API. |
4144527
to
22ef37e
Compare
206803d
to
b8c8b50
Compare
As we discussed, the compiler itself (e.g., ECJ, Javac) doesn't provide incremental build capabilities. Instead, it's the wrappers like @mickaelistria WDYT? |
ce3797c
to
d8c82c8
Compare
Thanks; I'm not sure I fully get the problem, so I'm going to ask probably dumb questions, sorry! I'm trying to get a clear enough understanding of what really needs to change in JDT. Do I understand it right that:
What is the particular point requiring change in JDT? |
They are great questions.
Yes, we don't need change the API for CompilationResult. We can create subtype to populate the ClassFile and other state data to CompilationResult without making changes to JDT.
The existing writeClassFile brings two issues for Javac:
Lines 935 to 951 in 8397f18
Lines 874 to 884 in 8397f18
|
OK, I see. So the expectation is that the Compiler doesn't directly modify the class files here, but instead that it returns the bytes, and the ImageBuilder takes care of persisting the bytes where it makes sense. |
8397f18
to
1d841cc
Compare
Generating Javac result into a temp directory might work. But we definitely need to find ways to clean the temp output with the clean build or rename operations. I can make some experiment to see how far it can go. |
Another question about the |
I rebased the dom-with-javac branch on top of upstream JDT master branch. As a result, all the commits that are not from upstream appear as new in the PR. |
fd888a3
to
0ad2048
Compare
…lt to support incremental build
d8c82c8
to
d296711
Compare
That looks good, the design seems to use perfectly existing JDT capabilities. I'll merge it as soon as build completes. |
from the feature point of view, the new approach can effectively support incremental build and it's ready for merge. I'm ok to merge it first. I'll see how to add some unit tests later. |
454ed58
into
eclipse-jdtls:dom-with-javac
Thank you for this excellent addition! |
Fixes #443
Fixes #532