mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Fix for bug 61505 - closing and opening a project causes "null" to appear in the makefile
This commit is contained in:
parent
87821eb4fc
commit
437c6840b1
1 changed files with 20 additions and 18 deletions
|
@ -11,6 +11,7 @@
|
||||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ public class ToolReference implements IToolReference {
|
||||||
private boolean isDirty = false;
|
private boolean isDirty = false;
|
||||||
private List optionReferences;
|
private List optionReferences;
|
||||||
private IBuildObject owner;
|
private IBuildObject owner;
|
||||||
private List outputExtensions;
|
private String outputExtensions;
|
||||||
private String outputFlag;
|
private String outputFlag;
|
||||||
private String outputPrefix;
|
private String outputPrefix;
|
||||||
protected ITool parent;
|
protected ITool parent;
|
||||||
|
@ -85,11 +86,7 @@ public class ToolReference implements IToolReference {
|
||||||
|
|
||||||
// Get the output extensions the reference produces
|
// Get the output extensions the reference produces
|
||||||
if (element.hasAttribute(ITool.OUTPUTS)) {
|
if (element.hasAttribute(ITool.OUTPUTS)) {
|
||||||
String output = element.getAttribute(ITool.OUTPUTS);
|
outputExtensions = element.getAttribute(ITool.OUTPUTS);
|
||||||
String[] outputs = output.split(DEFAULT_SEPARATOR);
|
|
||||||
for (int index = outputs.length - 1; index >= 0; --index) {
|
|
||||||
getOutputsList().add(outputs[index].trim());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Get the flag to control output
|
// Get the flag to control output
|
||||||
if (element.hasAttribute(ITool.OUTPUT_FLAG))
|
if (element.hasAttribute(ITool.OUTPUT_FLAG))
|
||||||
|
@ -133,10 +130,7 @@ public class ToolReference implements IToolReference {
|
||||||
// Get the overridden output extensions (if any)
|
// Get the overridden output extensions (if any)
|
||||||
String output = element.getAttribute(ITool.OUTPUTS);
|
String output = element.getAttribute(ITool.OUTPUTS);
|
||||||
if (output != null) {
|
if (output != null) {
|
||||||
String[] outputs = output.split(DEFAULT_SEPARATOR);
|
outputExtensions = output;
|
||||||
for (int index = outputs.length - 1; index >= 0; --index) {
|
|
||||||
getOutputsList().add(outputs[index].trim());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the flag to control output
|
// Get the flag to control output
|
||||||
|
@ -317,6 +311,18 @@ public class ToolReference implements IToolReference {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List getOutputsList() {
|
||||||
|
ArrayList answer = new ArrayList();
|
||||||
|
if (outputExtensions != null) {
|
||||||
|
String[] exts = outputExtensions.split(DEFAULT_SEPARATOR);
|
||||||
|
answer.addAll(Arrays.asList(exts));
|
||||||
|
}
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IToolReference#getTool()
|
* @see org.eclipse.cdt.managedbuilder.core.IToolReference#getTool()
|
||||||
*/
|
*/
|
||||||
|
@ -482,13 +488,6 @@ public class ToolReference implements IToolReference {
|
||||||
return parent.getOutputExtension(inputExtension);
|
return parent.getOutputExtension(inputExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List getOutputsList() {
|
|
||||||
if (outputExtensions == null) {
|
|
||||||
outputExtensions = new ArrayList();
|
|
||||||
}
|
|
||||||
return outputExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputFlag()
|
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputFlag()
|
||||||
*/
|
*/
|
||||||
|
@ -561,11 +560,14 @@ public class ToolReference implements IToolReference {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the output flag
|
// Save the output flag
|
||||||
if (outputPrefix != null) {
|
if (outputFlag != null) {
|
||||||
element.setAttribute(ITool.OUTPUT_FLAG, getOutputFlag());
|
element.setAttribute(ITool.OUTPUT_FLAG, getOutputFlag());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the outputs
|
// Save the outputs
|
||||||
|
if (outputExtensions != null) {
|
||||||
|
element.setAttribute(ITool.OUTPUTS, outputExtensions);
|
||||||
|
}
|
||||||
|
|
||||||
// Output the option references
|
// Output the option references
|
||||||
Iterator iter = getOptionReferenceList().listIterator();
|
Iterator iter = getOptionReferenceList().listIterator();
|
||||||
|
|
Loading…
Add table
Reference in a new issue