org.eclipse.cdt.managedbuilder.ui.tests.util
Class TestToolchain

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.internal.core.BuildObject
      extended by org.eclipse.cdt.managedbuilder.internal.core.HoldsOptions
          extended by org.eclipse.cdt.managedbuilder.ui.tests.util.TestToolchain
All Implemented Interfaces:
IBuildObject, IBuildPropertiesRestriction, IHoldsOptions, IToolChain, IBuildPropertyChangeListener

public class TestToolchain
extends HoldsOptions
implements IToolChain


Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IToolChain
ARCH_LIST, CONFIGURATION_ENVIRONMENT_SUPPLIER, CONFIGURATION_MACRO_SUPPLIER, CONVERT_TO_ID, ERROR_PARSERS, IS_SYSTEM, IS_TOOL_CHAIN_SUPPORTED, NON_INTERNAL_BUILDER_ID, OS_LIST, RESOURCE_TYPE_BASED_DISCOVERY, SCANNER_CONFIG_PROFILE_ID, SECONDARY_OUTPUTS, SUPPORTS_MANAGED_BUILD, TARGET_TOOL, TOOL_CHAIN_ELEMENT_NAME, VERSIONS_SUPPORTED
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IHoldsOptions
OPTION, OPTION_CAT, OPTION_REF
 
