Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2020-10-27 12:51:54 +0000
committerAndrey Loskutov2020-10-28 11:37:31 +0000
commit65c524f971ac5b4879acdb1519283c0af0c4a311 (patch)
tree2508ee46c1a05f4f7e0eed45a46f8339e1a9ab4c
parent46ccfcd6080964a9923a854609a750325f2342ce (diff)
downloadeclipse.platform.resources-65c524f971ac5b4879acdb1519283c0af0c4a311.tar.gz
eclipse.platform.resources-65c524f971ac5b4879acdb1519283c0af0c4a311.tar.xz
eclipse.platform.resources-65c524f971ac5b4879acdb1519283c0af0c4a311.zip
Bug 568299 - rebuildRequested flag should cancel following build configsY20201030-1200Y20201029-1200Y20201028-1200I20201029-1800I20201028-1800
execution If one config requested rebuild, running following configs in same round only wastes resources. So we introduce a system flag that allows to skip the rest of the current build round and start again with the first config to be built. The flag can be set via system property -Dorg.eclipse.core.resources.allowEarlyInnerBuildLoopExit and by default early exit is not allowed. This avoids potential side effects with legacy software (so there will be no build behavior changes without extra system property). Change-Id: Ic59bf3227c98ee67bc937e7481d37d140d41c54e Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java
index ab9bf0d65..b8b9a4f05 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java
@@ -129,6 +129,14 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene
private ILock lock;
+ /**
+ * {@code true} if we can exit inner build loop cycle early after
+ * rebuildRequested is set by one build config and before following build
+ * configs are executed. Default is {@code false} to keep legacy behavior.
+ */
+ private static final boolean EARLY_EXIT_FROM_INNER_BUILD_LOOP_ALLOWED = System
+ .getProperty("org.eclipse.core.resources.allowEarlyInnerBuildLoopExit") != null; //$NON-NLS-1$
+
//used for the build cycle looping mechanism
private boolean rebuildRequested = false;
@@ -256,6 +264,11 @@ public class BuildManager implements ICoreConstants, IManager, ILifecycleListene
try {
for (int i = 0; i < commands.length; i++) {
checkCanceled(trigger, monitor);
+ if (EARLY_EXIT_FROM_INNER_BUILD_LOOP_ALLOWED && rebuildRequested) {
+ // Don't build following configs if one of the predecessors
+ // requested rebuild anyway, just start from scratch
+ break;
+ }
BuildCommand command = (BuildCommand) commands[i];
IProgressMonitor sub = Policy.subMonitorFor(monitor, 1);
IncrementalProjectBuilder builder = getBuilder(buildConfiguration, command, i, status, context);

Back to the top