Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-05-19 13:39:16 -0400
committerSean Evoy2004-05-19 13:39:16 -0400
commitf64e265d26a1f7aa716521de3a895306083c1f75 (patch)
treefc205106c266918792b28cb33a2c78da1a7e9c71 /build/org.eclipse.cdt.managedbuilder.core
parent9ebf2c99093949be13d33b05a6695fc9d76e14fc (diff)
downloadorg.eclipse.cdt-f64e265d26a1f7aa716521de3a895306083c1f75.tar.gz
org.eclipse.cdt-f64e265d26a1f7aa716521de3a895306083c1f75.tar.xz
org.eclipse.cdt-f64e265d26a1f7aa716521de3a895306083c1f75.zip
Final fix for bug 61505. When an option was set, a toolr reference was created but the "copy constructor" was not doing a complete copy, so the output of the tool was lost. This fix addresses that
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java19
3 files changed, 37 insertions, 4 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java
index d147b9a802d..c6be9280f37 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java
@@ -92,6 +92,13 @@ public interface ITool extends IBuildObject {
public IOption[] getOptions();
/**
+ * Answers all of the output extensions that the receiver can build.
+ *
+ * @return <code>String[]</code> of extensions
+ */
+ public String[] getOutputExtensions();
+
+ /**
* Answer the output extension the receiver will create from the input,
* or <code>null</code> if the tool does not understand that extension.
*
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
index 8edae32748b..26e7f3cae71 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
@@ -48,7 +48,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
private int natureFilter;
private Vector optionList;
private Map optionMap;
- private String outputExtension;
+ private String outputExtensions;
private String outputFlag;
private String outputPrefix;
private boolean resolved = true;
@@ -374,6 +374,13 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtensions()
+ */
+ public String[] getOutputExtensions() {
+ return outputExtensions.split(DEFAULT_SEPARATOR);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITool#getOutput(java.lang.String)
*/
public String getOutputExtension(String inputExtension) {
@@ -381,7 +388,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
ListIterator iter = getInputExtensions().listIterator();
while (iter.hasNext()) {
if (((String)iter.next()).equals(inputExtension)) {
- return outputExtension;
+ return outputExtensions;
}
}
return null;
@@ -445,7 +452,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
}
// Get the output extension
- outputExtension = element.getAttribute(ITool.OUTPUTS) == null ?
+ outputExtensions = element.getAttribute(ITool.OUTPUTS) == null ?
new String() :
element.getAttribute(ITool.OUTPUTS);
@@ -484,7 +491,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
* @see org.eclipse.cdt.core.build.managed.ITool#producesFileType(java.lang.String)
*/
public boolean producesFileType(String outputExtension) {
- return this.outputExtension.equals(outputExtension);
+ return this.outputExtensions.equals(outputExtension);
}
/**
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 d7e7af24d41..1a8c036c008 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
@@ -157,6 +157,17 @@ public class ToolReference implements IToolReference {
command = parent.getToolCommand();
outputFlag = parent.getOutputFlag();
outputPrefix = parent.getOutputPrefix();
+ String[] extensions = parent.getOutputExtensions();
+ if (extensions != null) {
+ outputExtensions = new String();
+ for (int index = 0; index < extensions.length; ++index) {
+ if (extensions[index] == null) continue;
+ outputExtensions += extensions[index];
+ if (index < extensions.length - 1) {
+ outputExtensions += DEFAULT_SEPARATOR;
+ }
+ }
+ }
if (owner instanceof Configuration) {
((Configuration)owner).addToolReference(this);
@@ -482,6 +493,14 @@ public class ToolReference implements IToolReference {
}
/* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtensions()
+ */
+ public String[] getOutputExtensions() {
+ return outputExtensions.split(DEFAULT_SEPARATOR);
+ }
+
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtension(java.lang.String)
*/
public String getOutputExtension(String inputExtension) {

Back to the top