diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
index 3c95c03c3f0..f2ebf0461d7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog
@@ -1,3 +1,46 @@
+2003-09-25 Sean Evoy
+ This patch contains a lot of changes needed to implement fixes for 42648 and
+ 43122.
+
+ For 42648, the schema for the the target had to be modified to include a
+ comma-separated list of valid host platforms.
+ * schema/ManagedBuildTools.exsd
+
+ The target had to be updated to properly read in and understand this info, and
+ the interface had to be updated to return a list to the clients in the UI. The
+ target was also changed slightly. It now uses a safer accessor method to get at
+ the list of tools it maintains. I have also stopped persisting non-variant info
+ to the project file on serialize. There are elements of the target that are not
+ subject to change by the user (yet) so they should not be saved.
+ * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
+ * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+
+ For 43122, I started by simply adding a tool reference to the configurations.
+ The tool reference had option references for debug and optimization levels. It
+ should have worked, but the model was not handling the inheritance properly. The
+ JUnit tests were not finding it because of how they were configured. It was most
+ evident in the UI. So, the way configurations and tool reference search for
+ overridden option references had to be modified. While I was in there, I cleaned
+ up some of the accessor and iteration code in ToolReference and OptionReference.
+
+ For the configuration, the only significant change was a new search method to
+ find all option references for a given tool, no matter where they are stored.
+ The method had to consider what was overridden in a child config, what was added by
+ a child config, and what the parent (or parents) define.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+
+ Option reference now pays attention to overidden values in the plugin file. Until
+ now, it only handled the overrides in the project file.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+
+ The ToolReference now distinguishes between local option references which it
+ manages directly, and option references held by tool references in the parent(s)
+ of its owner. It only serializes its own references, but when asked for options
+ relating to the tool it references, it replies with all option references in its
+ hierarchy.
+ * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+
+
2003-09-24 Sean Evoy
Changed the implementor of IScannerInfo to answer only absolute paths when asked for
includes paths. Users will specify the includes paths in the managed build UI in such a way
diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
index 79709bc8f5e..82bf278d2fb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
+++ b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd
@@ -394,6 +394,13 @@ Two additional types exist to flag options of special relevance to the build mod
+
+
+
+ This field is used by the managed build system to decide when to show the user the target. The value should be a comma-separated list. Current values are "win32", "linux", and "solaris".
+
+
+
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
index 010a97db574..ef7395aba71 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
@@ -25,6 +25,7 @@ public interface ITarget extends IBuildObject {
public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
public static final String IS_TEST = "isTest"; //$NON-NLS-1$
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
+ public static final String OS_LIST = "osList"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$
/**
@@ -35,7 +36,7 @@ public interface ITarget extends IBuildObject {
*
* @param parent The IConfiguration to use as a settings template
* @param id The unique id the new configuration will have
- * @return
+ * @return IConfiguration
*/
public IConfiguration createConfiguration(IConfiguration parent, String id);
@@ -44,34 +45,35 @@ public interface ITarget extends IBuildObject {
* the tools defined for that target and options set at their defaults.
*
* @param id id for this configuration.
- * @return
+ * @return IConfiguration
*/
public IConfiguration createConfiguration(String id);
/**
* Get the name of the final build artifact.
*
- * @return
+ * @return String
*/
public String getArtifactName();
/**
* Answers the unique ID of the binary parser associated with the target.
*
- * @return
+ * @return String
*/
public String getBinaryParserId();
/**
* Answers the OS-specific command to remove files created by the build
*
- * @return
+ * @return String
*/
public String getCleanCommand();
/**
* Returns all of the configurations defined by this target.
- * @return
+ *
+ * @return IConfiguration[]
*/
public IConfiguration[] getConfigurations();
@@ -79,14 +81,14 @@ public interface ITarget extends IBuildObject {
* Get the default extension that should be applied to build artifacts
* created by this target.
*
- * @return
+ * @return String
*/
public String getDefaultExtension();
/**
* Answers the name of the make utility for the target.
*
- * @return
+ * @return String
*/
public String getMakeCommand();
@@ -94,27 +96,36 @@ public interface ITarget extends IBuildObject {
* Returns the configuration with the given id, or null if not found.
*
* @param id
- * @return
+ * @return IConfiguration
*/
public IConfiguration getConfiguration(String id);
/**
* Gets the resource that this target is applied to.
*
- * @return
+ * @return IResource
*/
public IResource getOwner();
/**
- * @return the ITarget that is the parent of the receiver.
+ * Answers the ITarget that is the parent of the receiver.
+ *
+ * @return ITarget
*/
public ITarget getParent();
+ /**
+ * Answers an array of operating systems the target can be created on.
+ *
+ * @return String[]
+ */
+ public String[] getTargetOSList();
+
/**
* Returns the list of platform specific tools associated with this
* platform.
*
- * @return
+ * @return ITool[]
*/
public ITool[] getTools();
@@ -123,13 +134,13 @@ public interface ITarget extends IBuildObject {
* Answers true if the receiver has a make command that differs from its
* parent specification.
*
- * @return
+ * @return boolean
*/
public boolean hasOverridenMakeCommand();
/**
* Returns whether this target is abstract.
- * @return
+ * @return boolean
*/
public boolean isAbstract();
@@ -138,7 +149,7 @@ public interface ITarget extends IBuildObject {
* for testing purposes only, else false. A test target will
* not be shown in the UI but can still be manipulated programmatically.
*
- * @return
+ * @return boolean
*/
public boolean isTestTarget();
@@ -170,4 +181,5 @@ public interface ITarget extends IBuildObject {
* @param command
*/
public void setMakeCommand(String command);
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index 4de1b3afa7e..e11691734f0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
@@ -12,6 +12,7 @@ package org.eclipse.cdt.managedbuilder.internal.core;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.cdt.managedbuilder.core.BuildException;
@@ -61,6 +62,9 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target;
this.parent = parent;
+ // Get the tool references from the parent
+ getLocalToolReferences().addAll(((Configuration)parent).getLocalToolReferences());
+
target.addConfiguration(this);
}
@@ -147,14 +151,29 @@ public class Configuration extends BuildObject implements IConfiguration {
if (parent != null)
element.setAttribute(IConfiguration.PARENT, parent.getId());
- for (int i = 0; i < getToolReferences().size(); ++i) {
- ToolReference toolRef = (ToolReference)getToolReferences().get(i);
+ // Serialize only the tool references defined in the configuration
+ Iterator iter = getLocalToolReferences().listIterator();
+ while (iter.hasNext()) {
+ ToolReference toolRef = (ToolReference) iter.next();
Element toolRefElement = doc.createElement(IConfiguration.TOOL_REF);
element.appendChild(toolRefElement);
toolRef.serialize(doc, toolRefElement);
}
}
+ /* (non-javadoc)
+ * A safety method to avoid NPEs. It answers the tool reference list in the
+ * receiver. It does not look at the tool references defined in the parent.
+ *
+ * @return List
+ */
+ protected List getLocalToolReferences() {
+ if (toolReferences == null) {
+ toolReferences = new ArrayList();
+ }
+ return toolReferences;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getName()
*/
@@ -162,16 +181,6 @@ public class Configuration extends BuildObject implements IConfiguration {
return (name == null && parent != null) ? parent.getName() : name;
}
- /*
- * @return
- */
- private List getToolReferences() {
- if (toolReferences == null) {
- toolReferences = new ArrayList();
- }
- return toolReferences;
- }
-
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTools()
*/
@@ -180,7 +189,7 @@ public class Configuration extends BuildObject implements IConfiguration {
? parent.getTools()
: target.getTools();
- // Replace tools with overrides
+ // Replace tools with local overrides
for (int i = 0; i < tools.length; ++i) {
ToolReference ref = getToolReference(tools[i]);
if (ref != null)
@@ -195,7 +204,7 @@ public class Configuration extends BuildObject implements IConfiguration {
*/
public void reset(IConfigurationElement element) {
// I just need to reset the tool references
- getToolReferences().clear();
+ getLocalToolReferences().clear();
IConfigurationElement[] configElements = element.getChildren();
for (int l = 0; l < configElements.length; ++l) {
IConfigurationElement configElement = configElements[l];
@@ -211,6 +220,35 @@ public class Configuration extends BuildObject implements IConfiguration {
public IConfiguration getParent() {
return parent;
}
+
+ /* (non-javadoc)
+ *
+ * @param tool
+ * @return List
+ */
+ protected List getOptionReferences(ITool tool) {
+ List references = new ArrayList();
+
+ // Get all the option references I add for this tool
+ ToolReference toolRef = getToolReference(tool);
+ if (toolRef != null) {
+ references.addAll(toolRef.getLocalOptionRefs());
+ }
+
+ // See if there is anything that my parents add that I don't
+ if (parent != null) {
+ List temp = ((Configuration)parent).getOptionReferences(tool);
+ Iterator iter = temp.listIterator();
+ while (iter.hasNext()) {
+ OptionReference ref = (OptionReference) iter.next();
+ if (!references.contains(ref)) {
+ references.add(ref);
+ }
+ }
+ }
+
+ return references;
+ }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTarget()
@@ -227,22 +265,29 @@ public class Configuration extends BuildObject implements IConfiguration {
}
/**
- * Returns the reference for a given tool.
+ * Returns the reference for a given tool or null if one is not
+ * found.
*
* @param tool
- * @return
+ * @return ToolReference
*/
private ToolReference getToolReference(ITool tool) {
- for (int i = 0; i < getToolReferences().size(); ++i) {
- ToolReference toolRef = (ToolReference)getToolReferences().get(i);
- if (toolRef.references(tool))
- return toolRef;
+ // See if the receiver has a reference to the tool
+ ToolReference ref = null;
+ Iterator iter = getLocalToolReferences().listIterator();
+ while (iter.hasNext()) {
+ ToolReference temp = (ToolReference)iter.next();
+ if (temp.references(tool)) {
+ ref = temp;
+ break;
+ }
}
- return null;
+
+ return ref;
}
public void addToolReference(ToolReference toolRef) {
- getToolReferences().add(toolRef);
+ getLocalToolReferences().add(toolRef);
}
public OptionReference createOptionReference(IOption option) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
index 269812c5832..5f72cf0dd34 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
@@ -76,11 +76,15 @@ public class OptionReference implements IOption {
value = element.getAttribute(IOption.DEFAULT_VALUE);
break;
case IOption.ENUMERATED:
- try {
- value = option.getSelectedEnum();
- } catch (BuildException e) {
- value = new String();
+ String temp = element.getAttribute(DEFAULT_VALUE);
+ if (temp == null) {
+ try {
+ temp = option.getSelectedEnum();
+ } catch (BuildException e) {
+ temp = new String();
+ }
}
+ value = temp;
break;
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
index a40912c2b60..9461b47da91 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
@@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.StringTokenizer;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -42,8 +43,9 @@ public class Target extends BuildObject implements ITarget {
private String makeCommand;
private IResource owner;
private ITarget parent;
+ private List targetOSList;
private Map toolMap;
- private List tools;
+ private List toolList;
private static final IConfiguration[] emptyConfigs = new IConfiguration[0];
private static final String EMPTY_STRING = new String();
@@ -78,7 +80,8 @@ public class Target extends BuildObject implements ITarget {
}
/**
- * This constructor is called to create a target defined by an extension.
+ * This constructor is called to create a target defined by an extension point in
+ * a plugin manifest file.
*
* @param element
*/
@@ -113,8 +116,7 @@ public class Target extends BuildObject implements ITarget {
}
// isAbstract
- if ("true".equals(element.getAttribute(IS_ABSTRACT)))
- isAbstract = true;
+ isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT)));
// Is this a test target
isTest = ("true".equals(element.getAttribute(IS_TEST)));
@@ -133,12 +135,29 @@ public class Target extends BuildObject implements ITarget {
makeCommand = parent.getMakeCommand();
}
+ // Get the comma-separated list of valid OS
+ String os = element.getAttribute(OS_LIST);
+ if (os != null) {
+ targetOSList = new ArrayList();
+ StringTokenizer tokens = new StringTokenizer(os, ",");
+ while (tokens.hasMoreTokens()) {
+ targetOSList.add(tokens.nextToken().trim());
+ }
+ }
+
IConfigurationElement[] targetElements = element.getChildren();
- for (int k = 0; k < targetElements.length; ++k) {
+ int k;
+ // Load the tools first
+ for (k = 0; k < targetElements.length; ++k) {
IConfigurationElement targetElement = targetElements[k];
if (targetElement.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
new Tool(this, targetElement);
- } else if (targetElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
+ }
+ }
+ // Then load the configurations which may have tool references
+ for (k = 0; k < targetElements.length; ++k) {
+ IConfigurationElement targetElement = targetElements[k];
+ if (targetElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
new Configuration(this, targetElement);
}
}
@@ -146,7 +165,7 @@ public class Target extends BuildObject implements ITarget {
}
/**
- * Create target from project file
+ * Create target from project file.
*
* @param buildInfo
* @param element
@@ -167,9 +186,6 @@ public class Target extends BuildObject implements ITarget {
// contain what the user entered in the UI).
artifactName = element.getAttribute(ARTIFACT_NAME);
- // Get the ID of the binary parser
- binaryParserId = element.getAttribute(BINARY_PARSER);
-
// Get the default extension
defaultExtension = element.getAttribute(DEFAULT_EXTENSION);
@@ -238,7 +254,6 @@ public class Target extends BuildObject implements ITarget {
element.setAttribute(PARENT, parent.getId());
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false");
element.setAttribute(ARTIFACT_NAME, getArtifactName());
- element.setAttribute(BINARY_PARSER, getBinaryParserId());
element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension());
element.setAttribute(IS_TEST, isTest ? "true" : "false");
element.setAttribute(CLEAN_COMMAND, getCleanCommand());
@@ -277,6 +292,22 @@ public class Target extends BuildObject implements ITarget {
return parent;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITarget#getTargetOSList()
+ */
+ public String[] getTargetOSList() {
+ if (targetOSList == null) {
+ // Ask parent for its list
+ if (parent != null) {
+ return parent.getTargetOSList();
+ } else {
+ // I have no parent and no defined list but never return null
+ return new String[0];
+ }
+ }
+ return (String[]) targetOSList.toArray(new String[targetOSList.size()]);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getOwner()
*/
@@ -285,25 +316,41 @@ public class Target extends BuildObject implements ITarget {
}
private int getNumTools() {
- int n = (tools == null) ? 0 : tools.size();
+ int n = getToolList().size();
if (parent != null)
n += ((Target)parent).getNumTools();
return n;
}
+
private int addToolsToArray(ITool[] toolArray, int start) {
int n = start;
if (parent != null)
n = ((Target)parent).addToolsToArray(toolArray, start);
- if (tools != null) {
- for (int i = 0; i < tools.size(); ++i)
- toolArray[n++] = (ITool)tools.get(i);
+ for (int i = 0; i < getToolList().size(); ++i) {
+ toolArray[n++] = (ITool)getToolList().get(i);
}
return n;
}
+ private List getToolList() {
+ if (toolList == null) {
+ toolList = new ArrayList();
+ toolList.clear();
+ }
+ return toolList;
+ }
+
+ private Map getToolMap() {
+ if (toolMap == null) {
+ toolMap = new HashMap();
+ toolMap.clear();
+ }
+ return toolMap;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getTools()
*/
@@ -322,16 +369,19 @@ public class Target extends BuildObject implements ITarget {
/**
* @param id
- * @return
+ * @return ITool
*/
public ITool getTool(String id) {
ITool result = null;
+
// See if receiver has it in list
- result = (ITool)toolMap.get(id);
+ result = (ITool) getToolMap().get(id);
+
// If not, check if parent has it
if (result == null && parent != null) {
result = ((Target)parent).getTool(id);
}
+
return result;
}
@@ -339,13 +389,8 @@ public class Target extends BuildObject implements ITarget {
* @param tool
*/
public void addTool(ITool tool) {
- if (tools == null) {
- tools = new ArrayList();
- toolMap = new HashMap();
- }
-
- tools.add(tool);
- toolMap.put(tool.getId(), tool);
+ getToolList().add(tool);
+ getToolMap().put(tool.getId(), tool);
}
/* (non-Javadoc)
@@ -377,15 +422,33 @@ public class Target extends BuildObject implements ITarget {
* @see org.eclipse.cdt.core.build.managed.ITarget#getArtifactName()
*/
public String getArtifactName() {
- // Return name or an empty string
- return artifactName == null ? EMPTY_STRING : artifactName;
+ if (artifactName == null) {
+ // If I have a parent, ask it
+ if (parent != null) {
+ return parent.getArtifactName();
+ } else {
+ // I'm it and this is not good!
+ return EMPTY_STRING;
+ }
+ } else {
+ return artifactName;
+ }
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId()
*/
public String getBinaryParserId() {
- return binaryParserId == null ? EMPTY_STRING : binaryParserId;
+ if (binaryParserId == null) {
+ // If I have a parent, ask it
+ if (parent != null) {
+ return parent.getBinaryParserId();
+ } else {
+ // I'm it and this is not good!
+ return EMPTY_STRING;
+ }
+ }
+ return binaryParserId;
}
/* (non-Javadoc)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
index bd230450dbf..e671a2a3dcc 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
@@ -11,6 +11,7 @@
package org.eclipse.cdt.managedbuilder.internal.core;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -49,6 +50,15 @@ public class ToolReference implements ITool {
owner.addToolReference(this);
}
+ /**
+ * Adds the option reference specified in the argument to the receiver.
+ *
+ * @param optionRef
+ */
+ public void addOptionReference(OptionReference optionRef) {
+ getLocalOptionRefs().add(optionRef);
+ }
+
/**
* Created tool reference from an extension defined in a plugin manifest.
*
@@ -58,7 +68,7 @@ public class ToolReference implements ITool {
public ToolReference(Configuration owner, IConfigurationElement element) {
this.owner = owner;
- parent = ((Target)owner.getTarget()).getTool(element.getAttribute("id"));
+ parent = ((Target)owner.getTarget()).getTool(element.getAttribute(ID));
owner.addToolReference(this);
@@ -104,14 +114,13 @@ public class ToolReference implements ITool {
*/
public void serialize(Document doc, Element element) {
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(ITool.OPTION_REF);
- element.appendChild(optionRefElement);
- optionRef.serialize(doc, optionRefElement);
- }
+ Iterator iter = getLocalOptionRefs().listIterator();
+ while (iter.hasNext()) {
+ OptionReference optionRef = (OptionReference) iter.next();
+ Element optionRefElement = doc.createElement(ITool.OPTION_REF);
+ element.appendChild(optionRefElement);
+ optionRef.serialize(doc, optionRefElement);
+ }
}
public IConfiguration getConfiguration() {
@@ -254,6 +263,11 @@ public class ToolReference implements ITool {
return parent.producesFileType(outputExtension);
}
+ protected List getAllOptionRefs() {
+ // First get all the option references this tool reference contains
+ return ((Configuration)owner).getOptionReferences(parent);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
@@ -283,35 +297,63 @@ public class ToolReference implements ITool {
}
public boolean references(ITool target) {
- if (equals(target))
+ if (equals(target)) {
// we are the target
return true;
- else if (parent instanceof ToolReference)
+ }
+ else if (parent instanceof ToolReference) {
// check the reference we are overriding
return ((ToolReference)parent).references(target);
- else
+ }
+ else if (target instanceof ToolReference) {
+ return parent.equals(((ToolReference)target).parent);
+ }
+ else {
// the real reference
return parent.equals(target);
+ }
}
+ /* (non-javadoc)
+ * Answers an option reference that overrides the option, or null
+ *
+ * @param option
+ * @return OptionReference
+ */
private OptionReference getOptionReference(IOption option) {
- if (optionReferences != null)
- for (int i = 0; i < optionReferences.size(); ++i) {
- OptionReference optionRef = (OptionReference)optionReferences.get(i);
- if (optionRef.references(option))
- return optionRef;
- }
+ // Get all the option references for this option
+ Iterator iter = getAllOptionRefs().listIterator();
+ while (iter.hasNext()) {
+ OptionReference optionRef = (OptionReference) iter.next();
+ if (optionRef.references(option))
+ return optionRef;
+ }
+
return null;
}
- public OptionReference createOptionReference(IOption option) {
- return new OptionReference(this, option);
+ protected List getLocalOptionRefs() {
+ if (optionReferences == null) {
+ optionReferences = new ArrayList();
+ optionReferences.clear();
+ }
+ return optionReferences;
}
- public void addOptionReference(OptionReference optionRef) {
- if (optionReferences == null)
- optionReferences = new ArrayList();
- optionReferences.add(optionRef);
+ /**
+ * Answers a reference to the option. If the reference does not exist,
+ * a new reference is created.
+ *
+ * @param option
+ * @return OptionReference
+ */
+ public OptionReference createOptionReference(IOption option) {
+ // Check if the option reference already exists
+ OptionReference ref = getOptionReference(option);
+ if (ref == null) {
+ ref = new OptionReference(this, option);
+ }
+ return ref;
}
/* (non-Javadoc)
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
index 98cbb16ca00..f0a2e2f0649 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
+++ b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog
@@ -1,3 +1,24 @@
+2003-09-25 Sean Evoy
+ This patch contains a lot of changes needed to implement fixes for 42648 and
+ 43122.
+
+ The properties file has been updated to externalize some of the option labels
+ to try and address some of the concern about continuity between UIs on
+ different platforms.
+ * plugin.properties
+
+ There are changes in the plugin XML file to accomodate showing the targets
+ only on the correct host platform. Option names have bee replaced with
+ externalized equivalents where possible. The release and debug configurations
+ for each configuration now apply "reasonable" defaults for debug and optimization
+ option. Finally, the Cygwinb tool specification has been brought closer to those
+ for *nix.
+ * plugin.xml
+
+ Only targets that correspond to the host platforms are shown in the drop-down
+ list.
+ * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
+
2003-09-23 Sean Evoy
I added a fix for critical bug 43439. The new project wizard is ready to be hooked
up to the help system content on F1. There is a new file with the string constant
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
index bff79be6a1e..10a64d102da 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties
@@ -22,7 +22,21 @@ OptionCategory.Debug=Debugging
OptionCategory.Warn=Warnings
OptionCategory.Misc=Miscellaneous
OptionCategory.Libs=Libraries
+
Option.Posix.PreprocOnly=Preprocess only (-E)
+Option.Posix.Nostdinc=Do not search system directories (-nostdinc)
+
Option.Posix.DefSym=Defined symbols (-D)
+Option.Posix.UndefSym=Undefined symbols (-U)
+
+Option.Posix.Optimize.None=None (-O0)
+Option.Posix.Optimize.Optimize=Optimize (-O1)
+Option.Posix.Optimize.More=Optimize more (-O2)
+Option.Posix.Optimize.Most=Optimize most (-O3)
+
+Option.Posix.Verbose=Verbose (-v)
+Option.OtherFlags=Other flags
+
+Option.Posix.Linker.Flags=Linker flags
Option.Posix.Libs=Libraries (-l)
Option.Posix.Libsearch=Library search path (-L)
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index 95183810699..7210dbccae4 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -61,19 +61,21 @@
+
+ binaryParser="org.eclipse.cdt.core.PE"
+ makeFlags="-k"
+ osList="win32">
+
+
+
+
+
+
+
+
+
+
+
@@ -315,10 +376,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ binaryParser="org.eclipse.cdt.core.ELF"
+ makeFlags="-k"
+ osList="linux">
+
@@ -766,21 +935,21 @@
name="%OptionCategory.Misc"
id="linux.gnu.compiler.category.other">
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ binaryParser="org.eclipse.cdt.core.ELF"
+ makeFlags="-k"
+ osList="solaris">