Constructor Summary
TestToolchain()
           
 
Method Summary
 IBuilder createBuilder(IBuilder superClass, java.lang.String Id, java.lang.String name, boolean isExtensionElement)
          Creates the Builder child of this tool-chain.
 ITargetPlatform createTargetPlatform(ITargetPlatform superClass, java.lang.String Id, java.lang.String name, boolean isExtensionElement)
          Creates the TargetPlatform child of this tool-chain.
 ITool createTool(ITool superClass, java.lang.String Id, java.lang.String name, boolean isExtensionElement)
          Creates a Tool child of this tool-chain.
 java.lang.String[] getArchList()
          Returns an array of architectures the tool-chain outputs can run on.
 IBuilder getBuilder()
          Returns the builder child of this tool-chain.
 IConfigurationBuildMacroSupplier getBuildMacroSupplier()
          Returns the tool-integrator provided implementation of the configuration build macro supplier or null if none.
 java.lang.String getConvertToId()
          Returns the 'convertToId' of this tool-chain
 IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier()
          Returns the tool-integrator provided implementation of the configuration environment variable supplier or null if none.
 java.lang.String getErrorParserIds()
          Returns the semicolon separated list of unique IDs of the error parsers associated with the tool-chain.
 java.lang.String getErrorParserIds(IConfiguration config)
          Returns the semicolon separated list of unique IDs of the error parsers associated with the tool-chain, filtered for the specified configuration.
 java.lang.String[] getErrorParserList()
          Returns the ordered list of unique IDs of the error parsers associated with the tool-chain.
 java.lang.String getId()
           
 java.lang.String getManagedBuildRevision()
           
 java.lang.String getName()
           
 IOptionPathConverter getOptionPathConverter()
          Returns an IOptionPathConverter implementation for this toolchain or null, if no conversion is required
 java.lang.String[] getOSList()
          Returns an array of operating systems the tool-chain outputs can run on.
 IConfiguration getParent()
          Returns the configuration that is the parent of this tool-chain.
 IFolderInfo getParentFolderInfo()
           
 java.lang.String getScannerConfigDiscoveryProfileId()
          Returns the scanner config discovery profile id or null if none.
 IOutputType[] getSecondaryOutputs()
          Returns the OutputTypes in this tool-chain, besides the primary output of the targetTool, that are also considered to be build artifacts.
 IToolChain getSuperClass()
          Returns the IToolChain that is the superclass of this tool-chain, or null if the attribute was not specified.
 ITargetPlatform getTargetPlatform()
          Returns the target-platform child of this tool-chain
 org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData getTargetPlatformData()
           
 java.lang.String getTargetToolIds()
          Returns the sem-colon separated list of Tool ids containing each tool that can create the final build artifact (the end target of the build).
 java.lang.String[] getTargetToolList()
          Returns the list of Tool ids containing each tool that can create the final build artifact (the end target of the build).
 ITool getTool(java.lang.String id)
          Returns the tool in this tool-chain with the ID specified in the argument, or null
 ITool[] getTools()
          Returns an array of tool children of this tool-chain
 ITool[] getToolsBySuperClassId(java.lang.String id)
          Returns the ITool in the tool-chain with the specified ID, or the tool(s) with a superclass with this id.
 java.lang.String getUniqueRealName()
           
 java.lang.String getUnusedChildren()
          Returns a semi-colon delimited list of child Ids of the superclass' children that should not be automatically inherited by this element.
 org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
           
 java.lang.String getVersionsSupported()
          Returns the 'versionsSupported' of this tool-chain
 boolean isAbstract()
          Returns whether this element is abstract.
 boolean isDirty()
          Returns true if this tool-chain has changes that need to be saved in the project file, else false.
 boolean isExtensionElement()
          Returns true if this tool-chain was loaded from a manifest file, and false if it was loaded from a project (.cdtbuild) file.
 boolean isSupported()
          Returns true if the tool-chain support is installed on the system otherwise returns false
 boolean isSystemObject()
           
 boolean matches(IToolChain tc)
           
 void removeLocalBuilder()
          If the tool chain is not an extension element, and it has its own Builder child, remove the builder so that the tool chain uses its superclass' Builder
 void removeLocalTargetPlatform()
          If the tool chain is not an extension element, and it has its own TargetPlatform child, remove the TargetPlatform so that the tool chain uses its superclass' TargetPlatform
 void setArchList(java.lang.String[] archs)
          Sets the architecture list.
 void setConvertToId(java.lang.String convertToId)
          Sets the 'convertToId' attribute of the tool-chain.
 void setDirty(boolean isDirty)
          Sets the element's "dirty" (have I been modified?)
 void setErrorParserIds(java.lang.String ids)
          Sets the semicolon separated list of error parser ids.
 void setID(java.lang.String id)
           
 void setIsAbstract(boolean b)
          Sets the isAbstract attribute of the tool-chain.
 void setOSList(java.lang.String[] OSs)
          Sets the OS list.
 void setScannerConfigDiscoveryProfileId(java.lang.String profileId)
          Sets the scanner config discovery profile id.
 void setSecondaryOutputs(java.lang.String ids)
          Sets the semicolon separated list of OutputType identifiers in this tool-chain, besides the primary output of the targetTool, that are also considered to be build artifacts.
 void setTargetToolIds(java.lang.String targetToolIds)
          Sets the sem-colon separated list of Tool ids containing each tool that can create the final build artifact (the end target of the build).
 void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
           
 void setVersionsSupported(java.lang.String versionsSupported)
          Sets the 'versionsSupported' attribute of the tool-chain.
 boolean supportsBuild(boolean managed)
           
 
Methods inherited from class org.eclipse.cdt.managedbuilder.internal.core.HoldsOptions
addChildCategory, addOption, addOptionCategory, adjustOptions, createOption, createOptions, getChildCategories, getOption, getOptionById, getOptionBySuperClassId, getOptionCategory, getOptions, getOptionToSet, getRequiredTypeIds, getSupportedTypeIds, getSupportedValueIds, needsRebuild, propertiesChanged, removeOption, requiresType, setRebuildState, supportsType, supportsType, supportsValue, supportsValue
 
Methods inherited from class org.eclipse.cdt.managedbuilder.internal.core.BuildObject
getBaseId, getVersionFromId, setId, setManagedBuildRevision, setName, toString, updateManagedBuildRevision
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.cdt.managedbuilder.core.IHoldsOptions
addOptionCategory, createOption, createOptions, getChildCategories, getOption, getOptionById, getOptionBySuperClassId, getOptionCategory, getOptions, getOptionToSet, needsRebuild, removeOption, setRebuildState
 

Constructor Detail

TestToolchain

public TestToolchain()
Method Detail

getManagedBuildRevision

