Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSean Evoy2004-08-05 10:30:42 -0400
committerSean Evoy2004-08-05 10:30:42 -0400
commit39dd636454e8559471c4a86f4a4c0a85b507436b (patch)
tree83646004a057f3effd07c474980bd533bc037157 /build
parent172c988cf8d3eba6f968194ea89b55c0dd2b6f5a (diff)
downloadorg.eclipse.cdt-39dd636454e8559471c4a86f4a4c0a85b507436b.tar.gz
org.eclipse.cdt-39dd636454e8559471c4a86f4a4c0a85b507436b.tar.xz
org.eclipse.cdt-39dd636454e8559471c4a86f4a4c0a85b507436b.zip
Commit for Leo Treggiari: bugzilla 70577 and 71254.
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java4
6 files changed, 56 insertions, 5 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 b068228f2b5..09605b5352c 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
@@ -130,6 +130,13 @@ public interface IOption extends IBuildObject {
public String getEnumCommand (String id);
/**
+ * Answers the "name" associated with the enumeration id.
+ *
+ * @return
+ */
+ public String getEnumName (String id);
+
+ /**
* @param name
* @return
*/
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 76b82b723f4..6469a1cad13 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
@@ -268,6 +268,23 @@ public class Option extends BuildObject implements IOption {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getEnumName(java.lang.String)
+ */
+ public String getEnumName(String id) {
+ // Sanity
+ if (id == null) return EMPTY_STRING;
+
+ // First check for the command in ID->name map
+ String name = (String) getEnumNameMap().get(id);
+ if (name == null) {
+ // This may be a 1.2 project or plugin manifest. If so, the argument is the human readable
+ // name of the enumeration.
+ name = id;
+ }
+ return name;
+ }
+
+ /* (non-Javadoc)
* A memory-safe accessor to the map of enumerated option value IDs to the commands
* that a tool understands.
*
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 ab375eb89b8..c115677ec1e 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
@@ -286,12 +286,26 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
*/
- public String getEnumCommand(String name) {
+ public String getEnumCommand(String id) {
if (!resolved) {
resolveReferences();
}
if (option != null) {
- return option.getEnumCommand(name);
+ return option.getEnumCommand(id);
+ } else {
+ return new String();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getEnumName(java.lang.String)
+ */
+ public String getEnumName(String id) {
+ if (!resolved) {
+ resolveReferences();
+ }
+ if (option != null) {
+ return option.getEnumName(id);
} else {
return new String();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
index 2236eb2265d..2603c2abb0b 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
@@ -68,9 +68,11 @@ public class BuildOptionSettingsPage extends BuildSettingsPage {
fieldsList.add(booleanField);
break;
case IOption.ENUMERATED :
+ String selId;
String sel;
try {
- sel = opt.getSelectedEnum();
+ selId = opt.getSelectedEnum();
+ sel = opt.getEnumName(selId);
} catch (BuildException e) {
// If we get this exception, then the option type is
// wrong
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
index 8c36b835fcf..02833e10888 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
@@ -184,8 +184,15 @@ public class BuildToolSettingsPage extends BuildSettingsPage {
IOption option = options[k];
switch (option.getValueType()) {
case IOption.BOOLEAN :
+ String boolCmd;
if (getPreferenceStore().getBoolean(option.getId())) {
- buf.append(option.getCommand() + ITool.WHITE_SPACE);
+ boolCmd = option.getCommand();
+ } else {
+ // Note: getCommandFalse is new with CDT 2.0
+ boolCmd = option.getCommandFalse();
+ }
+ if (boolCmd != null && boolCmd.length() > 0) {
+ buf.append(boolCmd + ITool.WHITE_SPACE);
}
break;
case IOption.ENUMERATED :
@@ -199,10 +206,12 @@ public class BuildToolSettingsPage extends BuildSettingsPage {
}
break;
case IOption.STRING :
+ String strCmd = option.getCommand();
String val = getPreferenceStore().getString(option.getId());
// add this string option value to the list
stringOptionsMap.put(option, val);
if (val.length() > 0) {
+ if (strCmd != null) buf.append(strCmd);
buf.append(val + ITool.WHITE_SPACE);
}
break;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
index f164cab091c..9507da90b54 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
@@ -232,7 +232,9 @@ public class BuildToolsSettingsStore implements IPreferenceStore {
case IOption.ENUMERATED :
try{
- value = opt.getSelectedEnum();
+ String selId;
+ selId = opt.getSelectedEnum();
+ value = opt.getEnumName(selId);
} catch (BuildException e) {
break;
}

Back to the top