Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-06-14 14:07:25 -0400
committerSean Evoy2004-06-14 14:07:25 -0400
commit7e9807c15f482eee2b166a1afa447649473c9d9e (patch)
tree1de2350a53e1c4d7e1e339412e62695d514428ff /build/org.eclipse.cdt.managedbuilder.core
parent066c13ce245a1ee74563d7c6db063b0719786db3 (diff)
downloadorg.eclipse.cdt-7e9807c15f482eee2b166a1afa447649473c9d9e.tar.gz
org.eclipse.cdt-7e9807c15f482eee2b166a1afa447649473c9d9e.tar.xz
org.eclipse.cdt-7e9807c15f482eee2b166a1afa447649473c9d9e.zip
Fix for bug 59238 - Tool command option not getting cloned
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index d512be1269e..e1f0ac094e7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
@@ -87,26 +87,39 @@ public class Configuration extends BuildObject implements IConfiguration {
* Create a new configuration based on one already defined.
*
* @param target The <code>Target</code> the receiver will be added to.
- * @param parent The <code>IConfiguration</code> to copy the settings from.
+ * @param parentConfig The <code>IConfiguration</code> to copy the settings from.
* @param id A unique ID for the configuration.
*/
- public Configuration(Target target, IConfiguration parent, String id) {
+ public Configuration(Target target, IConfiguration parentConfig, String id) {
this.id = id;
- this.name = parent.getName();
+ this.name = parentConfig.getName();
this.target = target;
- this.parent = parent;
+
+ // If this contructor is called to clone an existing
+ // configuration, the parent of the parent should be stored.
+ // As of 2.0, there is still one single level of inheritence to
+ // worry about
+ parent = parentConfig.getParent() == null ? parentConfig : parentConfig.getParent();
// Check that the tool and the project match
IProject project = (IProject) target.getOwner();
// Get the tool references from the parent
- List parentToolRefs = ((Configuration)parent).getLocalToolReferences();
+ List parentToolRefs = ((Configuration)parentConfig).getLocalToolReferences();
Iterator iter = parentToolRefs.listIterator();
while (iter.hasNext()) {
ToolReference toolRef = (ToolReference)iter.next();
// Make a new ToolReference based on the tool in the ref
- ToolReference newRef = new ToolReference(this, toolRef.getTool());
+ ITool parentTool = toolRef.getTool();
+ ToolReference newRef = new ToolReference(this, parentTool);
+
+ // The reference may have a different command than the parent tool
+ String refCmd = toolRef.getToolCommand();
+ if (!refCmd.equals(parentTool.getToolCommand())) {
+ newRef.setToolCommand(refCmd);
+ }
+
List optRefs = toolRef.getOptionReferenceList();
Iterator optIter = optRefs.listIterator();
while (optIter.hasNext()) {

Back to the top