summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Eidsness2013-03-18 16:51:43 (EDT)
committer Doug Schaefer2013-03-21 15:50:50 (EDT)
commit178b505535690042301a73187c97523e55c2053d (patch)
treeeaee15259f3485639c3100e43f1221da04a17632
parent7728d48724f0f89b664220060fb1c27de6a43d04 (diff)
downloadorg.eclipse.cdt-178b505535690042301a73187c97523e55c2053d.zip
org.eclipse.cdt-178b505535690042301a73187c97523e55c2053d.tar.gz
org.eclipse.cdt-178b505535690042301a73187c97523e55c2053d.tar.bz2
Bug 403670: Do no work on parallel rebuilds if nothing changedrefs/changes/86/11286/2
This fixes the parallel build case (for the InternalBuilder) to update the configuration build state on successful builds. Because parallel builds follow a different code path than the non-parallel case, updating the state was misssed. Change-Id: Idab10c39c3093a731fe6961b451d0fdb5975f240 Reviewed-on: https://git.eclipse.org/r/11286 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java9
2 files changed, 12 insertions, 3 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
index e48974c..7618eea 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
@@ -128,6 +128,12 @@ public class InternalBuildRunner extends AbstractBuildRunner {
status = dBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
} else {
status = ParallelBuilder.build(des, null, null, stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK), resumeOnErr, buildIncrementaly);
+ // Bug 403670:
+ // Make sure the build configuration's rebuild status is updated with the result of
+ // this successful build. In the non-parallel case this happens within dBuilder.build
+ // (the cBS is passed as an instance of IResourceRebuildStateContainer).
+ if (status == ParallelBuilder.STATUS_OK)
+ cBS.setState(0);
buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("CommonBuilder.7", Integer.toString(ParallelBuilder.lastThreadsUsed))); //$NON-NLS-1$
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java
index b6e41fd..6295a54 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java
@@ -200,6 +200,9 @@ public class ParallelBuilder {
* @param monitor Progress monitor
* @param resumeOnErrors If true, build process will not stop when
* compilation errors encountered
+ * @return the status of the operation, one of {@link ParallelBuilder#STATUS_OK},
+ * {@link ParallelBuilder#STATUS_ERROR}, {@link ParallelBuilder#STATUS_CANCELED}, or {@link
+ * ParallelBuilder#STATUS_INVALID}. *
*/
static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err, IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally) {
IConfiguration cfg = des.getConfiguration();
@@ -214,12 +217,12 @@ public class ParallelBuilder {
builder.sortQueue();
monitor.beginTask("", builder.queue.size()); //$NON-NLS-1$
BuildProcessManager buildProcessManager = new BuildProcessManager(out, err, true, threads);
- builder.dispatch(buildProcessManager);
+ int status = builder.dispatch(buildProcessManager);
lastThreadsUsed = buildProcessManager.getThreadsUsed();
monitor.done();
- return IBuildModelBuilder.STATUS_OK;
+ return status;
}
-
+
/**
* Initializes parallel builder
*/