Skip to content

Commit c8cfec6

Browse files
committed
fix: remove redundant IncrementalProjectBuilder.needRebuild() from BuildContext
BuildContext.needRebuild() served two purposes: 1. Set the internal rebuildRequired flag (consumed by RebuildingXtextBuilder.doBuild()'s internal rebuild loop) 2. Call builder.needRebuild() which tells Eclipse to re-invoke the entire build() method for this project in the next round Purpose (2) is redundant because purpose (1) already drives re-processing of generated sources via the internal loop (up to 2 extra iterations in doBuild()). The Eclipse-level needRebuild() causes unnecessary re-invocations of the builder that cascade through the workspace dependency graph: each builder participant that writes a generated file triggers needRebuild(), Eclipse re-schedules the project, which produces more workspace changes, triggering builds in dependent projects, and so on. This resulted in unrelated projects (e.g. intfdef.core) being fully rebuilt when editing files in completely unrelated projects (e.g. assistant.chat.ui). Remove the builder.needRebuild() call while keeping the internal rebuildRequired flag that drives the RebuildingXtextBuilder's own rebuild loop.
1 parent 06de656 commit c8cfec6

File tree

1 file changed

+6
-3
lines changed
  • com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder

1 file changed

+6
-3
lines changed

com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/BuildContext.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,12 @@ public ResourceSet getResourceSet() {
117117
@Override
118118
public void needRebuild() {
119119
rebuildRequired = true;
120-
if (builder != null) {
121-
builder.needRebuild();
122-
}
120+
// Don't call builder.needRebuild() here. The RebuildingXtextBuilder's internal
121+
// rebuild loop (rebuilds <= 2 in doBuild()) already handles re-processing of
122+
// generated sources. Calling builder.needRebuild() additionally tells Eclipse to
123+
// re-invoke the entire build() method for this project in the next auto-build round,
124+
// which causes redundant builder re-invocations that cascade through the workspace
125+
// dependency graph.
123126
}
124127

125128
/**

0 commit comments

Comments
 (0)