1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Output type and output prefix edit functionality

This commit is contained in:
Mikhail Sennikovsky 2007-05-21 14:10:25 +00:00
parent 2bd73d2db8
commit cbf4f25769
3 changed files with 48 additions and 0 deletions

View file

@ -419,9 +419,12 @@ public interface ITool extends IBuildObject, IHoldsOptions {
* Sets the prefix that the tool should prepend to the name of the build artifact.
* For example, a librarian usually prepends 'lib' to the target.a
* @param String
* @see {@link #setOutputPrefixForPrimaryOutput(String)}
*/
public void setOutputPrefix(String prefix);
public void setOutputPrefixForPrimaryOutput(String prefix);
/**
* Returns <code>true</code> if the Tool wants the MBS to display the Advanced
* Input category that allows the user to specify additional input resources and
@ -754,6 +757,8 @@ public interface ITool extends IBuildObject, IHoldsOptions {
*/
IInputType getEdtableInputType(IInputType base);
IOutputType getEdtableOutputType(IOutputType base);
boolean isEnabled();
// boolean isReal();

View file

@ -2463,6 +2463,25 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
}
public void setOutputPrefixForPrimaryOutput(String prefix) {
if(prefix != null && prefix.equals(getOutputPrefix()))
return;
IOutputType type = getPrimaryOutputType();
if(type == null)
setOutputPrefix(prefix);
else {
setOutputPrefixForType(type, prefix);
}
}
private void setOutputPrefixForType(IOutputType type, String prefix){
type = getEdtableOutputType(type);
type.setOutputPrefix(prefix);
setRebuildState(true);
isDirty = true;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#setOutputsAttribute(java.lang.String)
*/
@ -3545,6 +3564,22 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
return newType;
}
public IOutputType getEdtableOutputType(IOutputType base) {
if(base.getParent() == this)
return base;
IOutputType extType = base;
for(;extType != null && !extType.isExtensionElement();extType = extType.getSuperClass());
String id;
if(extType != null){
id = ManagedBuildManager.calculateChildId(extType.getId(), null);
} else {
id = ManagedBuildManager.calculateChildId(getId(), null);
}
IOutputType newType = (IOutputType)createOutputType(base, id, base.getName(), false);
return newType;
}
public boolean supportsType(IBuildPropertyType type) {
return supportsType(type.getId());

View file

@ -1325,4 +1325,12 @@ public class ToolReference implements IToolReference {
public String getUniqueRealName() {
return getName();
}
public IOutputType getEdtableOutputType(IOutputType base) {
return null;
}
public void setOutputPrefixForPrimaryOutput(String prefix) {
setOutputPrefix(prefix);
}
}