1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

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

This commit is contained in:
Sean Evoy 2004-05-19 17:39:16 +00:00
parent 9ebf2c9909
commit f64e265d26
3 changed files with 37 additions and 4 deletions

View file

@ -91,6 +91,13 @@ public interface ITool extends IBuildObject {
*/ */
public IOption[] getOptions(); 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, * Answer the output extension the receiver will create from the input,
* or <code>null</code> if the tool does not understand that extension. * or <code>null</code> if the tool does not understand that extension.

View file

@ -48,7 +48,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
private int natureFilter; private int natureFilter;
private Vector optionList; private Vector optionList;
private Map optionMap; private Map optionMap;
private String outputExtension; private String outputExtensions;
private String outputFlag; private String outputFlag;
private String outputPrefix; private String outputPrefix;
private boolean resolved = true; private boolean resolved = true;
@ -373,6 +373,13 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
return (IOptionCategory)getCategoryMap().get(id); return (IOptionCategory)getCategoryMap().get(id);
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtensions()
*/
public String[] getOutputExtensions() {
return outputExtensions.split(DEFAULT_SEPARATOR);
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITool#getOutput(java.lang.String) * @see org.eclipse.cdt.core.build.managed.ITool#getOutput(java.lang.String)
*/ */
@ -381,7 +388,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
ListIterator iter = getInputExtensions().listIterator(); ListIterator iter = getInputExtensions().listIterator();
while (iter.hasNext()) { while (iter.hasNext()) {
if (((String)iter.next()).equals(inputExtension)) { if (((String)iter.next()).equals(inputExtension)) {
return outputExtension; return outputExtensions;
} }
} }
return null; return null;
@ -445,7 +452,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
} }
// Get the output extension // Get the output extension
outputExtension = element.getAttribute(ITool.OUTPUTS) == null ? outputExtensions = element.getAttribute(ITool.OUTPUTS) == null ?
new String() : new String() :
element.getAttribute(ITool.OUTPUTS); 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) * @see org.eclipse.cdt.core.build.managed.ITool#producesFileType(java.lang.String)
*/ */
public boolean producesFileType(String outputExtension) { public boolean producesFileType(String outputExtension) {
return this.outputExtension.equals(outputExtension); return this.outputExtensions.equals(outputExtension);
} }
/** /**

View file

@ -157,6 +157,17 @@ public class ToolReference implements IToolReference {
command = parent.getToolCommand(); command = parent.getToolCommand();
outputFlag = parent.getOutputFlag(); outputFlag = parent.getOutputFlag();
outputPrefix = parent.getOutputPrefix(); 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) { if (owner instanceof Configuration) {
((Configuration)owner).addToolReference(this); ((Configuration)owner).addToolReference(this);
@ -481,6 +492,14 @@ public class ToolReference implements IToolReference {
return options; return options;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtensions()
*/
public String[] getOutputExtensions() {
return outputExtensions.split(DEFAULT_SEPARATOR);
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtension(java.lang.String) * @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtension(java.lang.String)
*/ */