Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog25
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java26
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java3
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java17
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java3
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java9
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java26
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java38
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java8
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java30
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java28
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java8
-rw-r--r--core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd115
13 files changed, 223 insertions, 113 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 5a40d48ba6c..4d1c76eda5c 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,6 +1,31 @@
2003-07-30 Hoda Amer
The C Model recognizes pointers to functions.
+2003-07-30 Sean Evoy
+ The managed build model is going to go through a bit of change over the next while.
+ In order to make that more manageable, I have moved all the hard-coded strings used
+ to access the XML elements of the extension point definition into the appropriate
+ interface classes.
+
+ * build/org/eclipse/cdt/core/build/managed/IBuildObject.java
+ * build/org/eclipse/cdt/core/build/managed/IConfiguration.java
+ * build/org/eclipse/cdt/core/build/managed/IOption.java
+ * build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
+ * build/org/eclipse/cdt/core/build/managed/ITool.java
+ * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+ * build/org/eclipse/cdt/internal/core/build/managed/Option.java
+ * build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
+ * build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
+ * build/org/eclipse/cdt/internal/core/build/managed/Tool.java
+ * build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java:
+ Moved the hard-coded strings used to access the XML elements into appropropriate interfaces.
+
+ * schema/ManagedBuildTools.exsd:
+ Renamed four attributes optionRef->optionReference, toolRef->toolReference,
+ optionValue->listOptionValue, and optionEnum->enumeratedOptionValue. In the first
+ 2 cases, I was just trying to remove the tech-ese from the names. In the later 2, I
+ tried to use a more descriptive name.
+
2003-07-29 Alain Magloire
To discover if an application has debug info for DWARF-2 format
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java
index 1cce486b013..2529da7ec8b 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java
@@ -1,21 +1,21 @@
-/*
- * Created on Apr 9, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+/**********************************************************************
+ * Copyright (c) 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ **********************************************************************/
package org.eclipse.cdt.core.build.managed;
-/**
- * @author dschaefe
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
public interface IBuildObject {
+ // Schema element names
+ public static final String ID = "id";
+ public static final String NAME = "name";
public String getId();
-
public String getName();
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java
index 65d8309258e..84cf2f187cb 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java
@@ -13,6 +13,9 @@ package org.eclipse.cdt.core.build.managed;
import org.eclipse.core.resources.IResource;
public interface IConfiguration extends IBuildObject {
+ // Schema element names
+ public static final String TOOL_REF = "toolReference";
+ public static final String PARENT = "parent";
/**
* Returns the target for this configuration.
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
index c4042236d27..006044796e8 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java
@@ -23,6 +23,23 @@ public interface IOption extends IBuildObject {
public static final int PREPROCESSOR_SYMBOLS = 5;
public static final int LIBRARIES = 6;
+ // Schema element names for options
+ public static final String CATEGORY = "category";
+ public static final String COMMAND = "command";
+ public static final String DEFAULT_VALUE = "defaultValue";
+ public static final String ENUM_VALUE = "enumeratedOptionValue";
+ public static final String IS_DEFAULT = "isDefault";
+ public static final String LIST_VALUE = "listOptionValue";
+ public static final String TYPE_BOOL = "boolean";
+ public static final String TYPE_ENUM = "enumerated";
+ public static final String TYPE_INC_PATH = "includePath";
+ public static final String TYPE_LIB = "libs";
+ public static final String TYPE_STRING = "string";
+ public static final String TYPE_STR_LIST = "stringList";
+ public static final String VALUE_TYPE = "valueType";
+ public static final String VALUE = "value";
+
+
/**
* If this option is defined as an enumeration, this function returns
* the list of possible values for that enum.
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
index 4ba523abd7a..e0b5a7bfcf6 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
@@ -15,6 +15,9 @@ package org.eclipse.cdt.core.build.managed;
*/
public interface IOptionCategory extends IBuildObject {
+ // Schema element names
+ public static final String PARENT = "parent";
+
/**
* Returns the list of children of this node in the option category tree
*
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java
index e7cef1c63c9..d7002965208 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java
@@ -14,6 +14,15 @@ package org.eclipse.cdt.core.build.managed;
*
*/
public interface ITool extends IBuildObject {
+ // Schema element names
+ public static final String COMMAND = "command";
+ public static final String OPTION = "option";
+ public static final String OPTION_CAT = "optionCategory";
+ public static final String OPTION_REF = "optionReference";
+ public static final String OUTPUT_FLAG = "outputFlag";
+ public static final String OUTPUT_PREFIX = "outputPrefix";
+ public static final String OUTPUTS = "outputs";
+ public static final String SOURCES = "sources";
public static final String WHITE_SPACE = " ";
/**
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
index 45af3a8f52a..94b2b27acf6 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
@@ -74,18 +74,18 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IConfiguration.ID));
// hook me up
target.addConfiguration(this);
// name
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(IConfiguration.NAME));
IConfigurationElement[] configElements = element.getChildren();
for (int l = 0; l < configElements.length; ++l) {
IConfigurationElement configElement = configElements[l];
- if (configElement.getName().equals("toolRef")) {
+ if (configElement.getName().equals(IConfiguration.TOOL_REF)) {
new ToolReference(this, configElement);
}
}
@@ -101,21 +101,21 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IConfiguration.ID));
// hook me up
target.addConfiguration(this);
// name
- if (element.hasAttribute("name"))
- setName(element.getAttribute("name"));
+ if (element.hasAttribute(IConfiguration.NAME))
+ setName(element.getAttribute(IConfiguration.NAME));
- if (element.hasAttribute("parent")) {
+ if (element.hasAttribute(IConfiguration.PARENT)) {
// See if the target has a parent
ITarget targetParent = target.getParent();
// If so, then get my parent from it
if (targetParent != null) {
- parent = targetParent.getConfiguration(element.getAttribute("parent"));
+ parent = targetParent.getConfiguration(element.getAttribute(IConfiguration.PARENT));
}
else {
parent = null;
@@ -125,7 +125,7 @@ public class Configuration extends BuildObject implements IConfiguration {
NodeList configElements = element.getChildNodes();
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
- if (configElement.getNodeName().equals("toolRef")) {
+ if (configElement.getNodeName().equals(IConfiguration.TOOL_REF)) {
new ToolReference(this, (Element)configElement);
}
}
@@ -139,18 +139,18 @@ public class Configuration extends BuildObject implements IConfiguration {
* @param element
*/
public void serialize(Document doc, Element element) {
- element.setAttribute("id", id);
+ element.setAttribute(IConfiguration.ID, id);
if (name != null)
- element.setAttribute("name", name);
+ element.setAttribute(IConfiguration.NAME, name);
if (parent != null)
- element.setAttribute("parent", parent.getId());
+ element.setAttribute(IConfiguration.PARENT, parent.getId());
if (toolReferences != null)
for (int i = 0; i < toolReferences.size(); ++i) {
ToolReference toolRef = (ToolReference)toolReferences.get(i);
- Element toolRefElement = doc.createElement("toolRef");
+ Element toolRefElement = doc.createElement(IConfiguration.TOOL_REF);
element.appendChild(toolRefElement);
toolRef.serialize(doc, toolRefElement);
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
index 17a7cbfef34..e3e5cd59563 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java
@@ -47,37 +47,37 @@ public class Option extends BuildObject implements IOption {
this(tool);
// Get the unique id of the option
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IOption.ID));
// Hook me up to a tool
tool.addOption(this);
// Get the option Name (this is what the user will see in the UI)
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(IOption.NAME));
// Options can be grouped into categories
- String categoryId = element.getAttribute("category");
+ String categoryId = element.getAttribute(IOption.CATEGORY);
if (categoryId != null)
setCategory(tool.getOptionCategory(categoryId));
// Get the command defined for the option
- command = element.getAttribute("command");
+ command = element.getAttribute(IOption.COMMAND);
// Options hold different types of values
- String valueTypeStr = element.getAttribute("valueType");
+ String valueTypeStr = element.getAttribute(IOption.VALUE_TYPE);
if (valueTypeStr == null)
valueType = -1;
- else if (valueTypeStr.equals("string"))
+ else if (valueTypeStr.equals(IOption.TYPE_STRING))
valueType = IOption.STRING;
- else if (valueTypeStr.equals("stringList"))
+ else if (valueTypeStr.equals(IOption.TYPE_STR_LIST))
valueType = IOption.STRING_LIST;
- else if (valueTypeStr.equals("boolean"))
+ else if (valueTypeStr.equals(IOption.TYPE_BOOL))
valueType = IOption.BOOLEAN;
- else if (valueTypeStr.equals("enumerated"))
+ else if (valueTypeStr.equals(IOption.TYPE_ENUM))
valueType = IOption.ENUMERATED;
- else if (valueTypeStr.equals("includePath"))
+ else if (valueTypeStr.equals(IOption.TYPE_INC_PATH))
valueType = IOption.INCLUDE_PATH;
- else if (valueTypeStr.equals("libs"))
+ else if (valueTypeStr.equals(IOption.TYPE_LIB))
valueType = IOption.LIBRARIES;
else
valueType = IOption.PREPROCESSOR_SYMBOLS;
@@ -87,21 +87,21 @@ public class Option extends BuildObject implements IOption {
switch (valueType) {
case IOption.BOOLEAN:
// Convert the string to a boolean
- value = new Boolean(element.getAttribute("defaultValue"));
+ value = new Boolean(element.getAttribute(IOption.DEFAULT_VALUE));
break;
case IOption.STRING:
// Just get the value out of the option directly
- value = element.getAttribute("defaultValue");
+ value = element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.ENUMERATED:
List enumList = new ArrayList();
- IConfigurationElement[] enumElements = element.getChildren("optionEnum");
+ IConfigurationElement[] enumElements = element.getChildren(IOption.ENUM_VALUE);
for (int i = 0; i < enumElements.length; ++i) {
- String optName = enumElements[i].getAttribute("name");
- String optCommand = enumElements[i].getAttribute("command");
+ String optName = enumElements[i].getAttribute(IOption.NAME);
+ String optCommand = enumElements[i].getAttribute(IOption.COMMAND);
enumList.add(optName);
enumCommands.put(optName, optCommand);
- Boolean isDefault = new Boolean(enumElements[i].getAttribute("isDefault"));
+ Boolean isDefault = new Boolean(enumElements[i].getAttribute(IOption.IS_DEFAULT));
if (isDefault.booleanValue()) {
defaultEnumName = optName;
}
@@ -113,9 +113,9 @@ public class Option extends BuildObject implements IOption {
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
List valueList = new ArrayList();
- IConfigurationElement[] valueElements = element.getChildren("optionValue");
+ IConfigurationElement[] valueElements = element.getChildren(IOption.LIST_VALUE);
for (int i = 0; i < valueElements.length; ++i) {
- valueList.add(valueElements[i].getAttribute("value"));
+ valueList.add(valueElements[i].getAttribute(IOption.VALUE));
}
value = valueList;
break;
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
index 41b4af476a5..e8e6ec6e8a8 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
@@ -34,17 +34,17 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
}
public OptionCategory(Tool tool, IConfigurationElement element) {
- String parentId = element.getAttribute("parent");
+ String parentId = element.getAttribute(IOptionCategory.PARENT);
if (parentId != null)
- owner = tool.getOptionCategory(element.getAttribute("parent"));
+ owner = tool.getOptionCategory(element.getAttribute(IOptionCategory.PARENT));
else
owner = tool;
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(IOptionCategory.ID));
// Name
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(IOptionCategory.NAME));
// Hook me in
if (owner instanceof Tool)
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
index e4db4b0530e..f1c15492425 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
@@ -60,17 +60,17 @@ public class OptionReference implements IOption {
*/
public OptionReference(ToolReference owner, IConfigurationElement element) {
this.owner = owner;
- option = owner.getTool().getOption(element.getAttribute("id"));
+ option = owner.getTool().getOption(element.getAttribute(IOption.ID));
owner.addOptionReference(this);
// value
switch (option.getValueType()) {
case IOption.BOOLEAN:
- value = new Boolean(element.getAttribute("defaultValue"));
+ value = new Boolean(element.getAttribute(IOption.DEFAULT_VALUE));
break;
case IOption.STRING:
- value = element.getAttribute("defaultValue");
+ value = element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.ENUMERATED:
try {
@@ -84,9 +84,9 @@ public class OptionReference implements IOption {
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
List valueList = new ArrayList();
- IConfigurationElement[] valueElements = element.getChildren("optionValue");
+ IConfigurationElement[] valueElements = element.getChildren(IOption.LIST_VALUE);
for (int i = 0; i < valueElements.length; ++i) {
- valueList.add(valueElements[i].getAttribute("value"));
+ valueList.add(valueElements[i].getAttribute(IOption.VALUE));
}
value = valueList;
break;
@@ -101,29 +101,29 @@ public class OptionReference implements IOption {
*/
public OptionReference(ToolReference owner, Element element) {
this.owner = owner;
- option = owner.getTool().getOption(element.getAttribute("id"));
+ option = owner.getTool().getOption(element.getAttribute(IOption.ID));
owner.addOptionReference(this);
// value
switch (option.getValueType()) {
case IOption.BOOLEAN:
- value = new Boolean(element.getAttribute("defaultValue"));
+ value = new Boolean(element.getAttribute(IOption.DEFAULT_VALUE));
break;
case IOption.STRING:
case IOption.ENUMERATED:
- value = (String) element.getAttribute("defaultValue");
+ value = (String) element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
List valueList = new ArrayList();
- NodeList nodes = element.getElementsByTagName("optionValue");
+ NodeList nodes = element.getElementsByTagName(IOption.LIST_VALUE);
for (int i = 0; i < nodes.getLength(); ++i) {
Node node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
- valueList.add(((Element)node).getAttribute("value"));
+ valueList.add(((Element)node).getAttribute(IOption.VALUE));
}
}
value = valueList;
@@ -139,16 +139,16 @@ public class OptionReference implements IOption {
* @param element
*/
public void serialize(Document doc, Element element) {
- element.setAttribute("id", option.getId());
+ element.setAttribute(IOption.ID, option.getId());
// value
switch (option.getValueType()) {
case IOption.BOOLEAN:
- element.setAttribute("defaultValue", ((Boolean)value).toString());
+ element.setAttribute(IOption.DEFAULT_VALUE, ((Boolean)value).toString());
break;
case IOption.STRING:
case IOption.ENUMERATED:
- element.setAttribute("defaultValue", (String)value);
+ element.setAttribute(IOption.DEFAULT_VALUE, (String)value);
break;
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
@@ -157,8 +157,8 @@ public class OptionReference implements IOption {
ArrayList stringList = (ArrayList)value;
ListIterator iter = stringList.listIterator();
while (iter.hasNext()) {
- Element valueElement = doc.createElement("optionValue");
- valueElement.setAttribute("value", (String)iter.next());
+ Element valueElement = doc.createElement(IOption.LIST_VALUE);
+ valueElement.setAttribute(IOption.VALUE, (String)iter.next());
element.appendChild(valueElement);
}
break;
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
index 5564b5b72b7..488e1fb8d95 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
@@ -62,42 +62,42 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
this(target);
// id
- setId(element.getAttribute("id"));
+ setId(element.getAttribute(ITool.ID));
// hook me up
target.addTool(this);
// name
- setName(element.getAttribute("name"));
+ setName(element.getAttribute(ITool.NAME));
// Get the supported input file extension
- String inputs = element.getAttribute("sources") == null ?
+ String inputs = element.getAttribute(ITool.SOURCES) == null ?
new String() :
- element.getAttribute("sources");
+ element.getAttribute(ITool.SOURCES);
StringTokenizer tokenizer = new StringTokenizer(inputs, DEFAULT_SEPARATOR);
while (tokenizer.hasMoreElements()) {
getInputExtensions().add(tokenizer.nextElement());
}
// Get the output extension
- outputExtension = element.getAttribute("outputs") == null ?
+ outputExtension = element.getAttribute(ITool.OUTPUTS) == null ?
new String() :
- element.getAttribute("outputs");
+ element.getAttribute(ITool.OUTPUTS);
// Get the tool invocation
- command = element.getAttribute("command") == null ?
+ command = element.getAttribute(ITool.COMMAND) == null ?
new String() :
- element.getAttribute("command");
+ element.getAttribute(ITool.COMMAND);
// Get the flag to control output
- outputFlag = element.getAttribute("outputFlag") == null ?
+ outputFlag = element.getAttribute(ITool.OUTPUT_FLAG) == null ?
new String() :
- element.getAttribute("outputFlag");
+ element.getAttribute(ITool.OUTPUT_FLAG);
// Get the output prefix
- outputPrefix = element.getAttribute("outputPrefix") == null ?
+ outputPrefix = element.getAttribute(ITool.OUTPUT_PREFIX) == null ?
new String() :
- element.getAttribute("outputPrefix");
+ element.getAttribute(ITool.OUTPUT_PREFIX);
// set up the category map
categoryMap = new HashMap();
@@ -107,9 +107,9 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
IConfigurationElement[] toolElements = element.getChildren();
for (int l = 0; l < toolElements.length; ++l) {
IConfigurationElement toolElement = toolElements[l];
- if (toolElement.getName().equals("option")) {
+ if (toolElement.getName().equals(ITool.OPTION)) {
new Option(this, toolElement);
- } else if (toolElement.getName().equals("optionCategory")) {
+ } else if (toolElement.getName().equals(ITool.OPTION_CAT)) {
new OptionCategory(this, toolElement);
}
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
index 3ce12a2890f..a670db24dc6 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
@@ -65,7 +65,7 @@ public class ToolReference implements ITool {
IConfigurationElement[] toolElements = element.getChildren();
for (int m = 0; m < toolElements.length; ++m) {
IConfigurationElement toolElement = toolElements[m];
- if (toolElement.getName().equals("optionRef")) {
+ if (toolElement.getName().equals(ITool.OPTION_REF)) {
new OptionReference(this, toolElement);
}
}
@@ -89,7 +89,7 @@ public class ToolReference implements ITool {
NodeList configElements = element.getChildNodes();
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
- if (configElement.getNodeName().equals("optionRef")) {
+ if (configElement.getNodeName().equals(ITool.OPTION_REF)) {
new OptionReference(this, (Element)configElement);
}
}
@@ -103,12 +103,12 @@ public class ToolReference implements ITool {
* to persist settings.
*/
public void serialize(Document doc, Element element) {
- element.setAttribute("id", parent.getId());
+ element.setAttribute(ITool.ID, parent.getId());
if (optionReferences != null)
for (int i = 0; i < optionReferences.size(); ++i) {
OptionReference optionRef = (OptionReference)optionReferences.get(i);
- Element optionRefElement = doc.createElement("optionRef");
+ Element optionRefElement = doc.createElement(ITool.OPTION_REF);
element.appendChild(optionRefElement);
optionRef.serialize(doc, optionRefElement);
}
diff --git a/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd b/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
index c87d96db2e3..49276a0ccd3 100644
--- a/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
+++ b/core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
@@ -6,7 +6,7 @@
<meta.schema plugin="org.eclipse.cdt.core" id="ManagedBuildTools" name="Managed Build Tools"/>
</appInfo>
<documentation>
- Describes targets, configurations, and toolchains for the build system.
+ The managed build information model describes targets, configurations, and toolchains for the build system.
</documentation>
</annotation>
@@ -80,16 +80,6 @@
</documentation>
</annotation>
</attribute>
- <attribute name="dependencyCalculator" type="string">
- <annotation>
- <documentation>
- A reference to the class that will calculate the dependencies for a given file. For example, a compiler might require a dependency calculator for source files that discovers the dependenncies on header files.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
<attribute name="command" type="string">
<annotation>
<documentation>
@@ -111,14 +101,29 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="dependencyCalculator" type="string">
+ <annotation>
+ <documentation>
+ This is an optional field that specifies the class that provides the dependency calculation for a given tool.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.cdt.internal.core.sourcedependency.ISourceDependency"/>
+ </appInfo>
+ </annotation>
+ </attribute>
</complexType>
</element>
<element name="option">
+ <annotation>
+ <documentation>
+ An option is associated with a tool. Options can contain boolean values, a simple text string, a selection from an enumerated list, or a list of values. Options also map the value they contain to a command-line flag, such as &apos;-g&apos; in the case of debugging symbol information for compilers.
+ </documentation>
+ </annotation>
<complexType>
<sequence>
- <element ref="optionEnum"/>
- <element ref="optionValue"/>
+ <element ref="enumeratedOptionValue"/>
+ <element ref="listOptionValue"/>
</sequence>
<attribute name="id" type="string" use="required">
<annotation>
@@ -192,7 +197,7 @@ Two additional types exist to flag options of special relevance to the build mod
</complexType>
</element>
- <element name="optionEnum">
+ <element name="enumeratedOptionValue">
<annotation>
<documentation>
Defines a single value of an enumerated option.
@@ -231,31 +236,36 @@ Two additional types exist to flag options of special relevance to the build mod
</element>
<element name="configuration">
+ <annotation>
+ <documentation>
+ A configuration is used to gather together certain default tools and options to build target a certain way. For example, a &quot;Debug&quot; configuration might supply tools with the options set to build with debugging symbols, whereas a &quot;Release&quot; configuration would supply tools with options set to create the best performance.
+ </documentation>
+ </annotation>
<complexType>
<sequence>
- <element ref="toolRef"/>
+ <element ref="toolReference"/>
</sequence>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
-
+ Unique identifier for the configuration.
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>
-
+ A descriptive name for the configuration to be used in the UI.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
- <element name="toolRef">
+ <element name="toolReference">
<complexType>
<sequence>
- <element ref="optionRef"/>
+ <element ref="optionReference"/>
</sequence>
<attribute name="id" type="string" use="required">
<annotation>
@@ -267,7 +277,7 @@ Two additional types exist to flag options of special relevance to the build mod
</complexType>
</element>
- <element name="optionRef">
+ <element name="optionReference">
<annotation>
<documentation>
Option references hold onto information the user has changed through the UI. Not all fields will be populated, depending on the option type the reference overrides. For example, the &apos;name&apos; field is used by enumerated options only.
@@ -277,7 +287,7 @@ Two additional types exist to flag options of special relevance to the build mod
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
-
+ The ID of the option the reference is for.
</documentation>
</annotation>
</attribute>
@@ -392,38 +402,38 @@ Two additional types exist to flag options of special relevance to the build mod
<attribute name="id" type="string">
<annotation>
<documentation>
-
+ Used by the build model to uniquely identify the option category.
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
-
+ A human-readable category name, such as &apos;Preprocessor Options&apos;. This will be the name the user sees displayed in the UI.
</documentation>
</annotation>
</attribute>
<attribute name="owner" type="string">
<annotation>
<documentation>
-
+ Option categories can be nested inside other option categories. This is the ID of the owner of the category.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
- <element name="optionValue">
+ <element name="listOptionValue">
<annotation>
<documentation>
- A value for defining individual elements of a string list option.
+ A value for defining individual elements of a list option.
</documentation>
</annotation>
<complexType>
<attribute name="value" type="string" use="required">
<annotation>
<documentation>
-
+ The contents of the list item.
</documentation>
</annotation>
</attribute>
@@ -444,7 +454,49 @@ Two additional types exist to flag options of special relevance to the build mod
<meta.section type="examples"/>
</appInfo>
<documentation>
- [Enter extension point usage example here.]
+ The following is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;
+ &lt;extension
+ id=&quot;buildExample&quot;
+ name=&quot;Tools for Build Example&quot;
+ point=&quot;org.eclipse.cdt.core.ManagedBuildInfo&quot;&gt;
+ &lt;target
+ makeFlags=&quot;-k&quot;
+ isTest=&quot;false&quot;
+ cleanCommand=&quot;rm -rf&quot;
+ name=&quot;Executable&quot;
+ defaultExtension=&quot;.exe&quot;
+ isAbstract=&quot;false&quot;
+ makeCommand=&quot;make&quot;
+ id=&quot;example.target.executable&quot;&gt;
+ &lt;tool
+ sources=&quot;C&quot;
+ name=&quot;Compiler&quot;
+ outputFlag=&quot;-o&quot;
+ outputs=&quot;exe&quot;
+ command=&quot;g++&quot;
+ id=&quot;executable.compiler&quot;&gt;
+ &lt;optionCategory
+ owner=&quot;executable.compiler&quot;
+ name=&quot;Flags&quot;
+ id=&quot;compiler.category.flags&quot;&gt;
+ &lt;/optionCategory&gt;
+ &lt;option
+ defaultValue=&quot;-c&quot;
+ name=&quot;Compiler Flags&quot;
+ category=&quot;compiler.category.flags&quot;
+ valueType=&quot;string&quot;
+ id=&quot;category.flags.comp_flags&quot;&gt;
+ &lt;/option&gt;
+ &lt;/tool&gt;
+ &lt;configuration
+ name=&quot;Default&quot;
+ id=&quot;example.config.default&quot;&gt;
+ &lt;/configuration&gt;
+ &lt;/target&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
</documentation>
</annotation>
@@ -453,7 +505,7 @@ Two additional types exist to flag options of special relevance to the build mod
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
- [Enter API information here.]
+
</documentation>
</annotation>
@@ -462,7 +514,7 @@ Two additional types exist to flag options of special relevance to the build mod
<meta.section type="implementation"/>
</appInfo>
<documentation>
- [Enter information about supplied implementation of this extension point.]
+ An implementation of this extension point is supplied in &lt;samp&gt;org.eclipse.cdt.ui&lt;/samp&gt;
</documentation>
</annotation>
@@ -471,7 +523,8 @@ Two additional types exist to flag options of special relevance to the build mod
<meta.section type="copyright"/>
</appInfo>
<documentation>
-
+ Copyright (c) 2003 IBM Corporation and others.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available on the &lt;a href=&quot;http://www.eclipse.org/legal/cpl-v10.html&quot;&gt; Eclipse&lt;/a&gt; website.
</documentation>
</annotation>

Back to the top