org.eclipse.cdt.managedbuilder.internal.core
Class Target

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.internal.core.BuildObject
      extended by org.eclipse.cdt.managedbuilder.internal.core.Target
All Implemented Interfaces:
IBuildObject, ITarget

public class Target
extends BuildObject
implements ITarget


Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.ITarget
ARCH_LIST, ARTIFACT_NAME, BINARY_PARSER, CLEAN_COMMAND, DEFAULT_EXTENSION, ERROR_PARSERS, EXTENSION, IS_ABSTRACT, IS_TEST, MAKE_ARGS, MAKE_COMMAND, OS_LIST, PARENT, SCANNER_INFO_COLLECTOR_ID, TARGET_ELEMENT_NAME
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.core.IBuildObject
ID, NAME
 
Constructor Summary
Target(IManagedConfigElement element, java.lang.String managedBuildRevision)
          This constructor is called to create a target defined by an extension point in a plugin manifest file.
Target(org.eclipse.core.resources.IResource owner, ITarget parent)
          Create a copy of the target specified in the argument, that is owned by the owned by the specified resource.
Target(ManagedBuildInfo buildInfo, org.w3c.dom.Element element)
          Create target from project file.
 
Method Summary
 void addConfiguration(IConfigurationV2 configuration)
           
 void addTargetToolReferences(java.util.Vector toolRefs)
           
 void addTool(ITool tool)
          Adds a tool specification to the receiver.
 void addToolReference(ToolReference toolRef)
          Adds a tool reference to the receiver.
 void convertToProjectType(java.lang.String managedBuildRevision)
          Converts a CDT V2.0 target into a ProjectType + Configuration + Toolchain + Builder + TargetPlatform.
 IConfigurationV2 createConfiguration(IConfigurationV2 parent, java.lang.String id)
          Creates a configuration for the target populated with the tools and options settings from the parent configuration.
 IConfigurationV2 createConfiguration(java.lang.String id)
          Creates a new configuration for the target.
 java.lang.String getArtifactExtension()
          Answers the extension that should be applied to build artifacts created by this target.
 java.lang.String getArtifactName()
          Get the name of the final build artifact.
 java.lang.String getBinaryParserId()
          Answers the unique ID of the binary parser associated with the target.
 java.lang.String getCleanCommand()
          Answers the OS-specific command to remove files created by the build
 IConfigurationV2 getConfiguration(java.lang.String id)
          Returns the configuration with the given id, or null if not found.
 IConfigurationV2[] getConfigurations()
          Returns all of the configurations defined by this target.
 ProjectType getCreatedProjectType()
          Returns the ProjectType that this Target has been converted to, or null if it has not been converted.
 java.lang.String getDefaultExtension()
          Get the default extension that should be applied to build artifacts created by this target.
 java.lang.String getErrorParserIds()
          Answers the semicolon separated list of unique IDs of the error parsers associated with the target.
 java.lang.String[] getErrorParserList()
          Answers the ordered list of unique IDs of the error parsers associated with the target.
 java.lang.String getMakeArguments()
          Answers the command line arguments to pass to the make utility used by the receiver to build a project.
 java.lang.String getMakeCommand()
          Answers the name of the make utility for the target.
 java.lang.String getName()
           
 org.eclipse.core.resources.IResource getOwner()
          Gets the resource that this target is applied to.
 ITarget getParent()
          Answers the ITarget that is the parent of the receiver.
 java.lang.String[] getTargetArchList()
          Answers an array of architectures the target can be created on.
 java.lang.String[] getTargetOSList()
          Answers an array of operating systems the target can be created on.
 ITool getTool(java.lang.String id)
          Answers the tool in the receiver with the ID specified in the argument, or null
 ITool[] getTools()
          Returns the list of platform specific tools associated with this platform.
 org.eclipse.core.runtime.PluginVersionIdentifier getVersion()
           
 boolean hasOverridenMakeCommand()
          Answers true if the receiver has a make command that differs from its parent specification.
 boolean isAbstract()
          Returns whether this target is abstract.
 boolean isDirty()
          Answers true the receiver has changes that need to be saved in the project file, else false.
 boolean isTestTarget()
          Answers true if the receiver is a target that is defined for testing purposes only, else false.
 boolean needsRebuild()
          Answers whether the receiver has been changed and requires the project to be rebuilt.
 void removeConfiguration(java.lang.String id)
          Removes the configuration with the ID specified in the argument.
 void resetMakeCommand()
           
 void resolveReferences()
           
 void serialize(org.w3c.dom.Document doc, org.w3c.dom.Element element)
          Persist receiver to project file.
 void setArtifactExtension(java.lang.String extension)
          Set (override) the extension that should be appended to the build artifact for the receiver.
 void setArtifactName(java.lang.String name)
          Set the name of the artifact that will be produced when the receiver is built.
 void setDirty(boolean isDirty)
           
 void setErrorParserIds(java.lang.String ids)
          Sets the semicolon separated list of error parser ids
 void setMakeArguments(java.lang.String makeArgs)
          Sets the arguments to be passed to the make utility used by the receiver to produce a build goal.
 void setMakeCommand(java.lang.String command)
          Sets the make command for the receiver to the value in the argument.
 void setRebuildState(boolean rebuild)
          Set the rebuild state of the receiver.
 void setVersion(org.eclipse.core.runtime.PluginVersionIdentifier version)
           
 void updateOwner(org.eclipse.core.resources.IResource resource)
          Sets the resource that owns the receiver.
 
