diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java index 96196495736..8d5d90ed798 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java @@ -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 true 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(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java index 4686324be21..b7ebec459bd 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java @@ -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()); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java index 075eb593a51..40eae24ec7c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java @@ -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); + } }