1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 03:45:35 +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. * 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 * For example, a librarian usually prepends 'lib' to the target.a
* @param String * @param String
* @see {@link #setOutputPrefixForPrimaryOutput(String)}
*/ */
public void setOutputPrefix(String prefix); public void setOutputPrefix(String prefix);
public void setOutputPrefixForPrimaryOutput(String prefix);
/** /**
* Returns <code>true</code> if the Tool wants the MBS to display the Advanced * 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 * 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); IInputType getEdtableInputType(IInputType base);
IOutputType getEdtableOutputType(IOutputType base);
boolean isEnabled(); boolean isEnabled();
// boolean isReal(); // 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) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#setOutputsAttribute(java.lang.String) * @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; 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) { public boolean supportsType(IBuildPropertyType type) {
return supportsType(type.getId()); return supportsType(type.getId());

View file

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