public java.lang.String getManagedBuildRevision()
Specified by:
getManagedBuildRevision in interface IBuildObject
Overrides:
getManagedBuildRevision in class BuildObject
Returns:
Returns the managedBuildRevision.

getVersion

public org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
Specified by:
getVersion in interface IBuildObject
Overrides:
getVersion in class BuildObject
Returns:
Returns the version.

setVersion

public void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
Specified by:
setVersion in interface IBuildObject
Overrides:
setVersion in class BuildObject
Parameters:
version - The version to set.

getBuildMacroSupplier

public IConfigurationBuildMacroSupplier getBuildMacroSupplier()
Description copied from interface: IToolChain
Returns the tool-integrator provided implementation of the configuration build macro supplier or null if none.

Specified by:
getBuildMacroSupplier in interface IToolChain
Returns:
IConfigurationBuildMacroSupplier

getParent

public IConfiguration getParent()
Description copied from interface: IToolChain
Returns the configuration that is the parent of this tool-chain.

Specified by:
getParent in interface IToolChain
Returns:
IConfiguration

createTargetPlatform

public ITargetPlatform createTargetPlatform(ITargetPlatform superClass,
                                            java.lang.String Id,
                                            java.lang.String name,
                                            boolean isExtensionElement)
Description copied from interface: IToolChain
Creates the TargetPlatform child of this tool-chain.

Specified by:
createTargetPlatform in interface IToolChain
Returns:
ITargetPlatform

getTargetPlatform

public ITargetPlatform getTargetPlatform()
Description copied from interface: IToolChain
Returns the target-platform child of this tool-chain

Specified by:
getTargetPlatform in interface IToolChain
Returns:
ITargetPlatform

removeLocalTargetPlatform

public void removeLocalTargetPlatform()
Description copied from interface: IToolChain
If the tool chain is not an extension element, and it has its own TargetPlatform child, remove the TargetPlatform so that the tool chain uses its superclass' TargetPlatform

Specified by:
removeLocalTargetPlatform in interface IToolChain

getVersionsSupported

public java.lang.String getVersionsSupported()
Description copied from interface: IToolChain
Returns the 'versionsSupported' of this tool-chain

Specified by:
getVersionsSupported in interface IToolChain
Returns:
String

getConvertToId

public java.lang.String getConvertToId()
Description copied from interface: IToolChain
Returns the 'convertToId' of this tool-chain

Specified by:
getConvertToId in interface IToolChain
Returns:
String

setVersionsSupported

public void setVersionsSupported(java.lang.String versionsSupported)
Description copied from interface: IToolChain
Sets the 'versionsSupported' attribute of the tool-chain.

Specified by:
setVersionsSupported in interface IToolChain

setConvertToId

public void setConvertToId(java.lang.String convertToId)
Description copied from interface: IToolChain
Sets the 'convertToId' attribute of the tool-chain.

Specified by:
setConvertToId in interface IToolChain

createBuilder

public IBuilder createBuilder(IBuilder superClass,
                              java.lang.String Id,
                              java.lang.String name,
                              boolean isExtensionElement)
Description copied from interface: IToolChain
Creates the Builder child of this tool-chain.

Specified by:
createBuilder in interface IToolChain
Returns:
IBuilder

removeLocalBuilder

public void removeLocalBuilder()
Description copied from interface: IToolChain
If the tool chain is not an extension element, and it has its own Builder child, remove the builder so that the tool chain uses its superclass' Builder

Specified by:
removeLocalBuilder in interface IToolChain

getBuilder

public IBuilder getBuilder()
Description copied from interface: IToolChain
Returns the builder child of this tool-chain.

Specified by:
getBuilder in interface IToolChain
Returns:
IBuilder

createTool

public ITool createTool(ITool superClass,
                        java.lang.String Id,
                        java.lang.String name,
                        boolean isExtensionElement)
Description copied from interface: IToolChain
Creates a Tool child of this tool-chain.

Specified by:
createTool in interface IToolChain
Returns:
ITool

getTools

public ITool[] getTools()
Description copied from interface: IToolChain
Returns an array of tool children of this tool-chain

Specified by:
getTools in interface IToolChain
Returns:
ITool[]

getTool

