From 865ddb50ce0c95bd64aca5291f4962e7648d0eae Mon Sep 17 00:00:00 2001
From: Magesh Umasankar It is very easy to write your own task:
@@ -163,8 +163,8 @@ public class MyVeryOwnTask extends Task {
org.apache.tools.ant.Task
.public void
method that takes a single argument. The
name of the method must begin with set
, followed by the
attribute name, with the first character of the name in uppercase, and the rest in
@@ -26,7 +26,7 @@ any primitive type (they are converted for you from their String-representation
in the buildfile)
true
,
yes
, or on
)
File
-(in which case the value of the attribute is interpreted relative to the
+(in which case the value of the attribute is interpreted relative to the
project's basedir)
String
argument
org/apache/tools/ant/taskdefs/FixCRLF.java
for
an example.
-public void
+
public void
addText(String)
method.public
method that takes no arguments and returns
-an Object
type. The name of the create method must begin with
-create
, followed by the element name. An add method must be
-a public void
method that takes a single argument of an
+A create method
+must be a public
method that takes no arguments and returns
+an Object
type. The name of the create method must begin with
+create
, followed by the element name. An add method must be
+a public void
method that takes a single argument of an
Object
type with a no-argument constructor.
-The name of the add method
+The name of the add method
must begin with add
, followed by the element name.public void execute
method, with no arguments, that
throws a BuildException
. This method implements the task
@@ -101,11 +101,11 @@ itself.setXXX
methods, at runtime.execute()
is called at runtime. While the above initialization
- steps only occur once, the execute() method may be
- called more than once, if the task is invoked more than once. For example,
+ execute()
is called at runtime. While the above initialization
+ steps only occur once, the execute() method may be
+ called more than once, if the task is invoked more than once. For example,
if target1
and target2
both depend
- on target3
, then running
+ on target3
, then running
'ant target1 target2'
will run all tasks in
target3
twice.Example 2
-To use a task directly from the buildfile which created it, place the
-<taskdef>
declaration inside a target
+To use a task directly from the buildfile which created it, place the
+<taskdef>
declaration inside a target
after the compilation. Use the classpath
attribute of
<taskdef>
to point to where the code has just been
compiled.
@@ -178,9 +178,9 @@ compiled.
<mkdir dir="build"/>
<javac srcdir="source" destdir="build"/>
</target>
-
+
<target name="declare" depends="build">
- <taskdef name="mytask"
+ <taskdef name="mytask"
classname="com.mydomain.MyVeryOwnTask"
classpath="build"/>
</target>
@@ -200,13 +200,13 @@ package. Then you can use it as if it were a built-in task.
Ant is capable of generating build events as it performs the tasks necessary to build a project. +
Ant is capable of generating build events as it performs the tasks necessary to build a project. Listeners can be attached to Ant to receive these events. This capability could be used, for example, -to connect Ant to a GUI or to integrate Ant with an IDE. +to connect Ant to a GUI or to integrate Ant with an IDE.
-To use build events you need to create an ant Project
object. You can then call the
+
To use build events you need to create an ant Project
object. You can then call the
addBuildListener
method to add your listener to the project. Your listener must implement
-the org.apache.tools.antBuildListener
interface. The listener will receive BuildEvents
+the org.apache.tools.antBuildListener
interface. The listener will receive BuildEvents
for the following events
-ant -listener org.apache.tools.ant.XmlLogger
will run Ant with a listener that generates an XML representation of the build progress. This +
will run Ant with a listener that generates an XML representation of the build progress. This listener is included with Ant, as is the default listener, which generates the logging to standard output.
-Please consult the +Please consult the Getting Involved pages on the Jakarta web site -for details on how to fetch the latest source and how to submit changes for reincorporation into the -source tree. +for details on how to fetch the latest source and how to submit changes for reincorporation into the +source tree.
Ant also has some task guidelines which provides some advice to people developing and testing tasks. Even if you intend to -keep your tasks to yourself, you should still read this as it should be informative. +keep your tasks to yourself, you should still read this as it should be informative.
Copyright © 2001 Apache Software Foundation. All rights +
Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.
diff --git a/docs/manual/dirtasks.html b/docs/manual/dirtasks.html index b9a4420fe..79e1a79b9 100644 --- a/docs/manual/dirtasks.html +++ b/docs/manual/dirtasks.html @@ -2,7 +2,7 @@ -To provide feedback on this software, please subscribe to the +
To provide feedback on this software, please subscribe to the Ant User Mailing List
If you want to contribute to Ant or stay current with the latest -development, join the +development, join the Ant Development Mailing List
Archives of both lists can be found at http://marc.theaimsgroup.com you know of any additional archive sites, please report them to the lists.
Copyright © 2001 Apache Software Foundation. All rights +
Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.
diff --git a/docs/manual/ide.html b/docs/manual/ide.html index 84e864643..a2e7f36c7 100644 --- a/docs/manual/ide.html +++ b/docs/manual/ide.html @@ -2,7 +2,7 @@ -Copyright © 2001-2002 Apache Software Foundation. All rights +Reserved.
+ diff --git a/docs/manual/intro.html b/docs/manual/intro.html index 82c54c344..73e609ad1 100644 --- a/docs/manual/intro.html +++ b/docs/manual/intro.html @@ -2,7 +2,7 @@ -Copyright © 2001 Apache Software Foundation. All rights +
Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.
diff --git a/docs/manual/listeners.html b/docs/manual/listeners.html index ce1e44f04..aba880df1 100644 --- a/docs/manual/listeners.html +++ b/docs/manual/listeners.html @@ -2,7 +2,7 @@ -You can also set properties that
override properties specified in the
-buildfile (see the property task).
+buildfile (see the property task).
This can be done with
the -Dproperty=value
Options that affect the amount of logging output by Ant are: -quiet
-verbose
-debug
The value of the build.sysclasspath property control how the system classpath, ie. the classpath in effect when -Ant is run, affects the behaviour of classpaths in Ant. +Ant is run, affects the behaviour of classpaths in Ant. The default behavior varies from Ant to Ant task.
The values and their meanings are: @@ -52,7 +52,7 @@ the other form of compromise where the build runner has priority.Copyright © 2001 Apache Software Foundation. All rights +
Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.
diff --git a/docs/manual/using.html b/docs/manual/using.html index 28ff4093c..1ce50c997 100644 --- a/docs/manual/using.html +++ b/docs/manual/using.html @@ -2,7 +2,7 @@ -where name is the name of the task, attributeN is the attribute name, and valueN is the value for this attribute.
-There is a set of built-in tasks, along with a +
There is a set of built-in tasks, along with a number of optional tasks, but it is also very easy to write your own.
@@ -205,7 +205,7 @@ This is resolved at run-time asbuild/classes
.
defined using a <property>
task.
For example, ${os.name}
expands to the
name of the operating system.
-For a list of system properties see +
For a list of system properties see the Javadoc of System.getProperties.
In addition, Ant has some built-in properties:
@@ -371,22 +371,22 @@ that contain space characters, nestedarg
elements can be used.
;
or :
as
@@ -468,7 +468,7 @@ href="CoreTypes/patternset.html">PatternSets, Copyright © 2001 Apache Software Foundation. All rights
+Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.