Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorLeo Treggiari2005-08-23 22:01:17 +0000
committerLeo Treggiari2005-08-23 22:01:17 +0000
commita1ccd95cad8f2e29c129852f2c9c1feea77ef0e3 (patch)
treea39fe27fde75ef9c6ab3faf8eb7b07f62c3d8d8f /build
parentfece65cbf3761d02f0e38c16a8595e51b45e022d (diff)
downloadorg.eclipse.cdt-a1ccd95cad8f2e29c129852f2c9c1feea77ef0e3.tar.gz
org.eclipse.cdt-a1ccd95cad8f2e29c129852f2c9c1feea77ef0e3.tar.xz
org.eclipse.cdt-a1ccd95cad8f2e29c129852f2c9c1feea77ef0e3.zip
Apply Bob M. patch for browseType and resourceFilter attributes.
Fix problem with overridesOnlyValue uncovered by Bob's fix.
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java2
7 files changed, 62 insertions, 20 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
index 92abd8fedbe..ba8910af075 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
@@ -395,6 +395,7 @@ public interface IOption extends IBuildObject {
* of its superclass and <code>false</code> if it overrides other attributes.
*
* @return boolean
+ * @deprecated
*/
public boolean overridesOnlyValue();
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 08385ddd043..c881fd5df63 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
@@ -704,13 +704,13 @@ public class Configuration extends BuildObject implements IConfiguration {
IOption retOpt = option;
if (option.getBooleanValue() != value) {
if (option.isExtensionElement()) {
- // If the extension element is only overriding the "value" of its superclass, hook the
+ // If the extension element was created from an MBS 2.0 model OptionReference element, hook the
// new option up to its superclass directly. This is to avoid references to oddly id'ed
// elements that are automatically generated from V2.0 model optionReferences. If these
// end up in the project file, then the project could have a problem when the integration
// provider switches to providing the new model.
IOption newSuperClass = option;
- if (option.overridesOnlyValue()) {
+ if (((Option)option).wasOptRef()) {
newSuperClass = option.getSuperClass();
}
// Create an Option element for the managed build project file (.CDTBUILD)
@@ -738,13 +738,13 @@ public class Configuration extends BuildObject implements IConfiguration {
oldValue = option.getStringValue();
if (oldValue != null && !oldValue.equals(value)) {
if (option.isExtensionElement()) {
- // If the extension element is only overriding the "value" of its superclass, hook the
+ // If the extension element was created from an MBS 2.0 model OptionReference element, hook the
// new option up to its superclass directly. This is to avoid references to oddly id'ed
// elements that are automatically generated from V2.0 model optionReferences. If these
// end up in the project file, then the project could have a problem when the integration
// provider switches to providing the new model.
IOption newSuperClass = option;
- if (option.overridesOnlyValue()) {
+ if (((Option)option).wasOptRef()) {
newSuperClass = option.getSuperClass();
}
// Create an Option element for the managed build project file (.CDTBUILD)
@@ -792,13 +792,13 @@ public class Configuration extends BuildObject implements IConfiguration {
}
if(!Arrays.equals(value, oldValue)) {
if (option.isExtensionElement()) {
- // If the extension element is only overriding the "value" of its superclass, hook the
+ // If the extension element was created from an MBS 2.0 model OptionReference element, hook the
// new option up to its superclass directly. This is to avoid references to oddly id'ed
// elements that are automatically generated from V2.0 model optionReferences. If these
// end up in the project file, then the project could have a problem when the integration
// provider switches to providing the new model.
IOption newSuperClass = option;
- if (option.overridesOnlyValue()) {
+ if (((Option)option).wasOptRef()) {
newSuperClass = option.getSuperClass();
}
// Create an Option element for the managed build project file (.CDTBUILD)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java
index d1dccbb1167..8561f59c3de 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java
@@ -232,7 +232,7 @@ public class HoldsOptions extends BuildObject implements IHoldsOptions {
IOption ourOpt = (IOption)ourOpts.get(i);
int j;
for (j = 0; j < options.length; j++) {
- if (options[j].overridesOnlyValue()) {
+ if (((Option)options[j]).wasOptRef()) {
if (ourOpt.getSuperClass() != null // Remove assumption that ALL options must have superclasses
&& ourOpt.getSuperClass().getId().equals(options[j].getSuperClass().getId())) {
options[j] = ourOpt;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
index 68d3ea0be99..431732cd3c3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
@@ -78,6 +78,8 @@ public class Option extends BuildObject implements IOption {
private boolean verified = false;
private boolean isValid = true; /** False for options which are invalid. getOption()
* routines will ignore invalid options. */
+ private boolean wasOptRef = false; /** True for options which are created because of an
+ * MBS 2.0 model OptionReference element
/*
* C O N S T R U C T O R S
@@ -303,7 +305,13 @@ public class Option extends BuildObject implements IOption {
// Determine if there needs to be a browse button
String browseTypeStr = element.getAttribute(BROWSE_TYPE);
- if (browseTypeStr == null || browseTypeStr.equals(NONE)) {
+ if (browseTypeStr == null) {
+ // Set to null, to indicate no browse type specification
+ // This will allow any superclasses to be searched for the
+ // browse type specification, and thus inherited, if found,
+ // which they should be
+ browseType = null;
+ } else if (browseTypeStr.equals(NONE)) {
browseType = new Integer(BROWSE_NONE);
} else if (browseTypeStr.equals(FILE)) {
browseType = new Integer(BROWSE_FILE);
@@ -315,7 +323,13 @@ public class Option extends BuildObject implements IOption {
// Get the resourceFilter attribute
String resFilterStr = element.getAttribute(RESOURCE_FILTER);
- if (resFilterStr == null || resFilterStr.equals(ALL)) {
+ if (resFilterStr == null) {
+ // Set to null, to indicate no resource filter specification
+ // This will allow any superclasses to be searched for the
+ // resource filter specification, and thus inherited, if found,
+ // which they should be
+ resourceFilter = null;
+ } else if (resFilterStr.equals(ALL)) {
resourceFilter = new Integer(FILTER_ALL);
} else if (resFilterStr.equals(FILE)) {
resourceFilter = new Integer(FILTER_FILE);
@@ -496,8 +510,15 @@ public class Option extends BuildObject implements IOption {
// Determine if there needs to be a browse button
if (element.hasAttribute(BROWSE_TYPE)) {
String browseTypeStr = element.getAttribute(BROWSE_TYPE);
- if (browseTypeStr == null || browseTypeStr.equals(NONE)) {
- browseType = new Integer(BROWSE_NONE);
+
+ if (browseTypeStr == null) {
+ // Set to null, to indicate no browse type specification
+ // This will allow any superclasses to be searched for the
+ // browse type specification, and thus inherited, if found,
+ // which they should be
+ browseType = null;
+ } else if (browseTypeStr.equals(NONE)) {
+ browseType = new Integer(BROWSE_NONE);
} else if (browseTypeStr.equals(FILE)) {
browseType = new Integer(BROWSE_FILE);
} else if (browseTypeStr.equals(DIR)) {
@@ -515,8 +536,14 @@ public class Option extends BuildObject implements IOption {
// Get the resourceFilter attribute
if (element.hasAttribute(RESOURCE_FILTER)) {
String resFilterStr = element.getAttribute(RESOURCE_FILTER);
- if (resFilterStr == null || resFilterStr.equals(ALL)) {
- resourceFilter = new Integer(FILTER_ALL);
+ if (resFilterStr == null) {
+ // Set to null, to indicate no resource filter specification
+ // This will allow any superclasses to be searched for the
+ // resource filter specification, and thus inherited, if found,
+ // which they should be
+ resourceFilter = null;
+ } else if (resFilterStr.equals(ALL)) {
+ resourceFilter = new Integer(FILTER_ALL);
} else if (resFilterStr.equals(FILE)) {
resourceFilter = new Integer(FILTER_FILE);
} else if (resFilterStr.equals(PROJECT)) {
@@ -1477,6 +1504,7 @@ public class Option extends BuildObject implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#overridesOnlyValue()
+ * Deprecated since 3.0.1
*/
public boolean overridesOnlyValue() {
if (superClass != null &&
@@ -1710,6 +1738,18 @@ public class Option extends BuildObject implements IOption {
}
/**
+ * @return Returns true if this Option was created from an MBS 2.0 model
+ * OptionReference element.
+ */
+ public boolean wasOptRef() {
+ return wasOptRef;
+ }
+
+ public void setWasOptRef(boolean was) {
+ wasOptRef = was;
+ }
+
+ /**
* @return Returns the version.
*/
public PluginVersionIdentifier getVersion() {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
index bc25d63c41a..3eca00f38c8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
@@ -777,12 +777,12 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
newSuperClass = newSuperClass.getSuperClass();
}
if (newSuperClass.isExtensionElement()) {
- // If the extension element is only overriding the "value" of its superclass, hook the
+ // If the extension element was created from an MBS 2.0 model OptionReference element, hook the
// new option up to its superclass directly. This is to avoid references to oddly id'ed
// elements that are automatically generated from V2.0 model optionReferences. If these
// end up in the project file, then the project could have a problem when the integration
// provider switches to providing the new model.
- if (newSuperClass.overridesOnlyValue()) {
+ if (((Option)newSuperClass).wasOptRef()) {
newSuperClass = newSuperClass.getSuperClass();
}
}
@@ -817,12 +817,12 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
newSuperClass = newSuperClass.getSuperClass();
}
if (newSuperClass.isExtensionElement()) {
- // If the extension element is only overriding the "value" of its superclass, hook the
+ // If the extension element was created from an MBS 2.0 model OptionReference element, hook the
// new option up to its superclass directly. This is to avoid references to oddly id'ed
// elements that are automatically generated from V2.0 model optionReferences. If these
// end up in the project file, then the project could have a problem when the integration
// provider switches to providing the new model.
- if (newSuperClass.overridesOnlyValue()) {
+ if (((Option)newSuperClass).wasOptRef()) {
newSuperClass = newSuperClass.getSuperClass();
}
}
@@ -880,12 +880,12 @@ public class ResourceConfiguration extends BuildObject implements IResourceConfi
newSuperClass = newSuperClass.getSuperClass();
}
if (newSuperClass.isExtensionElement()) {
- // If the extension element is only overriding the "value" of its superclass, hook the
+ // If the extension element was created from an MBS 2.0 model OptionReference element, hook the
// new option up to its superclass directly. This is to avoid references to oddly id'ed
// elements that are automatically generated from V2.0 model optionReferences. If these
// end up in the project file, then the project could have a problem when the integration
// provider switches to providing the new model.
- if (newSuperClass.overridesOnlyValue()) {
+ if (((Option)newSuperClass).wasOptRef()) {
newSuperClass = newSuperClass.getSuperClass();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
index be8e1122645..faec831b34a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
@@ -1091,6 +1091,7 @@ public class Target extends BuildObject implements ITarget {
// Set the option attributes
newOption.setValue(optRef.getValue());
newOption.setValueType(optRef.getValueType());
+ ((Option)newOption).setWasOptRef(true);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
index a80e4fcacfd..ec1bec9a00e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
@@ -2511,7 +2511,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
case IManagedDependencyGenerator.TYPE_EXTERNAL:
IResource[] res = depGen.findDependencies(resource, project);
for (int i=0; i<res.length; i++) {
- IPath dep = res[i].getFullPath();
+ IPath dep = res[i].getProjectRelativePath();
deps.add(dep);
}
break;

Back to the top