Methods inherited from class org.eclipse.cdt.managedbuilder.internal.core.BuildObject
getBaseId, getId, getManagedBuildRevision, 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.IBuildObject
getBaseId, getId, getManagedBuildRevision
 

Constructor Detail

Target

public Target(IManagedConfigElement element,
              java.lang.String managedBuildRevision)
This constructor is called to create a target defined by an extension point in a plugin manifest file.

Parameters:
element -
managedBuildRevision - the fileVersion of Managed Build System

Target

public Target(org.eclipse.core.resources.IResource owner,
              ITarget parent)
Create a copy of the target specified in the argument, that is owned by the owned by the specified resource.

Parameters:
owner -
parent -

Target

public Target(ManagedBuildInfo buildInfo,
              org.w3c.dom.Element element)
Create target from project file.

Parameters:
buildInfo -
element -
Method Detail

addConfiguration

public void addConfiguration(IConfigurationV2 configuration)
Parameters:
configuration -

addTool

public void addTool(ITool tool)
Adds a tool specification to the receiver. This tool is defined only for the receiver, and cannot be shared by other targets.

Parameters:
tool -

addToolReference

public void addToolReference(ToolReference toolRef)
Adds a tool reference to the receiver.

Parameters:
toolRef -

createConfiguration

public IConfigurationV2 createConfiguration(IConfigurationV2 parent,
                                            java.lang.String id)
Description copied from interface: ITarget
Creates a configuration for the target populated with the tools and options settings from the parent configuration. As options and tools change in the parent, unoverridden values are updated in the child config as well.

Specified by:
createConfiguration in interface ITarget
Parameters:
parent - The IConfigurationV2 to use as a settings template
id - The unique id the new configuration will have
Returns:
IConfigurationV2

createConfiguration

public IConfigurationV2 createConfiguration(java.lang.String id)
Description copied from interface: ITarget
Creates a new configuration for the target. It is populated with the tools defined for that target and options set at their defaults.

Specified by:
createConfiguration in interface ITarget
Parameters:
id - id for this configuration.
Returns:
IConfigurationV2

getArtifactExtension

public java.lang.String getArtifactExtension()
Description copied from interface: ITarget
Answers the extension that should be applied to build artifacts created by this target.

Specified by:
getArtifactExtension in interface ITarget
Returns:
String

getArtifactName

public java.lang.String getArtifactName()
Description copied from interface: ITarget
Get the name of the final build artifact.

Specified by:
getArtifactName in interface ITarget
Returns:
String

getBinaryParserId

public java.lang.String getBinaryParserId()
Description copied from interface: ITarget
Answers the unique ID of the binary parser associated with the target.

Specified by:
getBinaryParserId in interface ITarget
Returns:
String

getCleanCommand

public java.lang.String getCleanCommand()
Description copied from interface: ITarget
Answers the OS-specific command to remove files created by the build

Specified by:
getCleanCommand in interface ITarget
Returns:
String

getConfiguration

public IConfigurationV2 getConfiguration(java.lang.String id)
Description copied from interface: ITarget
Returns the configuration with the given id, or null if not found.

Specified by:
getConfiguration in interface ITarget
Returns:
IConfigurationV2

getConfigurations

public IConfigurationV2[] getConfigurations()
Description copied from interface: ITarget
Returns all of the configurations defined by this target.

Specified by:
getConfigurations in interface ITarget
Returns:
IConfigurationV2[]

getDefaultExtension

public java.lang.String getDefaultExtension()
Description copied from interface: ITarget
Get the default extension that should be applied to build artifacts created by this target.

Specified by:
getDefaultExtension in interface ITarget
Returns:
String

getErrorParserIds

public java.lang.String getErrorParserIds()
Description copied from interface: ITarget
Answers the semicolon separated list of unique IDs of the error parsers associated with the target.

Specified by:
getErrorParserIds in interface ITarget
Returns:
String

getErrorParserList

public java.lang.String[] getErrorParserList()
Description copied from interface: ITarget
Answers the ordered list of unique IDs of the error parsers associated with the target.

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

getMakeArguments

public java.lang.String getMakeArguments()
Description copied from interface: ITarget
Answers the command line arguments to pass to the make utility used by the receiver to build a project.

Specified by:
getMakeArguments in interface ITarget
Returns:

getMakeCommand

public java.lang.String getMakeCommand()
Description copied from interface: ITarget
Answers the name of the make utility for the target.

Specified by:
getMakeCommand in interface ITarget
Returns:
String

