[#281] Improved interaction between Xtext builder and JDT #1156
Conversation
@cdietrich What do you think about this approach? |
org.eclipse.xtext.builder/src/org/eclipse/xtext/builder/impl/XtextBuilder.java
Show resolved
Hide resolved
...lipse.xtext.builder/src/org/eclipse/xtext/builder/impl/javasupport/JdtToBeBuiltComputer.java
Show resolved
Hide resolved
...ext.builder/src/org/eclipse/xtext/builder/impl/javasupport/SimpleProjectDependencyGraph.java
Show resolved
Hide resolved
org.eclipse.xtext.builder/src/org/eclipse/xtext/builder/impl/XtextBuilder.java
Show resolved
Hide resolved
...lipse.xtext.builder/src/org/eclipse/xtext/builder/impl/javasupport/JdtToBeBuiltComputer.java
Show resolved
Hide resolved
...lipse.xtext.builder/src/org/eclipse/xtext/builder/impl/javasupport/JdtToBeBuiltComputer.java
Show resolved
Hide resolved
...se.xtext.builder.tests/src/org/eclipse/xtext/builder/impl/SimpleProjectsIntegrationTest.java
Outdated
Show resolved
Hide resolved
...eclipse.xtext.builder/src/org/eclipse/xtext/builder/impl/IToBeBuiltComputerContribution.java
Show resolved
Hide resolved
org.eclipse.xtext.builder/src/org/eclipse/xtext/builder/impl/XtextBuilder.java
Show resolved
Hide resolved
...t.builder/src/org/eclipse/xtext/builder/impl/javasupport/ProjectClasspathChangeListener.java
Outdated
Show resolved
Hide resolved
org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/util/TestedWorkspaceWithJDT.java
Show resolved
Hide resolved
org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/util/TestedWorkspaceWithJDT.java
Show resolved
Hide resolved
Please take another look @cdietrich |
I added a test. Please re-examine. |
org.eclipse.xtext.builder.tests/src/org/eclipse/xtext/builder/impl/IntegrationTest.java
Show resolved
Hide resolved
if (queuedBuildData.needRebuild(getProject())) { | ||
needRebuild(); | ||
} | ||
pollQueuedBuildData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szarnekow this leads to a full build immediately following a project.build(clean)
is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have deltas for projects that are no related at
all.
but still the full build gets called for the project we called clean on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problematic call is the one in clean.
unfortunately
the taskqueue ist nailed down so hard to exchange.
will try with subclassing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't follow yet.
There is a clean on some unrelated project. And then you see a full build here?
@@ -495,6 +516,8 @@ protected boolean isOpened(IResourceDelta delta) { | |||
protected void clean(IProgressMonitor monitor) throws CoreException { | |||
SubMonitor progress = SubMonitor.convert(monitor, 10); | |||
try { | |||
pollQueuedBuildData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is the problematic call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. there is an unrelated project with deltas (on generated code)
this call leads to a needsRebuild.
the rebuild detects that the project that was cleaned has no lastcurrentbuildstate
and thus does an immediate fullbuild on the cleaned build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this correctly, some code / callgraph lead to unrelated projects being in the SimpleProjectDependencyGraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont see how simpleProjectdependencygraph is involved.
needsrebuild is globally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and org.eclipse.xtext.builder.impl.javasupport.JdtQueuedBuildData.doNeedRebuild(JavaBuilderState, Procedure1<? super UnconfirmedStructuralChangesDelta>)
does not care about any graphs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. The offending full-build trigger is not visible in this change set here but is 'legacy' from JdtQueuedBuildData.doNeedRebuild
- we may need the simpleProjectdependencygraph and check, if the project without delta is even related to the "asking" project. Would that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant we simply skip the clean part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
[#281] Improved interaction between Xtext builder and JDT