Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langer2019-02-22 07:52:52 -0500
committerJonah Graham2019-02-26 02:02:01 -0500
commit730898c8d89ce3cfb986315edd154ceba08b99e1 (patch)
tree116c5d47de60f52a096919c983686ef90d31d9d5
parent49919595008edfc39b1454e7c635c0712d19c224 (diff)
downloadorg.eclipse.cdt-730898c8d89ce3cfb986315edd154ceba08b99e1.tar.gz
org.eclipse.cdt-730898c8d89ce3cfb986315edd154ceba08b99e1.tar.xz
org.eclipse.cdt-730898c8d89ce3cfb986315edd154ceba08b99e1.zip
Bug 544721 Retain rebuildState state when cloning build configs
When cloning build config, all its childrens' rebuildState and dirty state are maintained except for the states of AdditionalInput and InputOrder. With this change, we also retain their rebuildState and dirty state, if it is a clone (that is, copyId is true in the InputType). Change-Id: I63b2d38d0065e50357887bfccb340d458d2f4441 Signed-off-by: Philip Langer <planger@eclipsesource.com> (cherry picked from commit 90c82078ac31ecc426c5d5223b5c865dd620f2dd)
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java23
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java7
4 files changed, 38 insertions, 10 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
index 7e843ce629..bb90a81f34 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
-Bundle-Version: 8.6.1.qualifier
+Bundle-Version: 8.6.2.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java
index d1c6b57d32..dada8d82a1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 Intel Corporation and others.
+ * Copyright (c) 2005, 2019 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -12,6 +12,7 @@
* Intel Corporation - Initial API and implementation
* IBM Corporation
* Marc-Andre Laperle
+ * EclipseSource
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
@@ -131,6 +132,10 @@ public class AdditionalInput implements IAdditionalInput {
* @param additionalInput The existing AdditionalInput to clone.
*/
public AdditionalInput(IInputType parent, AdditionalInput additionalInput) {
+ this(parent, additionalInput, false);
+ }
+
+ public AdditionalInput(IInputType parent, AdditionalInput additionalInput, boolean retainRebuildState) {
this.fParent = parent;
fIsExtensionAdditionalInput = false;
@@ -143,8 +148,13 @@ public class AdditionalInput implements IAdditionalInput {
fKind = additionalInput.fKind;
}
- setDirty(true);
- setRebuildState(true);
+ if (retainRebuildState) {
+ setDirty(additionalInput.fIsDirty);
+ setRebuildState(additionalInput.fRebuildState);
+ } else {
+ setDirty(true);
+ setRebuildState(true);
+ }
}
/*
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java
index d03131f578..7b4444988c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 Intel Corporation and others.
+ * Copyright (c) 2005, 2019 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
* Contributors:
* Intel Corporation - Initial API and implementation
* IBM Corporation
+ * EclipseSource
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
@@ -93,6 +94,17 @@ public class InputOrder implements IInputOrder {
* @param inputOrder The existing InputOrder to clone.
*/
public InputOrder(IInputType parent, InputOrder inputOrder) {
+ this(parent, inputOrder, false);
+ }
+
+ /**
+ * Create an <code>InputOrder</code> based upon an existing InputOrder.
+ *
+ * @param parent The <code>IInputType</code> the InputOrder will be added to.
+ * @param inputOrder The existing InputOrder to clone.
+ * @param retainRebuildState Whether or not to retain the <code>rebuildState</code> and <code>dirty</code> state of <code>inputOrder</code>.
+ */
+ public InputOrder(IInputType parent, InputOrder inputOrder, boolean retainRebuildState) {
this.fParent = parent;
fIsExtensionInputOrder = false;
@@ -109,8 +121,13 @@ public class InputOrder implements IInputOrder {
fExcluded = inputOrder.fExcluded;
}
- setDirty(true);
- setRebuildState(true);
+ if (retainRebuildState) {
+ setDirty(inputOrder.fIsDirty);
+ setRebuildState(inputOrder.fRebuildState);
+ } else {
+ setDirty(true);
+ setRebuildState(true);
+ }
}
/*
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
index 843b7c3852..ebcfc85df2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 Intel Corporation and others.
+ * Copyright (c) 2005, 2019 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
* Contributors:
* Intel Corporation - Initial API and implementation
* IBM Corporation
+ * EclipseSource
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
@@ -282,13 +283,13 @@ public class InputType extends BuildObject implements IInputType {
// Clone the children
if (inputType.inputOrderList != null) {
for (InputOrder inputOrder : inputType.getInputOrderList()) {
- InputOrder newInputOrder = new InputOrder(this, inputOrder);
+ InputOrder newInputOrder = new InputOrder(this, inputOrder, copyIds);
getInputOrderList().add(newInputOrder);
}
}
if (inputType.additionalInputList != null) {
for (AdditionalInput additionalInput : inputType.getAdditionalInputList()) {
- AdditionalInput newAdditionalInput = new AdditionalInput(this, additionalInput);
+ AdditionalInput newAdditionalInput = new AdditionalInput(this, additionalInput, copyIds);
getAdditionalInputList().add(newAdditionalInput);
}
}

Back to the top