Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Small (but annoying) patch

Hi All,
I apologize in advance for what this patch is going to do. 

I am in the process of documenting the build model and as I go along, a 
number of things will have to be cleaned up in the actual model itself. 
This patch is purely a bookeeping change to make it easier for me to 
maintain the build model in the face of these changes as we go forward. 
Where I used to access XML elements using hard-coded strings, I have moved 
the string into the appropriate interface class. If the name of the 
attribute changes in the future, I only have to update it one place.

I have also begun the process of renaming certain attributes of the schema 
to make them better reflect what they are doing. My hope is that if they 
have intuitive names, toolchain implementers will have less difficulty 
understanding their intent. In any case, I have changed four attribute 
names; optionRef -> optionReference, toolRef -> toolReference, optionValue 
-> listOptionValue, and  optionEnum -> enumeratedOptionValue. 

Unfortunately, these changes will invalidate the dot-cdtbuild files for 
any managed build projects in your workspace. If you can't bear to create 
a new project, move the files over, and set-up the compiler options again, 
you can always hand-edit the changes in the file yourself. Just remember 
to restart CDT after you do so. 

Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.118
diff -u -r1.118 ChangeLog
--- ChangeLog	29 Jul 2003 19:51:30 -0000	1.118
+++ ChangeLog	30 Jul 2003 18:58:07 -0000
@@ -1,3 +1,28 @@
+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
Index: build/org/eclipse/cdt/core/build/managed/IBuildObject.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IBuildObject.java,v
retrieving revision 1.2
diff -u -r1.2 IBuildObject.java
--- build/org/eclipse/cdt/core/build/managed/IBuildObject.java	17 Apr 2003 19:21:40 -0000	1.2
+++ build/org/eclipse/cdt/core/build/managed/IBuildObject.java	30 Jul 2003 18:58:07 -0000
@@ -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();
 	
 }
Index: build/org/eclipse/cdt/core/build/managed/IConfiguration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IConfiguration.java,v
retrieving revision 1.6
diff -u -r1.6 IConfiguration.java
--- build/org/eclipse/cdt/core/build/managed/IConfiguration.java	29 May 2003 14:00:58 -0000	1.6
+++ build/org/eclipse/cdt/core/build/managed/IConfiguration.java	30 Jul 2003 18:58:07 -0000
@@ -13,6 +13,9 @@
 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.
Index: build/org/eclipse/cdt/core/build/managed/IOption.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOption.java,v
retrieving revision 1.9
diff -u -r1.9 IOption.java
--- build/org/eclipse/cdt/core/build/managed/IOption.java	25 Jul 2003 17:31:01 -0000	1.9
+++ build/org/eclipse/cdt/core/build/managed/IOption.java	30 Jul 2003 18:58:07 -0000
@@ -23,6 +23,23 @@
 	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.
Index: build/org/eclipse/cdt/core/build/managed/IOptionCategory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/IOptionCategory.java,v
retrieving revision 1.4
diff -u -r1.4 IOptionCategory.java
--- build/org/eclipse/cdt/core/build/managed/IOptionCategory.java	14 Apr 2003 20:02:38 -0000	1.4
+++ build/org/eclipse/cdt/core/build/managed/IOptionCategory.java	30 Jul 2003 18:58:07 -0000
@@ -15,6 +15,9 @@
  */
 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
 	 * 
Index: build/org/eclipse/cdt/core/build/managed/ITool.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/core/build/managed/ITool.java,v
retrieving revision 1.5
diff -u -r1.5 ITool.java
--- build/org/eclipse/cdt/core/build/managed/ITool.java	25 Jul 2003 17:31:01 -0000	1.5
+++ build/org/eclipse/cdt/core/build/managed/ITool.java	30 Jul 2003 18:58:07 -0000
@@ -14,6 +14,15 @@
  * 
  */
 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 = " ";
 
 	/**
Index: build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java,v
retrieving revision 1.11
diff -u -r1.11 Configuration.java
--- build/org/eclipse/cdt/internal/core/build/managed/Configuration.java	23 Jun 2003 14:36:31 -0000	1.11
+++ build/org/eclipse/cdt/internal/core/build/managed/Configuration.java	30 Jul 2003 18:58:07 -0000
@@ -74,18 +74,18 @@
 		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 @@
 		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 @@
 		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 @@
 	 * @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);
 			}
Index: build/org/eclipse/cdt/internal/core/build/managed/Option.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Option.java,v
retrieving revision 1.8
diff -u -r1.8 Option.java
--- build/org/eclipse/cdt/internal/core/build/managed/Option.java	25 Jul 2003 17:31:00 -0000	1.8
+++ build/org/eclipse/cdt/internal/core/build/managed/Option.java	30 Jul 2003 18:58:08 -0000
@@ -47,37 +47,37 @@
 		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 @@
 		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 @@
 			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;
Index: build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java,v
retrieving revision 1.3
diff -u -r1.3 OptionCategory.java
--- build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java	14 Apr 2003 20:02:38 -0000	1.3
+++ build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java	30 Jul 2003 18:58:08 -0000
@@ -34,17 +34,17 @@
 	}
 	
 	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)
Index: build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java,v
retrieving revision 1.10
diff -u -r1.10 OptionReference.java
--- build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java	25 Jul 2003 17:31:00 -0000	1.10
+++ build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java	30 Jul 2003 18:58:08 -0000
@@ -60,17 +60,17 @@
 	 */
 	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 @@
 			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 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 @@
 	 * @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 @@
 				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;
