mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42: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:
parent
9ebf2c9909
commit
f64e265d26
3 changed files with 37 additions and 4 deletions
|
@ -91,6 +91,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.
|
||||
|
|
|
@ -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;
|
||||
|
@ -373,6 +373,13 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
|
|||
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)
|
||||
* @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();
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
@ -481,6 +492,14 @@ public class ToolReference implements IToolReference {
|
|||
return options;
|
||||
}
|
||||
|
||||
/* (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)
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue