|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.Project
Central representation of an Ant project. This class defines an Ant project with all of its targets, tasks and various other properties. It also provides the mechanism to kick off a build using a particular target name.
This class also encapsulates methods which allow files to be referred to using abstract path names which are translated to native system file paths at runtime.
Field Summary | |
static java.lang.String |
JAVA_1_0
Deprecated. use org.apache.tools.ant.util.JavaEnvUtils instead |
static java.lang.String |
JAVA_1_1
Deprecated. use org.apache.tools.ant.util.JavaEnvUtils instead |
static java.lang.String |
JAVA_1_2
Deprecated. use org.apache.tools.ant.util.JavaEnvUtils instead |
static java.lang.String |
JAVA_1_3
Deprecated. use org.apache.tools.ant.util.JavaEnvUtils instead |
static java.lang.String |
JAVA_1_4
Deprecated. use org.apache.tools.ant.util.JavaEnvUtils instead |
static int |
MSG_DEBUG
Message priority of "debug". |
static int |
MSG_ERR
Message priority of "error". |
static int |
MSG_INFO
Message priority of "information". |
static int |
MSG_VERBOSE
Message priority of "verbose". |
static int |
MSG_WARN
Message priority of "warning". |
static java.lang.String |
TOKEN_END
Default filter end token. |
static java.lang.String |
TOKEN_START
Default filter start token. |
Constructor Summary | |
Project()
Creates a new Ant project. |
Method Summary | |
void |
addBuildListener(BuildListener listener)
Adds a build listener to the list. |
void |
addDataTypeDefinition(java.lang.String typeName,
java.lang.Class typeClass)
Adds a new datatype definition. |
void |
addFilter(java.lang.String token,
java.lang.String value)
Deprecated. Use getGlobalFilterSet().addFilter(token,value) |
void |
addOrReplaceTarget(java.lang.String targetName,
Target target)
Adds a target to the project, or replaces one with the same name. |
void |
addOrReplaceTarget(Target target)
Adds a target to the project, or replaces one with the same name. |
void |
addReference(java.lang.String name,
java.lang.Object value)
Adds a reference to the project. |
void |
addTarget(java.lang.String targetName,
Target target)
Adds a new target to the project. |
void |
addTarget(Target target)
Adds a new target to the project. |
void |
addTaskDefinition(java.lang.String taskName,
java.lang.Class taskClass)
Adds a new task definition to the project. |
void |
checkTaskClass(java.lang.Class taskClass)
Checks whether or not a class is suitable for serving as Ant task. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile)
Deprecated. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
boolean filtering)
Deprecated. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
boolean filtering,
boolean overwrite)
Deprecated. |
void |
copyFile(java.io.File sourceFile,
java.io.File destFile,
boolean filtering,
boolean overwrite,
boolean preserveLastModified)
Deprecated. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile)
Deprecated. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
boolean filtering)
Deprecated. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
boolean filtering,
boolean overwrite)
Deprecated. |
void |
copyFile(java.lang.String sourceFile,
java.lang.String destFile,
boolean filtering,
boolean overwrite,
boolean preserveLastModified)
Deprecated. |
void |
copyInheritedProperties(Project other)
Copies all user properties that have not been set on the command line or a GUI tool from this instance to the Project instance given as the argument. |
void |
copyUserProperties(Project other)
Copies all user properties that have been set on the command line or a GUI tool from this instance to the Project instance given as the argument. |
AntClassLoader |
createClassLoader(Path path)
Factory method to create a class loader for loading classes from a given path |
java.lang.Object |
createDataType(java.lang.String typeName)
Creates a new instance of a data type. |
Task |
createTask(java.lang.String taskType)
Creates a new instance of a task, adding it to a list of created tasks for later invalidation. |
int |
defaultInput(byte[] buffer,
int offset,
int length)
Read data from the default input stream. |
void |
demuxFlush(java.lang.String output,
boolean isError)
Demultiplexes flush operation so that each task receives the appropriate messages. |
int |
demuxInput(byte[] buffer,
int offset,
int length)
Demux an input request to the correct task. |
void |
demuxOutput(java.lang.String output,
boolean isWarning)
Demultiplexes output so that each task receives the appropriate messages. |
void |
executeTarget(java.lang.String targetName)
Executes the specified target and any targets it depends on. |
void |
executeTargets(java.util.Vector targetNames)
Execute the specified sequence of targets, and the targets they depend on. |
void |
fireBuildFinished(java.lang.Throwable exception)
Sends a "build finished" event to the build listeners for this project. |
void |
fireBuildStarted()
Sends a "build started" event to the build listeners for this project. |
protected void |
fireMessageLogged(Project project,
java.lang.String message,
int priority)
Sends a "message logged" project level event to the build listeners for this project. |
protected void |
fireMessageLogged(Target target,
java.lang.String message,
int priority)
Sends a "message logged" target level event to the build listeners for this project. |
protected void |
fireMessageLogged(Task task,
java.lang.String message,
int priority)
Sends a "message logged" task level event to the build listeners for this project. |
void |
fireSubBuildFinished(java.lang.Throwable exception)
Sends a "subbuild finished" event to the build listeners for this project. |
void |
fireSubBuildStarted()
Sends a "subbuild started" event to the build listeners for this project. |
protected void |
fireTargetFinished(Target target,
java.lang.Throwable exception)
Sends a "target finished" event to the build listeners for this project. |
protected void |
fireTargetStarted(Target target)
Sends a "target started" event to the build listeners for this project. |
protected void |
fireTaskFinished(Task task,
java.lang.Throwable exception)
Sends a "task finished" event to the build listeners for this project. |
protected void |
fireTaskStarted(Task task)
Sends a "task started" event to the build listeners for this project. |
java.io.File |
getBaseDir()
Returns the base directory of the project as a file object. |
java.util.Vector |
getBuildListeners()
Returns a copy of the list of build listeners for the project. |
java.lang.ClassLoader |
getCoreLoader()
Returns the core classloader to use for this project. |
java.util.Hashtable |
getDataTypeDefinitions()
Returns the current datatype definition hashtable. |
java.io.InputStream |
getDefaultInputStream()
Get this project's input stream |
java.lang.String |
getDefaultTarget()
Returns the name of the default target of the project. |
java.lang.String |
getDescription()
Returns the project description, if one has been set. |
java.lang.String |
getElementName(java.lang.Object element)
Returns a description of the type of the given element, with special handling for instances of tasks and data types. |
java.util.Hashtable |
getFilters()
Deprecated. Use getGlobalFilterSet().getFilterHash() |
FilterSet |
getGlobalFilterSet()
Returns the set of global filters. |
InputHandler |
getInputHandler()
Retrieves the current input handler. |
static java.lang.String |
getJavaVersion()
Deprecated. use org.apache.tools.ant.util.JavaEnvUtils instead |
java.lang.String |
getName()
Returns the project name, if one has been set. |
java.util.Hashtable |
getProperties()
Returns a copy of the properties table. |
java.lang.String |
getProperty(java.lang.String name)
Returns the value of a property, if it is set. |
java.lang.Object |
getReference(java.lang.String key)
Looks up a reference by its key (ID). |
java.util.Hashtable |
getReferences()
Returns a map of the references in the project (String to Object). |
java.util.Hashtable |
getTargets()
Returns the hashtable of targets. |
java.util.Hashtable |
getTaskDefinitions()
Returns the current task definition hashtable. |
Task |
getThreadTask(java.lang.Thread thread)
Get the current task associated with a thread, if any |
java.util.Hashtable |
getUserProperties()
Returns a copy of the user property hashtable |
java.lang.String |
getUserProperty(java.lang.String name)
Returns the value of a user property, if it is set. |
void |
init()
Initialises the project. |
void |
initSubProject(Project subProject)
inits a sub project - used by taskdefs.Ant |
boolean |
isKeepGoingMode()
Returns the keep-going mode. |
void |
log(java.lang.String message)
Writes a message to the log with the default log level of MSG_INFO |
void |
log(java.lang.String message,
int msgLevel)
Writes a project level message to the log with the given log level. |
void |
log(Target target,
java.lang.String message,
int msgLevel)
Writes a target level message to the log with the given log level. |
void |
log(Task task,
java.lang.String message,
int msgLevel)
Writes a task level message to the log with the given log level. |
void |
registerThreadTask(java.lang.Thread thread,
Task task)
Register a task as the current task for a thread. |
void |
removeBuildListener(BuildListener listener)
Removes a build listener from the list. |
java.lang.String |
replaceProperties(java.lang.String value)
Replaces ${} style constructions in the given value with the string value of the corresponding data types. |
java.io.File |
resolveFile(java.lang.String fileName)
Returns the canonical form of a filename. |
java.io.File |
resolveFile(java.lang.String fileName,
java.io.File rootDir)
Deprecated. |
void |
setBaseDir(java.io.File baseDir)
Sets the base directory for the project, checking that the given file exists and is a directory. |
void |
setBasedir(java.lang.String baseD)
Sets the base directory for the project, checking that the given filename exists and is a directory. |
void |
setCoreLoader(java.lang.ClassLoader coreLoader)
Sets the core classloader for the project. |
void |
setDefault(java.lang.String defaultTarget)
Sets the default target of the project. |
void |
setDefaultInputStream(java.io.InputStream defaultInputStream)
Set the default System input stream. |
void |
setDefaultTarget(java.lang.String defaultTarget)
Deprecated. use setDefault |
void |
setDescription(java.lang.String description)
Sets the project description. |
void |
setFileLastModified(java.io.File file,
long time)
Deprecated. |
void |
setInheritedProperty(java.lang.String name,
java.lang.String value)
Sets a user property, which cannot be overwritten by set/unset property calls. |
void |
setInputHandler(InputHandler handler)
Sets the input handler |
void |
setJavaVersionProperty()
Sets the ant.java.version property and tests for
unsupported JVM versions. |
void |
setKeepGoingMode(boolean keepGoingMode)
Sets "keep-going" mode. |
void |
setName(java.lang.String name)
Sets the name of the project, also setting the user property ant.project.name . |
void |
setNewProperty(java.lang.String name,
java.lang.String value)
Sets a property if no value currently exists. |
void |
setProjectReference(java.lang.Object obj)
Set a reference to this Project on the parameterized object. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property. |
void |
setSystemProperties()
Adds all system properties which aren't already defined as user properties to the project properties. |
void |
setUserProperty(java.lang.String name,
java.lang.String value)
Sets a user property, which cannot be overwritten by set/unset property calls. |
static boolean |
toBoolean(java.lang.String s)
Returns the boolean equivalent of a string, which is considered true if either "on" , "true" ,
or "yes" is found, ignoring case. |
java.util.Vector |
topoSort(java.lang.String root,
java.util.Hashtable targets)
Topologically sorts a set of targets. |
static java.lang.String |
translatePath(java.lang.String toProcess)
Translates a path into its native (platform specific) format. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MSG_ERR
public static final int MSG_WARN
public static final int MSG_INFO
public static final int MSG_VERBOSE
public static final int MSG_DEBUG
public static final java.lang.String JAVA_1_0
public static final java.lang.String JAVA_1_1
public static final java.lang.String JAVA_1_2
public static final java.lang.String JAVA_1_3
public static final java.lang.String JAVA_1_4
public static final java.lang.String TOKEN_START
public static final java.lang.String TOKEN_END
Constructor Detail |
public Project()
Method Detail |
public void setInputHandler(InputHandler handler)
handler
- the InputHandler instance to use for gathering input.public void setDefaultInputStream(java.io.InputStream defaultInputStream)
defaultInputStream
- the default input stream to use when input
is requested.public java.io.InputStream getDefaultInputStream()
public InputHandler getInputHandler()
public void initSubProject(Project subProject)
subProject
- the subproject to initializepublic void init() throws BuildException
BuildException
- if the default task list cannot be loadedpublic AntClassLoader createClassLoader(Path path)
path
- the path from which classes are to be loaded.
public void setCoreLoader(java.lang.ClassLoader coreLoader)
null
classloader is specified, the parent classloader should be used.
coreLoader
- The classloader to use for the project.
May be null
.public java.lang.ClassLoader getCoreLoader()
null
, indicating that
the parent classloader should be used.
public void addBuildListener(BuildListener listener)
listener
- The listener to add to the list.
Must not be null
.public void removeBuildListener(BuildListener listener)
listener
- The listener to remove from the list.
Should not be null
.public java.util.Vector getBuildListeners()
public void log(java.lang.String message)
message
- The text to log. Should not be null
.public void log(java.lang.String message, int msgLevel)
message
- The text to log. Should not be null
.msgLevel
- The priority level to log at.public void log(Task task, java.lang.String message, int msgLevel)
task
- The task to use in the log. Must not be null
.message
- The text to log. Should not be null
.msgLevel
- The priority level to log at.public void log(Target target, java.lang.String message, int msgLevel)
target
- The target to use in the log.
Must not be null
.message
- The text to log. Should not be null
.msgLevel
- The priority level to log at.public FilterSet getGlobalFilterSet()
public void setProperty(java.lang.String name, java.lang.String value)
name
- The name of property to set.
Must not be null
.value
- The new value of the property.
Must not be null
.public void setNewProperty(java.lang.String name, java.lang.String value)
name
- The name of property to set.
Must not be null
.value
- The new value of the property.
Must not be null
.public void setUserProperty(java.lang.String name, java.lang.String value)
name
- The name of property to set.
Must not be null
.value
- The new value of the property.
Must not be null
.setProperty(String,String)
public void setInheritedProperty(java.lang.String name, java.lang.String value)
name
- The name of property to set.
Must not be null
.value
- The new value of the property.
Must not be null
.setProperty(String,String)
public java.lang.String getProperty(java.lang.String name)
name
- The name of the property.
May be null
, in which case
the return value is also null
.
null
for no match
or if a null
name is provided.public java.lang.String replaceProperties(java.lang.String value) throws BuildException
value
- The string to be scanned for property references.
May be null
.
null
if the given string is
null
.
BuildException
- if the given value has an unclosed
property name, e.g. ${xxx
public java.lang.String getUserProperty(java.lang.String name)
name
- The name of the property.
May be null
, in which case
the return value is also null
.
null
for no match
or if a null
name is provided.public java.util.Hashtable getProperties()
public java.util.Hashtable getUserProperties()
public void copyUserProperties(Project other)
To copy all "user" properties, you will also have to call
copyInheritedProperties
.
other
- the project to copy the properties to. Must not be null.public void copyInheritedProperties(Project other)
To copy all "user" properties, you will also have to call
copyUserProperties
.
other
- the project to copy the properties to. Must not be null.public void setDefaultTarget(java.lang.String defaultTarget)
defaultTarget
- The name of the default target for this project.
May be null
, indicating that there is
no default target.setDefault(String)
public java.lang.String getDefaultTarget()
null
if no default has been set.public void setDefault(java.lang.String defaultTarget)
defaultTarget
- The name of the default target for this project.
May be null
, indicating that there is
no default target.public void setName(java.lang.String name)
ant.project.name
.
name
- The name of the project.
Must not be null
.public java.lang.String getName()
null
if it hasn't been set.public void setDescription(java.lang.String description)
description
- The description of the project.
May be null
.public java.lang.String getDescription()
null
if it hasn't
been set.public void addFilter(java.lang.String token, java.lang.String value)
token
- The token to filter.
Must not be null
.value
- The replacement value.
Must not be null
.getGlobalFilterSet()
,
FilterSet.addFilter(String,String)
public java.util.Hashtable getFilters()
getGlobalFilterSet()
,
FilterSet.getFilterHash()
public void setBasedir(java.lang.String baseD) throws BuildException
baseD
- The project base directory.
Must not be null
.
BuildException
- if the directory if invalidpublic void setBaseDir(java.io.File baseDir) throws BuildException
baseDir
- The project base directory.
Must not be null
.
BuildException
- if the specified file doesn't exist or
isn't a directorypublic java.io.File getBaseDir()
null
if the
base directory has not been successfully set to a valid value.public void setKeepGoingMode(boolean keepGoingMode)
keepGoingMode
- "keep-going" modepublic boolean isKeepGoingMode()
public static java.lang.String getJavaVersion()
JavaEnvUtils.getJavaVersion()
public void setJavaVersionProperty() throws BuildException
ant.java.version
property and tests for
unsupported JVM versions. If the version is supported,
verbose log messages are generated to record the Java version
and operating system name.
BuildException
- if this Java version is not supportedJavaEnvUtils.getJavaVersion()
public void setSystemProperties()
public void addTaskDefinition(java.lang.String taskName, java.lang.Class taskClass) throws BuildException
taskName
- The name of the task to add.
Must not be null
.taskClass
- The full name of the class implementing the task.
Must not be null
.
BuildException
- if the class is unsuitable for being an Ant
task. An error level message is logged before
this exception is thrown.checkTaskClass(Class)
public void checkTaskClass(java.lang.Class taskClass) throws BuildException
taskClass
- The class to be checked.
Must not be null
.
BuildException
- if the class is unsuitable for being an Ant
task. An error level message is logged before
this exception is thrown.public java.util.Hashtable getTaskDefinitions()
public void addDataTypeDefinition(java.lang.String typeName, java.lang.Class typeClass)
typeName
- The name of the datatype.
Must not be null
.typeClass
- The full name of the class implementing the datatype.
Must not be null
.public java.util.Hashtable getDataTypeDefinitions()
public void addTarget(Target target) throws BuildException
target
- The target to be added to the project.
Must not be null
.
BuildException
- if the target already exists in the projectaddOrReplaceTarget(org.apache.tools.ant.Target)
public void addTarget(java.lang.String targetName, Target target) throws BuildException
targetName
- The name to use for the target.
Must not be null
.target
- The target to be added to the project.
Must not be null
.
BuildException
- if the target already exists in the projectaddOrReplaceTarget(org.apache.tools.ant.Target)
public void addOrReplaceTarget(Target target)
target
- The target to be added or replaced in the project.
Must not be null
.public void addOrReplaceTarget(java.lang.String targetName, Target target)
targetName
- The name to use for the target.
Must not be null
.target
- The target to be added or replaced in the project.
Must not be null
.public java.util.Hashtable getTargets()
public Task createTask(java.lang.String taskType) throws BuildException
taskType
- The name of the task to create an instance of.
Must not be null
.
null
if
the task name is not recognised.
BuildException
- if the task name is recognised but task
creation fails.public java.lang.Object createDataType(java.lang.String typeName) throws BuildException
typeName
- The name of the data type to create an instance of.
Must not be null
.
null
if
the data type name is not recognised.
BuildException
- if the data type name is recognised but
instance creation fails.public void executeTargets(java.util.Vector targetNames) throws BuildException
targetNames
- A vector of target name strings to execute.
Must not be null
.
BuildException
- if the build failedpublic void demuxOutput(java.lang.String output, boolean isWarning)
output
- Message to handle. Should not be null
.isWarning
- Whether the text represents an warning (true
)
or information (false
).public int defaultInput(byte[] buffer, int offset, int length) throws java.io.IOException
buffer
- the buffer into which data is to be read.offset
- the offset into the buffer at which data is stored.length
- the amount of data to read
java.io.IOException
- if the data cannot be readpublic int demuxInput(byte[] buffer, int offset, int length) throws java.io.IOException
buffer
- the buffer into which data is to be read.offset
- the offset into the buffer at which data is stored.length
- the amount of data to read
java.io.IOException
- if the data cannot be readpublic void demuxFlush(java.lang.String output, boolean isError)
output
- Message to handle. Should not be null
.isError
- Whether the text represents an error (true
)
or information (false
).public void executeTarget(java.lang.String targetName) throws BuildException
targetName
- The name of the target to execute.
Must not be null
.
BuildException
- if the build failedpublic java.io.File resolveFile(java.lang.String fileName, java.io.File rootDir)
If the specified file name is relative it is resolved with respect to the given root directory.
fileName
- The name of the file to resolve.
Must not be null
.rootDir
- The directory to resolve relative file names with
respect to. May be null
, in which case
the current directory is used.
public java.io.File resolveFile(java.lang.String fileName)
If the specified file name is relative it is resolved with respect to the project's base directory.
fileName
- The name of the file to resolve.
Must not be null
.
public static java.lang.String translatePath(java.lang.String toProcess)
This method uses PathTokenizer to separate the input path into its components. This handles DOS style paths in a relatively sensible way. The file separators are then converted to their platform specific versions.
toProcess
- The path to be translated.
May be null
.
null
or empty.PathTokenizer
public void copyFile(java.lang.String sourceFile, java.lang.String destFile) throws java.io.IOException
sourceFile
- Name of file to copy from.
Must not be null
.destFile
- Name of file to copy to.
Must not be null
.
java.io.IOException
- if the copying failspublic void copyFile(java.lang.String sourceFile, java.lang.String destFile, boolean filtering) throws java.io.IOException
sourceFile
- Name of file to copy from.
Must not be null
.destFile
- Name of file to copy to.
Must not be null
.filtering
- Whether or not token filtering should be used during
the copy.
java.io.IOException
- if the copying failspublic void copyFile(java.lang.String sourceFile, java.lang.String destFile, boolean filtering, boolean overwrite) throws java.io.IOException
sourceFile
- Name of file to copy from.
Must not be null
.destFile
- Name of file to copy to.
Must not be null
.filtering
- Whether or not token filtering should be used during
the copy.overwrite
- Whether or not the destination file should be
overwritten if it already exists.
java.io.IOException
- if the copying failspublic void copyFile(java.lang.String sourceFile, java.lang.String destFile, boolean filtering, boolean overwrite, boolean preserveLastModified) throws java.io.IOException
sourceFile
- Name of file to copy from.
Must not be null
.destFile
- Name of file to copy to.
Must not be null
.filtering
- Whether or not token filtering should be used during
the copy.overwrite
- Whether or not the destination file should be
overwritten if it already exists.preserveLastModified
- Whether or not the last modified time of
the resulting file should be set to that
of the source file.
java.io.IOException
- if the copying failspublic void copyFile(java.io.File sourceFile, java.io.File destFile) throws java.io.IOException
sourceFile
- File to copy from.
Must not be null
.destFile
- File to copy to.
Must not be null
.
java.io.IOException
- if the copying failspublic void copyFile(java.io.File sourceFile, java.io.File destFile, boolean filtering) throws java.io.IOException
sourceFile
- File to copy from.
Must not be null
.destFile
- File to copy to.
Must not be null
.filtering
- Whether or not token filtering should be used during
the copy.
java.io.IOException
- if the copying failspublic void copyFile(java.io.File sourceFile, java.io.File destFile, boolean filtering, boolean overwrite) throws java.io.IOException
sourceFile
- File to copy from.
Must not be null
.destFile
- File to copy to.
Must not be null
.filtering
- Whether or not token filtering should be used during
the copy.overwrite
- Whether or not the destination file should be
overwritten if it already exists.
java.io.IOException
- if the file cannot be copied.public void copyFile(java.io.File sourceFile, java.io.File destFile, boolean filtering, boolean overwrite, boolean preserveLastModified) throws java.io.IOException
sourceFile
- File to copy from.
Must not be null
.destFile
- File to copy to.
Must not be null
.filtering
- Whether or not token filtering should be used during
the copy.overwrite
- Whether or not the destination file should be
overwritten if it already exists.preserveLastModified
- Whether or not the last modified time of
the resulting file should be set to that
of the source file.
java.io.IOException
- if the file cannot be copied.public void setFileLastModified(java.io.File file, long time) throws BuildException
file
- The file to set the last modified time on.
Must not be null
.time
- the required modification time.
BuildException
- if the last modified time cannot be set
despite running on a platform with a version
above 1.1.public static boolean toBoolean(java.lang.String s)
true
if either "on"
, "true"
,
or "yes"
is found, ignoring case.
s
- The string to convert to a boolean value.
true
if the given string is "on"
,
"true"
or "yes"
, or
false
otherwise.public final java.util.Vector topoSort(java.lang.String root, java.util.Hashtable targets) throws BuildException
root
- The name of the root target. The sort is created in such
a way that the sequence of Targets up to the root
target is the minimum possible such sequence.
Must not be null
.targets
- A map of names to targets (String to Target).
Must not be null
.
BuildException
- if there is a cyclic dependency among the
targets, or if a named target does not exist.public void addReference(java.lang.String name, java.lang.Object value)
name
- The name of the reference. Must not be null
.value
- The value of the reference. Must not be null
.public java.util.Hashtable getReferences()
public java.lang.Object getReference(java.lang.String key)
key
- The key for the desired reference.
Must not be null
.
null
if
there is no such reference in the project.public java.lang.String getElementName(java.lang.Object element)
This is useful for logging purposes.
element
- The element to describe.
Must not be null
.
public void fireBuildStarted()
public void fireBuildFinished(java.lang.Throwable exception)
exception
- an exception indicating a reason for a build
failure. May be null
, indicating
a successful build.public void fireSubBuildStarted()
public void fireSubBuildFinished(java.lang.Throwable exception)
exception
- an exception indicating a reason for a build
failure. May be null
, indicating
a successful build.protected void fireTargetStarted(Target target)
target
- The target which is starting to build.
Must not be null
.protected void fireTargetFinished(Target target, java.lang.Throwable exception)
target
- The target which has finished building.
Must not be null
.exception
- an exception indicating a reason for a build
failure. May be null
, indicating
a successful build.protected void fireTaskStarted(Task task)
task
- The target which is starting to execute.
Must not be null
.protected void fireTaskFinished(Task task, java.lang.Throwable exception)
task
- The task which has finished executing.
Must not be null
.exception
- an exception indicating a reason for a build
failure. May be null
, indicating
a successful build.protected void fireMessageLogged(Project project, java.lang.String message, int priority)
project
- The project generating the event.
Should not be null
.message
- The message to send. Should not be null
.priority
- The priority of the message.protected void fireMessageLogged(Target target, java.lang.String message, int priority)
target
- The target generating the event.
Must not be null
.message
- The message to send. Should not be null
.priority
- The priority of the message.protected void fireMessageLogged(Task task, java.lang.String message, int priority)
task
- The task generating the event.
Must not be null
.message
- The message to send. Should not be null
.priority
- The priority of the message.public void registerThreadTask(java.lang.Thread thread, Task task)
thread
- the thread on which the task is registered.task
- the task to be registered.public Task getThreadTask(java.lang.Thread thread)
thread
- the thread for which the task is required.
public final void setProjectReference(java.lang.Object obj)
obj
- the object to invoke setProject(this) on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |