Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2003-10-01 22:56:46 -0400
committerDoug Schaefer2003-10-01 22:56:46 -0400
commit0e11088e84be6fa6d92d8a900fbc28f7b24b62a0 (patch)
tree8cda8928ce2a8ca42ce61ffa39ef310f4ee1126f
parentcc6084024dd2af4d5b3c4287f5e9fbae20d84a2a (diff)
downloadorg.eclipse.cdt-0e11088e84be6fa6d92d8a900fbc28f7b24b62a0.tar.gz
org.eclipse.cdt-0e11088e84be6fa6d92d8a900fbc28f7b24b62a0.tar.xz
org.eclipse.cdt-0e11088e84be6fa6d92d8a900fbc28f7b24b62a0.zip
Patch for Sean Evoy:
Details in ChangeLog.
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/ChangeLog15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java48
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java4
3 files changed, 66 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
index 9de80e413e..35655878af 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
@@ -1,4 +1,19 @@
2003-10-01 Sean Evoy
+ Final fix for bugs 44020.
+ The problem lay with the way that new projects were being created when the
+ root configuration of the project had tool references overriding options.
+ What the new configuration should have been doing is making a personal copy
+ of the tool reference and its options. Instead, they were all sharing the
+ parents. Seems simple enough now that I found it.
+
+ OptionReference provides a method to retreive its option (so new
+ OptionReferences can be cloned).
+ * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+
+ Configuration now behaves correctly when it is created from another configuration.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+
+2003-10-01 Sean Evoy
Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of
project natures that the tool should be filtered against in the build model
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 d953336751..a223de8147 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
@@ -66,8 +66,54 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
this.parent = parent;
+ // Check that the tool and the project match
+ IProject project = (IProject) target.getOwner();
+
// Get the tool references from the parent
- getLocalToolReferences().addAll(((Configuration)parent).getLocalToolReferences());
+ List parentToolRefs = ((Configuration)parent).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());
+ List optRefs = toolRef.getLocalOptionRefs();
+ Iterator optIter = optRefs.listIterator();
+ while (optIter.hasNext()) {
+ OptionReference optRef = (OptionReference)optIter.next();
+ IOption opt = optRef.getOption();
+ try {
+ switch (opt.getValueType()) {
+ case IOption.BOOLEAN:
+ new OptionReference(newRef, opt).setValue(optRef.getBooleanValue());
+ break;
+ case IOption.STRING:
+ new OptionReference(newRef, opt).setValue(optRef.getStringValue());
+ break;
+ case IOption.ENUMERATED:
+ new OptionReference(newRef, opt).setValue(optRef.getSelectedEnum());
+ break;
+ case IOption.STRING_LIST :
+ new OptionReference(newRef, opt).setValue(optRef.getStringListValue());
+ break;
+ case IOption.INCLUDE_PATH :
+ new OptionReference(newRef, opt).setValue(optRef.getIncludePaths());
+ break;
+ case IOption.PREPROCESSOR_SYMBOLS :
+ new OptionReference(newRef, opt).setValue(optRef.getDefinedSymbols());
+ break;
+ case IOption.LIBRARIES :
+ new OptionReference(newRef, opt).setValue(optRef.getLibraries());
+ break;
+ case IOption.OBJECTS :
+ new OptionReference(newRef, opt).setValue(optRef.getUserObjects());
+ break;
+ }
+ } catch (BuildException e) {
+ continue;
+ }
+ }
+ }
target.addConfiguration(this);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
index 265f820e27..b1bd81e882 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
@@ -319,6 +319,10 @@ public class OptionReference implements IOption {
(String[])builtIns.toArray(new String[builtIns.size()]);
}
+ public IOption getOption() {
+ return option;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
*/

Back to the top