From 73debc0e33669a9f37d2685f135e672f4fde4a00 Mon Sep 17 00:00:00 2001 From: Leo Treggiari Date: Tue, 7 Mar 2006 18:39:40 +0000 Subject: [PATCH] Fix line endings --- .../managedbuilder/core/IConfiguration.java | 1006 ++++++------ .../cdt/managedbuilder/core/IInputType.java | 782 ++++----- .../core/IManagedBuildInfo.java | 1002 ++++++------ .../cdt/managedbuilder/core/ITool.java | 1452 ++++++++--------- 4 files changed, 2121 insertions(+), 2121 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java index db97e1548a0..e17eb5f556e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java @@ -1,503 +1,503 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier; -import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; - -/** - * A tool-integrator defines default configurations as children of the project type. - * These provide a template for the configurations added to the user's project, - * which are stored in the project's .cdtbuild file. - *

- * The configuration contains one child of type tool-chain. This describes how the - * project's resources are transformed into the build artifact. The configuration can - * contain one or more children of type resourceConfiguration. These describe build - * settings of individual resources that are different from the configuration as a whole. - * - * @since 2.1 - */ -public interface IConfiguration extends IBuildObject { - public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$ - public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$ - public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$ - public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$ - public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$ - public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$ - // Schema element names - public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$ - public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$ - public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$ - public static final String PARENT = "parent"; //$NON-NLS-1$ - - public static final String DESCRIPTION = "description"; //$NON-NLS-1$ - - - - /** - * Returns the description of the configuration. - * - * @return String - */ - public String getDescription(); - - /** - * Sets the description of the receiver to the value specified in the argument - * - * @param description - */ - public void setDescription(String description); - - /** - * Creates a child resource configuration corresponding to the passed in file. - * - * @param file - * @return IResourceConfiguration - */ - public IResourceConfiguration createResourceConfiguration(IFile file); - - /** - * Creates the IToolChain child of this configuration. - * - * @param ToolChain The superClass, if any - * @param String The id for the new tool chain - * @param String The name for the new tool chain - * - * @return IToolChain - */ - public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement); - - /** - * Returns the extension that should be applied to build artifacts created by - * this configuration. - * - * @return String - */ - public String getArtifactExtension(); - - /** - * Returns the name of the final build artifact. - * - * @return String - */ - public String getArtifactName(); - - /** - * Returns the build arguments from this configuration's builder - * - * @return String - */ - public String getBuildArguments(); - - /** - * Returns the build command from this configuration's builder - * - * @return String - */ - public String getBuildCommand(); - - /** - * Returns the prebuild step command - * - * @return String - */ - public String getPrebuildStep(); - - /** - * Returns the postbuild step command - * - * @return String - */ - public String getPostbuildStep(); - - /** - * Returns the display string associated with the prebuild step - * - * @return String - */ - public String getPreannouncebuildStep(); - - /** - * Returns the display string associated with the postbuild step - * - * @return String - */ - public String getPostannouncebuildStep(); - - /** - * Answers the OS-specific command to remove files created by the build - * of this configuration. - * - * @return String - */ - public String getCleanCommand(); - - /** - * Answers the semicolon separated list of unique IDs of the error parsers associated - * with this configuration. - * - * @return String - */ - public String getErrorParserIds(); - - /** - * Answers the ordered list of unique IDs of the error parsers associated - * with this configuration. - * - * @return String[] - */ - public String[] getErrorParserList(); - - /** - * Projects have C or CC natures. Tools can specify a filter so they are not - * misapplied to a project. This method allows the caller to retrieve a list - * of tools from a project that are correct for a project's nature. - * - * @return an array of ITools that have compatible filters - * for this configuration. - */ - ITool[] getFilteredTools(); - - /** - * Returns the managed-project parent of this configuration, if this is a - * project configuration. Otherwise, returns null. - * - * @return IManagedProject - */ - public IManagedProject getManagedProject(); - - /** - * Returns the Eclipse project that owns the configuration. - * - * @return IResource - */ - public IResource getOwner(); - - /** - * Returns the configuration that this configuration is based on. - * - * @return IConfiguration - */ - public IConfiguration getParent(); - - /** - * Returns the project-type parent of this configuration, if this is an - * extension configuration. Otherwise, returns null. - * - * @return IProjectType - */ - public IProjectType getProjectType(); - - /** - * Returns the resource configuration child of this configuration - * that is associated with the project resource, or null if none. - * - * @return IResourceConfiguration - */ - public IResourceConfiguration getResourceConfiguration(String path); - - /** - * Returns the resource configuration children of this configuration. - * - * @return IResourceConfigurations[] - */ - public IResourceConfiguration[] getResourceConfigurations(); - - /** - * Returns the ITool in this configuration's tool-chain with - * the same id as the argument, or null. - * - * @param id unique identifier to search for - * @return ITool - */ - public ITool getTool(String id); - - /** - * Returns the ITool in this configuration's tool-chain with - * the specified ID, or the tool(s) with a superclass with this id. - * - *

If the tool-chain does not have a tool with that ID, the method - * returns an empty array. It is the responsibility of the caller to - * verify the return value. - * - * @param id unique identifier of the tool to search for - * @return ITool[] - * @since 3.0.2 - */ - public ITool[] getToolsBySuperClassId(String id); - - /** - * Returns the IToolChain child of this configuration. - * - * @return IToolChain - */ - public IToolChain getToolChain(); - - /** - * Returns the command-line invocation command for the specified tool. - * - * @param tool The tool that will have its command retrieved. - * @return String The command - */ - public String getToolCommand(ITool tool); - - /** - * Returns the tools that are used in this configuration's tool-chain. - * - * @return ITool[] - */ - public ITool[] getTools(); - - /** - * Returns the tool in this configuration that creates the build artifact. - * - * @return ITool - */ - public ITool getTargetTool(); - - /** - * Returns true if this configuration has overridden the default build - * build command in this configuration, otherwise false. - * - * @return boolean - */ - public boolean hasOverriddenBuildCommand(); - - /** - * Returns true if the extension matches one of the special - * file extensions the tools for the configuration consider to be a header file. - * - * @param ext the file extension of the resource - * @return boolean - */ - public boolean isHeaderFile(String ext); - - /** - * Returns true if this configuration has changes that need to - * be saved in the project file, else false. - * Should not be called for an extension configuration. - * - * @return boolean - */ - public boolean isDirty(); - - /** - * Returns true if this configuration was loaded from a manifest file, - * and false if it was loaded from a project (.cdtbuild) file. - * - * @return boolean - */ - public boolean isExtensionElement(); - - /** - * Returns whether this configuration has been changed and requires the - * project to be rebuilt. - * - * @return true if the configuration contains a change - * that needs the project to be rebuilt. - * Should not be called for an extension configuration. - */ - public boolean needsRebuild(); - - /** - * Removes a resource configuration from the configuration's list. - * - * @param option - */ - public void removeResourceConfiguration(IResourceConfiguration resConfig); - - /** - * Set (override) the extension that should be appended to the build artifact - * for the receiver. - * - * @param extension - */ - public void setArtifactExtension(String extension); - - /** - * Set the name of the artifact that will be produced when the receiver - * is built. - * - * @param name - */ - public void setArtifactName(String name); - - /** - * Sets the arguments to be passed to the build utility used by the - * receiver to produce a build goal. - * - * @param makeArgs - */ - public void setBuildArguments(String makeArgs); - - /** - * Sets the build command for the receiver to the value in the argument. - * - * @param command - */ - public void setBuildCommand(String command); - - /** - * Sets the prebuild step for the receiver to the value in the argument. - * - * @param step - */ - public void setPrebuildStep(String step); - - /** - * Sets the postbuild step for the receiver to the value in the argument. - * - * @param step - */ - public void setPostbuildStep(String step); - - /** - * Sets the prebuild step display string for the receiver to the value in the argument. - * - * @param announceStep - */ - public void setPreannouncebuildStep(String announceStep); - - /** - * Sets the postbuild step display string for the receiver to the value in the argument. - * - * @param announceStep - */ - public void setPostannouncebuildStep(String announceStep); - - /** - * Sets the command used to clean the outputs of this configuration. - * - * @param name - */ - public void setCleanCommand(String command); - - /** - * Sets the element's "dirty" (have I been modified?) flag. - * - * @param isDirty - */ - public void setDirty(boolean isDirty); - - /** - * Sets the semicolon separated list of error parser ids - * - * @param ids - */ - public void setErrorParserIds(String ids); - - /** - * Sets the name of the receiver to the value specified in the argument - * - * @param name - */ - public void setName(String name); - - /** - * Sets the value of a boolean option for this configuration. - * - * @param parent The holder/parent of the option. - * @param option The option to change. - * @param value The value to apply to the option. - * - * @return IOption The modified option. This can be the same option or a newly created option. - * - * @throws BuildException - * - * @since 3.0 - The type of parent has changed from ITool to IHoldsOptions. - * Code assuming ITool as type, will continue to work unchanged. - */ - public IOption setOption(IHoldsOptions parent, IOption option, boolean value) - throws BuildException; - - /** - * Sets the value of a string option for this configuration. - * - * @param parent The holder/parent of the option. - * @param option The option that will be effected by change. - * @param value The value to apply to the option. - * - * @return IOption The modified option. This can be the same option or a newly created option. - * - * @throws BuildException - * - * @since 3.0 - The type of parent has changed from ITool to IHoldsOptions. - * Code assuming ITool as type, will continue to work unchanged. - */ - public IOption setOption(IHoldsOptions parent, IOption option, String value) - throws BuildException; - - /** - * Sets the value of a list option for this configuration. - * - * @param parent The holder/parent of the option. - * @param option The option to change. - * @param value The values to apply to the option. - * - * @return IOption The modified option. This can be the same option or a newly created option. - * - * @throws BuildException - * - * @since 3.0 - The type of parent has changed from ITool to IHoldsOptions. - * Code assuming ITool as type, will continue to work unchanged. - */ - public IOption setOption(IHoldsOptions parent, IOption option, String[] value) - throws BuildException; - - /** - * Sets the rebuild state in this configuration. - * - * @param rebuild true will force a rebuild the next time the project builds - * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean) - */ - void setRebuildState(boolean rebuild); - - /** - * Overrides the tool command for a tool defined in this configuration's tool-chain. - * - * @param tool The tool that will have its command modified. - * @param command The command - */ - public void setToolCommand(ITool tool, String command); - - /** - * Returns true if the configuration's tool-chain is supported on the system - * otherwise returns false - * - * @return boolean - */ - public boolean isSupported(); - - /** - * Returns the implementation of the IConfigurationEnvironmentVariableSupplier provided - * by the tool-integrator or null if none. - * - * @return IConfigurationEnvironmentVariableSupplier - */ - public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier(); - - /** - * Returns the tool-integrator provided implementation of the configuration build macro supplier - * or null if none. - * - * @return IConfigurationBuildMacroSupplier - */ - public IConfigurationBuildMacroSupplier getBuildMacroSupplier(); - - /** - * answers true if the configuration is temporary, otherwise - false - * @return boolean - */ - public boolean isTemporary(); - -} +/******************************************************************************* + * Copyright (c) 2003, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.managedbuilder.core; + +import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier; +import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; + +/** + * A tool-integrator defines default configurations as children of the project type. + * These provide a template for the configurations added to the user's project, + * which are stored in the project's .cdtbuild file. + *

+ * The configuration contains one child of type tool-chain. This describes how the + * project's resources are transformed into the build artifact. The configuration can + * contain one or more children of type resourceConfiguration. These describe build + * settings of individual resources that are different from the configuration as a whole. + * + * @since 2.1 + */ +public interface IConfiguration extends IBuildObject { + public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$ + public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$ + public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$ + public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$ + public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$ + public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$ + // Schema element names + public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$ + public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$ + public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$ + public static final String PARENT = "parent"; //$NON-NLS-1$ + + public static final String DESCRIPTION = "description"; //$NON-NLS-1$ + + + + /** + * Returns the description of the configuration. + * + * @return String + */ + public String getDescription(); + + /** + * Sets the description of the receiver to the value specified in the argument + * + * @param description + */ + public void setDescription(String description); + + /** + * Creates a child resource configuration corresponding to the passed in file. + * + * @param file + * @return IResourceConfiguration + */ + public IResourceConfiguration createResourceConfiguration(IFile file); + + /** + * Creates the IToolChain child of this configuration. + * + * @param ToolChain The superClass, if any + * @param String The id for the new tool chain + * @param String The name for the new tool chain + * + * @return IToolChain + */ + public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement); + + /** + * Returns the extension that should be applied to build artifacts created by + * this configuration. + * + * @return String + */ + public String getArtifactExtension(); + + /** + * Returns the name of the final build artifact. + * + * @return String + */ + public String getArtifactName(); + + /** + * Returns the build arguments from this configuration's builder + * + * @return String + */ + public String getBuildArguments(); + + /** + * Returns the build command from this configuration's builder + * + * @return String + */ + public String getBuildCommand(); + + /** + * Returns the prebuild step command + * + * @return String + */ + public String getPrebuildStep(); + + /** + * Returns the postbuild step command + * + * @return String + */ + public String getPostbuildStep(); + + /** + * Returns the display string associated with the prebuild step + * + * @return String + */ + public String getPreannouncebuildStep(); + + /** + * Returns the display string associated with the postbuild step + * + * @return String + */ + public String getPostannouncebuildStep(); + + /** + * Answers the OS-specific command to remove files created by the build + * of this configuration. + * + * @return String + */ + public String getCleanCommand(); + + /** + * Answers the semicolon separated list of unique IDs of the error parsers associated + * with this configuration. + * + * @return String + */ + public String getErrorParserIds(); + + /** + * Answers the ordered list of unique IDs of the error parsers associated + * with this configuration. + * + * @return String[] + */ + public String[] getErrorParserList(); + + /** + * Projects have C or CC natures. Tools can specify a filter so they are not + * misapplied to a project. This method allows the caller to retrieve a list + * of tools from a project that are correct for a project's nature. + * + * @return an array of ITools that have compatible filters + * for this configuration. + */ + ITool[] getFilteredTools(); + + /** + * Returns the managed-project parent of this configuration, if this is a + * project configuration. Otherwise, returns null. + * + * @return IManagedProject + */ + public IManagedProject getManagedProject(); + + /** + * Returns the Eclipse project that owns the configuration. + * + * @return IResource + */ + public IResource getOwner(); + + /** + * Returns the configuration that this configuration is based on. + * + * @return IConfiguration + */ + public IConfiguration getParent(); + + /** + * Returns the project-type parent of this configuration, if this is an + * extension configuration. Otherwise, returns null. + * + * @return IProjectType + */ + public IProjectType getProjectType(); + + /** + * Returns the resource configuration child of this configuration + * that is associated with the project resource, or null if none. + * + * @return IResourceConfiguration + */ + public IResourceConfiguration getResourceConfiguration(String path); + + /** + * Returns the resource configuration children of this configuration. + * + * @return IResourceConfigurations[] + */ + public IResourceConfiguration[] getResourceConfigurations(); + + /** + * Returns the ITool in this configuration's tool-chain with + * the same id as the argument, or null. + * + * @param id unique identifier to search for + * @return ITool + */ + public ITool getTool(String id); + + /** + * Returns the ITool in this configuration's tool-chain with + * the specified ID, or the tool(s) with a superclass with this id. + * + *

If the tool-chain does not have a tool with that ID, the method + * returns an empty array. It is the responsibility of the caller to + * verify the return value. + * + * @param id unique identifier of the tool to search for + * @return ITool[] + * @since 3.0.2 + */ + public ITool[] getToolsBySuperClassId(String id); + + /** + * Returns the IToolChain child of this configuration. + * + * @return IToolChain + */ + public IToolChain getToolChain(); + + /** + * Returns the command-line invocation command for the specified tool. + * + * @param tool The tool that will have its command retrieved. + * @return String The command + */ + public String getToolCommand(ITool tool); + + /** + * Returns the tools that are used in this configuration's tool-chain. + * + * @return ITool[] + */ + public ITool[] getTools(); + + /** + * Returns the tool in this configuration that creates the build artifact. + * + * @return ITool + */ + public ITool getTargetTool(); + + /** + * Returns true if this configuration has overridden the default build + * build command in this configuration, otherwise false. + * + * @return boolean + */ + public boolean hasOverriddenBuildCommand(); + + /** + * Returns true if the extension matches one of the special + * file extensions the tools for the configuration consider to be a header file. + * + * @param ext the file extension of the resource + * @return boolean + */ + public boolean isHeaderFile(String ext); + + /** + * Returns true if this configuration has changes that need to + * be saved in the project file, else false. + * Should not be called for an extension configuration. + * + * @return boolean + */ + public boolean isDirty(); + + /** + * Returns true if this configuration was loaded from a manifest file, + * and false if it was loaded from a project (.cdtbuild) file. + * + * @return boolean + */ + public boolean isExtensionElement(); + + /** + * Returns whether this configuration has been changed and requires the + * project to be rebuilt. + * + * @return true if the configuration contains a change + * that needs the project to be rebuilt. + * Should not be called for an extension configuration. + */ + public boolean needsRebuild(); + + /** + * Removes a resource configuration from the configuration's list. + * + * @param option + */ + public void removeResourceConfiguration(IResourceConfiguration resConfig); + + /** + * Set (override) the extension that should be appended to the build artifact + * for the receiver. + * + * @param extension + */ + public void setArtifactExtension(String extension); + + /** + * Set the name of the artifact that will be produced when the receiver + * is built. + * + * @param name + */ + public void setArtifactName(String name); + + /** + * Sets the arguments to be passed to the build utility used by the + * receiver to produce a build goal. + * + * @param makeArgs + */ + public void setBuildArguments(String makeArgs); + + /** + * Sets the build command for the receiver to the value in the argument. + * + * @param command + */ + public void setBuildCommand(String command); + + /** + * Sets the prebuild step for the receiver to the value in the argument. + * + * @param step + */ + public void setPrebuildStep(String step); + + /** + * Sets the postbuild step for the receiver to the value in the argument. + * + * @param step + */ + public void setPostbuildStep(String step); + + /** + * Sets the prebuild step display string for the receiver to the value in the argument. + * + * @param announceStep + */ + public void setPreannouncebuildStep(String announceStep); + + /** + * Sets the postbuild step display string for the receiver to the value in the argument. + * + * @param announceStep + */ + public void setPostannouncebuildStep(String announceStep); + + /** + * Sets the command used to clean the outputs of this configuration. + * + * @param name + */ + public void setCleanCommand(String command); + + /** + * Sets the element's "dirty" (have I been modified?) flag. + * + * @param isDirty + */ + public void setDirty(boolean isDirty); + + /** + * Sets the semicolon separated list of error parser ids + * + * @param ids + */ + public void setErrorParserIds(String ids); + + /** + * Sets the name of the receiver to the value specified in the argument + * + * @param name + */ + public void setName(String name); + + /** + * Sets the value of a boolean option for this configuration. + * + * @param parent The holder/parent of the option. + * @param option The option to change. + * @param value The value to apply to the option. + * + * @return IOption The modified option. This can be the same option or a newly created option. + * + * @throws BuildException + * + * @since 3.0 - The type of parent has changed from ITool to IHoldsOptions. + * Code assuming ITool as type, will continue to work unchanged. + */ + public IOption setOption(IHoldsOptions parent, IOption option, boolean value) + throws BuildException; + + /** + * Sets the value of a string option for this configuration. + * + * @param parent The holder/parent of the option. + * @param option The option that will be effected by change. + * @param value The value to apply to the option. + * + * @return IOption The modified option. This can be the same option or a newly created option. + * + * @throws BuildException + * + * @since 3.0 - The type of parent has changed from ITool to IHoldsOptions. + * Code assuming ITool as type, will continue to work unchanged. + */ + public IOption setOption(IHoldsOptions parent, IOption option, String value) + throws BuildException; + + /** + * Sets the value of a list option for this configuration. + * + * @param parent The holder/parent of the option. + * @param option The option to change. + * @param value The values to apply to the option. + * + * @return IOption The modified option. This can be the same option or a newly created option. + * + * @throws BuildException + * + * @since 3.0 - The type of parent has changed from ITool to IHoldsOptions. + * Code assuming ITool as type, will continue to work unchanged. + */ + public IOption setOption(IHoldsOptions parent, IOption option, String[] value) + throws BuildException; + + /** + * Sets the rebuild state in this configuration. + * + * @param rebuild true will force a rebuild the next time the project builds + * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean) + */ + void setRebuildState(boolean rebuild); + + /** + * Overrides the tool command for a tool defined in this configuration's tool-chain. + * + * @param tool The tool that will have its command modified. + * @param command The command + */ + public void setToolCommand(ITool tool, String command); + + /** + * Returns true if the configuration's tool-chain is supported on the system + * otherwise returns false + * + * @return boolean + */ + public boolean isSupported(); + + /** + * Returns the implementation of the IConfigurationEnvironmentVariableSupplier provided + * by the tool-integrator or null if none. + * + * @return IConfigurationEnvironmentVariableSupplier + */ + public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier(); + + /** + * Returns the tool-integrator provided implementation of the configuration build macro supplier + * or null if none. + * + * @return IConfigurationBuildMacroSupplier + */ + public IConfigurationBuildMacroSupplier getBuildMacroSupplier(); + + /** + * answers true if the configuration is temporary, otherwise - false + * @return boolean + */ + public boolean isTemporary(); + +} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java index 91dc116939f..1118055fe61 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java @@ -1,391 +1,391 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 Intel Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Intel Corporation - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.content.IContentType; - -/** - * This interface represents an inputType instance in the managed build system. - * It describes one category of input files to a Tool. A tool can have - * multiple inputType children. - * - * @since 3.0 - */ -public interface IInputType extends IBuildObject { - public static final String INPUT_TYPE_ELEMENT_NAME = "inputType"; //$NON-NLS-1$ - public static final String SOURCE_CONTENT_TYPE = "sourceContentType"; //$NON-NLS-1$ - public static final String SOURCES = "sources"; //$NON-NLS-1$ - public static final String DEPENDENCY_CONTENT_TYPE = "dependencyContentType"; //$NON-NLS-1$ - public static final String DEPENDENCY_EXTENSIONS = "dependencyExtensions"; //$NON-NLS-1$ - public static final String OPTION = "option"; //$NON-NLS-1$ - public static final String ASSIGN_TO_OPTION = "assignToOption"; //$NON-NLS-1$ - public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$ - public static final String PRIMARY_INPUT = "primaryInput"; //$NON-NLS-1$ - public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$ - - /** - * Creates an inputOrder child for this InputType. - * - * @param path The path associated with the InputOrder element - * @return IInputOrder of the new element - */ - public IInputOrder createInputOrder(String path); - - /** - * Removes the InputOrder element with the path specified in the argument. - * - * @param path The path associated with the InputOrder element - */ - public void removeInputOrder(String path); - - /** - * Removes the InputOrder element specified in the argument. - * - * @param path The InputOrder element - */ - public void removeInputOrder(IInputOrder element); - - /** - * Returns all of the InputOrder children of this InputType - * - * @return IInputOrder[] - */ - public IInputOrder[] getInputOrders(); - - /** - * Returns the InputOrder element with the path specified in the argument. - * - * @param path The path associated with the InputOrder element - * @return IInputOrder - */ - public IInputOrder getInputOrder(String path); - - /** - * Creates an additionalInput child for this InputType. - * - * @param path The path associated with the AdditionalInput element - * @return IAdditionalInput of the new element - */ - public IAdditionalInput createAdditionalInput(String path); - - /** - * Removes the AdditionalInput element with the path specified in the argument. - * - * @param path The path associated with the AdditionalInput element - */ - public void removeAdditionalInput(String path); - - /** - * Removes the AdditionalInput element specified in the argument. - * - * @param element The AdditionalInput element - */ - public void removeAdditionalInput(IAdditionalInput element); - - /** - * Returns all of the AdditionalInput children of this InputType - * - * @return IAdditionalInput[] - */ - public IAdditionalInput[] getAdditionalInputs(); - - /** - * Returns the AdditionalInput element with the path specified in the argument. - * - * @param path The path associated with the AdditionalInput element - * @return IAdditionalInput - */ - public IAdditionalInput getAdditionalInput(String path); - - /** - * Returns all of the additional input resources of this InputType. - * Note: This does not include additional dependencies. - * - * @return IPath[] - */ - public IPath[] getAdditionalResources(); - - /** - * Returns all of the additional dependency resources of this InputType. - * Note: This does not include additional inputs. - * - * @return IPath[] - */ - public IPath[] getAdditionalDependencies(); - - /** - * Returns the tool parent of this InputType. - * - * @return ITool - */ - public ITool getParent(); - - /** - * Returns the IInputType that is the superclass of this - * InputType, or null if the attribute was not specified. - * - * @return IInputType - */ - public IInputType getSuperClass(); - - /** - * Returns the Eclipse IContentType that describes this - * input type. If both the sources attribute and the sourceContentType - * attribute are specified, the sourceContentType will be used if it - * is registered in Eclipse. - * - * @return IContentType - */ - public IContentType getSourceContentType(); - - /** - * Sets the Eclipse IContentType that describes this - * input type. - * - * @param contentType The Eclipse content type - */ - public void setSourceContentType(IContentType contentType); - - /** - * Returns the list of valid source extensions from the - * sourceExtensions attribute. Note that this value is not used - * if source content type is specified and registered with Eclipse. - * Also, the user will not be able to modify the set of file - * extensions as they can when sourceContentType is specified. - * - * @return String[] - */ - public String[] getSourceExtensionsAttribute(); - - /** - * Sets the list of valid source extensions for this input type. - * NOTE: The value of this attribute will NOT be used if a - * source content type is specified and is registered with - * Eclipse. - * - * @param extensions The comma-separated list of valid file extensions - * - not including the separator period. - */ - public void setSourceExtensionsAttribute(String extensions); - - /** - * Returns the list of valid source extensions for this input type. - * Note that the list will come from the sourceContentType if it - * is specified and registered with Eclipse. Otherwise the - * sourceExtensions attribute will be used. - * - * @param tool the tool that contains the input-type - * @return String[] - */ - public String[] getSourceExtensions(ITool tool); - - /** - * Answers true if the input type considers the file extension to be - * one associated with a source file. - * - * @param tool the tool that contains the input-type - * @param ext file extension of the source - * @return boolean - */ - public boolean isSourceExtension(ITool tool, String ext); - - /** - * Returns the Eclipse IContentType that describes the - * dependency files of this input type. If both the dependencyExtensions - * attribute and the dependencyContentType attribute are specified, - * the dependencyContentType will be used if it is defined in Eclipse. - * - * @return IContentType - */ - public IContentType getDependencyContentType(); - - /** - * Sets the Eclipse IContentType that describes the - * dependency files of this input type. - * - * @return type - */ - public void setDependencyContentType(IContentType type); - - /** - * Returns the list of valid dependency extensions from the - * dependencyExtensions attribute. Note that this value is not used - * if dependency content type is specified and registered with Eclipse. - * Also, the user will not be able to modify the set of file - * extensions as they can when dependencyContentType is specified. - * - * @return String[] - */ - public String[] getDependencyExtensionsAttribute(); - - /** - * Sets the list of valid dependency extensions for this input type. - * NOTE: The value of this attribute will NOT be used if a - * dependency content type is specified and is registered with - * Eclipse. - * - * @param extensions The comma-separated list of valid dependency extensions - * - not including the separator period. - */ - public void setDependencyExtensionsAttribute(String extensions); - - /** - * Returns the list of valid dependency extensions for this input type. - * Note that the list will come from the dependencyContentType if it - * is specified and registered with Eclipse. Otherwise the - * dependencyExtensions attribute will be used. - * - * @param tool the tool that contains the input-type - * @return String[] - */ - public String[] getDependencyExtensions(ITool tool); - - /** - * Answers true if the input type considers the file extension to be - * one associated with a dependency file. - * - * @param tool the tool that contains the input-type - * @param ext file extension of the source - * @return boolean - */ - public boolean isDependencyExtension(ITool tool, String ext); - - /** - * Returns the id of the option that is associated with this input - * type on the command line. If specified, the name(s) of the input - * files for this input type are taken from the value specified - * for the option. - * - * @return String - */ - public String getOptionId(); - - /** - * Sets the id of the option that is associated with this input type on - * the command line. If specified, the name(s) of the input files for - * this input type are taken from the value specified for the option. - * - * @param optionId - */ - public void setOptionId(String optionId); - - /** - * Returns the id of the option whose value is to be assigned to the - * file(s) calculated for this input type. The default is not to - * assign the input file(s) to a command line option but to assign the - * files to the ${Inputs} part of the command line. Note that the - * option value is only updated during build file generation and therefore - * could be out of sync with the project until build file generation - * occurs. - * - * @return String - */ - public String getAssignToOptionId(); - - /** - * Sets the id of the option whose value is to be assigned to the - * file(s) calculated for this input type. The default is not to - * assign the input file(s) to a command line option but to assign the - * files to the ${Inputs} part of the command line. Note that the - * option value is only updated during build file generation and therefore - * could be out of sync with the project until build file generation - * occurs. - * - * @param optionId - */ - public void setAssignToOptionId(String optionId); - - /** - * Returns true if this inputType can contain multiple input - * resources, else false. The inputs can be project resources, - * or the outputs of other tools in the tool-chain. - * - * @return boolean - */ - public boolean getMultipleOfType(); - - /** - * Sets whether this inputType can contain multiple input resources - * - * @param multiple - */ - public void setMultipleOfType(boolean multiple); - - /** - * Returns true if this inputType is considered the primary input - * of the tool, else false. - * - * @return boolean - */ - public boolean getPrimaryInput(); - - /** - * Sets whether this inputType is considered the primary input of the tool - * - * @param primary - */ - public void setPrimaryInput(boolean primary); - - /** - * Returns a class instance that implements an interface to generate - * source-level dependencies for this input type. - * This method may return null in which case, the receiver - * should assume that the input type does not require dependency information - * when the project is built. - * - * @return IManagedDependencyGeneratorType - */ - public IManagedDependencyGeneratorType getDependencyGenerator(); - - /** - * Returns the name of the build variable associated this this input type's resources - * The build variable used in the build file to represent the list of input files when - * multipleOfType is True. The same variable name can be used by an outputType to - * identify a set of output files that contribute to this tool’s input - * (i.e., those using the same buildVariable name). The default name is chosen by MBS. - * - * @return String - */ - public String getBuildVariable(); - - /** - * Sets the name of the build variable associated this this input type's resources - * - * @return variableName - */ - public void setBuildVariable(String variableName); - - /** - * Returns true if this element has changes that need to - * be saved in the project file, else false. - * - * @return boolean - */ - public boolean isDirty(); - - /** - * Returns true if this InputType was loaded from a manifest file, - * and false if it was loaded from a project (.cdtbuild) file. - * - * @return boolean - */ - public boolean isExtensionElement(); - - /** - * Sets the element's "dirty" (have I been modified?) flag. - * - * @param isDirty - */ - public void setDirty(boolean isDirty); - -} +/******************************************************************************* + * Copyright (c) 2005, 2006 Intel Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.managedbuilder.core; + +import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.content.IContentType; + +/** + * This interface represents an inputType instance in the managed build system. + * It describes one category of input files to a Tool. A tool can have + * multiple inputType children. + * + * @since 3.0 + */ +public interface IInputType extends IBuildObject { + public static final String INPUT_TYPE_ELEMENT_NAME = "inputType"; //$NON-NLS-1$ + public static final String SOURCE_CONTENT_TYPE = "sourceContentType"; //$NON-NLS-1$ + public static final String SOURCES = "sources"; //$NON-NLS-1$ + public static final String DEPENDENCY_CONTENT_TYPE = "dependencyContentType"; //$NON-NLS-1$ + public static final String DEPENDENCY_EXTENSIONS = "dependencyExtensions"; //$NON-NLS-1$ + public static final String OPTION = "option"; //$NON-NLS-1$ + public static final String ASSIGN_TO_OPTION = "assignToOption"; //$NON-NLS-1$ + public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$ + public static final String PRIMARY_INPUT = "primaryInput"; //$NON-NLS-1$ + public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$ + + /** + * Creates an inputOrder child for this InputType. + * + * @param path The path associated with the InputOrder element + * @return IInputOrder of the new element + */ + public IInputOrder createInputOrder(String path); + + /** + * Removes the InputOrder element with the path specified in the argument. + * + * @param path The path associated with the InputOrder element + */ + public void removeInputOrder(String path); + + /** + * Removes the InputOrder element specified in the argument. + * + * @param path The InputOrder element + */ + public void removeInputOrder(IInputOrder element); + + /** + * Returns all of the InputOrder children of this InputType + * + * @return IInputOrder[] + */ + public IInputOrder[] getInputOrders(); + + /** + * Returns the InputOrder element with the path specified in the argument. + * + * @param path The path associated with the InputOrder element + * @return IInputOrder + */ + public IInputOrder getInputOrder(String path); + + /** + * Creates an additionalInput child for this InputType. + * + * @param path The path associated with the AdditionalInput element + * @return IAdditionalInput of the new element + */ + public IAdditionalInput createAdditionalInput(String path); + + /** + * Removes the AdditionalInput element with the path specified in the argument. + * + * @param path The path associated with the AdditionalInput element + */ + public void removeAdditionalInput(String path); + + /** + * Removes the AdditionalInput element specified in the argument. + * + * @param element The AdditionalInput element + */ + public void removeAdditionalInput(IAdditionalInput element); + + /** + * Returns all of the AdditionalInput children of this InputType + * + * @return IAdditionalInput[] + */ + public IAdditionalInput[] getAdditionalInputs(); + + /** + * Returns the AdditionalInput element with the path specified in the argument. + * + * @param path The path associated with the AdditionalInput element + * @return IAdditionalInput + */ + public IAdditionalInput getAdditionalInput(String path); + + /** + * Returns all of the additional input resources of this InputType. + * Note: This does not include additional dependencies. + * + * @return IPath[] + */ + public IPath[] getAdditionalResources(); + + /** + * Returns all of the additional dependency resources of this InputType. + * Note: This does not include additional inputs. + * + * @return IPath[] + */ + public IPath[] getAdditionalDependencies(); + + /** + * Returns the tool parent of this InputType. + * + * @return ITool + */ + public ITool getParent(); + + /** + * Returns the IInputType that is the superclass of this + * InputType, or null if the attribute was not specified. + * + * @return IInputType + */ + public IInputType getSuperClass(); + + /** + * Returns the Eclipse IContentType that describes this + * input type. If both the sources attribute and the sourceContentType + * attribute are specified, the sourceContentType will be used if it + * is registered in Eclipse. + * + * @return IContentType + */ + public IContentType getSourceContentType(); + + /** + * Sets the Eclipse IContentType that describes this + * input type. + * + * @param contentType The Eclipse content type + */ + public void setSourceContentType(IContentType contentType); + + /** + * Returns the list of valid source extensions from the + * sourceExtensions attribute. Note that this value is not used + * if source content type is specified and registered with Eclipse. + * Also, the user will not be able to modify the set of file + * extensions as they can when sourceContentType is specified. + * + * @return String[] + */ + public String[] getSourceExtensionsAttribute(); + + /** + * Sets the list of valid source extensions for this input type. + * NOTE: The value of this attribute will NOT be used if a + * source content type is specified and is registered with + * Eclipse. + * + * @param extensions The comma-separated list of valid file extensions + * - not including the separator period. + */ + public void setSourceExtensionsAttribute(String extensions); + + /** + * Returns the list of valid source extensions for this input type. + * Note that the list will come from the sourceContentType if it + * is specified and registered with Eclipse. Otherwise the + * sourceExtensions attribute will be used. + * + * @param tool the tool that contains the input-type + * @return String[] + */ + public String[] getSourceExtensions(ITool tool); + + /** + * Answers true if the input type considers the file extension to be + * one associated with a source file. + * + * @param tool the tool that contains the input-type + * @param ext file extension of the source + * @return boolean + */ + public boolean isSourceExtension(ITool tool, String ext); + + /** + * Returns the Eclipse IContentType that describes the + * dependency files of this input type. If both the dependencyExtensions + * attribute and the dependencyContentType attribute are specified, + * the dependencyContentType will be used if it is defined in Eclipse. + * + * @return IContentType + */ + public IContentType getDependencyContentType(); + + /** + * Sets the Eclipse IContentType that describes the + * dependency files of this input type. + * + * @return type + */ + public void setDependencyContentType(IContentType type); + + /** + * Returns the list of valid dependency extensions from the + * dependencyExtensions attribute. Note that this value is not used + * if dependency content type is specified and registered with Eclipse. + * Also, the user will not be able to modify the set of file + * extensions as they can when dependencyContentType is specified. + * + * @return String[] + */ + public String[] getDependencyExtensionsAttribute(); + + /** + * Sets the list of valid dependency extensions for this input type. + * NOTE: The value of this attribute will NOT be used if a + * dependency content type is specified and is registered with + * Eclipse. + * + * @param extensions The comma-separated list of valid dependency extensions + * - not including the separator period. + */ + public void setDependencyExtensionsAttribute(String extensions); + + /** + * Returns the list of valid dependency extensions for this input type. + * Note that the list will come from the dependencyContentType if it + * is specified and registered with Eclipse. Otherwise the + * dependencyExtensions attribute will be used. + * + * @param tool the tool that contains the input-type + * @return String[] + */ + public String[] getDependencyExtensions(ITool tool); + + /** + * Answers true if the input type considers the file extension to be + * one associated with a dependency file. + * + * @param tool the tool that contains the input-type + * @param ext file extension of the source + * @return boolean + */ + public boolean isDependencyExtension(ITool tool, String ext); + + /** + * Returns the id of the option that is associated with this input + * type on the command line. If specified, the name(s) of the input + * files for this input type are taken from the value specified + * for the option. + * + * @return String + */ + public String getOptionId(); + + /** + * Sets the id of the option that is associated with this input type on + * the command line. If specified, the name(s) of the input files for + * this input type are taken from the value specified for the option. + * + * @param optionId + */ + public void setOptionId(String optionId); + + /** + * Returns the id of the option whose value is to be assigned to the + * file(s) calculated for this input type. The default is not to + * assign the input file(s) to a command line option but to assign the + * files to the ${Inputs} part of the command line. Note that the + * option value is only updated during build file generation and therefore + * could be out of sync with the project until build file generation + * occurs. + * + * @return String + */ + public String getAssignToOptionId(); + + /** + * Sets the id of the option whose value is to be assigned to the + * file(s) calculated for this input type. The default is not to + * assign the input file(s) to a command line option but to assign the + * files to the ${Inputs} part of the command line. Note that the + * option value is only updated during build file generation and therefore + * could be out of sync with the project until build file generation + * occurs. + * + * @param optionId + */ + public void setAssignToOptionId(String optionId); + + /** + * Returns true if this inputType can contain multiple input + * resources, else false. The inputs can be project resources, + * or the outputs of other tools in the tool-chain. + * + * @return boolean + */ + public boolean getMultipleOfType(); + + /** + * Sets whether this inputType can contain multiple input resources + * + * @param multiple + */ + public void setMultipleOfType(boolean multiple); + + /** + * Returns true if this inputType is considered the primary input + * of the tool, else false. + * + * @return boolean + */ + public boolean getPrimaryInput(); + + /** + * Sets whether this inputType is considered the primary input of the tool + * + * @param primary + */ + public void setPrimaryInput(boolean primary); + + /** + * Returns a class instance that implements an interface to generate + * source-level dependencies for this input type. + * This method may return null in which case, the receiver + * should assume that the input type does not require dependency information + * when the project is built. + * + * @return IManagedDependencyGeneratorType + */ + public IManagedDependencyGeneratorType getDependencyGenerator(); + + /** + * Returns the name of the build variable associated this this input type's resources + * The build variable used in the build file to represent the list of input files when + * multipleOfType is True. The same variable name can be used by an outputType to + * identify a set of output files that contribute to this tool�s input + * (i.e., those using the same buildVariable name). The default name is chosen by MBS. + * + * @return String + */ + public String getBuildVariable(); + + /** + * Sets the name of the build variable associated this this input type's resources + * + * @return variableName + */ + public void setBuildVariable(String variableName); + + /** + * Returns true if this element has changes that need to + * be saved in the project file, else false. + * + * @return boolean + */ + public boolean isDirty(); + + /** + * Returns true if this InputType was loaded from a manifest file, + * and false if it was loaded from a project (.cdtbuild) file. + * + * @return boolean + */ + public boolean isExtensionElement(); + + /** + * Sets the element's "dirty" (have I been modified?) flag. + * + * @param isDirty + */ + public void setDirty(boolean isDirty); + +} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java index 58a95cdf21b..b7ec2f7d49c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java @@ -1,501 +1,501 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import java.util.List; - -import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; -import org.eclipse.core.runtime.IPath; - -/* - * There is a ManagedBuildInfo per CDT managed build project. Here are - * some notes on their usage: - * o You can look up the managed build info associated with a CDT - * project by using ManagedBuildManager.getBuildInfo(IProject). - * o Given a ManagedBuildInfo, you can retrieve the associated CDT - * managed build system project by using getManagedProject. - * o The usage model of a ManagedBuildInfo is: - * 1. Call setDefaultConfiguration to set the context - * 2. Call other methods (e.g. getBuildArtifactName) which get - * information from the default configuration, and the other managed - * build system model elements that can be reached from the - * configuration. - */ -public interface IManagedBuildInfo { - public static final String DEFAULT_CONFIGURATION = "defaultConfig"; //$NON-NLS-1$ - public static final String DEFAULT_TARGET = "defaultTarget"; //$NON-NLS-1$ - - /* - * Note: "Target" routines are only currently applicable when loading a CDT 2.0 - * or earlier managed build project file (.cdtbuild) - */ - - /** - * Add a new target to the build information for the receiver - * - * @param target - */ - public void addTarget(ITarget target); - - /** - * Answers true if the build system knows how to - * build a file with the extension passed in the argument. - * - * @param srcExt - * @return - */ - public boolean buildsFileType(String srcExt); - - /** - * Returns IManagedCommandLineInfo for source with extension - * The command line info contains values with - * build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * command line info contains values contain all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the command line info contains values contain - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param sourceExtension - source extension - * @param flags - build flags - * @param outputFlag - output flag for build tool - * @param outputPrefix - * @param outputName - * @param inputResources - * @return IManagedCommandLineInfo - * - * @deprecated - use generateToolCommandLineInfo instead - */ - public IManagedCommandLineInfo generateCommandLineInfo( String sourceExtension, String[] flags, - String outputFlag, String outputPrefix, String outputName, String[] inputResources ); - - /** - * Returns IManagedCommandLineInfo for source with extension - * The command line info contains values with - * build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * command line info contains values contain all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the command line info contains values contain - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param sourceExtension - * @param flags - * @param outputFlag - * @param outputPrefix - * @param outputName - * @param inputResources - * @param inputLocation - * @param outputLocation - * @return - */ - public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags, - String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ); - - /** - * Answers a String containing the arguments to be passed to make. - * For example, if the user has selected a build that keeps going on error, the - * answer would contain {"-k"}. - * - * @return String - */ - public String getBuildArguments(); - - - /** - * Answers the file extension for the receivers build goal without a separator. - * - * @return the extension or an empty string if none is defined - */ - public String getBuildArtifactExtension(); - - /** - * Returns the name of the artifact to build for the receiver. - * - * @return - */ - public String getBuildArtifactName(); - - /** - * Answers a String containing the make command invocation - * for the default configuration. - */ - public String getBuildCommand(); - - /** - * Answers the prebuild step for the default configuration - * - * @return String - */ - public String getPrebuildStep(); - - /** - * Answers the postbuild step for the default configuration - * - * @return String - */ - public String getPostbuildStep(); - - /** - * Answers the display string associated with the prebuild step for the default configuration - * - * @return String - */ - public String getPreannouncebuildStep(); - - /** - * Answers the display string associated with the postbuild step for the default configuration - * - * @return String - */ - public String getPostannouncebuildStep(); - - /** - * Answers the command needed to remove files on the build machine - * - * @return - */ - public String getCleanCommand(); - - /** - * Answers the name of the default configuration, for example Debug - * or Release. - * - * @return - */ - public String getConfigurationName(); - - /** - * Answers a String array containing the names of all the configurations - * defined for the project. - * - * @return - */ - public String[] getConfigurationNames(); - - /** - * Get the default configuration associated with the receiver - * - * @return - */ - public IConfiguration getDefaultConfiguration(); - - /** - * @param sourceExtension - * @return - */ - public IManagedDependencyGeneratorType getDependencyGenerator(String sourceExtension); - - /** - * Returns a String containing the flags, including - * those overridden by the user, for the tool in the configuration - * defined by the argument. - * The string contains build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the string contains all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the string contains - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param extension - * @return - * - * @deprecated - use getToolFlagsForConfiguration - */ - public String getFlagsForConfiguration(String extension); - - /** - * Returns a String containing the flags, including - * those overridden by the user, for the tool in the configuration - * defined by the argument. - * The string contains build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the string contains all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the string contains - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param extension - * @param inputLocation - * @param outputLocation - * @return - */ - public String getToolFlagsForConfiguration(String extension, IPath inputLocation, IPath outputLocation); - - /** - * Returns a String containing the flags, including - * those overridden by the user, for the tool that handles the - * type of source file defined by the argument. - * The string contains build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the string contains all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the string contains - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param extension - * @return - * - * @deprecated - use getToolFlagsForSource - */ - public String getFlagsForSource(String extension); - - /** - * Returns a String containing the flags, including - * those overridden by the user, for the tool that handles the - * type of source file defined by the argument. - * The string contains build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the string contains all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the string contains - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param extension - * @param inputLocation - * @param outputLocation - * @return - */ - public String getToolFlagsForSource(String extension, IPath inputLocation, IPath outputLocation); - - /** - * Answers the libraries the project links in. - * - * @param extension - * @return - */ - public String[] getLibsForConfiguration(String extension); - - /** - * Returns the ManagedProject associated with this build info - * - * @return IManagedProject - */ - public IManagedProject getManagedProject( ); - - /** - * Answers the extension that will be built by the current configuration - * for the extension passed in the argument or null. - * - * @param resourceName - * @return - */ - public String getOutputExtension(String resourceExtension); - - /** - * Answers the flag to be passed to the build tool to produce a specific output - * or an empty String if there is no special flag. For example, the - * GCC tools use the '-o' flag to produce a named output, for example - * gcc -c foo.c -o foo.o - * - * @param outputExt - * @return - */ - public String getOutputFlag(String outputExt); - - /** - * Answers the prefix that should be prepended to the name of the build - * artifact. For example, a library foo, should have the prefix 'lib' and - * the extension '.a', so the final goal would be 'libfoo.a' - * - * @param extension - * @return the prefix or an empty string - */ - public String getOutputPrefix(String outputExtension); - - /** - * Returns the currently selected configuration. This is used while the project - * property pages are displayed - * - * @return IConfiguration - */ - public IConfiguration getSelectedConfiguration(); - - /** - * Get the target specified in the argument. - * - * @param id - * @return - */ - public ITarget getTarget(String id); - - /** - * Get all of the targets associated with the receiver. - * - * @return - */ - public List getTargets(); - - /** - * Returns a String containing the command-line invocation - * for the tool associated with the output extension. - * - * @param extension the file extension of the output file - * @return a String containing the command line invocation for the tool - */ - public String getToolForConfiguration(String extension); - - /** - * Returns a String containing the command-line invocation - * for the tool associated with the source extension. - * - * @param sourceExtension the file extension of the file to be built - * @return a String containing the command line invocation for the tool - */ - public String getToolForSource(String sourceExtension); - - /** - * Returns a ITool for the tool associated with the - * input extension. - * - * @param extension the file extension of the input file - * @return ITool - */ - public ITool getToolFromInputExtension(String extension); - - /** - * Returns a ITool for the tool associated with the - * output extension. - * - * @param extension the file extension of the output file - * @return ITool - */ - public ITool getToolFromOutputExtension(String extension); - - /** - * Answers a String array containing the contents of the - * user objects option, if one is defined for the target. - * - * @param extension the file ecxtension of the build target - * @return - */ - public String[] getUserObjectsForConfiguration(String extension); - - - /** - * Answers the version of the build information in the format - * @return a String containing the build information - * version - */ - public String getVersion(); - - /** - * Answers true if the build model has been changed by the user. - * - * @return boolean - */ - public boolean isDirty(); - - /** - * Answers true if the extension matches one of the special - * file extensions the tools for the configuration consider to be a header file. - * - * @param ext the file extension of the resource - * @return boolean - */ - public boolean isHeaderFile(String ext); - - /** - * Gets the read only status of Managed Build Info - * - * @return true if Managed Build Info is read only - * otherwise returns false - */ - public boolean isReadOnly(); - - /** - * Gets the "valid" status of Managed Build Info. Managed Build Info is invalid - * if the loading of, or conversion to, the Managed Build Info failed. - * - * @return true if Managed Build Info is valid, - * otherwise returns false - */ - public boolean isValid(); - - /** - * Answers whether the receiver has been changed and requires the - * project to be rebuilt. When a project is first created, it is - * assumed that the user will need it to be fully rebuilt. However - * only option and tool command changes will trigger the build - * information for an existing project to require a rebuild. - *

- * Clients can reset the state to force or clear the rebuild status - * using setRebuildState() - * @see ManagedBuildInfo#setRebuildState(boolean) - * - * @return true if the resource managed by the - * receiver needs to be rebuilt - */ - public boolean needsRebuild(); - - public void removeTarget(String id); - - /** - * Set the primary configuration for the receiver. - * - * @param configuration The IConfiguration that will be used as the default - * for all building. - */ - public void setDefaultConfiguration(IConfiguration configuration); - - /** - * - * @param configuration - * @return - */ - public boolean setDefaultConfiguration(String configName); - - /** - * Sets the dirty flag for the build model to the value of the argument. - * - * @param isDirty - */ - public void setDirty(boolean isDirty); - - /** - * Sets the valid flag for the build model to the value of the argument. - * - * @param isValid - */ - public void setValid(boolean isValid); - - /** - * Sets the ManagedProject associated with this build info - * - * @param project - */ - public void setManagedProject(IManagedProject project); - - /** - * sets the read only status of Managed Build Info - * - * @param readOnly - */ - public void setReadOnly(boolean readOnly); - - /** - * Sets the rebuild state in the receiver to the value of the argument. - * This is a potentially expensive option, so setting it to true should - * only be done if a project resource or setting has been modified in a - * way that would invalidate the previous build. - * - * @param true will force a rebuild the next time the project builds - */ - public void setRebuildState(boolean rebuild); - - /** - * Sets the currently selected configuration. This is used while the project - * property pages are displayed - * - * @param configuration the user selection - */ - public void setSelectedConfiguration(IConfiguration configuration); -} +/******************************************************************************* + * Copyright (c) 2003, 2006 Rational Software Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.managedbuilder.core; + +import java.util.List; + +import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; +import org.eclipse.core.runtime.IPath; + +/* + * There is a ManagedBuildInfo per CDT managed build project. Here are + * some notes on their usage: + * o You can look up the managed build info associated with a CDT + * project by using ManagedBuildManager.getBuildInfo(IProject). + * o Given a ManagedBuildInfo, you can retrieve the associated CDT + * managed build system project by using getManagedProject. + * o The usage model of a ManagedBuildInfo is: + * 1. Call setDefaultConfiguration to set the context + * 2. Call other methods (e.g. getBuildArtifactName) which get + * information from the default configuration, and the other managed + * build system model elements that can be reached from the + * configuration. + */ +public interface IManagedBuildInfo { + public static final String DEFAULT_CONFIGURATION = "defaultConfig"; //$NON-NLS-1$ + public static final String DEFAULT_TARGET = "defaultTarget"; //$NON-NLS-1$ + + /* + * Note: "Target" routines are only currently applicable when loading a CDT 2.0 + * or earlier managed build project file (.cdtbuild) + */ + + /** + * Add a new target to the build information for the receiver + * + * @param target + */ + public void addTarget(ITarget target); + + /** + * Answers true if the build system knows how to + * build a file with the extension passed in the argument. + * + * @param srcExt + * @return + */ + public boolean buildsFileType(String srcExt); + + /** + * Returns IManagedCommandLineInfo for source with extension + * The command line info contains values with + * build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * command line info contains values contain all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the command line info contains values contain + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param sourceExtension - source extension + * @param flags - build flags + * @param outputFlag - output flag for build tool + * @param outputPrefix + * @param outputName + * @param inputResources + * @return IManagedCommandLineInfo + * + * @deprecated - use generateToolCommandLineInfo instead + */ + public IManagedCommandLineInfo generateCommandLineInfo( String sourceExtension, String[] flags, + String outputFlag, String outputPrefix, String outputName, String[] inputResources ); + + /** + * Returns IManagedCommandLineInfo for source with extension + * The command line info contains values with + * build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * command line info contains values contain all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the command line info contains values contain + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param sourceExtension + * @param flags + * @param outputFlag + * @param outputPrefix + * @param outputName + * @param inputResources + * @param inputLocation + * @param outputLocation + * @return + */ + public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags, + String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ); + + /** + * Answers a String containing the arguments to be passed to make. + * For example, if the user has selected a build that keeps going on error, the + * answer would contain {"-k"}. + * + * @return String + */ + public String getBuildArguments(); + + + /** + * Answers the file extension for the receivers build goal without a separator. + * + * @return the extension or an empty string if none is defined + */ + public String getBuildArtifactExtension(); + + /** + * Returns the name of the artifact to build for the receiver. + * + * @return + */ + public String getBuildArtifactName(); + + /** + * Answers a String containing the make command invocation + * for the default configuration. + */ + public String getBuildCommand(); + + /** + * Answers the prebuild step for the default configuration + * + * @return String + */ + public String getPrebuildStep(); + + /** + * Answers the postbuild step for the default configuration + * + * @return String + */ + public String getPostbuildStep(); + + /** + * Answers the display string associated with the prebuild step for the default configuration + * + * @return String + */ + public String getPreannouncebuildStep(); + + /** + * Answers the display string associated with the postbuild step for the default configuration + * + * @return String + */ + public String getPostannouncebuildStep(); + + /** + * Answers the command needed to remove files on the build machine + * + * @return + */ + public String getCleanCommand(); + + /** + * Answers the name of the default configuration, for example Debug + * or Release. + * + * @return + */ + public String getConfigurationName(); + + /** + * Answers a String array containing the names of all the configurations + * defined for the project. + * + * @return + */ + public String[] getConfigurationNames(); + + /** + * Get the default configuration associated with the receiver + * + * @return + */ + public IConfiguration getDefaultConfiguration(); + + /** + * @param sourceExtension + * @return + */ + public IManagedDependencyGeneratorType getDependencyGenerator(String sourceExtension); + + /** + * Returns a String containing the flags, including + * those overridden by the user, for the tool in the configuration + * defined by the argument. + * The string contains build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the string contains all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the string contains + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param extension + * @return + * + * @deprecated - use getToolFlagsForConfiguration + */ + public String getFlagsForConfiguration(String extension); + + /** + * Returns a String containing the flags, including + * those overridden by the user, for the tool in the configuration + * defined by the argument. + * The string contains build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the string contains all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the string contains + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param extension + * @param inputLocation + * @param outputLocation + * @return + */ + public String getToolFlagsForConfiguration(String extension, IPath inputLocation, IPath outputLocation); + + /** + * Returns a String containing the flags, including + * those overridden by the user, for the tool that handles the + * type of source file defined by the argument. + * The string contains build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the string contains all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the string contains + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param extension + * @return + * + * @deprecated - use getToolFlagsForSource + */ + public String getFlagsForSource(String extension); + + /** + * Returns a String containing the flags, including + * those overridden by the user, for the tool that handles the + * type of source file defined by the argument. + * The string contains build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the string contains all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the string contains + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param extension + * @param inputLocation + * @param outputLocation + * @return + */ + public String getToolFlagsForSource(String extension, IPath inputLocation, IPath outputLocation); + + /** + * Answers the libraries the project links in. + * + * @param extension + * @return + */ + public String[] getLibsForConfiguration(String extension); + + /** + * Returns the ManagedProject associated with this build info + * + * @return IManagedProject + */ + public IManagedProject getManagedProject( ); + + /** + * Answers the extension that will be built by the current configuration + * for the extension passed in the argument or null. + * + * @param resourceName + * @return + */ + public String getOutputExtension(String resourceExtension); + + /** + * Answers the flag to be passed to the build tool to produce a specific output + * or an empty String if there is no special flag. For example, the + * GCC tools use the '-o' flag to produce a named output, for example + * gcc -c foo.c -o foo.o + * + * @param outputExt + * @return + */ + public String getOutputFlag(String outputExt); + + /** + * Answers the prefix that should be prepended to the name of the build + * artifact. For example, a library foo, should have the prefix 'lib' and + * the extension '.a', so the final goal would be 'libfoo.a' + * + * @param extension + * @return the prefix or an empty string + */ + public String getOutputPrefix(String outputExtension); + + /** + * Returns the currently selected configuration. This is used while the project + * property pages are displayed + * + * @return IConfiguration + */ + public IConfiguration getSelectedConfiguration(); + + /** + * Get the target specified in the argument. + * + * @param id + * @return + */ + public ITarget getTarget(String id); + + /** + * Get all of the targets associated with the receiver. + * + * @return + */ + public List getTargets(); + + /** + * Returns a String containing the command-line invocation + * for the tool associated with the output extension. + * + * @param extension the file extension of the output file + * @return a String containing the command line invocation for the tool + */ + public String getToolForConfiguration(String extension); + + /** + * Returns a String containing the command-line invocation + * for the tool associated with the source extension. + * + * @param sourceExtension the file extension of the file to be built + * @return a String containing the command line invocation for the tool + */ + public String getToolForSource(String sourceExtension); + + /** + * Returns a ITool for the tool associated with the + * input extension. + * + * @param extension the file extension of the input file + * @return ITool + */ + public ITool getToolFromInputExtension(String extension); + + /** + * Returns a ITool for the tool associated with the + * output extension. + * + * @param extension the file extension of the output file + * @return ITool + */ + public ITool getToolFromOutputExtension(String extension); + + /** + * Answers a String array containing the contents of the + * user objects option, if one is defined for the target. + * + * @param extension the file ecxtension of the build target + * @return + */ + public String[] getUserObjectsForConfiguration(String extension); + + + /** + * Answers the version of the build information in the format + * @return a String containing the build information + * version + */ + public String getVersion(); + + /** + * Answers true if the build model has been changed by the user. + * + * @return boolean + */ + public boolean isDirty(); + + /** + * Answers true if the extension matches one of the special + * file extensions the tools for the configuration consider to be a header file. + * + * @param ext the file extension of the resource + * @return boolean + */ + public boolean isHeaderFile(String ext); + + /** + * Gets the read only status of Managed Build Info + * + * @return true if Managed Build Info is read only + * otherwise returns false + */ + public boolean isReadOnly(); + + /** + * Gets the "valid" status of Managed Build Info. Managed Build Info is invalid + * if the loading of, or conversion to, the Managed Build Info failed. + * + * @return true if Managed Build Info is valid, + * otherwise returns false + */ + public boolean isValid(); + + /** + * Answers whether the receiver has been changed and requires the + * project to be rebuilt. When a project is first created, it is + * assumed that the user will need it to be fully rebuilt. However + * only option and tool command changes will trigger the build + * information for an existing project to require a rebuild. + *

+ * Clients can reset the state to force or clear the rebuild status + * using setRebuildState() + * @see ManagedBuildInfo#setRebuildState(boolean) + * + * @return true if the resource managed by the + * receiver needs to be rebuilt + */ + public boolean needsRebuild(); + + public void removeTarget(String id); + + /** + * Set the primary configuration for the receiver. + * + * @param configuration The IConfiguration that will be used as the default + * for all building. + */ + public void setDefaultConfiguration(IConfiguration configuration); + + /** + * + * @param configuration + * @return + */ + public boolean setDefaultConfiguration(String configName); + + /** + * Sets the dirty flag for the build model to the value of the argument. + * + * @param isDirty + */ + public void setDirty(boolean isDirty); + + /** + * Sets the valid flag for the build model to the value of the argument. + * + * @param isValid + */ + public void setValid(boolean isValid); + + /** + * Sets the ManagedProject associated with this build info + * + * @param project + */ + public void setManagedProject(IManagedProject project); + + /** + * sets the read only status of Managed Build Info + * + * @param readOnly + */ + public void setReadOnly(boolean readOnly); + + /** + * Sets the rebuild state in the receiver to the value of the argument. + * This is a potentially expensive option, so setting it to true should + * only be done if a project resource or setting has been modified in a + * way that would invalidate the previous build. + * + * @param true will force a rebuild the next time the project builds + */ + public void setRebuildState(boolean rebuild); + + /** + * Sets the currently selected configuration. This is used while the project + * property pages are displayed + * + * @param configuration the user selection + */ + public void setSelectedConfiguration(IConfiguration configuration); +} 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 3d04cd8d696..aeb51258ebd 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 @@ -1,726 +1,726 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IPath; - -import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator; -import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; - -/** - * This interface represents a utility of some sort that is used in the build process. - * A tool will generally process one or more resources to produce output resources. - * Most tools have a set of options that can be used to modify the behavior of the tool. - */ -public interface ITool extends IBuildObject, IHoldsOptions { - // Schema element names - public static final String COMMAND = "command"; //$NON-NLS-1$ - public static final String COMMAND_LINE_PATTERN = "commandLinePattern"; //$NON-NLS-1$ - public static final String COMMAND_LINE_GENERATOR = "commandLineGenerator"; //$NON-NLS-1$ - public static final String DEP_CALC_ID ="dependencyCalculator"; //$NON-NLS-1$ - public static final String INTERFACE_EXTS = "headerExtensions"; //$NON-NLS-1$ - public static final String NATURE = "natureFilter"; //$NON-NLS-1$ - public static final String OUTPUT_FLAG = "outputFlag"; //$NON-NLS-1$ - public static final String INPUT_TYPE = "inputType"; //$NON-NLS-1$ - public static final String OUTPUT_TYPE = "outputType"; //$NON-NLS-1$ - public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$ - public static final String OUTPUTS = "outputs"; //$NON-NLS-1$ - public static final String SOURCES = "sources"; //$NON-NLS-1$ - public static final String ADVANCED_INPUT_CATEGORY = "advancedInputCategory"; //$NON-NLS-1$ - public static final String CUSTOM_BUILD_STEP = "customBuildStep"; //$NON-NLS-1$ - public static final String ANNOUNCEMENT = "announcement"; //$NON-NLS-1$ - public static final String TOOL_ELEMENT_NAME = "tool"; //$NON-NLS-1$ - public static final String WHITE_SPACE = " "; //$NON-NLS-1$ - public static final String EMPTY_STRING = ""; //$NON-NLS-1$ - - public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$ - public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$ - - public static final int FILTER_C = 0; - public static final int FILTER_CC = 1; - public static final int FILTER_BOTH = 2; - - /** - * Returns the tool-chain or resource configuration that is the parent of this tool. - * - * @return IBuildObject - */ - public IBuildObject getParent(); - - /** - * Creates a child InputType for this tool. - * - * @param InputType The superClass, if any - * @param String The id for the new InputType - * @param String The name for the new InputType - * @param boolean Indicates whether this is an extension element or a managed project element - * - * @return IInputType - * @since 3.0 - */ - public IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement); - - /** - * Removes an InputType from the tool's list. - * - * @param type - * @since 3.0 - */ - public void removeInputType(IInputType type); - - /** - * Returns the complete list of input types that are available for this tool. - * The list is a merging of the input types specified for this tool with the - * input types of its superclasses. The lowest input type instance in the hierarchy - * takes precedence. - * - * @return IInputType[] - * @since 3.0 - */ - public IInputType[] getInputTypes(); - - /** - * Returns the IInputType in the tool with the specified - * ID. This is an efficient search in the receiver. - * - *

If the receiver does not have an InputType with that ID, the method - * returns null. It is the responsibility of the caller to - * verify the return value. - * - * @param id unique identifier of the InputType to search for - * @return IInputType - * @since 3.0 - */ - public IInputType getInputTypeById(String id); - - /** - * Returns the IInputType in the tool that uses the - * specified extension. - * - *

If the receiver does not have an InputType that uses the extension, - * the method returns null. It is the responsibility of the - * caller to verify the return value. - * - * @param inputExtension File extension - * @return IInputType - * @since 3.0 - */ - public IInputType getInputType(String inputExtension); - - /** - * Returns the primary IInputType in this tool - * - *

If the receiver has no InputTypes, - * the method returns null. It is the responsibility of the - * caller to verify the return value. - * - * @return IInputType - * @since 3.0 - */ - public IInputType getPrimaryInputType(); - - /** - * Returns all of the additional input resources of all InputType children. - * Note: This does not include the primary InputType and does not include - * additional dependencies. - * - * @return IPath[] - */ - public IPath[] getAdditionalResources(); - - /** - * Returns all of the additional dependency resources of all InputType children. - * Note: This does not include the primary InputType and does not include - * additional inputs. - * - * @return IPath[] - */ - public IPath[] getAdditionalDependencies(); - - /** - * Creates a child OutputType for this tool. - * - * @param OutputType The superClass, if any - * @param String The id for the new OutputType - * @param String The name for the new OutputType - * @param boolean Indicates whether this is an extension element or a managed project element - * - * @return IOutputType - * @since 3.0 - */ - public IOutputType createOutputType(IOutputType superClass, String Id, String name, boolean isExtensionElement); - - /** - * Removes an OutputType from the tool's list. - * - * @param type - * @since 3.0 - */ - public void removeOutputType(IOutputType type); - - /** - * Returns the complete list of output types that are available for this tool. - * The list is a merging of the output types specified for this tool with the - * output types of its superclasses. The lowest output type instance in the hierarchy - * takes precedence. - * - * @return IOutputType[] - * @since 3.0 - */ - public IOutputType[] getOutputTypes(); - /** - * Get the IOutputType in the receiver with the specified - * ID. This is an efficient search in the receiver. - * - *

If the receiver does not have an OutputType with that ID, the method - * returns null. It is the responsibility of the caller to - * verify the return value. - * - * @param id unique identifier of the OutputType to search for - * @return IOutputType - * @since 3.0 - */ - public IOutputType getOutputTypeById(String id); - - /** - * Returns the IOutputType in the tool that creates the - * specified extension. - * - *

If the receiver does not have an OutputType that creates the extension, - * the method returns null. It is the responsibility of the - * caller to verify the return value. - * - * @param outputExtension File extension - * @return IOutputType - * @since 3.0 - */ - public IOutputType getOutputType(String outputExtension); - - /** - * Returns the primary IOutputType in this tool - * - *

If the receiver has no OutputTypes, - * the method returns null. It is the responsibility of the - * caller to verify the return value. - * - * @return IOutputType - * @since 3.0 - */ - public IOutputType getPrimaryOutputType(); - - /** - * Returns the ITool that is the superclass of this - * tool, or null if the attribute was not specified. - * - * @return ITool - */ - public ITool getSuperClass(); - - /** - * Returns whether this element is abstract. Returns false - * if the attribute was not specified. - * @return boolean - */ - public boolean isAbstract(); - - /** - * Sets the isAbstract attribute of the tool-chain. - * - * @param b - */ - public void setIsAbstract(boolean b); - - /** - * Returns a semi-colon delimited list of child Ids of the superclass' - * children that should not be automatically inherited by this element. - * Returns an empty string if the attribute was not specified. - * @return String - */ - public String getUnusedChildren(); - - /** - * Returns the semicolon separated list of unique IDs of the error parsers associated - * with the tool. - * - * @return String - */ - public String getErrorParserIds(); - - /** - * Returns the ordered list of unique IDs of the error parsers associated with the - * tool. - * - * @return String[] - */ - public String[] getErrorParserList(); - - /** - * Sets the semicolon separated list of error parser ids - * - * @param ids - */ - public void setErrorParserIds(String ids); - - /** - * Returns the list of valid source extensions this tool knows how to build. - * The list may be empty but will never be null. - * - * @return List - * @deprecated - use getPrimaryInputExtensions or getAllInputExtensions - */ - public List getInputExtensions(); - - /** - * Returns the array of valid primary source extensions this tool knows how to build. - * The array may be empty but will never be null. - * - * @return String[] - */ - public String[] getPrimaryInputExtensions(); - - /** - * Returns the array of all valid source extensions this tool knows how to build. - * The array may be empty but will never be null. - * - * @return String[] - */ - public String[] getAllInputExtensions(); - - /** - * Returns the default input extension for the primary input of the tool - * - * @return String - */ - public String getDefaultInputExtension(); - - /** - * Returns the array of all valid dependency extensions for this tool's inputs. - * The array may be empty but will never be null. - * - * @return String[] - */ - public String[] getAllDependencyExtensions(); - - /** - * Returns the list of valid header extensions for this tool. - * Returns the value of the headerExtensions attribute - * The list may be empty but will never be null. - * - * @return List - * @deprecated - use getDependency* methods - */ - public List getInterfaceExtensions(); - - /** - * Answers a constant corresponding to the project nature the tool should be used - * for. Possible answers are: - * - *

- *
ITool.FILTER_C - *
The tool should only be displayed for C projects. Notes: even - * though a C++ project has a C nature, this flag will mask the tool for C++ - * projects. - *
ITool.FILTER_CC - *
The tool should only be displayed for C++ projects. - *
ITool.FILTER_BOTH - *
The tool should be displayed for projects with both natures. - *
- * - * @return int - */ - public int getNatureFilter(); - - /** - * Returns the array of all valid output extensions this tool can create. - * The array may be empty but will never be null. - * - * @return String[] - */ - public String[] getAllOutputExtensions(); - - /** - * Answers all of the output extensions that the receiver can build. - * This routine returns the value if the outputs attribute. - * - * @return String[] of extensions - * @deprecated - use getAllOutputExtensions - */ - public String[] getOutputExtensions(); - - /** - * Answers all of the output extensions that the receiver can build, - * from the value of the outputs attribute - * - * @return String[] of extensions - */ - public String[] getOutputsAttribute(); - - /** - * Answer the output extension the receiver will create from the input, - * or null if the tool does not understand that extension. - * - * @param inputExtension The extension of the source file. - * @return String - */ - public String getOutputExtension(String inputExtension); - - /** - * Sets all of the output extensions that the receiver can build, - * into the outputs attribute. Note that the outputs attribute is - * ignored when one or more outputTypes are specified. - * - * @param String - */ - public void setOutputsAttribute(String extensions); - - /** - * Answers the argument that must be passed to a specific tool in order to - * control the name of the output artifact. For example, the GCC compile and - * linker use '-o', while the archiver does not. - * - * @return String - */ - public String getOutputFlag(); - - /** - * Sets the argument that must be passed to a specific tool in order to - * control the name of the output artifact. For example, the GCC compile and - * linker use '-o', while the archiver does not. - * - * @param String - */ - public void setOutputFlag(String flag); - - /** - * Answers 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 - * @return String - */ - public String getOutputPrefix(); - - /** - * 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 - */ - public void setOutputPrefix(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 - * dependencies, else false. - * - * @return boolean - */ - public boolean getAdvancedInputCategory(); - - /** - * Sets whether the Tool wants the MBS to display the Advanced - * Input category that allows the user to specify additional input resources and - * dependencies. - * - * @param display - */ - public void setAdvancedInputCategory(boolean display); - - /** - * Returns true if the Tool represents a user-define custom build - * step, else false. - * - * @return boolean - */ - public boolean getCustomBuildStep(); - - /** - * Sets whether the Tool represents a user-define custom build step. - * - * @param customBuildStep - */ - public void setCustomBuildStep(boolean customBuildStep); - - /** - * Returns the announcement string for this tool - * @return String - */ - public String getAnnouncement(); - - /** - * Sets the announcement string for this tool - * @param announcement - */ - public void setAnnouncement(String announcement); - - /** - * Answers the command-line invocation defined for the receiver. - * - * @return String - */ - public String getToolCommand(); - - /** - * Sets the command-line invocation command defined for this tool. - * - * @param String - * - * @return boolean if true, then the tool command was modified - */ - public boolean setToolCommand(String command); - - /** - * Returns command line pattern for this tool - * @return String - */ - public String getCommandLinePattern(); - - /** - * Sets the command line pattern for this tool - * @param String - */ - public void setCommandLinePattern(String pattern); - - /** - * Returns the plugin.xml element of the commandLineGenerator extension or null if none. - * - * @return IConfigurationElement - * - * @deprecated - use getCommandLineGenerator - */ - public IConfigurationElement getCommandLineGeneratorElement(); - - /** - * Sets the CommandLineGenerator plugin.xml element - * - * @param element - * @deprecated - */ - public void setCommandLineGeneratorElement(IConfigurationElement element); - - /** - * Returns the command line generator specified for this tool - * @return IManagedCommandLineGenerator - */ - public IManagedCommandLineGenerator getCommandLineGenerator(); - - /** - * Returns the plugin.xml element of the dependencyGenerator extension or null if none. - * - * @return IConfigurationElement - * @deprecated - use getDependencyGeneratorForExtension or IInputType#getDependencyGenerator method - */ - public IConfigurationElement getDependencyGeneratorElement(); - - /** - * Sets the DependencyGenerator plugin.xml element - * - * @param element - * @deprecated - */ - public void setDependencyGeneratorElement(IConfigurationElement element); - - /** - * Returns a class instance that implements an interface to generate - * source-level dependencies for the tool specified in the argument. - * This method may return null in which case, the receiver - * should assume that the tool does not require dependency information - * when the project is built. - * - * @return IManagedDependencyGenerator - * @deprecated - use getDependencyGeneratorForExtension or IInputType method - */ - public IManagedDependencyGenerator getDependencyGenerator(); - - /** - * Returns a class instance that implements an interface to generate - * source-level dependencies for the tool specified in the argument. - * This method may return null in which case, the receiver - * should assume that the tool does not require dependency information - * when the project is built. - * - * @param sourceExt source file extension - * @return IManagedDependencyGeneratorType - */ - public IManagedDependencyGeneratorType getDependencyGeneratorForExtension(String sourceExt); - - /** - * Returns an array of command line arguments that have been specified for - * the tool. - * The flags contain build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the flags contain all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the flags contain - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @return String[] - * @throws BuildException - * - * @deprecated - use getToolCommandFlags instead - */ - public String[] getCommandFlags() throws BuildException; - - /** - * Returns the command line arguments that have been specified for - * the tool. - * The string contains build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the string contains all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the string contains - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @return String - * - * @deprecated - use getToolCommandFlagsString instead - */ - public String getToolFlags() throws BuildException ; - - /** - * Returns an array of command line arguments that have been specified for - * the tool. - * The flags contain build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the flags contain all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the flags contain - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param inputFileLocation - * @param outputFileLocation - * @return - * @throws BuildException - */ - public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException; - - /** - * Returns the command line arguments that have been specified for - * the tool. - * The string contains build macros resolved to the makefile format. - * That is if a user has chosen to expand all macros in the buildfile, - * the string contains all macro references resolved, otherwise, if a user has - * chosen to keep the environment build macros unresolved, the string contains - * the environment macro references converted to the buildfile variable format, - * all other macro references are resolved - * - * @param inputFileLocation - * @param outputFileLocation - * @return - * @throws BuildException - */ - public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException; - - /** - * Options are organized into categories for UI purposes. - * These categories are organized into a tree. This is the root - * of that tree. - * - * @return IOptionCategory - */ - public IOptionCategory getTopOptionCategory(); - - /** - * Return true if the receiver builds files with the - * specified extension, else false. - * - * @param extension file extension of the source - * @return boolean - */ - public boolean buildsFileType(String extension); - - /** - * Return true if the receiver uses files with the - * specified extension as input, else false. This - * returns true for a superset of the extensions that buildFileType - * returns true for - it includes secondary inputs. - * - * @param extension file extension of the source - * @return boolean - */ - public boolean isInputFileType(String extension); - - /** - * Answers true if the tool considers the file extension to be - * one associated with a header file. - * - * @param ext file extension of the source - * @return boolean - */ - public boolean isHeaderFile(String ext); - - /** - * Answers true if the receiver builds a file with the extension specified - * in the argument, else false. - * - * @param outputExtension extension of the file being produced by a tool - * @return boolean - */ - public boolean producesFileType(String outputExtension); - - /** - * Returns true if this tool has changes that need to - * be saved in the project file, else false. - * - * @return boolean - */ - public boolean isDirty(); - - /** - * Sets the element's "dirty" (have I been modified?) flag. - * - * @param isDirty - */ - public void setDirty(boolean isDirty); - - /** - * Returns true if this tool was loaded from a manifest file, - * and false if it was loaded from a project (.cdtbuild) file. - * - * @return boolean - */ - public boolean isExtensionElement(); - - /** - * Returns the 'versionsSupported' of this tool - * - * @return String - */ - public String getVersionsSupported(); - - /** - * Returns the 'convertToId' of this tool - * - * @return String - */ - public String getConvertToId(); - - /** - * Sets the 'versionsSupported' attribute of the tool. - * - * @param versionsSupported - */ - public void setVersionsSupported(String versionsSupported); - - /** - * Sets the 'convertToId' attribute of the tool. - * - * @param convertToId - */ - public void setConvertToId(String convertToId); - - /** - * Returns an array of the Environment Build Path variable descriptors - * - * @return IEnvVarBuildPath[] - */ - public IEnvVarBuildPath[] getEnvVarBuildPaths(); -} +/******************************************************************************* + * Copyright (c) 2003, 2006 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.managedbuilder.core; + +import java.util.List; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IPath; + +import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator; +import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; + +/** + * This interface represents a utility of some sort that is used in the build process. + * A tool will generally process one or more resources to produce output resources. + * Most tools have a set of options that can be used to modify the behavior of the tool. + */ +public interface ITool extends IBuildObject, IHoldsOptions { + // Schema element names + public static final String COMMAND = "command"; //$NON-NLS-1$ + public static final String COMMAND_LINE_PATTERN = "commandLinePattern"; //$NON-NLS-1$ + public static final String COMMAND_LINE_GENERATOR = "commandLineGenerator"; //$NON-NLS-1$ + public static final String DEP_CALC_ID ="dependencyCalculator"; //$NON-NLS-1$ + public static final String INTERFACE_EXTS = "headerExtensions"; //$NON-NLS-1$ + public static final String NATURE = "natureFilter"; //$NON-NLS-1$ + public static final String OUTPUT_FLAG = "outputFlag"; //$NON-NLS-1$ + public static final String INPUT_TYPE = "inputType"; //$NON-NLS-1$ + public static final String OUTPUT_TYPE = "outputType"; //$NON-NLS-1$ + public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$ + public static final String OUTPUTS = "outputs"; //$NON-NLS-1$ + public static final String SOURCES = "sources"; //$NON-NLS-1$ + public static final String ADVANCED_INPUT_CATEGORY = "advancedInputCategory"; //$NON-NLS-1$ + public static final String CUSTOM_BUILD_STEP = "customBuildStep"; //$NON-NLS-1$ + public static final String ANNOUNCEMENT = "announcement"; //$NON-NLS-1$ + public static final String TOOL_ELEMENT_NAME = "tool"; //$NON-NLS-1$ + public static final String WHITE_SPACE = " "; //$NON-NLS-1$ + public static final String EMPTY_STRING = ""; //$NON-NLS-1$ + + public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$ + public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$ + + public static final int FILTER_C = 0; + public static final int FILTER_CC = 1; + public static final int FILTER_BOTH = 2; + + /** + * Returns the tool-chain or resource configuration that is the parent of this tool. + * + * @return IBuildObject + */ + public IBuildObject getParent(); + + /** + * Creates a child InputType for this tool. + * + * @param InputType The superClass, if any + * @param String The id for the new InputType + * @param String The name for the new InputType + * @param boolean Indicates whether this is an extension element or a managed project element + * + * @return IInputType + * @since 3.0 + */ + public IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement); + + /** + * Removes an InputType from the tool's list. + * + * @param type + * @since 3.0 + */ + public void removeInputType(IInputType type); + + /** + * Returns the complete list of input types that are available for this tool. + * The list is a merging of the input types specified for this tool with the + * input types of its superclasses. The lowest input type instance in the hierarchy + * takes precedence. + * + * @return IInputType[] + * @since 3.0 + */ + public IInputType[] getInputTypes(); + + /** + * Returns the IInputType in the tool with the specified + * ID. This is an efficient search in the receiver. + * + *

If the receiver does not have an InputType with that ID, the method + * returns null. It is the responsibility of the caller to + * verify the return value. + * + * @param id unique identifier of the InputType to search for + * @return IInputType + * @since 3.0 + */ + public IInputType getInputTypeById(String id); + + /** + * Returns the IInputType in the tool that uses the + * specified extension. + * + *

If the receiver does not have an InputType that uses the extension, + * the method returns null. It is the responsibility of the + * caller to verify the return value. + * + * @param inputExtension File extension + * @return IInputType + * @since 3.0 + */ + public IInputType getInputType(String inputExtension); + + /** + * Returns the primary IInputType in this tool + * + *

If the receiver has no InputTypes, + * the method returns null. It is the responsibility of the + * caller to verify the return value. + * + * @return IInputType + * @since 3.0 + */ + public IInputType getPrimaryInputType(); + + /** + * Returns all of the additional input resources of all InputType children. + * Note: This does not include the primary InputType and does not include + * additional dependencies. + * + * @return IPath[] + */ + public IPath[] getAdditionalResources(); + + /** + * Returns all of the additional dependency resources of all InputType children. + * Note: This does not include the primary InputType and does not include + * additional inputs. + * + * @return IPath[] + */ + public IPath[] getAdditionalDependencies(); + + /** + * Creates a child OutputType for this tool. + * + * @param OutputType The superClass, if any + * @param String The id for the new OutputType + * @param String The name for the new OutputType + * @param boolean Indicates whether this is an extension element or a managed project element + * + * @return IOutputType + * @since 3.0 + */ + public IOutputType createOutputType(IOutputType superClass, String Id, String name, boolean isExtensionElement); + + /** + * Removes an OutputType from the tool's list. + * + * @param type + * @since 3.0 + */ + public void removeOutputType(IOutputType type); + + /** + * Returns the complete list of output types that are available for this tool. + * The list is a merging of the output types specified for this tool with the + * output types of its superclasses. The lowest output type instance in the hierarchy + * takes precedence. + * + * @return IOutputType[] + * @since 3.0 + */ + public IOutputType[] getOutputTypes(); + /** + * Get the IOutputType in the receiver with the specified + * ID. This is an efficient search in the receiver. + * + *

If the receiver does not have an OutputType with that ID, the method + * returns null. It is the responsibility of the caller to + * verify the return value. + * + * @param id unique identifier of the OutputType to search for + * @return IOutputType + * @since 3.0 + */ + public IOutputType getOutputTypeById(String id); + + /** + * Returns the IOutputType in the tool that creates the + * specified extension. + * + *

If the receiver does not have an OutputType that creates the extension, + * the method returns null. It is the responsibility of the + * caller to verify the return value. + * + * @param outputExtension File extension + * @return IOutputType + * @since 3.0 + */ + public IOutputType getOutputType(String outputExtension); + + /** + * Returns the primary IOutputType in this tool + * + *

If the receiver has no OutputTypes, + * the method returns null. It is the responsibility of the + * caller to verify the return value. + * + * @return IOutputType + * @since 3.0 + */ + public IOutputType getPrimaryOutputType(); + + /** + * Returns the ITool that is the superclass of this + * tool, or null if the attribute was not specified. + * + * @return ITool + */ + public ITool getSuperClass(); + + /** + * Returns whether this element is abstract. Returns false + * if the attribute was not specified. + * @return boolean + */ + public boolean isAbstract(); + + /** + * Sets the isAbstract attribute of the tool-chain. + * + * @param b + */ + public void setIsAbstract(boolean b); + + /** + * Returns a semi-colon delimited list of child Ids of the superclass' + * children that should not be automatically inherited by this element. + * Returns an empty string if the attribute was not specified. + * @return String + */ + public String getUnusedChildren(); + + /** + * Returns the semicolon separated list of unique IDs of the error parsers associated + * with the tool. + * + * @return String + */ + public String getErrorParserIds(); + + /** + * Returns the ordered list of unique IDs of the error parsers associated with the + * tool. + * + * @return String[] + */ + public String[] getErrorParserList(); + + /** + * Sets the semicolon separated list of error parser ids + * + * @param ids + */ + public void setErrorParserIds(String ids); + + /** + * Returns the list of valid source extensions this tool knows how to build. + * The list may be empty but will never be null. + * + * @return List + * @deprecated - use getPrimaryInputExtensions or getAllInputExtensions + */ + public List getInputExtensions(); + + /** + * Returns the array of valid primary source extensions this tool knows how to build. + * The array may be empty but will never be null. + * + * @return String[] + */ + public String[] getPrimaryInputExtensions(); + + /** + * Returns the array of all valid source extensions this tool knows how to build. + * The array may be empty but will never be null. + * + * @return String[] + */ + public String[] getAllInputExtensions(); + + /** + * Returns the default input extension for the primary input of the tool + * + * @return String + */ + public String getDefaultInputExtension(); + + /** + * Returns the array of all valid dependency extensions for this tool's inputs. + * The array may be empty but will never be null. + * + * @return String[] + */ + public String[] getAllDependencyExtensions(); + + /** + * Returns the list of valid header extensions for this tool. + * Returns the value of the headerExtensions attribute + * The list may be empty but will never be null. + * + * @return List + * @deprecated - use getDependency* methods + */ + public List getInterfaceExtensions(); + + /** + * Answers a constant corresponding to the project nature the tool should be used + * for. Possible answers are: + * + *

+ *
ITool.FILTER_C + *
The tool should only be displayed for C projects. Notes: even + * though a C++ project has a C nature, this flag will mask the tool for C++ + * projects. + *
ITool.FILTER_CC + *
The tool should only be displayed for C++ projects. + *
ITool.FILTER_BOTH + *
The tool should be displayed for projects with both natures. + *
+ * + * @return int + */ + public int getNatureFilter(); + + /** + * Returns the array of all valid output extensions this tool can create. + * The array may be empty but will never be null. + * + * @return String[] + */ + public String[] getAllOutputExtensions(); + + /** + * Answers all of the output extensions that the receiver can build. + * This routine returns the value if the outputs attribute. + * + * @return String[] of extensions + * @deprecated - use getAllOutputExtensions + */ + public String[] getOutputExtensions(); + + /** + * Answers all of the output extensions that the receiver can build, + * from the value of the outputs attribute + * + * @return String[] of extensions + */ + public String[] getOutputsAttribute(); + + /** + * Answer the output extension the receiver will create from the input, + * or null if the tool does not understand that extension. + * + * @param inputExtension The extension of the source file. + * @return String + */ + public String getOutputExtension(String inputExtension); + + /** + * Sets all of the output extensions that the receiver can build, + * into the outputs attribute. Note that the outputs attribute is + * ignored when one or more outputTypes are specified. + * + * @param String + */ + public void setOutputsAttribute(String extensions); + + /** + * Answers the argument that must be passed to a specific tool in order to + * control the name of the output artifact. For example, the GCC compile and + * linker use '-o', while the archiver does not. + * + * @return String + */ + public String getOutputFlag(); + + /** + * Sets the argument that must be passed to a specific tool in order to + * control the name of the output artifact. For example, the GCC compile and + * linker use '-o', while the archiver does not. + * + * @param String + */ + public void setOutputFlag(String flag); + + /** + * Answers 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 + * @return String + */ + public String getOutputPrefix(); + + /** + * 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 + */ + public void setOutputPrefix(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 + * dependencies, else false. + * + * @return boolean + */ + public boolean getAdvancedInputCategory(); + + /** + * Sets whether the Tool wants the MBS to display the Advanced + * Input category that allows the user to specify additional input resources and + * dependencies. + * + * @param display + */ + public void setAdvancedInputCategory(boolean display); + + /** + * Returns true if the Tool represents a user-define custom build + * step, else false. + * + * @return boolean + */ + public boolean getCustomBuildStep(); + + /** + * Sets whether the Tool represents a user-define custom build step. + * + * @param customBuildStep + */ + public void setCustomBuildStep(boolean customBuildStep); + + /** + * Returns the announcement string for this tool + * @return String + */ + public String getAnnouncement(); + + /** + * Sets the announcement string for this tool + * @param announcement + */ + public void setAnnouncement(String announcement); + + /** + * Answers the command-line invocation defined for the receiver. + * + * @return String + */ + public String getToolCommand(); + + /** + * Sets the command-line invocation command defined for this tool. + * + * @param String + * + * @return boolean if true, then the tool command was modified + */ + public boolean setToolCommand(String command); + + /** + * Returns command line pattern for this tool + * @return String + */ + public String getCommandLinePattern(); + + /** + * Sets the command line pattern for this tool + * @param String + */ + public void setCommandLinePattern(String pattern); + + /** + * Returns the plugin.xml element of the commandLineGenerator extension or null if none. + * + * @return IConfigurationElement + * + * @deprecated - use getCommandLineGenerator + */ + public IConfigurationElement getCommandLineGeneratorElement(); + + /** + * Sets the CommandLineGenerator plugin.xml element + * + * @param element + * @deprecated + */ + public void setCommandLineGeneratorElement(IConfigurationElement element); + + /** + * Returns the command line generator specified for this tool + * @return IManagedCommandLineGenerator + */ + public IManagedCommandLineGenerator getCommandLineGenerator(); + + /** + * Returns the plugin.xml element of the dependencyGenerator extension or null if none. + * + * @return IConfigurationElement + * @deprecated - use getDependencyGeneratorForExtension or IInputType#getDependencyGenerator method + */ + public IConfigurationElement getDependencyGeneratorElement(); + + /** + * Sets the DependencyGenerator plugin.xml element + * + * @param element + * @deprecated + */ + public void setDependencyGeneratorElement(IConfigurationElement element); + + /** + * Returns a class instance that implements an interface to generate + * source-level dependencies for the tool specified in the argument. + * This method may return null in which case, the receiver + * should assume that the tool does not require dependency information + * when the project is built. + * + * @return IManagedDependencyGenerator + * @deprecated - use getDependencyGeneratorForExtension or IInputType method + */ + public IManagedDependencyGenerator getDependencyGenerator(); + + /** + * Returns a class instance that implements an interface to generate + * source-level dependencies for the tool specified in the argument. + * This method may return null in which case, the receiver + * should assume that the tool does not require dependency information + * when the project is built. + * + * @param sourceExt source file extension + * @return IManagedDependencyGeneratorType + */ + public IManagedDependencyGeneratorType getDependencyGeneratorForExtension(String sourceExt); + + /** + * Returns an array of command line arguments that have been specified for + * the tool. + * The flags contain build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the flags contain all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the flags contain + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @return String[] + * @throws BuildException + * + * @deprecated - use getToolCommandFlags instead + */ + public String[] getCommandFlags() throws BuildException; + + /** + * Returns the command line arguments that have been specified for + * the tool. + * The string contains build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the string contains all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the string contains + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @return String + * + * @deprecated - use getToolCommandFlagsString instead + */ + public String getToolFlags() throws BuildException ; + + /** + * Returns an array of command line arguments that have been specified for + * the tool. + * The flags contain build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the flags contain all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the flags contain + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param inputFileLocation + * @param outputFileLocation + * @return + * @throws BuildException + */ + public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException; + + /** + * Returns the command line arguments that have been specified for + * the tool. + * The string contains build macros resolved to the makefile format. + * That is if a user has chosen to expand all macros in the buildfile, + * the string contains all macro references resolved, otherwise, if a user has + * chosen to keep the environment build macros unresolved, the string contains + * the environment macro references converted to the buildfile variable format, + * all other macro references are resolved + * + * @param inputFileLocation + * @param outputFileLocation + * @return + * @throws BuildException + */ + public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException; + + /** + * Options are organized into categories for UI purposes. + * These categories are organized into a tree. This is the root + * of that tree. + * + * @return IOptionCategory + */ + public IOptionCategory getTopOptionCategory(); + + /** + * Return true if the receiver builds files with the + * specified extension, else false. + * + * @param extension file extension of the source + * @return boolean + */ + public boolean buildsFileType(String extension); + + /** + * Return true if the receiver uses files with the + * specified extension as input, else false. This + * returns true for a superset of the extensions that buildFileType + * returns true for - it includes secondary inputs. + * + * @param extension file extension of the source + * @return boolean + */ + public boolean isInputFileType(String extension); + + /** + * Answers true if the tool considers the file extension to be + * one associated with a header file. + * + * @param ext file extension of the source + * @return boolean + */ + public boolean isHeaderFile(String ext); + + /** + * Answers true if the receiver builds a file with the extension specified + * in the argument, else false. + * + * @param outputExtension extension of the file being produced by a tool + * @return boolean + */ + public boolean producesFileType(String outputExtension); + + /** + * Returns true if this tool has changes that need to + * be saved in the project file, else false. + * + * @return boolean + */ + public boolean isDirty(); + + /** + * Sets the element's "dirty" (have I been modified?) flag. + * + * @param isDirty + */ + public void setDirty(boolean isDirty); + + /** + * Returns true if this tool was loaded from a manifest file, + * and false if it was loaded from a project (.cdtbuild) file. + * + * @return boolean + */ + public boolean isExtensionElement(); + + /** + * Returns the 'versionsSupported' of this tool + * + * @return String + */ + public String getVersionsSupported(); + + /** + * Returns the 'convertToId' of this tool + * + * @return String + */ + public String getConvertToId(); + + /** + * Sets the 'versionsSupported' attribute of the tool. + * + * @param versionsSupported + */ + public void setVersionsSupported(String versionsSupported); + + /** + * Sets the 'convertToId' attribute of the tool. + * + * @param convertToId + */ + public void setConvertToId(String convertToId); + + /** + * Returns an array of the Environment Build Path variable descriptors + * + * @return IEnvVarBuildPath[] + */ + public IEnvVarBuildPath[] getEnvVarBuildPaths(); +}