Index: build/org/eclipse/cdt/internal/core/build/managed/Tool.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java,v
retrieving revision 1.8
diff -u -r1.8 Tool.java
--- build/org/eclipse/cdt/internal/core/build/managed/Tool.java	25 Jul 2003 17:31:00 -0000	1.8
+++ build/org/eclipse/cdt/internal/core/build/managed/Tool.java	30 Jul 2003 18:58:08 -0000
@@ -62,42 +62,42 @@
 		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 @@
 		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);
 			}
 		}
Index: build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java,v
retrieving revision 1.8
diff -u -r1.8 ToolReference.java
--- build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java	25 Jul 2003 17:31:00 -0000	1.8
+++ build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java	30 Jul 2003 18:58:08 -0000
@@ -65,7 +65,7 @@
 		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 @@
 		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 @@
 	 * 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);
 			}
Index: schema/ManagedBuildTools.exsd
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd,v
retrieving revision 1.10
diff -u -r1.10 ManagedBuildTools.exsd
--- schema/ManagedBuildTools.exsd	29 Jul 2003 14:28:37 -0000	1.10
+++ schema/ManagedBuildTools.exsd	30 Jul 2003 18:58:09 -0000
@@ -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>
@@ -137,8 +142,8 @@
          <attribute name="valueType" use="default" value="string">
             <annotation>
                <documentation>
-                  General options can be one of the following types; &apos;string&apos; for catch-all entries for options that cannot be easily defined any other way, &apos;string list&apos; for entries that consist of a list of values such as defined symbols or paths, &apos;boolean&apos; for options that have two values, and &apos;enumerated&apos; for options that are one-of a list of values.
-
+                  General options can be one of the following types; &apos;string&apos; for catch-all entries for options that cannot be easily defined any other way, &apos;string list&apos; for entries that consist of a list of values such as defined symbols or paths, &apos;boolean&apos; for options that have two values, and &apos;enumerated&apos; for options that are one-of a list of values.
+
 Two additional types exist to flag options of special relevance to the build model; &apos;include&apos;, and &apos;definedSymbols&apos;. You can pre-populate with optionValues, and they will display in the UI the same way the &apos;StringList&apos; options do. The build model will look specifically for these value types when clients query for include paths and preprocessor defines.
                </documentation>
             </annotation>
@@ -192,7 +197,7 @@
       </complexType>
    </element>
 
-   <element name="optionEnum">
+   <element name="enumeratedOptionValue">
       <annotation>
          <documentation>
             Defines a single value of an enumerated option.
@@ -231,31 +236,36 @@
    </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 @@
       </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 @@
          <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 @@
          <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 @@
          <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 @@
          <meta.section type="apiInfo"/>
       </appInfo>
       <documentation>
-         [Enter API information here.]
+         
       </documentation>
    </annotation>
 
@@ -462,7 +514,7 @@
          <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 @@
          <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>
 
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.45
diff -u -r1.45 ChangeLog
--- ChangeLog	30 Jul 2003 13:04:38 -0000	1.45
+++ ChangeLog	30 Jul 2003 18:58:22 -0000
@@ -1,3 +1,8 @@
+2003-07-30 Sean Evoy
+	* plugin.xml:
+	Updated the attribute names to reflect changes to the ManagedBuildInfo 
+	extension point schema.
+
 2003-07-30 Victor Mozgin
 	Moved testBug39532() from ASTFailedTests.java to QuickParseASTTests.java.
 
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/plugin.xml,v
retrieving revision 1.5
diff -u -r1.5 plugin.xml
--- plugin.xml	29 Jul 2003 14:28:32 -0000	1.5
+++ plugin.xml	30 Jul 2003 18:58:22 -0000
@@ -52,12 +52,12 @@
                   command="-L"
                   valueType="stringList"
                   id="list.option">
