PR: 5020 Submitted by: jesse.glick@netbeans.com (Jesse Glick) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271140 13f79535-47bb-0310-9956-ffa450edef68master
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Apache Ant User Manual - Credits</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Writing Your Own Task</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -12,7 +12,7 @@ | |||||
<p>It is very easy to write your own task:</p> | <p>It is very easy to write your own task:</p> | ||||
<ol> | <ol> | ||||
<li>Create a Java class that extends <code>org.apache.tools.ant.Task</code>.</li> | <li>Create a Java class that extends <code>org.apache.tools.ant.Task</code>.</li> | ||||
<li>For each attribute, write a <i>setter</i> method. The setter method must be a | |||||
<li>For each attribute, write a <i>setter</i> method. The setter method must be a | |||||
<code>public void</code> method that takes a single argument. The | <code>public void</code> method that takes a single argument. The | ||||
name of the method must begin with <code>set</code>, followed by the | name of the method must begin with <code>set</code>, followed by the | ||||
attribute name, with the first character of the name in uppercase, and the rest in | 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) | in the buildfile) | ||||
</li> | </li> | ||||
<li> | <li> | ||||
boolean - your method will be passed the value | |||||
boolean - your method will be passed the value | |||||
<i>true</i> if the value specified in the buildfile is one of <code>true</code>, | <i>true</i> if the value specified in the buildfile is one of <code>true</code>, | ||||
<code>yes</code>, or <code>on</code>) | <code>yes</code>, or <code>on</code>) | ||||
</li> | </li> | ||||
@@ -35,11 +35,11 @@ boolean - your method will be passed the value | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<code>File</code> | <code>File</code> | ||||
(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) | project's basedir) | ||||
</li> | </li> | ||||
<li> | <li> | ||||
any other type that has a constructor with a single | |||||
any other type that has a constructor with a single | |||||
<code>String</code> argument | <code>String</code> argument | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -50,16 +50,16 @@ as an argument | |||||
to your setter method. See | to your setter method. See | ||||
<code>org/apache/tools/ant/taskdefs/FixCRLF.java</code> for | <code>org/apache/tools/ant/taskdefs/FixCRLF.java</code> for | ||||
an example.</li> | an example.</li> | ||||
<li>If the task should support character data, write a <code>public void | |||||
<li>If the task should support character data, write a <code>public void | |||||
addText(String)</code> method.</li> | addText(String)</code> method.</li> | ||||
<li>For each nested element, write a <i>create</i> or <i>add</i> method. | <li>For each nested element, write a <i>create</i> or <i>add</i> method. | ||||
A create method | |||||
must be a <code>public</code> method that takes no arguments and returns | |||||
an <code>Object</code> type. The name of the create method must begin with | |||||
<code>create</code>, followed by the element name. An add method must be | |||||
a <code>public void</code> method that takes a single argument of an | |||||
A create method | |||||
must be a <code>public</code> method that takes no arguments and returns | |||||
an <code>Object</code> type. The name of the create method must begin with | |||||
<code>create</code>, followed by the element name. An add method must be | |||||
a <code>public void</code> method that takes a single argument of an | |||||
<code>Object</code> type with a no-argument constructor. | <code>Object</code> type with a no-argument constructor. | ||||
The name of the add method | |||||
The name of the add method | |||||
must begin with <code>add</code>, followed by the element name.</li> | must begin with <code>add</code>, followed by the element name.</li> | ||||
<li>Write a <code>public void execute</code> method, with no arguments, that | <li>Write a <code>public void execute</code> method, with no arguments, that | ||||
throws a <code>BuildException</code>. This method implements the task | throws a <code>BuildException</code>. This method implements the task | ||||
@@ -101,11 +101,11 @@ itself.</li> | |||||
<li>All attributes of all child elements get set via their corresponding | <li>All attributes of all child elements get set via their corresponding | ||||
<code>setXXX</code> methods, at runtime.</li> | <code>setXXX</code> methods, at runtime.</li> | ||||
<li><code>execute()</code> 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, | |||||
<li><code>execute()</code> 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 <code>target1</code> and <code>target2</code> both depend | if <code>target1</code> and <code>target2</code> both depend | ||||
on <code>target3</code>, then running | |||||
on <code>target3</code>, then running | |||||
<code>'ant target1 target2'</code> will run all tasks in | <code>'ant target1 target2'</code> will run all tasks in | ||||
<code>target3</code> twice.</li> | <code>target3</code> twice.</li> | ||||
</ol> | </ol> | ||||
@@ -163,8 +163,8 @@ public class MyVeryOwnTask extends Task { | |||||
</pre> | </pre> | ||||
</blockquote> | </blockquote> | ||||
<h3>Example 2</h3> | <h3>Example 2</h3> | ||||
To use a task directly from the buildfile which created it, place the | |||||
<code><taskdef></code> declaration inside a target | |||||
To use a task directly from the buildfile which created it, place the | |||||
<code><taskdef></code> declaration inside a target | |||||
<i>after the compilation</i>. Use the <code>classpath</code> attribute of | <i>after the compilation</i>. Use the <code>classpath</code> attribute of | ||||
<code><taskdef></code> to point to where the code has just been | <code><taskdef></code> to point to where the code has just been | ||||
compiled. | compiled. | ||||
@@ -178,9 +178,9 @@ compiled. | |||||
<mkdir dir="build"/> | <mkdir dir="build"/> | ||||
<javac srcdir="source" destdir="build"/> | <javac srcdir="source" destdir="build"/> | ||||
</target> | </target> | ||||
<target name="declare" depends="build"> | <target name="declare" depends="build"> | ||||
<taskdef name="mytask" | |||||
<taskdef name="mytask" | |||||
classname="com.mydomain.MyVeryOwnTask" | classname="com.mydomain.MyVeryOwnTask" | ||||
classpath="build"/> | classpath="build"/> | ||||
</target> | </target> | ||||
@@ -200,13 +200,13 @@ package. Then you can use it as if it were a built-in task.</p> | |||||
<hr> | <hr> | ||||
<h2><a name="buildevents">Build Events</a></h2> | <h2><a name="buildevents">Build Events</a></h2> | ||||
<P>Ant is capable of generating build events as it performs the tasks necessary to build a project. | |||||
<P>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, | 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. | |||||
</P> | </P> | ||||
<p>To use build events you need to create an ant <code>Project</code> object. You can then call the | |||||
<p>To use build events you need to create an ant <code>Project</code> object. You can then call the | |||||
<code>addBuildListener</code> method to add your listener to the project. Your listener must implement | <code>addBuildListener</code> method to add your listener to the project. Your listener must implement | ||||
the <code>org.apache.tools.antBuildListener</code> interface. The listener will receive BuildEvents | |||||
the <code>org.apache.tools.antBuildListener</code> interface. The listener will receive BuildEvents | |||||
for the following events</P> | for the following events</P> | ||||
<ul> | <ul> | ||||
<li>Build started</li> | <li>Build started</li> | ||||
@@ -224,30 +224,30 @@ If you wish to attach a listener from the command line you may use the | |||||
<blockquote> | <blockquote> | ||||
<pre>ant -listener org.apache.tools.ant.XmlLogger</pre> | <pre>ant -listener org.apache.tools.ant.XmlLogger</pre> | ||||
</blockquote> | </blockquote> | ||||
<p>will run Ant with a listener that generates an XML representation of the build progress. This | |||||
<p>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.</p> | listener is included with Ant, as is the default listener, which generates the logging to standard output.</p> | ||||
<hr> | <hr> | ||||
<h2><a name="integration">Source code integration</a></h2> | <h2><a name="integration">Source code integration</a></h2> | ||||
The other way to extend Ant through Java is to make changes to existing tasks, which is positively encouraged. | |||||
Both changes to the existing source and new tasks can be incorporated back into the Ant codebase, which | |||||
The other way to extend Ant through Java is to make changes to existing tasks, which is positively encouraged. | |||||
Both changes to the existing source and new tasks can be incorporated back into the Ant codebase, which | |||||
benefits all users and spreads the maintenance load around. | benefits all users and spreads the maintenance load around. | ||||
<p> | <p> | ||||
Please consult the | |||||
Please consult the | |||||
<a href="http://jakarta.apache.org/site/getinvolved.html">Getting Involved</a> pages on the Jakarta web site | <a href="http://jakarta.apache.org/site/getinvolved.html">Getting Involved</a> 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. | |||||
<p> | <p> | ||||
Ant also has some | Ant also has some | ||||
<a href="http://jakarta.apache.org/ant/ant_task_guidelines.html">task guidelines</a> | <a href="http://jakarta.apache.org/ant/ant_task_guidelines.html">task guidelines</a> | ||||
which provides some advice to people developing and testing tasks. Even if you intend to | 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. | |||||
<hr> | <hr> | ||||
<p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Directory-based Tasks</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -2,18 +2,18 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Apache Ant User Manual - Feedback</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
<h1><a name="feedback">Feedback</a></h1> | <h1><a name="feedback">Feedback</a></h1> | ||||
<p>To provide feedback on this software, please subscribe to the | |||||
<p>To provide feedback on this software, please subscribe to the | |||||
<a href="http://jakarta.apache.org/site/mail.html" target="_top">Ant User Mailing List</a> | <a href="http://jakarta.apache.org/site/mail.html" target="_top">Ant User Mailing List</a> | ||||
</p> | </p> | ||||
<p>If you want to contribute to Ant or stay current with the latest | <p>If you want to contribute to Ant or stay current with the latest | ||||
development, join the | |||||
development, join the | |||||
<a href="http://jakarta.apache.org/site/mail.html" target="_top">Ant Development Mailing List</a> | <a href="http://jakarta.apache.org/site/mail.html" target="_top">Ant Development Mailing List</a> | ||||
</p> | </p> | ||||
<p>Archives of both lists can be found at <a | <p>Archives of both lists can be found at <a | ||||
@@ -23,7 +23,7 @@ href="http://marc.theaimsgroup.com" target="_top">http://marc.theaimsgroup.com</ | |||||
you know of any additional archive sites, please report them to the | you know of any additional archive sites, please report them to the | ||||
lists.</p> | lists.</p> | ||||
<hr> | <hr> | ||||
<p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>IDE Integration</title> | |||||
<base target="mainFrame"> | <base target="mainFrame"> | ||||
</head> | </head> | ||||
@@ -26,6 +26,10 @@ selection of targets, execution, hyperlink to compilation errors<br><br> | |||||
<a href="http://ant.netbeans.org/">NetBeans <br>Forte for Java <br>(unbundled)</a><br><br> | <a href="http://ant.netbeans.org/">NetBeans <br>Forte for Java <br>(unbundled)</a><br><br> | ||||
<a href="Integration/VAJAntTool.html">VisualAge for Java</a><br><br> | <a href="Integration/VAJAntTool.html">VisualAge for Java</a><br><br> | ||||
<hr> | |||||
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Apache Ant User Manual - Introduction</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -46,7 +46,7 @@ allows different commands to be executed based on the OS it is executing | |||||
on.</p> | on.</p> | ||||
<hr> | <hr> | ||||
<p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Listeners & Loggers</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Running Apache Ant</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -26,7 +26,7 @@ where <i>file</i> is the name of the buildfile you want to use.</p> | |||||
<p>You can also set <a href="using.html#properties">properties</a> that | <p>You can also set <a href="using.html#properties">properties</a> that | ||||
override properties specified in the | override properties specified in the | ||||
buildfile (see the <a href="CoreTasks/property.html">property</a> task). | |||||
buildfile (see the <a href="CoreTasks/property.html">property</a> task). | |||||
This can be done with | This can be done with | ||||
the <nobr><code>-D<i>property</i>=<i>value</i></code></nobr> option, | the <nobr><code>-D<i>property</i>=<i>value</i></code></nobr> option, | ||||
where <i>property</i> is the name of the property, | where <i>property</i> is the name of the property, | ||||
@@ -42,7 +42,7 @@ property</a> task. | |||||
<p>Options that affect the amount of logging output by Ant are: <nobr><code>-quiet</code></nobr>, | <p>Options that affect the amount of logging output by Ant are: <nobr><code>-quiet</code></nobr>, | ||||
which instructs Ant to print less | which instructs Ant to print less | ||||
information on the console when running; | |||||
information on the console when running; | |||||
<nobr><code>-verbose</code></nobr>, which causes Ant to print | <nobr><code>-verbose</code></nobr>, which causes Ant to print | ||||
additional information to the console; and <nobr><code>-debug</code></nobr>, | additional information to the console; and <nobr><code>-debug</code></nobr>, | ||||
which causes Ant to print considerably more additional information. | which causes Ant to print considerably more additional information. | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>build.sysclasspath</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -10,7 +10,7 @@ | |||||
<h2><a name="sysclasspath">build.sysclasspath</a></h2> | <h2><a name="sysclasspath">build.sysclasspath</a></h2> | ||||
<p>The value of the build.sysclasspath property | <p>The value of the build.sysclasspath property | ||||
control how the system classpath, ie. the classpath in effect when | 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.</p> | The default behavior varies from Ant to Ant task.</p> | ||||
The values and their meanings are: | The values and their meanings are: | ||||
@@ -52,7 +52,7 @@ the other form of compromise where the build runner has priority. | |||||
</table> | </table> | ||||
<hr> | <hr> | ||||
<p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
</html> | </html> | ||||
@@ -2,7 +2,7 @@ | |||||
<head> | <head> | ||||
<meta http-equiv="Content-Language" content="en-us"> | <meta http-equiv="Content-Language" content="en-us"> | ||||
<title>Apache Ant User Manual</title> | |||||
<title>Writing a Simple Buildfile</title> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -126,7 +126,7 @@ have the name "init".</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">unless</td> | <td valign="top">unless</td> | ||||
<td valign="top">the name of the property that must not be set in order | |||||
<td valign="top">the name of the property that must not be set in order | |||||
for this target to execute.</td> | for this target to execute.</td> | ||||
<td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
@@ -150,7 +150,7 @@ resolved before the task is executed.</p> | |||||
<p>where <i>name</i> is the name of the task, | <p>where <i>name</i> is the name of the task, | ||||
<i>attributeN</i> is the attribute name, and | <i>attributeN</i> is the attribute name, and | ||||
<i>valueN</i> is the value for this attribute.</p> | <i>valueN</i> is the value for this attribute.</p> | ||||
<p>There is a set of <a href="coretasklist.html" target="navFrame">built-in tasks</a>, along with a | |||||
<p>There is a set of <a href="coretasklist.html" target="navFrame">built-in tasks</a>, along with a | |||||
number of | number of | ||||
<a href="optionaltasklist.html" target="navFrame"> optional tasks</a>, but it is also very | <a href="optionaltasklist.html" target="navFrame"> optional tasks</a>, but it is also very | ||||
easy to <a href="develop.html#writingowntask">write your own</a>.</p> | easy to <a href="develop.html#writingowntask">write your own</a>.</p> | ||||
@@ -205,7 +205,7 @@ This is resolved at run-time as <code>build/classes</code>.</p> | |||||
defined using a <code><property></code> task. | defined using a <code><property></code> task. | ||||
For example, <code>${os.name}</code> expands to the | For example, <code>${os.name}</code> expands to the | ||||
name of the operating system.</p> | name of the operating system.</p> | ||||
<p>For a list of system properties see | |||||
<p>For a list of system properties see | |||||
<a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#getProperties()">the Javadoc of System.getProperties</a>. | <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#getProperties()">the Javadoc of System.getProperties</a>. | ||||
</p> | </p> | ||||
<p>In addition, Ant has some built-in properties:</p> | <p>In addition, Ant has some built-in properties:</p> | ||||
@@ -371,22 +371,22 @@ that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
<td width="10%" valign="top"><b>Required</b></td> | <td width="10%" valign="top"><b>Required</b></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">value</td> | |||||
<td valign="top">value</td> | |||||
<td valign="top">a single command-line argument; can contain space | <td valign="top">a single command-line argument; can contain space | ||||
characters.</td> | characters.</td> | ||||
<td align="center" rowspan="4">Exactly one of these.</td> | <td align="center" rowspan="4">Exactly one of these.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">line</td> | |||||
<td valign="top">line</td> | |||||
<td valign="top">a space-delimited list of command-line arguments.</td> | <td valign="top">a space-delimited list of command-line arguments.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">file</td> | |||||
<td valign="top">file</td> | |||||
<td valign="top">The name of a file as a single command-line | <td valign="top">The name of a file as a single command-line | ||||
argument; will be replaced with the absolute filename of the file.</td> | argument; will be replaced with the absolute filename of the file.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">path</td> | |||||
<td valign="top">path</td> | |||||
<td valign="top">A string that will be treated as a path-like | <td valign="top">A string that will be treated as a path-like | ||||
string as a single command-line argument; you can use <code>;</code> | string as a single command-line argument; you can use <code>;</code> | ||||
or <code>:</code> as | or <code>:</code> as | ||||
@@ -468,7 +468,7 @@ href="CoreTypes/patternset.html">PatternSet</a>s, <a href="CoreTypes/fileset.htm | |||||
structures as well.</p> | structures as well.</p> | ||||
<hr> | <hr> | ||||
<p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||