public ITool getTool(java.lang.String id)
Description copied from interface: IToolChain
Returns the tool in this tool-chain with the ID specified in the argument, or null

Specified by:
getTool in interface IToolChain
Parameters:
id - The ID of the requested tool
Returns:
ITool

getToolsBySuperClassId

public ITool[] getToolsBySuperClassId(java.lang.String id)
Description copied from interface: IToolChain
Returns the ITool in the 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.

Specified by:
getToolsBySuperClassId in interface IToolChain
Parameters:
id - unique identifier of the tool to search for
Returns:
ITool[]

getSuperClass

public IToolChain getSuperClass()
Description copied from interface: IToolChain
Returns the IToolChain that is the superclass of this tool-chain, or null if the attribute was not specified.

Specified by:
getSuperClass in interface IToolChain
Returns:
IToolChain

isAbstract

public boolean isAbstract()
Description copied from interface: IToolChain
Returns whether this element is abstract. Returns false if the attribute was not specified.

Specified by:
isAbstract in interface IToolChain
Returns:
boolean

setIsAbstract

public void setIsAbstract(boolean b)
Description copied from interface: IToolChain
Sets the isAbstract attribute of the tool-chain.

Specified by:
setIsAbstract in interface IToolChain

getUnusedChildren

public java.lang.String getUnusedChildren()
Description copied from interface: IToolChain
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.

Specified by:
getUnusedChildren in interface IToolChain
Returns:
String

getOSList

public java.lang.String[] getOSList()
Description copied from interface: IToolChain
Returns an array of operating systems the tool-chain outputs can run on.

Specified by:
getOSList in interface IToolChain
Returns:
String[]

setOSList

public void setOSList(java.lang.String[] OSs)
Description copied from interface: IToolChain
Sets the OS list.

Specified by:
setOSList in interface IToolChain

getArchList

public java.lang.String[] getArchList()
Description copied from interface: IToolChain
Returns an array of architectures the tool-chain outputs can run on.

Specified by:
getArchList in interface IToolChain
Returns:
String[]

setArchList

public void setArchList(java.lang.String[] archs)
Description copied from interface: IToolChain
Sets the architecture list.

Specified by:
setArchList in interface IToolChain

getErrorParserIds

public java.lang.String getErrorParserIds()
Description copied from interface: IToolChain
Returns the semicolon separated list of unique IDs of the error parsers associated with the tool-chain.

Specified by:
getErrorParserIds in interface IToolChain
Returns:
String

getErrorParserIds

public java.lang.String getErrorParserIds(IConfiguration config)
Description copied from interface: IToolChain
Returns the semicolon separated list of unique IDs of the error parsers associated with the tool-chain, filtered for the specified configuration.

Specified by:
getErrorParserIds in interface IToolChain
Returns:
String

getErrorParserList

public java.lang.String[] getErrorParserList()
Description copied from interface: IToolChain
Returns the ordered list of unique IDs of the error parsers associated with the tool-chain.

Specified by:
getErrorParserList in interface IToolChain
Returns:
String[]

setErrorParserIds

public void setErrorParserIds(java.lang.String ids)
Description copied from interface: IToolChain
Sets the semicolon separated list of error parser ids.

Specified by:
setErrorParserIds in interface IToolChain

getScannerConfigDiscoveryProfileId

public java.lang.String getScannerConfigDiscoveryProfileId()
Description copied from interface: IToolChain
Returns the scanner config discovery profile id or null if none.

Specified by:
getScannerConfigDiscoveryProfileId in interface IToolChain
Returns:
String

setScannerConfigDiscoveryProfileId

public void setScannerConfigDiscoveryProfileId(java.lang.String profileId)
Description copied from interface: IToolChain
Sets the scanner config discovery profile id.

Specified by:
setScannerConfigDiscoveryProfileId in interface IToolChain

getTargetToolIds

public java.lang.String getTargetToolIds()
Description copied from interface: IToolChain
Returns the sem-colon separated list of Tool ids containing each tool that can create the final build artifact (the end target of the build). MBS will use the first ID in the list that matches a Tool in the ToolChain. One reason for specifying a list, is that different versions of a tool can be selected based upon the project nature (e.g. different tool definitions for a linker for C vs. C++).

