[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Changes to build model to support on-going UI work
|
My very first patch.
Core
- Added 2 new option types: Boolean
and enumerated
- Changed the IOption interface
to get new option type values
- In plugin manifest and IOption
interface added concept of a default enumerated value to support on-going
GUI work
- In plugin manifest and IOption,
added field to map the actual command line argument with the option for
makefile generation.
Tests
- Changed the plugin.xml manifest
to match the new option types
- AllBuildTests.java updated to
test new option types and fields added in core
Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada
Index: plugin.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/plugin.properties,v
retrieving revision 1.8
diff -u -r1.8 plugin.properties
--- plugin.properties 23 Sep 2002 17:08:16 -0000 1.8
+++ plugin.properties 15 May 2003 15:31:07 -0000
@@ -14,3 +14,7 @@
makeproject.name=Make Project
genericmake.name=Generic Make
makebuildmodel.name=Make Builder
+
+ManagedBuildNature.name=Managed C/C++ Build Nature
+
+GeneratedMakefileCBuilder.name=Generated Makefile C/C++ Builder
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/plugin.xml,v
retrieving revision 1.21
diff -u -r1.21 plugin.xml
--- plugin.xml 23 Apr 2003 15:02:41 -0000 1.21
+++ plugin.xml 15 May 2003 15:31:07 -0000
@@ -252,5 +252,29 @@
pattern="*.exe">
</ignore>
</extension>
+ <extension
+ id="managedBuildNature"
+ name="%ManagedBuildNature.name"
+ point="org.eclipse.core.resources.natures">
+ <requires-nature
+ id="org.eclipse.cdt.core.cnature">
+ </requires-nature>
+ <runtime>
+ <run
+ class="org.eclipse.cdt.core.ManagedCProjectNature">
+ </run>
+ </runtime>
+ </extension>
+ <extension
+ id="generatedMakefileCBuilder"
+ name="%GeneratedMakefileCBuilder.name"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ hasNature="true">
+ <run
+ class="org.eclipse.cdt.internal.core.GeneratedMakefileCBuilder">
+ </run>
+ </builder>
+ </extension>
</plugin>
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.5
diff -u -r1.5 IOption.java
--- build/org/eclipse/cdt/core/build/managed/IOption.java 17 Apr 2003 19:21:40 -0000 1.5
+++ build/org/eclipse/cdt/core/build/managed/IOption.java 15 May 2003 15:31:07 -0000
@@ -16,16 +16,25 @@
public interface IOption extends IBuildObject {
// Type for the value of the option
- public static final int STRING = 0;
- public static final int STRING_LIST = 1;
+ public static final int BOOLEAN = 0;
+ public static final int ENUMERATED = 1;
+ public static final int STRING = 2;
+ public static final int STRING_LIST = 3;
/**
- * Returns the tool defining this option.
+ * If this option is defined as an enumeration, this function returns
+ * the list of possible values for that enum.
*
+ * If this option is not defined as an enumeration, it returns null.
* @return
*/
- public ITool getTool();
-
+ public String [] getApplicableValues();
+
+ /**
+ * @return the value for a boolean option.
+ */
+ public boolean getBooleanValue() throws BuildException;
+
/**
* Returns the category for this option.
*
@@ -34,27 +43,37 @@
public IOptionCategory getCategory();
/**
- * Returns the name of this option.
- *
- * @return
+ * @return a String containing the actual command line option
+ * associated with the <code>IOption</code>
*/
- public String getName();
+ public String getCommand();
/**
- * Get the type for the value of the option.
+ * @return a <code>String</code> containing the default value for the
+ * enumerated option.
+ */
+ public String getDefaultEnumName ();
+
+
+ /**
+ * @return <code>String</code> containing the command associated with the
+ * enumeration name.
+ */
+ public String getEnumCommand (String name);
+
+ /**
+ * Returns the name of this option.
*
* @return
*/
- public int getValueType();
+ public String getName();
/**
- * If this option is defined as an enumeration, this function returns
- * the list of possible values for that enum.
+ * Returns the current value for this option if it is a List of Strings.
*
- * If this option is not defined as an enumeration, it returns null.
* @return
*/
- public String [] getApplicableValues();
+ public String [] getStringListValue() throws BuildException;
/**
* Returns the current value for this option if it is a String
@@ -64,10 +83,16 @@
public String getStringValue() throws BuildException;
/**
- * Returns the current value for this option if it is a List of Strings.
+ * Returns the tool defining this option.
*
* @return
*/
- public String [] getStringListValue() throws BuildException;
+ public ITool getTool();
+ /**
+ * Get the type for the value of the option.
+ *
+ * @return
+ */
+ public int getValueType();
}
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.4
diff -u -r1.4 Option.java
--- build/org/eclipse/cdt/internal/core/build/managed/Option.java 25 Apr 2003 14:32:51 -0000 1.4
+++ build/org/eclipse/cdt/internal/core/build/managed/Option.java 15 May 2003 15:31:08 -0000
@@ -11,7 +11,9 @@
package org.eclipse.cdt.internal.core.build.managed;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.cdt.core.build.managed.BuildException;
import org.eclipse.cdt.core.build.managed.IConfiguration;
@@ -27,10 +29,12 @@
private ITool tool;
private IOptionCategory category;
- private List enumValues;
private int valueType;
private Object value;
+ private Map enumCommands;
+ private String defaultEnumName;
+ private String command;
private static final String[] emptyStrings = new String[0];
@@ -55,25 +59,53 @@
if (categoryId != null)
setCategory(tool.getOptionCategory(categoryId));
+ // command
+ command = element.getAttribute("command");
+
// valueType
String valueTypeStr = element.getAttribute("valueType");
if (valueTypeStr == null || valueTypeStr.equals("string"))
valueType = IOption.STRING;
else if (valueTypeStr.equals("stringList"))
valueType = IOption.STRING_LIST;
+ else if (valueTypeStr.equals("boolean"))
+ valueType = IOption.BOOLEAN;
+ else
+ valueType = IOption.ENUMERATED;
// value
+ enumCommands = new HashMap();
switch (valueType) {
+ case IOption.BOOLEAN:
+ // Convert the string to a boolean
+ value = new Boolean(element.getAttribute("defaultValue"));
+ break;
case IOption.STRING:
- value = element.getAttribute("value");
+ // Just get the value out of the option directly
+ value = element.getAttribute("defaultValue");
+ break;
+ case IOption.ENUMERATED:
+ List enumList = new ArrayList();
+ IConfigurationElement[] enumElements = element.getChildren("optionEnum");
+ for (int i = 0; i < enumElements.length; ++i) {
+ String optName = enumElements[i].getAttribute("name");
+ String optCommand = enumElements[i].getAttribute("command");
+ enumList.add(optName);
+ enumCommands.put(optName, optCommand);
+ Boolean isDefault = new Boolean(enumElements[i].getAttribute("isDefault"));
+ if (isDefault.booleanValue()) {
+ defaultEnumName = optName;
+ }
+ }
+ value = enumList;
break;
case IOption.STRING_LIST:
List valueList = new ArrayList();
- value = valueList;
IConfigurationElement[] valueElements = element.getChildren("optionValue");
for (int i = 0; i < valueElements.length; ++i) {
valueList.add(valueElements[i].getAttribute("value"));
}
+ value = valueList;
break;
}
}
@@ -82,11 +114,17 @@
* @see org.eclipse.cdt.core.build.managed.IOption#getApplicableValues()
*/
public String[] getApplicableValues() {
+ List enumValues = (List)value;
return enumValues != null
? (String[])enumValues.toArray(new String[enumValues.size()])
: emptyStrings;
}
+ public boolean getBooleanValue() {
+ Boolean bool = (Boolean) value;
+ return bool.booleanValue();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCategory()
*/
@@ -95,6 +133,27 @@
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getCommand()
+ */
+ public String getCommand() {
+ return command;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
+ */
+ public String getDefaultEnumName() {
+ return defaultEnumName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
+ */
+ public String getEnumCommand(String name) {
+ return (String) enumCommands.get(name);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
public String[] getStringListValue() {
@@ -126,6 +185,13 @@
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
+ */
+ public void setCategory(IOptionCategory category) {
+ this.category = category;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setStringValue(org.eclipse.cdt.core.build.managed.IConfiguration, java.lang.String)
*/
public IOption setValue(IConfiguration config, String value)
@@ -161,13 +227,6 @@
// More magic
return null;
}
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
- */
- public void setCategory(IOptionCategory category) {
- this.category = category;
}
}
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.5
diff -u -r1.5 OptionReference.java
--- build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java 25 Apr 2003 14:32:51 -0000 1.5
+++ build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java 15 May 2003 15:31:08 -0000
@@ -11,7 +11,10 @@
package org.eclipse.cdt.internal.core.build.managed;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+
import org.eclipse.cdt.core.build.managed.BuildException;
import org.eclipse.cdt.core.build.managed.IOption;
@@ -30,6 +33,9 @@
private IOption option;
private ToolReference owner;
private Object value;
+ private String defaultEnumName;
+ private String command;
+ private Map enumCommands;
/**
* Created internally.
@@ -57,9 +63,28 @@
owner.addOptionReference(this);
// value
+ enumCommands = new HashMap();
switch (option.getValueType()) {
+ case IOption.BOOLEAN:
+ value = new Boolean(element.getAttribute("defaultValue"));
+ break;
case IOption.STRING:
- value = element.getAttribute("value");
+ value = element.getAttribute("defaultValue");
+ break;
+ case IOption.ENUMERATED:
+ List enumList = new ArrayList();
+ IConfigurationElement[] enumElements = element.getChildren("optionEnum");
+ for (int i = 0; i < enumElements.length; ++i) {
+ String optName = enumElements[i].getAttribute("name");
+ String optCommand = enumElements[i].getAttribute("command");
+ enumList.add(optName);
+ enumCommands.put(optName, optCommand);
+ Boolean isDefault = new Boolean(enumElements[i].getAttribute("isDefault"));
+ if (isDefault.booleanValue()) {
+ defaultEnumName = optName;
+ }
+ }
+ value = enumList;
break;
case IOption.STRING_LIST:
List valueList = new ArrayList();
@@ -67,6 +92,7 @@
for (int i = 0; i < valueElements.length; ++i) {
valueList.add(valueElements[i].getAttribute("value"));
}
+ value = valueList;
break;
}
}
@@ -85,6 +111,7 @@
// value
switch (option.getValueType()) {
+ case IOption.BOOLEAN:
case IOption.STRING:
value = element.getAttribute("value");
break;
@@ -94,6 +121,7 @@
for (int i = 0; i < nodes.getLength(); ++i) {
valueList.add(((Element)nodes.item(i)).getAttribute("value"));
}
+ value = valueList;
break;
}
@@ -110,16 +138,26 @@
// value
switch (option.getValueType()) {
+ case IOption.BOOLEAN:
case IOption.STRING:
element.setAttribute("value", (String)value);
break;
case IOption.STRING_LIST:
- List valueList = (List)value;
- for (int i = 0; i < valueList.size(); ++i) {
+ List stringList = (List)value;
+ for (int i = 0; i < stringList.size(); ++i) {
Element valueElement = doc.createElement("optionValue");
- valueElement.setAttribute("value", (String)valueList.get(i));
+ valueElement.setAttribute("value", (String)stringList.get(i));
element.appendChild(valueElement);
}
+ break;
+ case IOption.ENUMERATED:
+ List enumList = (List)value;
+ for (int i = 0; i < enumList.size(); ++i) {
+ Element valueElement = doc.createElement("optionEnum");
+ valueElement.setAttribute("value", (String)enumList.get(i));
+ element.appendChild(valueElement);
+ }
+ break;
}
}
@@ -138,6 +176,42 @@
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getCommand()
+ */
+ public String getCommand() {
+ return option.getCommand();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
+ */
+ public String getDefaultEnumName() {
+ if (value == null) {
+ return option.getDefaultEnumName();
+ } else {
+ return defaultEnumName;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
+ */
+ public String getEnumCommand(String name) {
+ if (value == null) {
+ return option.getEnumCommand(name);
+ } else {
+ return (String)enumCommands.get(name);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
+ */
+ public String getId() {
+ return option.getId();
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
*/
public String getName() {
@@ -145,6 +219,21 @@
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.core.build.managed.IOption#getBooleanValue()
+ */
+ public boolean getBooleanValue() throws BuildException {
+ if (value == null){
+ return option.getBooleanValue();
+ }
+ else if (getValueType() == IOption.BOOLEAN) {
+ Boolean bool = (Boolean) value;
+ return bool.booleanValue();
+ } else {
+ throw new BuildException("bad value type");
+ }
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
public String[] getStringListValue() throws BuildException {
@@ -184,13 +273,6 @@
*/
public int getValueType() {
return option.getValueType();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
- */
- public String getId() {
- return option.getId();
}
public boolean references(IOption target) {
Index: schema/ManagedBuildTools.exsd
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd,v
retrieving revision 1.4
diff -u -r1.4 ManagedBuildTools.exsd
--- schema/ManagedBuildTools.exsd 25 Apr 2003 14:32:51 -0000 1.4
+++ schema/ManagedBuildTools.exsd 15 May 2003 15:31:08 -0000
@@ -1,343 +1,397 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.cdt.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.cdt.core" id="ManagedBuildTools" name="Managed Build Tools"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="target"/>
- <element ref="tool"/>
- <element ref="configuration"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="tool">
- <complexType>
- <sequence>
- <element ref="option"/>
- <element ref="optionCategory"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="sources" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="outputs" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="dependencyCalculator" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="option">
- <complexType>
- <sequence>
- <element ref="optionEnum"/>
- <element ref="optionValue"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="valueType" use="default" value="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="string">
- </enumeration>
- <enumeration value="stringList">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="value" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="category" type="string">
- <annotation>
- <documentation>
- This is the id of the option category for this option. The id can be the id of the tool which is also a category.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="optionEnum">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="configuration">
- <complexType>
- <sequence>
- <element ref="toolRef"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="toolRef">
- <complexType>
- <sequence>
- <element ref="optionRef"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="optionRef">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="value" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="target">
- <annotation>
- <documentation>
- Represents a type of resource that is the target of the build process, for example, a Linux Library. A target contains a sequence of tool definitions and configurations. Targets are arranged in an inheritance hierarchy where a target inherits the list of tools from it's parent and can add to or override tools in this list.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="tool"/>
- <element ref="configuration"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isAbstract" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- This is a UI property. If set to true, users should not be able to create project configurations targeted at this target.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="parent" type="string">
- <annotation>
- <documentation>
- The id of a target that this tool inherits from.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="optionCategory">
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="owner" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="optionValue">
- <complexType>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.cdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.cdt.core" id="ManagedBuildTools" name="Managed Build Tools"/>
+ </appInfo>
+ <documentation>
+ Describes targets, configurations, and toolchains for the build system.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="target"/>
+ <element ref="tool"/>
+ <element ref="configuration"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tool">
+ <complexType>
+ <sequence>
+ <element ref="option"/>
+ <element ref="optionCategory"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="sources" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="outputs" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="dependencyCalculator" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="option">
+ <complexType>
+ <sequence>
+ <element ref="optionEnum"/>
+ <element ref="optionValue"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ A unique identifier for the option.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ A descriptive name for the option.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="valueType" use="default" value="string">
+ <annotation>
+ <documentation>
+ An option can be one of the following types; 'string' for catch-all entries for options that cannot be easily defined any other way, 'string list' for entries that consist of a list of values such as defined symbols or paths, 'boolean' for options that have two values, and 'enumerated' for options that are one-of a list of values.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="string">
+ </enumeration>
+ <enumeration value="stringList">
+ </enumeration>
+ <enumeration value="boolean">
+ </enumeration>
+ <enumeration value="enumerated">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="value" type="string">
+ <annotation>
+ <documentation>
+ Overridden value assigned to the option by the end user.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="category" type="string">
+ <annotation>
+ <documentation>
+ This is the id of the option category for this option. The id can be the id of the tool which is also a category.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="defaultValue" type="string">
+ <annotation>
+ <documentation>
+ Specifies the default value for the option if the 'value' field is blank. For enumerated options the optionEnums will be searched for the default. For string list options, all defined optionValues will be treated as defaults. For boolean values, specify truth using the string 'true'. All other strings will be treated as false.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="command" type="string">
+ <annotation>
+ <documentation>
+ An optional value that specifies the actual command that will be passed to the tool on the command line.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="optionEnum">
+ <annotation>
+ <documentation>
+ Defines a single value of an enumerated option.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique identifier for the option enumeration.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ A descriptive name for the enumeration.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="isDefault" type="boolean">
+ <annotation>
+ <documentation>
+ Flags this enumerated value as the default to apply to the option if the user has not changed the setting.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="command" type="string">
+ <annotation>
+ <documentation>
+ The command that the enumerated value translates to on the command line.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="configuration">
+ <complexType>
+ <sequence>
+ <element ref="toolRef"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="toolRef">
+ <complexType>
+ <sequence>
+ <element ref="optionRef"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="optionRef">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="defaultValue" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="command" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="target">
+ <annotation>
+ <documentation>
+ Represents a type of resource that is the target of the build process, for example, a Linux Library. A target contains a sequence of tool definitions and configurations. Targets are arranged in an inheritance hierarchy where a target inherits the list of tools from it's parent and can add to or override tools in this list.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="tool"/>
+ <element ref="configuration"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="isAbstract" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ This is a UI property. If set to true, users should not be able to create project configurations targeted at this target.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="parent" type="string">
+ <annotation>
+ <documentation>
+ The id of a target that this tool inherits from.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="optionCategory">
+ <annotation>
+ <documentation>
+ An optional, but useful, mechanism for grouping options together.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="owner" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="optionValue">
+ <annotation>
+ <documentation>
+ A value for defining individual elements of a string list option.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ CDT 1.1
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/plugin.xml,v
retrieving revision 1.10
diff -u -r1.10 plugin.xml
--- plugin.xml 25 Apr 2003 14:32:49 -0000 1.10
+++ plugin.xml 15 May 2003 15:31:52 -0000
@@ -105,7 +105,8 @@
id="category">
</optionCategory>
<option
- name="Option in Top"
+ name="List Option in Top"
+ command="-L"
valueType="stringList"
id="topOption">
<optionValue
@@ -116,12 +117,38 @@
</optionValue>
</option>
<option
- name="Option in Category"
+ defaultValue="false"
+ name="Boolean Option in Top"
+ command="-b"
+ valueType="boolean"
+ id="topBoolOption">
+ </option>
+ <option
+ defaultValue="x"
+ name="String Option in Category"
category="category"
- value="x"
valueType="string"
id="childOption">
</option>
+ <option
+ name="Enumerated Option in Category"
+ category="category"
+ valueType="enumerated"
+ id="child.enumerated.option">
+ <optionEnum
+ name="Default Enum"
+ value="s"
+ isDefault="true"
+ command="-e1"
+ id="default.enum.option">
+ </optionEnum>
+ <optionEnum
+ name="Another Enum"
+ value="t"
+ command="-e2"
+ id="another.enum.option">
+ </optionEnum>
+ </option>
</tool>
<configuration
name="Root Config"
@@ -133,6 +160,7 @@
<toolRef
id="root.tool">
<optionRef
+ defaultValue="y"
value="y"
id="childOption">
</optionRef>
Index: build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui.tests/build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java,v
retrieving revision 1.7
diff -u -r1.7 AllBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java 25 Apr 2003 14:32:49 -0000 1.7
+++ build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java 15 May 2003 15:31:52 -0000
@@ -172,27 +172,51 @@
// Root Tool
ITool rootTool = tools[0];
assertEquals("Root Tool", rootTool.getName());
- // Options
+ // 4 Options are defined in the root tool
IOption[] options = rootTool.getOptions();
- assertEquals(2, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(4, options.length);
+ // First option is a 2-element list
+ assertEquals("List Option in Top", options[0].getName());
+ assertEquals(IOption.STRING_LIST, options[0].getValueType());
String[] valueList = options[0].getStringListValue();
+ assertEquals(2, valueList.length);
assertEquals("a", valueList[0]);
assertEquals("b", valueList[1]);
- assertEquals("Option in Category", options[1].getName());
- assertEquals("x", options[1].getStringValue());
+ assertEquals(options[0].getCommand(), "-L");
+ // Next option is a boolean in top
+ assertEquals("Boolean Option in Top", options[1].getName());
+ assertEquals(IOption.BOOLEAN, options[1].getValueType());
+ assertEquals(false, options[1].getBooleanValue());
+ assertEquals("-b", options[1].getCommand());
+ // Next option is a string category
+ assertEquals("String Option in Category", options[2].getName());
+ assertEquals(IOption.STRING, options[2].getValueType());
+ assertEquals("x", options[2].getStringValue());
+ // Final option is an enumerated
+ assertEquals("Enumerated Option in Category", options[3].getName());
+ assertEquals(IOption.ENUMERATED, options[3].getValueType());
+ assertEquals("Default Enum", options[3].getDefaultEnumName());
+ valueList = options[3].getApplicableValues();
+ assertEquals(2, valueList.length);
+ assertEquals("Default Enum", valueList[0]);
+ assertEquals("Another Enum", valueList[1]);
+ assertEquals("-e1", options[3].getEnumCommand(valueList[0]));
+ assertEquals("-e2", options[3].getEnumCommand(valueList[1]));
+
// Option Categories
IOptionCategory topCategory = rootTool.getTopOptionCategory();
assertEquals("Root Tool", topCategory.getName());
options = topCategory.getOptions(null);
- assertEquals(1, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("List Option in Top", options[0].getName());
+ assertEquals("Boolean Option in Top", options[1].getName());
IOptionCategory[] categories = topCategory.getChildCategories();
assertEquals(1, categories.length);
assertEquals("Category", categories[0].getName());
options = categories[0].getOptions(null);
- assertEquals(1, options.length);
- assertEquals("Option in Category", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("String Option in Category", options[0].getName());
+ assertEquals("Enumerated Option in Category", options[1].getName());
// Configs
IConfiguration[] configs = target.getConfigurations();
@@ -205,15 +229,18 @@
assertEquals("Root Tool", tools[0].getName());
topCategory = tools[0].getTopOptionCategory();
options = topCategory.getOptions(configs[0]);
- assertEquals(1, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("List Option in Top", options[0].getName());
valueList = options[0].getStringListValue();
assertEquals("a", valueList[0]);
assertEquals("b", valueList[1]);
+ assertEquals("Boolean Option in Top", options[1].getName());
categories = topCategory.getChildCategories();
options = categories[0].getOptions(configs[0]);
- assertEquals("Option in Category", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("String Option in Category", options[0].getName());
assertEquals(oicValue, options[0].getStringValue());
+ assertEquals("Enumerated Option in Category", options[1].getName());
// Root Override Config
assertEquals("Root Override Config", configs[1].getName());
tools = configs[1].getTools();
@@ -222,15 +249,24 @@
assertEquals("Root Tool", tools[0].getName());
topCategory = tools[0].getTopOptionCategory();
options = topCategory.getOptions(configs[1]);
- assertEquals(1, options.length);
- assertEquals("Option in Top", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("List Option in Top", options[0].getName());
valueList = options[0].getStringListValue();
assertEquals("a", valueList[0]);
assertEquals("b", valueList[1]);
+ assertEquals("Boolean Option in Top", options[1].getName());
categories = topCategory.getChildCategories();
options = categories[0].getOptions(configs[1]);
- assertEquals("Option in Category", options[0].getName());
+ assertEquals(2, options.length);
+ assertEquals("String Option in Category", options[0].getName());
assertEquals("y", options[0].getStringValue());
+ assertEquals("Enumerated Option in Category", options[1].getName());
+ valueList = options[1].getApplicableValues();
+ assertEquals(2, valueList.length);
+ assertEquals("Default Enum", valueList[0]);
+ assertEquals("Another Enum", valueList[1]);
+ assertEquals("-e1", options[1].getEnumCommand(valueList[0]));
+ assertEquals("-e2", options[1].getEnumCommand(valueList[1]));
}
}