getName

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

getOwner

public org.eclipse.core.resources.IResource getOwner()
Description copied from interface: ITarget
Gets the resource that this target is applied to.

Specified by:
getOwner in interface ITarget
Returns:
IResource

getParent

public ITarget getParent()
Description copied from interface: ITarget
Answers the ITarget that is the parent of the receiver.

Specified by:
getParent in interface ITarget
Returns:
ITarget

getTargetArchList

public java.lang.String[] getTargetArchList()
Description copied from interface: ITarget
Answers an array of architectures the target can be created on.

Specified by:
getTargetArchList in interface ITarget
Returns:
String[]

getTargetOSList

public java.lang.String[] getTargetOSList()
Description copied from interface: ITarget
Answers an array of operating systems the target can be created on.

Specified by:
getTargetOSList in interface ITarget
Returns:
String[]

getTool

public ITool getTool(java.lang.String id)
Description copied from interface: ITarget
Answers the tool in the receiver with the ID specified in the argument, or null

Specified by:
getTool in interface ITarget
Returns:

getTools

public ITool[] getTools()
Description copied from interface: ITarget
Returns the list of platform specific tools associated with this platform.

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

hasOverridenMakeCommand

public boolean hasOverridenMakeCommand()
Description copied from interface: ITarget
Answers true if the receiver has a make command that differs from its parent specification.

Specified by:
hasOverridenMakeCommand in interface ITarget
Returns:
boolean

isAbstract

public boolean isAbstract()
Description copied from interface: ITarget
Returns whether this target is abstract.

Specified by:
isAbstract in interface ITarget
Returns:
boolean

isDirty

public boolean isDirty()
Description copied from interface: ITarget
Answers true the receiver has changes that need to be saved in the project file, else false.

Specified by:
isDirty in interface ITarget
Returns:
boolean

isTestTarget

public boolean isTestTarget()
Description copied from interface: ITarget
Answers true if the receiver is a target that is defined for testing purposes only, else false. A test target will not be shown in the UI but can still be manipulated programmatically.

Specified by:
isTestTarget in interface ITarget
Returns:
boolean

needsRebuild

public boolean needsRebuild()
Description copied from interface: ITarget
Answers whether the receiver has been changed and requires the project to be rebuilt.

Specified by:
needsRebuild in interface ITarget
Returns:
true if the receiver contains a change that needs the project to be rebuilt

removeConfiguration

public void removeConfiguration(java.lang.String id)
Description copied from interface: ITarget
Removes the configuration with the ID specified in the argument.

Specified by:
removeConfiguration in interface ITarget

resetMakeCommand

public void resetMakeCommand()

resolveReferences

public void resolveReferences()

serialize

public void serialize(org.w3c.dom.Document doc,
                      org.w3c.dom.Element element)
Persist receiver to project file.

Parameters:
doc -
element -

setArtifactExtension

public void setArtifactExtension(java.lang.String extension)
Description copied from interface: ITarget
Set (override) the extension that should be appended to the build artifact for the receiver.

Specified by:
setArtifactExtension in interface ITarget

setArtifactName

public void setArtifactName(java.lang.String name)
Description copied from interface: ITarget
Set the name of the artifact that will be produced when the receiver is built.

Specified by:
setArtifactName in interface ITarget

setDirty

public void setDirty(boolean isDirty)
Specified by:
setDirty in interface ITarget

setErrorParserIds

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

Specified by:
setErrorParserIds in interface ITarget

setMakeArguments

public void setMakeArguments(java.lang.String makeArgs)
Description copied from interface: ITarget
Sets the arguments to be passed to the make utility used by the receiver to produce a build goal.

Specified by:
setMakeArguments in interface ITarget

setMakeCommand

public void setMakeCommand(java.lang.String command)
Description copied from interface: ITarget
Sets the make command for the receiver to the value in the argument.

Specified by:
setMakeCommand in interface ITarget

setRebuildState

public void setRebuildState(boolean rebuild)
Description copied from interface: ITarget
Set the rebuild state of the receiver.

Specified by:
setRebuildState in interface ITarget
See Also:
IManagedBuildInfo.setRebuildState(boolean)

updateOwner

public void updateOwner(org.eclipse.core.resources.IResource resource)
Description copied from interface: ITarget
Sets the resource that owns the receiver.

Specified by:
updateOwner in interface ITarget

convertToProjectType

public void convertToProjectType(java.lang.String managedBuildRevision)
Description copied from interface: ITarget
Converts a CDT V2.0 target into a ProjectType + Configuration + Toolchain + Builder + TargetPlatform.

Specified by:
convertToProjectType in interface ITarget

addTargetToolReferences

public void addTargetToolReferences(java.util.Vector toolRefs)

getCreatedProjectType

public ProjectType getCreatedProjectType()
Description copied from interface: ITarget
Returns the ProjectType that this Target has been converted to, or null if it has not been converted.

Specified by:
getCreatedProjectType in interface ITarget
Returns:
ProjectType

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.