Specified by:
getTargetToolIds in interface IToolChain
Returns:
String

setTargetToolIds

public void setTargetToolIds(java.lang.String targetToolIds)
Description copied from interface: IToolChain
Sets the sem-colon separated list of Tool ids containing each tool that can create the final build artifact (the end target of the build).

Specified by:
setTargetToolIds in interface IToolChain

getTargetToolList

public java.lang.String[] getTargetToolList()
Description copied from interface: IToolChain
Returns the list of Tool ids containing each tool that can create the final build artifact (the end target of the build). MBS will use the first ID in the list that matches a Tool in the ToolChain. One reason for specifying a list, is that different versions of a tool can be selected based upon the project nature (e.g. different tool definitions for a linker for C vs. C++).

Specified by:
getTargetToolList in interface IToolChain
Returns:
String[]

getSecondaryOutputs

public IOutputType[] getSecondaryOutputs()
Description copied from interface: IToolChain
Returns the OutputTypes in this tool-chain, besides the primary output of the targetTool, that are also considered to be build artifacts.

Specified by:
getSecondaryOutputs in interface IToolChain
Returns:
IOutputType[]

setSecondaryOutputs

public void setSecondaryOutputs(java.lang.String ids)
Description copied from interface: IToolChain
Sets the semicolon separated list of OutputType identifiers in this tool-chain, besides the primary output of the targetTool, that are also considered to be build artifacts.

Specified by:
setSecondaryOutputs in interface IToolChain

isDirty

public boolean isDirty()
Description copied from interface: IToolChain
Returns true if this tool-chain has changes that need to be saved in the project file, else false.

Specified by:
isDirty in interface IToolChain
Returns:
boolean

setDirty

public void setDirty(boolean isDirty)
Description copied from interface: IToolChain
Sets the element's "dirty" (have I been modified?) flag.

Specified by:
setDirty in interface IToolChain

isExtensionElement

public boolean isExtensionElement()
Description copied from interface: IToolChain
Returns true if this tool-chain was loaded from a manifest file, and false if it was loaded from a project (.cdtbuild) file.

Specified by:
isExtensionElement in interface IToolChain
Specified by:
isExtensionElement in class HoldsOptions
Returns:
boolean

isSupported

public boolean isSupported()
Description copied from interface: IToolChain
Returns true if the tool-chain support is installed on the system otherwise returns false

Specified by:
isSupported in interface IToolChain
Returns:
boolean

getEnvironmentVariableSupplier

public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier()
Description copied from interface: IToolChain
Returns the tool-integrator provided implementation of the configuration environment variable supplier or null if none.

Specified by:
getEnvironmentVariableSupplier in interface IToolChain
Returns:
IConfigurationEnvironmentVariableSupplier

getId

public java.lang.String getId()
Specified by:
getId in interface IBuildObject
Overrides:
getId in class BuildObject

getName

public java.lang.String getName()
Specified by:
getName in interface IBuildObject
Overrides:
getName in class BuildObject

setID

public void setID(java.lang.String id)

getOptionPathConverter

public IOptionPathConverter getOptionPathConverter()
Description copied from interface: IToolChain
Returns an IOptionPathConverter implementation for this toolchain or null, if no conversion is required

Specified by:
getOptionPathConverter in interface IToolChain

getParentFolderInfo

public IFolderInfo getParentFolderInfo()
Specified by:
getParentFolderInfo in interface IToolChain

getTargetPlatformData

public org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData getTargetPlatformData()
Specified by:
getTargetPlatformData in interface IToolChain

getUniqueRealName

public java.lang.String getUniqueRealName()
Specified by:
getUniqueRealName in interface IToolChain

isSystemObject

public boolean isSystemObject()
Specified by:
isSystemObject in interface IToolChain

matches

public boolean matches(IToolChain tc)
Specified by:
matches in interface IToolChain

supportsBuild

public boolean supportsBuild(boolean managed)
Specified by:
supportsBuild in interface IToolChain