-               <optionValue
+               <listOptionValue
                      value="a">
-               </optionValue>
-               <optionValue
+               </listOptionValue>
+               <listOptionValue
                      value="b">
-               </optionValue>
+               </listOptionValue>
             </option>
             <option
                   defaultValue="false"
@@ -78,17 +78,17 @@
                   category="category"
                   valueType="enumerated"
                   id="enumerated.option">
-               <optionEnum
+               <enumeratedOptionValue
                      name="Default Enum"
                      isDefault="true"
                      command="-e1"
                      id="default.enum.option">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Another Enum"
                      command="-e2"
                      id="another.enum.option">
-               </optionEnum>
+               </enumeratedOptionValue>
             </option>
          </tool>
          <configuration
@@ -98,17 +98,17 @@
          <configuration
                name="Root Override Config"
                id="root.override.config">
-            <toolRef
+            <toolReference
                   id="root.tool">
-               <optionRef
+               <optionReference
                      defaultValue="y"
                      id="string.option">
-               </optionRef>
-               <optionRef
+               </optionReference>
+               <optionReference
                      defaultValue="true"
                      id="boolean.option">
-               </optionRef>
-            </toolRef>
+               </optionReference>
+            </toolReference>
          </configuration>
       </target>
       <target
@@ -136,12 +136,12 @@
                   command="-I"
                   valueType="includePath"
                   id="sub.tool.opt.inc.paths">
-               <optionValue
+               <listOptionValue
                      value="/usr/include">
-               </optionValue>
-               <optionValue
+               </listOptionValue>
+               <listOptionValue
                      value="/opt/gnome/include">
-               </optionValue>
+               </listOptionValue>
             </option>
             <option
                   name="Defined Symbols"
@@ -154,9 +154,9 @@
                   command="-I"
                   valueType="includePath"
                   id="sub.tool.opts.inc.paths.more">
-               <optionValue
+               <listOptionValue
                      value="/home/tester/include">
-               </optionValue>
+               </listOptionValue>
             </option>
          </tool>
       </target>
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.130
diff -u -r1.130 ChangeLog
--- ChangeLog	29 Jul 2003 22:47:59 -0000	1.130
+++ ChangeLog	30 Jul 2003 18:58:36 -0000
@@ -1,3 +1,8 @@
+2003-07-30 Sean Evoy
+	* plugin.xml:
+	Updated the attribute names to reflect changes to the ManagedBuildInfo 
+	extension point schema.
+
 2003-07-29 Andrew Niefer
 	- Refactoring Search Result Collecting:
 		* CSearchResultCollector now extends BasicSearchResultCollector
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/plugin.xml,v
retrieving revision 1.37
diff -u -r1.37 plugin.xml
--- plugin.xml	29 Jul 2003 14:28:40 -0000	1.37
+++ plugin.xml	30 Jul 2003 18:58:37 -0000
@@ -671,55 +671,55 @@
                   category="cygwin.compiler.category.general"
                   valueType="enumerated"
                   id="cygwin.compiler.general.optimization.level">
-               <optionEnum
+               <enumeratedOptionValue
                      name="None (-O0)"
                      command="-O0"
                      id="cygwin.optimization.level.none">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Optimize (-O1)"
                      command="-O1"
                      id="cygwin.optimization.level.optimize">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Optimize more (-O2)"
                      isDefault="true"
                      command="-O2"
                      id="cygwin.optimization.level.more">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Optimize most (-O3)"
                      command="-O3"
                      id="cygwin.optimization.level.most">
-               </optionEnum>
+               </enumeratedOptionValue>
             </option>
             <option
                   name="Debug Level"
                   category="cygwin.compiler.category.general"
                   valueType="enumerated"
                   id="cygwin.compiler.debugging.level">
-               <optionEnum
+               <enumeratedOptionValue
                      name="None"
                      isDefault="false"
                      id="cygwin.debugging.level.none">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Minimal (-g1)"
                      command="-g1"
                      id="cygwin.debugging.level.minimal">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Default (-g)"
                      isDefault="true"
                      command="-g"
                      id="cygwin.debugging.level.default">
-               </optionEnum>
-               <optionEnum
+               </enumeratedOptionValue>
+               <enumeratedOptionValue
                      name="Maximum (-g3)"
                      isDefault="false"
                      command="-g3"
                      id="cygwin.debugging.level.max">
-               </optionEnum>
+               </enumeratedOptionValue>
             </option>
             <option
                   name="Include Paths"

Back to the top