(the web is no longer frame-friendly…)master
@@ -30,25 +30,24 @@ by | |||||
<hr/> | <hr/> | ||||
<p>You can download the plugin | <p>You can download the plugin | ||||
at: <a href="http://sourceforge.net/projects/jext/files/OldFiles/antwork_plugin.zip/download">http://sourceforge.net/projects/jext/files/OldFiles/antwork_plugin.zip/download</a></p> | |||||
at: <a href="http://sourceforge.net/projects/jext/files/OldFiles/antwork_plugin.zip/download" | |||||
target="_top">http://sourceforge.net/projects/jext/files/OldFiles/antwork_plugin.zip/download</a></p> | |||||
<h2>Installation instructions from the Readme.txt</h2> | <h2>Installation instructions from the Readme.txt</h2> | ||||
<p>You have to enable the Jext Console to see the Apache Ant output (menu: | <p>You have to enable the Jext Console to see the Apache Ant output (menu: | ||||
Edit→Options…–General Panel), because Ant messages are | |||||
redirected to the Jext console.</p> | |||||
Edit→Options…–General Panel), because Ant messages are redirected to the Jext | |||||
console.</p> | |||||
<p>You can configure the Ant call in the Jext menu: Edit→Options…– | |||||
Plugin Options–Antwork Plugin Panel; here you can set Ant home | |||||
directory and the path to your build file.</p> | |||||
<p>You can configure the Ant call in the Jext menu: Edit→Options…– Plugin | |||||
Options–Antwork Plugin Panel; here you can set Ant home directory and the path to your build | |||||
file.</p> | |||||
<p>You can start AntWork in the menu: Plugins→Ant→Work Now! In the | |||||
appearing dialog box you can enter the target which you want to | |||||
compile.</p> | |||||
<p>You can start AntWork in the menu: Plugins→Ant→Work Now! In the appearing dialog box | |||||
you can enter the target which you want to compile.</p> | |||||
<p>If a <code>javac</code> error occurs in the Ant run, an error list opens within | |||||
Jext. With a double click on the error message you jump to the error | |||||
in the specified Java source file.</p> | |||||
<p>If a <code>javac</code> error occurs in the Ant run, an error list opens within Jext. With a | |||||
double click on the error message you jump to the error in the specified Java source file.</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -36,8 +36,8 @@ Deployment Descriptor, builds the jar file including the support files and verif | |||||
produced jar is valid or not.</p> | produced jar is valid or not.</p> | ||||
<p>Benoit Moussaud maintains a | <p>Benoit Moussaud maintains a | ||||
separate <a href="https://web.archive.org/web/20141122083215/http://www.moussaud.org/ejbjar.html">FAQ</a> | |||||
for this task at his homepage.</p> | |||||
separate <a href="https://web.archive.org/web/20141122083215/http://www.moussaud.org/ejbjar.html" | |||||
target="_top">FAQ</a> for this task at his homepage.</p> | |||||
<h3>Borland element</h3> | <h3>Borland element</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -31,7 +31,8 @@ the <a href="../Tasks/jar.html">jar</a> or <a href="../Tasks/zip.html">zip</a> t | |||||
will work on Windows using the external <code>cabarc</code> tool (provided by Microsoft) which must | will work on Windows using the external <code>cabarc</code> tool (provided by Microsoft) which must | ||||
be located in your executable path.</p> | be located in your executable path.</p> | ||||
<p>To use this task on other platforms you need to download and compile <code>libcabinet</code> | <p>To use this task on other platforms you need to download and compile <code>libcabinet</code> | ||||
from <a href="https://www.freshports.org/archivers/libcabinet/">https://www.freshports.org/archivers/libcabinet/</a>.</p> | |||||
from <a href="https://www.freshports.org/archivers/libcabinet/" | |||||
target="_top">https://www.freshports.org/archivers/libcabinet/</a>.</p> | |||||
<p>See the section on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on | <p>See the section on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on | ||||
how the inclusion/exclusion of files works, and how to write patterns.</p> | how the inclusion/exclusion of files works, and how to write patterns.</p> | ||||
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most | <p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most | ||||
@@ -28,12 +28,12 @@ | |||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Generates an XML-formatted report file of the change logs recorded in | <p>Generates an XML-formatted report file of the change logs recorded in | ||||
a <a href="https://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p> | a <a href="https://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p> | ||||
<p><strong>Important</strong>: This task needs <code>cvs</code> on the path. If it isn't, you will get | |||||
an error (such as error <code>2</code> on Windows). If <code><cvs></code> doesn't work, try to | |||||
execute <code>cvs.exe</code> from the command line in the target directory in which you are working. | |||||
Also note that this task assumes that the cvs executable is compatible with the Unix version, this | |||||
is not completely true for certain other CVS clients—like CVSNT for example—and some | |||||
operation may fail when using such an incompatible client.</p> | |||||
<p><strong>Important</strong>: This task needs <code>cvs</code> on the path. If it isn't, you will | |||||
get an error (such as <code>error=2</code> on Windows). If <code><cvs></code> doesn't work, | |||||
try to execute <code>cvs.exe</code> from the command line in the target directory in which you are | |||||
working. Also note that this task assumes that the cvs executable is compatible with the Unix | |||||
version, this is not completely true for certain other CVS clients—like CVSNT for | |||||
example—and some operation may fail when using such an incompatible client.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -31,19 +31,19 @@ | |||||
<p>Note that many popular message digest functions—including MD5 and SHA-1—have been | <p>Note that many popular message digest functions—including MD5 and SHA-1—have been | ||||
broken recently. If you are going to use the task to create checksums used in an environment where | broken recently. If you are going to use the task to create checksums used in an environment where | ||||
security is important, please take some time to investigate the algorithms offered by your JCE | security is important, please take some time to investigate the algorithms offered by your JCE | ||||
provider. Note also that some JCE providers like the one | |||||
by <a href="https://www.bouncycastle.org/">The Legion of the Bouncy Castle</a>, | |||||
the <a href="https://www.gnu.org/software/gnu-crypto/">GNU project</a> | |||||
or <a href="https://jce.iaik.tugraz.at/sic/Products">the Technical University Graz</a> offer more | |||||
digest algorithms than those built-in into your JDK.</p> | |||||
provider. Note also that some JCE providers like the one by <a href="https://www.bouncycastle.org/" | |||||
target="_top">The Legion of the Bouncy Castle</a>, | |||||
the <a href="https://www.gnu.org/software/gnu-crypto/" target="_top">GNU project</a> | |||||
or <a href="https://jce.iaik.tugraz.at/sic/Products" target="_top">the Technical University Graz</a> | |||||
offer more digest algorithms than those built-in into your JDK.</p> | |||||
<p>Warning: the case of the extension is that of the algorithm used. If you ask | <p>Warning: the case of the extension is that of the algorithm used. If you ask | ||||
for <samp>SHA1</samp>, you get a <samp>.SHA1</samp> extension; if you ask for <samp>sha1</samp>, you | for <samp>SHA1</samp>, you get a <samp>.SHA1</samp> extension; if you ask for <samp>sha1</samp>, you | ||||
get a file ending in <samp>.sha1</samp>. The Java Crypto Engines are case-insensitive in matching | get a file ending in <samp>.sha1</samp>. The Java Crypto Engines are case-insensitive in matching | ||||
algorithms, so choose a name to match your desired output extension, or set the <var>fileext</var> | algorithms, so choose a name to match your desired output extension, or set the <var>fileext</var> | ||||
attribute. The names of common hashing algorithms can be located on the <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest">Cryptography | |||||
Architecture Standard Algorithm Name Documentation</a></p> | |||||
attribute. The names of common hashing algorithms can be located on | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest" | |||||
target="_top">Cryptography Architecture Standard Algorithm Name Documentation</a></p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -66,10 +66,10 @@ Architecture Standard Algorithm Name Documentation</a></p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>algorithm</td> | <td>algorithm</td> | ||||
<td>Specifies the algorithm to be used to compute the checksum. Please check the | |||||
<a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest">documentation</a> | |||||
for available algorithm names, like <q>SHA-1</q> or <q>SHA-512</q>. | |||||
<td>Specifies the algorithm to be used to compute the checksum. Please check | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest" | |||||
target="_top">documentation</a> for available algorithm names, like <q>SHA-1</q> | |||||
or <q>SHA-512</q>. | |||||
</td> | </td> | ||||
<td>No; defaults to <q>MD5</q></td> | <td>No; defaults to <q>MD5</q></td> | ||||
</tr> | </tr> | ||||
@@ -101,12 +101,12 @@ Architecture Standard Algorithm Name Documentation</a></p> | |||||
<tr> | <tr> | ||||
<td>pattern</td> | <td>pattern</td> | ||||
<td>Specifies the pattern to use as a pattern suitable | <td>Specifies the pattern to use as a pattern suitable | ||||
for <a href="https://docs.oracle.com/javase/8/docs/api/java/text/MessageFormat.html">MessageFormat</a> | |||||
where <code>{0}</code> is replaced with the checksum and <code>{1}</code> with the file | |||||
name. <em>Since Ant 1.7.0</em><br/><em>Since Ant 1.8.2</em> <code>{2}</code> is replaced by the | |||||
path of the file relative to the checksum file being written, <code>{3}</code> with tha path of | |||||
the file relative to the project's <var>basedir</var> and <code>{4}</code> with the absolute | |||||
path of the file.</td> | |||||
for <a href="https://docs.oracle.com/javase/8/docs/api/java/text/MessageFormat.html" | |||||
target="_top">MessageFormat</a> where <code>{0}</code> is replaced with the checksum | |||||
and <code>{1}</code> with the file name. <em>Since Ant 1.7.0</em><br/><em>Since Ant | |||||
1.8.2</em> <code>{2}</code> is replaced by the path of the file relative to the checksum file | |||||
being written, <code>{3}</code> with the path of the file relative to the | |||||
project's <var>basedir</var> and <code>{4}</code> with the absolute path of the file.</td> | |||||
<td>No; default is <q>{0}</q></td> | <td>No; default is <q>{0}</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -81,8 +81,8 @@ | |||||
<tr> | <tr> | ||||
<td>encoding</td> | <td>encoding</td> | ||||
<td>Specifies the encoding for the input files. Please | <td>Specifies the encoding for the input files. Please | ||||
see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a> for a list of possible values.</td> | |||||
see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a> for a list of possible values.</td> | |||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -28,7 +28,7 @@ | |||||
<p>Conditions are nested elements of the <a href="condition.html"><code><condition></code></a> | <p>Conditions are nested elements of the <a href="condition.html"><code><condition></code></a> | ||||
and <a href="waitfor.html"><code><waitfor></code></a> tasks. There are core conditions and | and <a href="waitfor.html"><code><waitfor></code></a> tasks. There are core conditions and | ||||
custom conditions. Custom conditions are described | custom conditions. Custom conditions are described | ||||
in <a href="../Types/custom-programming.html#customconditions"> Custom Conditions</a>. Core | |||||
in <a href="../Types/custom-programming.html#customconditions">Custom Conditions</a>. Core | |||||
Conditions are described below.</p> | Conditions are described below.</p> | ||||
<h3 id="coreconditions">Core Conditions</h3> | <h3 id="coreconditions">Core Conditions</h3> | ||||
@@ -440,8 +440,8 @@ include tasks, datatypes, scriptdefs, macrodefs and presetdefs.</p> | |||||
<p>Evaluate a condition based on a script in any <a href="https://jakarta.apache.org/bsf" | <p>Evaluate a condition based on a script in any <a href="https://jakarta.apache.org/bsf" | ||||
target="_top">Apache BSF</a> | target="_top">Apache BSF</a> | ||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html">JSR | |||||
223</a> supported language.</p> | |||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html" | |||||
target="_top">JSR 223</a> supported language.</p> | |||||
<p>See the <a href="../Tasks/script.html">Script</a> task for an explanation of scripts and | <p>See the <a href="../Tasks/script.html">Script</a> task for an explanation of scripts and | ||||
dependencies.</p> | dependencies.</p> | ||||
@@ -29,7 +29,7 @@ | |||||
<p>Handles packages/modules retrieved from a <a href="https://www.nongnu.org/cvs/" | <p>Handles packages/modules retrieved from a <a href="https://www.nongnu.org/cvs/" | ||||
target="_top">CVS</a> repository.</p> | target="_top">CVS</a> repository.</p> | ||||
<p><strong>Important:</strong> This task needs <code>cvs</code> binary on the path. If it isn't, you | <p><strong>Important:</strong> This task needs <code>cvs</code> binary on the path. If it isn't, you | ||||
will get an error (such as error <code>2</code> on Windows). If <code><cvs></code> doesn't | |||||
will get an error (such as <code>error=2</code> on Windows). If <code><cvs></code> doesn't | |||||
work, try to execute <code>cvs.exe</code> from the command line in the target directory in which you | work, try to execute <code>cvs.exe</code> from the command line in the target directory in which you | ||||
are working. Also note that this task assumes that the cvs executable is compatible with the Unix | are working. Also note that this task assumes that the cvs executable is compatible with the Unix | ||||
version, this is not completely true for certain other CVS clients—like CVSNT for | version, this is not completely true for certain other CVS clients—like CVSNT for | ||||
@@ -38,8 +38,8 @@ example—and some operation may fail when using such an incompatible client | |||||
<p><strong>CVSNT Note</strong>: CVSNT prefers users to store the passwords inside the registry. If | <p><strong>CVSNT Note</strong>: CVSNT prefers users to store the passwords inside the registry. If | ||||
the <a href="cvspass.html">cvspass task</a> and the <var>passfile</var> attribute don't seem to work | the <a href="cvspass.html">cvspass task</a> and the <var>passfile</var> attribute don't seem to work | ||||
for you, the most likely reason is that CVSNT ignores your <samp>.cvspass</samp> file completely. | for you, the most likely reason is that CVSNT ignores your <samp>.cvspass</samp> file completely. | ||||
See <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5">bugzilla report 21657</a> | |||||
for recommended workarounds.</p> | |||||
See <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5" target="_top">bugzilla | |||||
report 21657</a> for recommended workarounds.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -32,8 +32,8 @@ a <code>cvs login</code> command.</p> | |||||
<p><strong>CVSNT Note</strong>: CVSNT prefers users to store the passwords inside the registry. If | <p><strong>CVSNT Note</strong>: CVSNT prefers users to store the passwords inside the registry. If | ||||
the task doesn't seem to work for you, the most likely reason is that CVSNT ignores | the task doesn't seem to work for you, the most likely reason is that CVSNT ignores | ||||
your <samp>.cvspass</samp> file | your <samp>.cvspass</samp> file | ||||
completely. See <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5">bugzilla | |||||
report 21657</a> for recommended workarounds.</p> | |||||
completely. See <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5" | |||||
target="_top">bugzilla report 21657</a> for recommended workarounds.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -26,7 +26,7 @@ | |||||
<p>Generates an XML-formatted report file of the changes between two tags or dates recorded in | <p>Generates an XML-formatted report file of the changes between two tags or dates recorded in | ||||
a <a href="https://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p> | a <a href="https://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p> | ||||
<p><strong>Important</strong>: This task needs <code>cvs</code> on the path. If it isn't, you will | <p><strong>Important</strong>: This task needs <code>cvs</code> on the path. If it isn't, you will | ||||
get an error (such as error <code>2</code> on Windows). If <code><cvs></code> doesn't work, | |||||
get an error (such as <code>error=2</code> on Windows). If <code><cvs></code> doesn't work, | |||||
try to execute <code>cvs.exe</code> from the command line in the target directory in which you are | try to execute <code>cvs.exe</code> from the command line in the target directory in which you are | ||||
working. Also note that this task assumes that the cvs executable is compatible with the Unix | working. Also note that this task assumes that the cvs executable is compatible with the Unix | ||||
version, this is not completely true for certain other CVS clients—like CVSNT for | version, this is not completely true for certain other CVS clients—like CVSNT for | ||||
@@ -84,12 +84,12 @@ normal behavior</p> | |||||
<h3>Notes</h3> | <h3>Notes</h3> | ||||
<p>By default the pattern <samp>**/.svn</samp> and <samp>**/.svn/**</samp> are set as default | <p>By default the pattern <samp>**/.svn</samp> and <samp>**/.svn/**</samp> are set as default | ||||
excludes. Since version 1.3, Subversion supports the <a target="_blank" | |||||
href="https://subversion.apache.org/docs/release-notes/1.3.html#_svn-hack">"_svn | |||||
hack"</a>. That means, that the svn-libraries evaluate environment variables and | |||||
use <samp>.svn</samp> or <samp>_svn</samp> directory regarding to that value. We had chosen not to | |||||
evaluate environment variables to get a more reliable build. Instead you have to change the settings | |||||
by yourself by changing the exclude patterns:</p> | |||||
excludes. Since version 1.3, Subversion supports | |||||
the <a href="https://subversion.apache.org/docs/release-notes/1.3.html#_svn-hack" | |||||
target="_top">"_svn hack"</a>. That means, that the svn-libraries evaluate environment | |||||
variables and use <samp>.svn</samp> or <samp>_svn</samp> directory regarding to that value. We had | |||||
chosen not to evaluate environment variables to get a more reliable build. Instead you have to | |||||
change the settings by yourself by changing the exclude patterns:</p> | |||||
<pre> | <pre> | ||||
<defaultexcludes remove="**/.svn"/> | <defaultexcludes remove="**/.svn"/> | ||||
<defaultexcludes remove="**/.svn/**"/> | <defaultexcludes remove="**/.svn/**"/> | ||||
@@ -124,7 +124,7 @@ nested <code><fileset></code>.</p> | |||||
<tr> | <tr> | ||||
<td>defaultexcludes</td> | <td>defaultexcludes</td> | ||||
<td><em><u>Deprecated</u></em>. Use resource collections. Whether to | <td><em><u>Deprecated</u></em>. Use resource collections. Whether to | ||||
use <a href="../dirtasks.html#defaultexcludes"> default excludes.</a></td> | |||||
use <a href="../dirtasks.html#defaultexcludes">default excludes.</a></td> | |||||
<td>No; default <q>true</q></td> | <td>No; default <q>true</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -40,7 +40,8 @@ class references encoded into the class files by the compiler. This is generally | |||||
the Java source files.</p> | the Java source files.</p> | ||||
<p>To learn more about how this information is obtained from the class files, please refer | <p>To learn more about how this information is obtained from the class files, please refer | ||||
to <a href="https://docs.oracle.com/javase/specs/">the Java Virtual Machine Specification</a></p> | |||||
to <a href="https://docs.oracle.com/javase/specs/" target="_top">the Java Virtual Machine | |||||
Specification</a></p> | |||||
<p>Since a class' dependencies only change when the class itself changes, the | <p>Since a class' dependencies only change when the class itself changes, the | ||||
<code>depend</code> task is able to cache dependency information. Only those class files which have | <code>depend</code> task is able to cache dependency information. Only those class files which have | ||||
@@ -122,10 +122,10 @@ attribute to a value other than its default, <q>add</q>.</strong></p> | |||||
<tr> | <tr> | ||||
<td>filesetmanifest</td> | <td>filesetmanifest</td> | ||||
<td>behavior when a manifest file is found in a <code>zipfileset</code> | <td>behavior when a manifest file is found in a <code>zipfileset</code> | ||||
or <code>zipgroupfileset</code> file. Valid values are <q>skip</q>, <q>merge</q>, | |||||
and <q>mergewithoutmain</q>. <q>merge</q> will merge all of the manifests together, and merge | |||||
this into any other specified manifests. <q>mergewithoutmain</q> merges everything but the Main | |||||
section of the manifests.</td> | |||||
or <code>zipgroupfileset</code> file. Valid values are <q>skip</q>, <q>merge</q>, | |||||
and <q>mergewithoutmain</q>. <q>merge</q> will merge all of the manifests together, and merge | |||||
this into any other specified manifests. <q>mergewithoutmain</q> merges everything but the | |||||
Main section of the manifests.</td> | |||||
<td>No; defaults to <q>skip</q></td> | <td>No; defaults to <q>skip</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -142,10 +142,11 @@ attribute to a value other than its default, <q>add</q>.</strong></p> | |||||
<tr> | <tr> | ||||
<td>index</td> | <td>index</td> | ||||
<td>whether to create | <td>whether to create | ||||
an <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#JAR_Index">index | |||||
list</a> to speed up classloading. This is a JDK 1.3+ specific feature. Unless you specify | |||||
additional jars with nested <a href="jar.html#indexjars"><code>indexjars</code></a> elements, | |||||
only the contents of this jar will be included in the index.</td> | |||||
an <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#JAR_Index" | |||||
target="_top">index list</a> to speed up classloading. This is a JDK 1.3+ specific feature. | |||||
Unless you specify additional jars with | |||||
nested <a href="jar.html#indexjars"><code>indexjars</code></a> elements, only the contents of | |||||
this jar will be included in the index.</td> | |||||
<td>No; defaults to <q>false</q></td> | <td>No; defaults to <q>false</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -153,9 +154,10 @@ attribute to a value other than its default, <q>add</q>.</strong></p> | |||||
<td>whether to include <samp>META-INF</samp> and its children in the index. Doesn't have any | <td>whether to include <samp>META-INF</samp> and its children in the index. Doesn't have any | ||||
effect if <var>index</var> is false.<br/>Oracle's jar implementation used to skip | effect if <var>index</var> is false.<br/>Oracle's jar implementation used to skip | ||||
the <samp>META-INF</samp> directory and Ant followed that example. The behavior has been | the <samp>META-INF</samp> directory and Ant followed that example. The behavior has been | ||||
changed with <a href="https://bugs.openjdk.java.net/browse/JDK-4408526">Java 5</a>. In order | |||||
to avoid problems with Ant generated jars on Java 1.4 or earlier, Ant will not | |||||
include <samp>META-INF</samp> unless explicitly asked to.<br/><em>Since Ant 1.8.0</em>.</td> | |||||
changed with <a href="https://bugs.openjdk.java.net/browse/JDK-4408526" target="_top">Java | |||||
5</a>. In order to avoid problems with Ant generated jars on Java 1.4 or earlier, Ant will | |||||
not include <samp>META-INF</samp> unless explicitly asked to.<br/><em>Since Ant | |||||
1.8.0</em>.</td> | |||||
<td>No; defaults to <q>false</q></td> | <td>No; defaults to <q>false</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -59,7 +59,7 @@ file is available, and the <var>level</var> option is ignored</p> | |||||
<td>append</td> | <td>append</td> | ||||
<td>Append to an existing file | <td>Append to an existing file | ||||
(or <a href="https://docs.oracle.com/javase/8/docs/api//java/io/FileWriter.html#FileWriter-java.lang.String-boolean-" | (or <a href="https://docs.oracle.com/javase/8/docs/api//java/io/FileWriter.html#FileWriter-java.lang.String-boolean-" | ||||
target="_blank"> open a new file / overwrite an existing file</a>)? | |||||
target="_top"> open a new file / overwrite an existing file</a>)? | |||||
</td> | </td> | ||||
<td>No; ignored unless <var>output</var> indicates a filesystem destination, default | <td>No; ignored unless <var>output</var> indicates a filesystem destination, default | ||||
is <q>false</q></td> | is <q>false</q></td> | ||||
@@ -96,8 +96,8 @@ three lines; the first line is a blank | |||||
</echo></pre> | </echo></pre> | ||||
<p>The newline immediately following the <code><echo></code> tag will be part of the | <p>The newline immediately following the <code><echo></code> tag will be part of the | ||||
output. Newlines in character data within the content of an element are not discarded by XML | output. Newlines in character data within the content of an element are not discarded by XML | ||||
parsers.<br/>See <a href="https://www.w3.org/TR/xml/#sec-line-ends">W3C Recommendation 26 November | |||||
2008 / End of Line handling</a> for more details.</p> | |||||
parsers.<br/>See <a href="https://www.w3.org/TR/xml/#sec-line-ends" target="_top">W3C Recommendation | |||||
26 November 2008 / End of Line handling</a> for more details.</p> | |||||
<pre><echo message="Deleting drive C:" level="debug"/></pre> | <pre><echo message="Deleting drive C:" level="debug"/></pre> | ||||
<p>A message which only appears in <code>-debug</code> mode.</p> | <p>A message which only appears in <code>-debug</code> mode.</p> | ||||
@@ -56,13 +56,15 @@ Server.</p> | |||||
<p>The tasks support:</p> | <p>The tasks support:</p> | ||||
<ul> | <ul> | ||||
<li><a href="http://www.borland.com">Borland</a>Application Server 4.5</li> | |||||
<li><a href="https://web.archive.org/web/20020202082841/http://www.iplanet.com:80/products/iplanet_application/home_ias.html">iPlanet</a>Application Server 6.0</li> | |||||
<li><a href="http://www.borland.com" target="_top">Borland</a>Application Server 4.5</li> | |||||
<li><a href="https://web.archive.org/web/20020202082841/http://www.iplanet.com:80/products/iplanet_application/home_ias.html" | |||||
target="_top">iPlanet</a> Application Server 6.0</li> | |||||
<li><a href="https://www.jboss.org/" target="_top">JBoss 2.1</a> and above EJB servers</li> | <li><a href="https://www.jboss.org/" target="_top">JBoss 2.1</a> and above EJB servers</li> | ||||
<li><a href="https://web.archive.org/web/20080516210506/http://www.ironflare.com/">Orion Application Server</a> 2.0 (<em>since Ant 1.10.2</em>)</li> | |||||
<li><a href="https://web.archive.org/web/20080516210506/http://www.ironflare.com/" | |||||
target="_top">Orion Application Server</a> 2.0 (<em>since Ant 1.10.2</em>)</li> | |||||
<li><a href="http://www.bea.com" target="_top">WebLogic</a> 4.5.1 through to 7.0 EJB servers</li> | <li><a href="http://www.bea.com" target="_top">WebLogic</a> 4.5.1 through to 7.0 EJB servers</li> | ||||
<li><a href="https://jonas.ow2.org/" target="_top">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li> | <li><a href="https://jonas.ow2.org/" target="_top">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li> | ||||
<li><a href="https://www.ibm.com/websphere">IBM WebSphere</a> 4.0</li> | |||||
<li><a href="https://www.ibm.com/websphere" target="_top">IBM WebSphere</a> 4.0</li> | |||||
</ul> | </ul> | ||||
<p>Vendors such as BEA and IBM now provide custom Ant tasks to work with their particular | <p>Vendors such as BEA and IBM now provide custom Ant tasks to work with their particular | ||||
products. More importantly, EJB 3.0 renders this whole process obsolete. Accordingly, development | products. More importantly, EJB 3.0 renders this whole process obsolete. Accordingly, development | ||||
@@ -74,16 +76,20 @@ applications and definitely not new EJB 2.x servers.</p> | |||||
<h2 id="ejbtasks">EJB Tasks</h2> | <h2 id="ejbtasks">EJB Tasks</h2> | ||||
<table> | <table> | ||||
<tr><th>Task</th><th colspan="2">Application Servers</th></tr> | <tr><th>Task</th><th colspan="2">Application Servers</th></tr> | ||||
<tr><td><a href="BorlandGenerateClient.html">blgenclient</a></td><td colspan="2">Borland Application Server 4.5 and 5.x</td></tr> | |||||
<tr><td><a href="#iplanet-ejbc">iplanet-ejbc</a></td><td colspan="2">iPlanet Application Server 6.0</td></tr> | |||||
<tr><td><a href="BorlandGenerateClient.html">blgenclient</a></td><td colspan="2">Borland | |||||
Application Server 4.5 and 5.x</td></tr> | |||||
<tr><td><a href="#iplanet-ejbc">iplanet-ejbc</a></td><td colspan="2">iPlanet Application Server | |||||
6.0</td></tr> | |||||
<tr><td rowspan="8"><a href="#ejbjar">ejbjar</a></td><th colspan="2">Nested Elements</th></tr> | <tr><td rowspan="8"><a href="#ejbjar">ejbjar</a></td><th colspan="2">Nested Elements</th></tr> | ||||
<tr><td><a href="BorlandEJBTasks.html">borland</a></td><td>Borland Application Server 4.5 and 5.x</td></tr> | |||||
<tr><td><a href="BorlandEJBTasks.html">borland</a></td><td>Borland Application Server 4.5 and | |||||
5.x</td></tr> | |||||
<tr><td><a href="#ejbjar_iplanet">iPlanet</a></td><td>iPlanet Application Server 6.0</td></tr> | <tr><td><a href="#ejbjar_iplanet">iPlanet</a></td><td>iPlanet Application Server 6.0</td></tr> | ||||
<tr><td><a href="#ejbjar_jboss">jboss</a></td><td>JBoss</td></tr> | <tr><td><a href="#ejbjar_jboss">jboss</a></td><td>JBoss</td></tr> | ||||
<tr><td><a href="#ejbjar_jonas">jonas</a></td><td>JOnAS 2.4.x and 2.5</td></tr> | <tr><td><a href="#ejbjar_jonas">jonas</a></td><td>JOnAS 2.4.x and 2.5</td></tr> | ||||
<tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>WebLogic 5.1 to 7.0</td></tr> | <tr><td><a href="#ejbjar_weblogic">weblogic</a></td><td>WebLogic 5.1 to 7.0</td></tr> | ||||
<tr><td><a href="#ejbjar_websphere">websphere</a></td><td>IBM WebSphere 4.0</td></tr> | <tr><td><a href="#ejbjar_websphere">websphere</a></td><td>IBM WebSphere 4.0</td></tr> | ||||
<tr><td><a href="#ejbjar_orion">orion</a></td><td>IronFlare (Oracle) Orion Application Server 2.0.6</td></tr> | |||||
<tr><td><a href="#ejbjar_orion">orion</a></td><td>IronFlare (Oracle) Orion Application Server | |||||
2.0.6</td></tr> | |||||
</table> | </table> | ||||
<hr/> | <hr/> | ||||
@@ -504,7 +510,8 @@ specific deployment tools. These currently include:</p> | |||||
<li>WebLogic 5.1/6.0 session/entity beans using the <code>weblogic.ejbc</code> tool</li> | <li>WebLogic 5.1/6.0 session/entity beans using the <code>weblogic.ejbc</code> tool</li> | ||||
<li>IBM WebSphere 4.0</li> | <li>IBM WebSphere 4.0</li> | ||||
<li>TOPLink for WebLogic 2.5.1-enabled entity beans</li> | <li>TOPLink for WebLogic 2.5.1-enabled entity beans</li> | ||||
<li><a href="https://jonas.ow2.org/">JOnAS</a> 2.4.x and 2.5 Open Source EJB server</li> | |||||
<li><a href="https://jonas.ow2.org/" target="_top">JOnAS</a> 2.4.x and 2.5 Open Source EJB | |||||
server</li> | |||||
<li>IronFlare Orion Application Server 2.0</li> | <li>IronFlare Orion Application Server 2.0</li> | ||||
</ul> | </ul> | ||||
@@ -528,11 +535,10 @@ its target jar file and determine if it is out of date with respect to the class | |||||
deployment descriptors that make up the bean. If any of these files are newer than the jar file the | deployment descriptors that make up the bean. If any of these files are newer than the jar file the | ||||
jar will be rebuilt otherwise a message is logged that the jar file is up to date.</p> | jar will be rebuilt otherwise a message is logged that the jar file is up to date.</p> | ||||
<p>The task uses | |||||
the <a href="https://commons.apache.org/bcel/">BCEL</a> <a href="../install.html#librarydependencies">library</a> | |||||
to extract all dependent classes. This means that, in addition to the classes that are mentioned in | |||||
the deployment descriptor, any classes that these depend on are also automatically included in the | |||||
jar file.</p> | |||||
<p>The task uses the <a href="https://commons.apache.org/bcel/" | |||||
target="_top">BCEL</a> <a href="../install.html#librarydependencies">library</a> to extract all | |||||
dependent classes. This means that, in addition to the classes that are mentioned in the deployment | |||||
descriptor, any classes that these depend on are also automatically included in the jar file.</p> | |||||
<h3 id="naming">Naming convention</h3> | <h3 id="naming">Naming convention</h3> | ||||
@@ -596,10 +602,10 @@ classes or as parameters to the bean's methods.</p> | |||||
super classes and super interfaces of the bean classes. For this technique to work the bean classes | super classes and super interfaces of the bean classes. For this technique to work the bean classes | ||||
had to be loaded into Ant's JVM. This was not always possible due to class dependencies.</p> | had to be loaded into Ant's JVM. This was not always possible due to class dependencies.</p> | ||||
<p><em>Since Ant 1.5</em> the task uses the <a href="https://commons.apache.org/bcel/">BCEL</a> | |||||
library to analyze the bean's class files directly, rather than loading them into the JVM. This also | |||||
allows <code>ejbjar</code> to add all of the required support classes for a bean and not just super | |||||
classes.</p> | |||||
<p><em>Since Ant 1.5</em> the task uses the <a href="https://commons.apache.org/bcel/" | |||||
target="_top">BCEL</a> library to analyze the bean's class files directly, rather than loading them | |||||
into the JVM. This also allows <code>ejbjar</code> to add all of the required support classes for a | |||||
bean and not just super classes.</p> | |||||
<p><em>Since Ant 1.5</em>, a <var>dependency</var> attribute allows the buildfile to control what | <p><em>Since Ant 1.5</em>, a <var>dependency</var> attribute allows the buildfile to control what | ||||
additional classes are added to the generated jar. It takes three possible values</p> | additional classes are added to the generated jar. It takes three possible values</p> | ||||
@@ -611,9 +617,9 @@ additional classes are added to the generated jar. It takes three possible value | |||||
<li><q>full</q>—In this mode all classes used by the bean's classes and interfaces are added | <li><q>full</q>—In this mode all classes used by the bean's classes and interfaces are added | ||||
to the jar</li> | to the jar</li> | ||||
</ul> | </ul> | ||||
<p>The <q>super</q> and <q>full</q> values require | |||||
the <a href="https://commons.apache.org/bcel/">BCEL</a> library to be available. If it is | |||||
not, <code>ejbjar</code> will drop back to the behaviour corresponding to the value <q>none</q>.</p> | |||||
<p>The <q>super</q> and <q>full</q> values require the <a href="https://commons.apache.org/bcel/" | |||||
target="_top">BCEL</a> library to be available. If it is not, <code>ejbjar</code> will drop back to | |||||
the behaviour corresponding to the value <q>none</q>.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -46,11 +46,11 @@ should be more reliable, as would be something like</p> | |||||
<h4>Windows Users</h4> | <h4>Windows Users</h4> | ||||
<p>The <code><exec></code> task delegates to <code>Runtime.exec</code> which in turn | <p>The <code><exec></code> task delegates to <code>Runtime.exec</code> which in turn | ||||
apparently | apparently | ||||
calls <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx"> <code>::CreateProcess</code></a>. It | |||||
is the latter Win32 function that defines the exact semantics of the call. In particular, if you do | |||||
not put a file extension on the executable, only <samp>.EXE</samp> files are looked for, | |||||
not <samp>.COM</samp>, <samp>.CMD</samp> or other file types listed in the environment | |||||
variable <code>PATHEXT</code>. That is only used by the shell.</p> | |||||
calls <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx" | |||||
target="_top"><code>::CreateProcess</code></a>. It is the latter Win32 function that defines the | |||||
exact semantics of the call. In particular, if you do not put a file extension on the executable, | |||||
only <samp>.EXE</samp> files are looked for, not <samp>.COM</samp>, <samp>.CMD</samp> or other file | |||||
types listed in the environment variable <code>PATHEXT</code>. That is only used by the shell.</p> | |||||
<p>Note that <samp>.bat</samp> files cannot in general by executed directly. One normally needs to | <p>Note that <samp>.bat</samp> files cannot in general by executed directly. One normally needs to | ||||
execute the command shell executable <code>cmd</code> using the <code>/c</code> switch.</p> | execute the command shell executable <code>cmd</code> using the <code>/c</code> switch.</p> | ||||
<pre> | <pre> | ||||
@@ -75,8 +75,8 @@ the <var>executable</var> attribute in your buildfile.</p> | |||||
executable parameter. This is because JVM in which Ant is running is a standard Windows executable | executable parameter. This is because JVM in which Ant is running is a standard Windows executable | ||||
and is not aware of the Cygwin environment (i.e., doesn't load <samp>cygwin1.dll</samp>). The only | and is not aware of the Cygwin environment (i.e., doesn't load <samp>cygwin1.dll</samp>). The only | ||||
work-around for this is to compile a JVM under Cygwin (at your own risk). See for | work-around for this is to compile a JVM under Cygwin (at your own risk). See for | ||||
instance <a href="https://cdn.rawgit.com/AdoptOpenJDK/openjdk-jdk9/dev/common/doc/building.html#cygwin">OpenJDK | |||||
build instructions for cygwin</a>.</p> | |||||
instance <a href="https://cdn.rawgit.com/AdoptOpenJDK/openjdk-jdk9/dev/common/doc/building.html#cygwin" | |||||
target="_top">OpenJDK build instructions for cygwin</a>.</p> | |||||
<h4>OpenVMS Users</h4> | <h4>OpenVMS Users</h4> | ||||
<p>The command specified using <code>executable</code> and <code><arg></code> elements is | <p>The command specified using <code>executable</code> and <code><arg></code> elements is | ||||
@@ -98,9 +98,9 @@ the <var>fork</var> attribute set to <q>true</q> instead as this task will follo | |||||
interpretation of exit codes.</p> | interpretation of exit codes.</p> | ||||
<h4>RedHat S/390 Users</h4> | <h4>RedHat S/390 Users</h4> | ||||
<p>It has been <a href="https://www.mail-archive.com/linux-390@vm.marist.edu/msg22223.html">reported | |||||
on linux-390</a> that shell scripts invoked via the Ant Exec task must have their interpreter | |||||
specified, i.e., the scripts must start with something like:</p> | |||||
<p>It has been <a href="https://www.mail-archive.com/linux-390@vm.marist.edu/msg22223.html" | |||||
target="_top">reported on linux-390</a> that shell scripts invoked via the Ant Exec task must have | |||||
their interpreter specified, i.e., the scripts must start with something like:</p> | |||||
<pre>#!/bin/bash</pre> | <pre>#!/bin/bash</pre> | ||||
<p>or the task will fail as follows:</p> | <p>or the task will fail as follows:</p> | ||||
@@ -323,10 +323,10 @@ property and have it assigned to the result code (barring immutability, of cours | |||||
then <code><exec></code> halts the build unless <var>failifexecutionfails</var> is set | then <code><exec></code> halts the build unless <var>failifexecutionfails</var> is set | ||||
to <q>false</q>. You can use that to run a program if it exists, but otherwise do nothing.</p> | to <q>false</q>. You can use that to run a program if it exists, but otherwise do nothing.</p> | ||||
<p>What do those error codes mean? Well, they are OS dependent. On Windows boxes you have to look | <p>What do those error codes mean? Well, they are OS dependent. On Windows boxes you have to look | ||||
at <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx"> the | |||||
documentation</a>; <code>error=2</code> means 'no such program', which usually means it is not on | |||||
the path. Any time you see such an error from any Ant task, it is usually not an Ant bug, but some | |||||
configuration problem on your machine.</p> | |||||
at <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx" | |||||
target="_top">the documentation</a>; <code>error=2</code> means 'no such program', which usually | |||||
means it is not on the path. Any time you see such an error from any Ant task, it is usually not an | |||||
Ant bug, but some configuration problem on your machine.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre> | <pre> | ||||
@@ -223,8 +223,8 @@ connection.</p> | |||||
<tr> | <tr> | ||||
<td colspan="3" class="left"> | <td colspan="3" class="left"> | ||||
<p><strong>The following attributes | <p><strong>The following attributes | ||||
require <a href="https://commons.apache.org/net/download_net.cgi">jakarta-commons-net-1.4.0 or | |||||
greater</a>.</strong></p> | |||||
require <a href="https://commons.apache.org/net/download_net.cgi" | |||||
target="_top">jakarta-commons-net-1.4.0 or greater</a>.</strong></p> | |||||
<p>Use these options when the standard options don't work, because</p> | <p>Use these options when the standard options don't work, because</p> | ||||
<ul> | <ul> | ||||
<li>the server is in a different timezone and you need timestamp dependency checking</li> | <li>the server is in a different timezone and you need timestamp dependency checking</li> | ||||
@@ -259,44 +259,45 @@ connection.</p> | |||||
<tr> | <tr> | ||||
<td>serverTimeZoneConfig</td> | <td>serverTimeZoneConfig</td> | ||||
<td>Specify as a | <td>Specify as a | ||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html">TimeZone</a> | |||||
identifier, (e.g. <q>GMT</q>, <q>America/Chicago</q> or <q>Asia/Jakarta</q>) the timezone used | |||||
by the server for timestamps. This enables timestamp dependency checking even when the server | |||||
is in a different time zone from the client. Time Zones know, also, about daylight savings | |||||
time, and do not require you to calculate milliseconds of difference. If not specified, (or | |||||
specified as <q></q>), the time zone of the client is assumed.<br/><em>Since Ant 1.7</em></td> | |||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html" | |||||
target="_top">TimeZone</a> identifier, (e.g. <q>GMT</q>, <q>America/Chicago</q> | |||||
or <q>Asia/Jakarta</q>) the timezone used by the server for timestamps. This enables | |||||
timestamp dependency checking even when the server is in a different time zone from the | |||||
client. Time Zones know, also, about daylight savings time, and do not require you to | |||||
calculate milliseconds of difference. If not specified, (or specified as <q></q>), the time | |||||
zone of the client is assumed.<br/><em>Since Ant 1.7</em></td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>defaultDateFormatConfig</td> | <td>defaultDateFormatConfig</td> | ||||
<td>Specify in | <td>Specify in | ||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a> | |||||
notation, (e.g. <q>yyyy-MM-dd</q>), the date format generally used by the FTP server to parse | |||||
dates. In some cases this will be the only date format used. In others, (<q>unix</q> for | |||||
example) this will be used for dates older than a year | |||||
old. (See <var>recentDateFormatConfig</var>). When specified as <q></q>, default value will | |||||
be used.<br/><em>Since Ant 1.7</em></td> | |||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html" | |||||
target="_top">SimpleDateFormat</a> notation, (e.g. <q>yyyy-MM-dd</q>), the date format | |||||
generally used by the FTP server to parse dates. In some cases this will be the only date | |||||
format used. In others, (<q>unix</q> for example) this will be used for dates older than a | |||||
year old. (See <var>recentDateFormatConfig</var>). When specified as <q></q>, default value | |||||
will be used.<br/><em>Since Ant 1.7</em></td> | |||||
<td>No; defaults to default date format for the system type indicated | <td>No; defaults to default date format for the system type indicated | ||||
by <var>systemTypeKey</var></td> | by <var>systemTypeKey</var></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>recentDateFormatConfig</td> | <td>recentDateFormatConfig</td> | ||||
<td>Specify in | <td>Specify in | ||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a> | |||||
notation, (e.g. <q>MMM dd hh:mm</q>) the date format used by the FTP server to parse dates | |||||
less than a year old. If not specified (or specified as <q></q>), and if the system type | |||||
indicated by the <var>systemTypeKey</var> uses a recent date format, its standard format will | |||||
be used.<br/><em>Since Ant 1.7</em></td> | |||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html" | |||||
target="_top">SimpleDateFormat</a> notation, (e.g. <q>MMM dd hh:mm</q>) the date format used | |||||
by the FTP server to parse dates less than a year old. If not specified (or specified | |||||
as <q></q>), and if the system type indicated by the <var>systemTypeKey</var> uses a recent | |||||
date format, its standard format will be used.<br/><em>Since Ant 1.7</em></td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>serverLanguageCodeConfig</td> | <td>serverLanguageCodeConfig</td> | ||||
<td>a <a href="http://www.mathguide.de/info/tools/languagecode.html">two-letter ISO-639 language | |||||
code</a> used to specify the language used by the server to format month names. This only | |||||
needs to be specified when the server uses non-numeric abbreviations for months in its date | |||||
listings in a language other than English. This appears to be becoming rarer and rarer, as | |||||
commonly distributed FTP servers seem increasingly to use English or all-numeric formats. | |||||
Languages supported are: | |||||
<td>a <a href="http://www.mathguide.de/info/tools/languagecode.html" target="_top">two-letter | |||||
ISO-639 language code</a> used to specify the language used by the server to format month | |||||
names. This only needs to be specified when the server uses non-numeric abbreviations for | |||||
months in its date listings in a language other than English. This appears to be becoming | |||||
rarer and rarer, as commonly distributed FTP servers seem increasingly to use English or | |||||
all-numeric formats. Languages supported are: | |||||
<ul> | <ul> | ||||
<li><q>en</q>—English</li> | <li><q>en</q>—English</li> | ||||
<li><q>fr</q>—French</li> | <li><q>fr</q>—French</li> | ||||
@@ -34,9 +34,9 @@ | |||||
Ant to use a ProjectHelper other than Ant's default, this task may or may not work.</p> | Ant to use a ProjectHelper other than Ant's default, this task may or may not work.</p> | ||||
<p>In the common use case where only Ant's default project helper is used, it basically works like | <p>In the common use case where only Ant's default project helper is used, it basically works like | ||||
the <a href="https://ant.apache.org/faq.html#xml-entity-include">Entity Includes as explained in | |||||
the Ant FAQ</a>, as if the imported file was contained in the importing file, minus the | |||||
top <code><project></code> tag.</p> | |||||
the <a href="https://ant.apache.org/faq.html#xml-entity-include" target="_top">Entity Includes | |||||
as explained in the Ant FAQ</a>, as if the imported file was contained in the importing file, | |||||
minus the top <code><project></code> tag.</p> | |||||
<p>The <code>import</code> task may only be used as a top-level task. This means that it may not | <p>The <code>import</code> task may only be used as a top-level task. This means that it may not | ||||
be used in a target.</p> | be used in a target.</p> | ||||
@@ -32,8 +32,8 @@ | |||||
<p>On execution it will read another Ant file into the same project rewriting the included | <p>On execution it will read another Ant file into the same project rewriting the included | ||||
target <var>name</var>s and <var>depends</var> lists. This is different | target <var>name</var>s and <var>depends</var> lists. This is different | ||||
from <a href="https://ant.apache.org/faq.html#xml-entity-include">Entity Includes as explained | |||||
in the Ant FAQ</a> insofar as the target names get prefixed by the included | |||||
from <a href="https://ant.apache.org/faq.html#xml-entity-include" target="_top">Entity Includes | |||||
as explained in the Ant FAQ</a> insofar as the target names get prefixed by the included | |||||
project's <var>name</var> or <var>as</var> attribute and do not appear as if the file was | project's <var>name</var> or <var>as</var> attribute and do not appear as if the file was | ||||
contained in the including file.</p> | contained in the including file.</p> | ||||
@@ -71,15 +71,14 @@ a <code>zipfileset</code> in a <code>Zip</code> task. The one difference is that | |||||
the <var>manifest</var> attribute is not specified, the <code>Jar</code> task will include an empty | the <var>manifest</var> attribute is not specified, the <code>Jar</code> task will include an empty | ||||
one for you.)</p> | one for you.)</p> | ||||
<p>Manifests are processed by the <code>Jar</code> task according to the <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html">Jar file | |||||
specification.</a> Note in particular that this may result in manifest lines greater than 72 bytes | |||||
being wrapped and continued on the next line.</p> | |||||
<p>Manifests are processed by the <code>Jar</code> task according to | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html" target="_top">Jar | |||||
file specification.</a> Note in particular that this may result in manifest lines greater than 72 | |||||
bytes being wrapped and continued on the next line.</p> | |||||
<p>The <code>Jar</code> task checks whether you specified package information according to | <p>The <code>Jar</code> task checks whether you specified package information according to | ||||
the <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779"> | |||||
versioning specification</a>.</p> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779" | |||||
target="_top">versioning specification</a>.</p> | |||||
<p><strong>Please note that the ZIP format allows multiple files of the same fully-qualified name to | <p><strong>Please note that the ZIP format allows multiple files of the same fully-qualified name to | ||||
exist within a single archive. This has been documented as causing various problems for unsuspecting | exist within a single archive. This has been documented as causing various problems for unsuspecting | ||||
@@ -89,7 +88,7 @@ other than its default, <q>add</q>.</strong></p> | |||||
<p>To cryptographically sign your JAR file, use the <a href="signjar.html">SignJar task</a> on the | <p>To cryptographically sign your JAR file, use the <a href="signjar.html">SignJar task</a> on the | ||||
JAR that you create from this task.</p> | JAR that you create from this task.</p> | ||||
<p>For creating a simple version of a <a target="_blank" href="http://openjdk.java.net/jeps/238">JEP | |||||
<p>For creating a simple version of a <a href="http://openjdk.java.net/jeps/238" target="_top">JEP | |||||
238 multi-release jar</a>, you don't need any special tools. Just set the | 238 multi-release jar</a>, you don't need any special tools. Just set the | ||||
required <code>manifest</code> entry and place the files where required, as you could see in | required <code>manifest</code> entry and place the files where required, as you could see in | ||||
the <a href="#jep238-example">JEP 238 example</a>. If you want to tune this kind of jar, | the <a href="#jep238-example">JEP 238 example</a>. If you want to tune this kind of jar, | ||||
@@ -202,10 +201,10 @@ e.g. decreasing the size by deleting 'same' classes from the versions-branches, | |||||
<tr> | <tr> | ||||
<td>index</td> | <td>index</td> | ||||
<td>whether to create | <td>whether to create | ||||
an <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#JAR_Index">index | |||||
list</a> to speed up classloading. This is a JDK 1.3+ specific feature. Unless you specify | |||||
additional jars with nested <a href="#indexjars"><code>indexjars</code></a> elements, only the | |||||
contents of this jar will be included in the index.</td> | |||||
an <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#JAR_Index" | |||||
target="_top">index list</a> to speed up classloading. This is a JDK 1.3+ specific feature. | |||||
Unless you specify additional jars with nested <a href="#indexjars"><code>indexjars</code></a> | |||||
elements, only the contents of this jar will be included in the index.</td> | |||||
<td>No; defaults to <q>false</q></td> | <td>No; defaults to <q>false</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -213,8 +212,8 @@ e.g. decreasing the size by deleting 'same' classes from the versions-branches, | |||||
<td>whether to include <samp>META-INF</samp> and its children in the index. Doesn't have any | <td>whether to include <samp>META-INF</samp> and its children in the index. Doesn't have any | ||||
effect if <var>index</var> is <q>false</q>.<br/>Sun's jar implementation used to skip | effect if <var>index</var> is <q>false</q>.<br/>Sun's jar implementation used to skip | ||||
the <samp>META-INF</samp> directory and Ant followed that example. The behavior has been | the <samp>META-INF</samp> directory and Ant followed that example. The behavior has been | ||||
changed with <a href="https://bugs.openjdk.java.net/browse/JDK-4408526">Java 5</a>. In order | |||||
to avoid problems with Ant generated jars on Java 1.4 or earlier Ant will not | |||||
changed with <a href="https://bugs.openjdk.java.net/browse/JDK-4408526" target="_top">Java | |||||
5</a>. In order to avoid problems with Ant generated jars on Java 1.4 or earlier Ant will not | |||||
include <samp>META-INF</samp> unless explicitly asked to. <em>Since Ant 1.8.0</em></td> | include <samp>META-INF</samp> unless explicitly asked to. <em>Since Ant 1.8.0</em></td> | ||||
<td>No; defaults to <q>false</q></td> | <td>No; defaults to <q>false</q></td> | ||||
</tr> | </tr> | ||||
@@ -355,10 +354,11 @@ to <q>true</q>.</p> | |||||
<p><em>Since Ant 1.7.0</em></p> | <p><em>Since Ant 1.7.0</em></p> | ||||
<p>The nested <code>service</code> element specifies a service. Services are described in | <p>The nested <code>service</code> element specifies a service. Services are described in | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Service_Provider">service | |||||
provider overview</a>. The approach is to have providers JARs include files named by the service | |||||
provided, for example, <samp>META-INF/services/javax.script.ScriptEngineFactory</samp> which can | |||||
include implementation class names, one per line (usually just one per JAR).</p> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Service_Provider" | |||||
target="_top">service provider overview</a>. The approach is to have providers JARs include files | |||||
named by the service provided, for | |||||
example, <samp>META-INF/services/javax.script.ScriptEngineFactory</samp> which can include | |||||
implementation class names, one per line (usually just one per JAR).</p> | |||||
<p>The name of the service is set by the <var>type</var> attribute. The classname implementing the | <p>The name of the service is set by the <var>type</var> attribute. The classname implementing the | ||||
service is the the <var>provider</var> attribute, or if one wants to specify a number of classes | service is the the <var>provider</var> attribute, or if one wants to specify a number of classes | ||||
@@ -464,7 +464,7 @@ embeds all the classes from all the jars in <samp>lib/main</samp>.</p> | |||||
<include name="build"/> | <include name="build"/> | ||||
<manifest> | <manifest> | ||||
<!-- If this is an Applet or Web Start application, include | <!-- If this is an Applet or Web Start application, include | ||||
the proper attributes from <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jweb/index.html">https://docs.oracle.com/javase/8/docs/technotes/guides/jweb/index.html</a> --> | |||||
the proper attributes from <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jweb/index.html" target="_top">https://docs.oracle.com/javase/8/docs/technotes/guides/jweb/index.html</a> --> | |||||
<attribute name="Permissions" value="sandbox"/> | <attribute name="Permissions" value="sandbox"/> | ||||
<attribute name="Codebase" value="example.com"/> | <attribute name="Codebase" value="example.com"/> | ||||
<!-- Who is building this jar? --> | <!-- Who is building this jar? --> | ||||
@@ -521,7 +521,7 @@ JDK 6 scripting interface:</p> | |||||
<h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4> | <h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4> | ||||
<p>Here we want to create a <em>Multi-Release JAR File</em> according the | <p>Here we want to create a <em>Multi-Release JAR File</em> according the | ||||
specification <a target="_blank" href="http://openjdk.java.net/jeps/238">JEP 238</a>. It defines on | |||||
specification <a href="http://openjdk.java.net/jeps/238" target="_top">JEP 238</a>. It defines on | |||||
top of a JAR the possibility to place additional or overwriting classes in a jar, which are | top of a JAR the possibility to place additional or overwriting classes in a jar, which are | ||||
available according to the Java version you run.<br/> Basically it says, that you have to set the | available according to the Java version you run.<br/> Basically it says, that you have to set the | ||||
manifest entry <code>Multi-Release: true</code> and place all additional or overwriting classes | manifest entry <code>Multi-Release: true</code> and place all additional or overwriting classes | ||||
@@ -31,10 +31,10 @@ If the extension is present then a property is set.</p> | |||||
<p>Note that this task works with extensions as defined by the "Optional Package" specification. | <p>Note that this task works with extensions as defined by the "Optional Package" specification. | ||||
For more information about optional packages, see the document <em>Optional Package Versioning</em> | For more information about optional packages, see the document <em>Optional Package Versioning</em> | ||||
in the documentation bundle for your Java Standard Edition package, in file | |||||
<samp>guide/extensions/versioning.html</samp> or the online <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html"> Extension | |||||
and ExtensionSet documentation</a> for further details.</p> | |||||
in the documentation bundle for your Java Standard Edition package, in | |||||
file <samp>guide/extensions/versioning.html</samp> or the | |||||
online <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html" | |||||
target="_top">Extension and ExtensionSet documentation</a> for further details.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -121,3 +121,4 @@ extension in.</p> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
@@ -31,10 +31,10 @@ specified jars.</p> | |||||
<p>Note that this task works with extensions as defined by the "Optional Package" specification. | <p>Note that this task works with extensions as defined by the "Optional Package" specification. | ||||
For more information about optional packages, see the document <em>Optional Package Versioning</em> | For more information about optional packages, see the document <em>Optional Package Versioning</em> | ||||
in the documentation bundle for your Java Standard Edition package, in file | |||||
<samp>guide/extensions/versioning.html</samp> or the online <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html"> Extension | |||||
and ExtensionSet documentation</a> for further details.</p> | |||||
in the documentation bundle for your Java Standard Edition package, in | |||||
file <samp>guide/extensions/versioning.html</samp> or the | |||||
online <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html" | |||||
target="_top">Extension and ExtensionSet documentation</a> for further details.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -32,10 +32,10 @@ specifications in the manifests of the jars.</p> | |||||
<p>Note that this task works with extensions as defined by the "Optional Package" specification. | <p>Note that this task works with extensions as defined by the "Optional Package" specification. | ||||
For more information about optional packages, see the document <em>Optional Package Versioning</em> | For more information about optional packages, see the document <em>Optional Package Versioning</em> | ||||
in the documentation bundle for your Java Standard Edition package, in file | |||||
<code>guide/extensions/versioning.html</code> or the online <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html">Extension | |||||
and ExtensionSet documentation</a> for further details.</p> | |||||
in the documentation bundle for your Java Standard Edition package, in | |||||
file <code>guide/extensions/versioning.html</code> or the | |||||
online <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html" | |||||
target="_top">Extension and ExtensionSet documentation</a> for further details.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -34,10 +34,10 @@ thrown.</p> | |||||
<p>Note that this task works with extensions as defined by the "Optional Package" specification. | <p>Note that this task works with extensions as defined by the "Optional Package" specification. | ||||
For more information about optional packages, see the document <em>Optional Package Versioning</em> | For more information about optional packages, see the document <em>Optional Package Versioning</em> | ||||
in the documentation bundle for your Java Standard Edition package, in file | |||||
<code>guide/extensions/versioning.html</code> or the online <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html"> Extension | |||||
and ExtensionSet documentation</a> for further details.</p> | |||||
in the documentation bundle for your Java Standard Edition package, in | |||||
file <code>guide/extensions/versioning.html</code> or the | |||||
online <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/extensions/versioning.html" | |||||
target="_top">Extension and ExtensionSet documentation</a> for further details.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -311,8 +311,8 @@ project, <em>not</em> the directory in which the Java task is run. If you need t | |||||
relative to the directory the task will be run in, you need to explicitly create the full path to | relative to the directory the task will be run in, you need to explicitly create the full path to | ||||
the JAR file.</p> | the JAR file.</p> | ||||
<p>When using the <var>jar</var> attribute, all classpath settings are ignored according | <p>When using the <var>jar</var> attribute, all classpath settings are ignored according | ||||
to <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html">Oracle's | |||||
specification</a>. | |||||
to <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html" | |||||
target="_top">Oracle's specification</a>. | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre> | <pre> | ||||
@@ -69,7 +69,7 @@ for either the <code>build.compiler</code> property or the <var>compiler</var> a | |||||
(the <a href="https://web.archive.org/web/20050212025507/http://www.dms.at/kopi/index.html" | (the <a href="https://web.archive.org/web/20050212025507/http://www.dms.at/kopi/index.html" | ||||
target="_top">kopi</a> compiler).</li> | target="_top">kopi</a> compiler).</li> | ||||
<li><q>gcj</q> (the <code>gcj</code> compiler | <li><q>gcj</q> (the <code>gcj</code> compiler | ||||
from <a href="https://gcc.gnu.org/gcc-7/changes.html#java">GCC</a>).</li> | |||||
from <a href="https://gcc.gnu.org/gcc-7/changes.html#java" target="_top">GCC</a>).</li> | |||||
<li><q>sj</q> (Symantec Java compiler) – <q>symantec</q> can be used as an alias.</li> | <li><q>sj</q> (Symantec Java compiler) – <q>symantec</q> can be used as an alias.</li> | ||||
<li><q>extJavac</q> (run either modern or classic in a JVM of its own).</li> | <li><q>extJavac</q> (run either modern or classic in a JVM of its own).</li> | ||||
</ul> | </ul> | ||||
@@ -309,8 +309,9 @@ file will not get compiled even if a native header file generated for it would b | |||||
magic <a href="../javacprops.html#target"><code>ant.build.javac.target</code></a> property is | magic <a href="../javacprops.html#target"><code>ant.build.javac.target</code></a> property is | ||||
set<br/><strong>Note that the default value depends on JDK that is running Ant and | set<br/><strong>Note that the default value depends on JDK that is running Ant and | ||||
on <var>source</var> | on <var>source</var> | ||||
(see <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJDCID">Cross-Compilation | |||||
Options</a>). We highly recommend to always specify this attribute.</strong></td> | |||||
(see <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJDCID" | |||||
target="_top">Cross-Compilation Options</a>). We highly recommend to always specify this | |||||
attribute.</strong></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>compiler</td> | <td>compiler</td> | ||||
@@ -345,9 +346,10 @@ file will not get compiled even if a native header file generated for it would b | |||||
compiler for doing unnecessary work. However, for some edge cases, involving generics, | compiler for doing unnecessary work. However, for some edge cases, involving generics, | ||||
the <code>javac</code> compiler needs to compile the dependent classes to get the generics | the <code>javac</code> compiler needs to compile the dependent classes to get the generics | ||||
information. One example is documented in the bug | information. One example is documented in the bug | ||||
report: <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=40776">Bug 40776 - a | |||||
problem compiling a Java 5 project with generics</a>. Setting the attribute to <q>false</q> | |||||
will cause the compiler to recompile dependent classes. <em>Since Ant 1.7.1</em>.</td> | |||||
report: <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=40776" target="_top">Bug | |||||
40776 - a problem compiling a Java 5 project with generics</a>. Setting the attribute | |||||
to <q>false</q> will cause the compiler to recompile dependent classes. <em>Since Ant | |||||
1.7.1</em>.</td> | |||||
<td>No; default is <q>true</q></td> | <td>No; default is <q>true</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -578,8 +580,8 @@ certain packages below a common root, use the <var>include</var>/<var>exclude</v | |||||
or <code><include></code>/<code><exclude></code> nested elements to filter for these | or <code><include></code>/<code><exclude></code> nested elements to filter for these | ||||
packages. Do not include part of your package structure in the <var>srcdir</var> attribute (or | packages. Do not include part of your package structure in the <var>srcdir</var> attribute (or | ||||
nested <code><src></code> elements), or Ant will recompile your source files every time you | nested <code><src></code> elements), or Ant will recompile your source files every time you | ||||
run your compile target. See the <a href="https://ant.apache.org/faq.html#always-recompiles">Ant | |||||
FAQ</a> for additional information.</p> | |||||
run your compile target. See the <a href="https://ant.apache.org/faq.html#always-recompiles" | |||||
target="_top">Ant FAQ</a> for additional information.</p> | |||||
<p>If you wish to compile only files explicitly specified and disable <code>javac</code>'s default | <p>If you wish to compile only files explicitly specified and disable <code>javac</code>'s default | ||||
searching mechanism then you can unset the <var>sourcepath</var> attribute:</p> | searching mechanism then you can unset the <var>sourcepath</var> attribute:</p> | ||||
@@ -734,9 +736,9 @@ references to strings that can by used in an OS independent fashion | |||||
</javac></pre> | </javac></pre> | ||||
<h3>OpenJDK notes</h3> | <h3>OpenJDK notes</h3> | ||||
<p>The <a href="http://openjdk.java.net/">openjdk</a> project has provided | |||||
the <code>javac</code> <a href="http://openjdk.java.net/groups/compiler/">compiler</a> as an open | |||||
source project. The output of this project is a <code>javac.jar</code> which contains | |||||
<p>The <a href="http://openjdk.java.net/" target="_top">OpenJDK</a> project has provided | |||||
the <code>javac</code> <a href="http://openjdk.java.net/groups/compiler/" target="_top">compiler</a> | |||||
as an open source project. The output of this project is a <code>javac.jar</code> which contains | |||||
the <code>javac</code> compiler. This compiler may be used with the <code><javac></code> task | the <code>javac</code> compiler. This compiler may be used with the <code><javac></code> task | ||||
with the use of a <code>-Xbootclasspath/p</code> Java argument. The argument needs to be given to | with the use of a <code>-Xbootclasspath/p</code> Java argument. The argument needs to be given to | ||||
the runtime system of the <code>javac</code> executable, so it needs to be prepended with | the runtime system of the <code>javac</code> executable, so it needs to be prepended with | ||||
@@ -57,7 +57,7 @@ attribute it is up to you to ensure that this command supports the attributes yo | |||||
<p><strong>Note</strong>: When generating the JavaDocs for classes which contains annotations you | <p><strong>Note</strong>: When generating the JavaDocs for classes which contains annotations you | ||||
maybe get a <code>java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl</code>. This is | maybe get a <code>java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl</code>. This is | ||||
due <a href="https://bugs.openjdk.java.net/browse/JDK-6442982" target="_blank">bug-6442982</a>. The | |||||
due <a href="https://bugs.openjdk.java.net/browse/JDK-6442982" target="_top">bug-6442982</a>. The | |||||
cause is that JavaDoc cannot find the implementations of used annotations. The workaround is | cause is that JavaDoc cannot find the implementations of used annotations. The workaround is | ||||
providing the jars with these implementations (like JAXBs <code>@XmlType</code>, ...) | providing the jars with these implementations (like JAXBs <code>@XmlType</code>, ...) | ||||
to <code><javadoc></code> using <var>classpath</var>, <var>classpathref</var> attributes or | to <code><javadoc></code> using <var>classpath</var>, <var>classpathref</var> attributes or | ||||
@@ -493,8 +493,8 @@ with the <var>exclude</var> patterns of the <code>packageset</code> (and vice ve | |||||
CVE-2013-1571. <em>Since Ant 1.9.2</em><br/> There is a frame injection attack possible in | CVE-2013-1571. <em>Since Ant 1.9.2</em><br/> There is a frame injection attack possible in | ||||
javadocs generated by Oracle JDKs prior to Java 7 update 25 | javadocs generated by Oracle JDKs prior to Java 7 update 25 | ||||
(<a href="https://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html#jpi-upt" | (<a href="https://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html#jpi-upt" | ||||
target="_blank">details</a>). When this flag is set to <q>true</q>, Ant will check whether | |||||
the docs are vulnerable and will try to fix them.</td> | |||||
target="_top">details</a>). When this flag is set to <q>true</q>, Ant will check whether the | |||||
docs are vulnerable and will try to fix them.</td> | |||||
<td>1.4</td> | <td>1.4</td> | ||||
<td>No; defaults to <q>true</q></td> | <td>No; defaults to <q>true</q></td> | ||||
</tr> | </tr> | ||||
@@ -678,12 +678,12 @@ task.</p> | |||||
<h4>doclet</h4> | <h4>doclet</h4> | ||||
<p>The doclet nested element is used to specify | <p>The doclet nested element is used to specify | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/doclet/overview.html">doclet</a> | |||||
that <code>javadoc</code> will use to process the input source files. A number of the | |||||
standard <code>javadoc</code> arguments are actually arguments of the standard doclet. If these are | |||||
specified in the <code>javadoc</code> task's attributes, they will be passed to the doclet specified | |||||
in the <code><doclet></code> nested element. Such attributes should only be specified, | |||||
therefore, if they can be interpreted by the doclet in use.</p> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/doclet/overview.html" | |||||
target="_top">doclet</a> that <code>javadoc</code> will use to process the input source files. A | |||||
number of the standard <code>javadoc</code> arguments are actually arguments of the standard | |||||
doclet. If these are specified in the <code>javadoc</code> task's attributes, they will be passed to | |||||
the doclet specified in the <code><doclet></code> nested element. Such attributes should only | |||||
be specified, therefore, if they can be interpreted by the doclet in use.</p> | |||||
<p>If the doclet requires additional parameters, these can be specified | <p>If the doclet requires additional parameters, these can be specified | ||||
with <code><param></code> elements within the <code><doclet></code> element. These | with <code><param></code> elements within the <code><doclet></code> element. These | ||||
@@ -742,8 +742,8 @@ those tags.</p> | |||||
<td>If this attribute is specified, this element will behave as an | <td>If this attribute is specified, this element will behave as an | ||||
implicit <a href="../Types/fileset.html">fileset</a>. The files included by this fileset | implicit <a href="../Types/fileset.html">fileset</a>. The files included by this fileset | ||||
should contain each tag definition on a separate line, as described in | should contain each tag definition on a separate line, as described in | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags">Javadoc | |||||
reference guide</a>: | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags" | |||||
target="_top">Javadoc reference guide</a>: | |||||
<pre>ejb.bean:t:XDoclet EJB Tag | <pre>ejb.bean:t:XDoclet EJB Tag | ||||
todo:a:To Do</pre> | todo:a:To Do</pre> | ||||
<strong>Note</strong>: The Javadoc reference quide has double quotes around the description | <strong>Note</strong>: The Javadoc reference quide has double quotes around the description | ||||
@@ -757,9 +757,10 @@ todo:a:To Do</pre> | |||||
<h4 id="tagletelement">taglet</h4> | <h4 id="tagletelement">taglet</h4> | ||||
<p>The taglet nested element is used to specify | <p>The taglet nested element is used to specify | ||||
custom <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/overview.html">taglets</a> | |||||
custom <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/overview.html" | |||||
target="_top">taglets</a> | |||||
beyond <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags" | beyond <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags" | ||||
target="_blank">the default taglets</a>.</p> | |||||
target="_top">the default taglets</a>.</p> | |||||
<h5>Parameters</h5> | <h5>Parameters</h5> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -771,7 +772,8 @@ target="_blank">the default taglets</a>.</p> | |||||
<tr> | <tr> | ||||
<td>name</td> | <td>name</td> | ||||
<td>The name of the taglet class | <td>The name of the taglet class | ||||
(e.g. <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/ToDoTaglet.java"><code>com.sun.tools.doclets.ToDoTaglet</code></a>)</td> | |||||
(e.g. <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/ToDoTaglet.java" | |||||
target="_top"><code>com.sun.tools.doclets.ToDoTaglet</code></a>)</td> | |||||
<td>Yes</td> | <td>Yes</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -29,10 +29,10 @@ | |||||
<p>Generates JNI headers from a Java class.</p> | <p>Generates JNI headers from a Java class.</p> | ||||
<p>When this task executes, it will generate the C header and source files that are needed to | <p>When this task executes, it will generate the C header and source files that are needed to | ||||
implement native methods. JNI operates differently depending on | implement native methods. JNI operates differently depending on | ||||
whether <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javah.html">JDK | |||||
1.2+</a> | |||||
or <a href="https://web.archive.org/web/20021018232717/http://java.sun.com/products/jdk/1.1/docs/tooldocs/win32/javah.html">pre-1.2 | |||||
JDK</a> systems are used.</p> | |||||
whether <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javah.html" | |||||
target="_top">JDK 1.2+</a> | |||||
or <a href="https://web.archive.org/web/20021018232717/http://java.sun.com/products/jdk/1.1/docs/tooldocs/win32/javah.html" | |||||
target="_top">pre-1.2 JDK</a> systems are used.</p> | |||||
<p>If you are building with Java 8 or above consider | <p>If you are building with Java 8 or above consider | ||||
using <a href="javac.html"><code>javac</code></a>'s <var>nativeheaderdir</var> attribute instead | using <a href="javac.html"><code>javac</code></a>'s <var>nativeheaderdir</var> attribute instead | ||||
@@ -47,7 +47,8 @@ attribute:</p> | |||||
<ul> | <ul> | ||||
<li><q>default</q>—the default compiler for the platform.</li> | <li><q>default</q>—the default compiler for the platform.</li> | ||||
<li><q>sun</q>—the standard compiler of the JDK.</li> | <li><q>sun</q>—the standard compiler of the JDK.</li> | ||||
<li><q>kaffeh</q>—the native standard compiler of <a href="http://www.kaffe.org" target="_top">Kaffe</a>.</li> | |||||
<li><q>kaffeh</q>—the native standard compiler of <a href="http://www.kaffe.org" | |||||
target="_top">Kaffe</a>.</li> | |||||
<li><q>gcjh</q>—the native standard compiler | <li><q>gcjh</q>—the native standard compiler | ||||
of <a href="https://gcc.gnu.org/gcc-7/changes.html#java" target="_top">gcj and | of <a href="https://gcc.gnu.org/gcc-7/changes.html#java" target="_top">gcj and | ||||
gij</a>. <em>Since Apache Ant 1.8.2</em></li> | gij</a>. <em>Since Apache Ant 1.8.2</em></li> | ||||
@@ -27,7 +27,8 @@ | |||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Invokes the <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> parser.</p> | |||||
<p>Invokes the <a href="http://www.clarkware.com/software/JDepend.html" target="_top">JDepend</a> | |||||
parser.</p> | |||||
<p>This parser "traverses a set of Java source file directories and generates design quality | <p>This parser "traverses a set of Java source file directories and generates design quality | ||||
metrics for each Java package". It allows to "automatically measure the quality of a | metrics for each Java package". It allows to "automatically measure the quality of a | ||||
@@ -26,9 +26,9 @@ | |||||
<p><em>Since Apache Ant 1.6</em></p> | <p><em>Since Apache Ant 1.6</em></p> | ||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Invokes the <a href="https://javacc.org/">JJDoc</a> preprocessor for the JavaCC compiler | |||||
compiler. It takes a JavaCC parser specification and produces documentation for the BNF grammar. It | |||||
can operate in three modes, determined by command line options. | |||||
<p>Invokes the <a href="https://javacc.org/" target="_top">JJDoc</a> preprocessor for the JavaCC | |||||
compiler compiler. It takes a JavaCC parser specification and produces documentation for the BNF | |||||
grammar. It can operate in three modes, determined by command line options. | |||||
<p>To use the <code>jjdoc</code> task, set the <var>target</var> attribute to the name of the JavaCC | <p>To use the <code>jjdoc</code> task, set the <var>target</var> attribute to the name of the JavaCC | ||||
grammar file to process. You also need to specify the directory containing the JavaCC installation | grammar file to process. You also need to specify the directory containing the JavaCC installation | ||||
using the <var>javacchome</var> attribute, so that Ant can find the JavaCC classes. Optionally, you | using the <var>javacchome</var> attribute, so that Ant can find the JavaCC classes. Optionally, you | ||||
@@ -25,9 +25,9 @@ | |||||
<h2 id="jjtree">JJTree</h2> | <h2 id="jjtree">JJTree</h2> | ||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Invokes the <a href="https://javacc.org/">JJTree</a> preprocessor for the JavaCC compiler | |||||
compiler. It inserts parse tree building actions at various places in the JavaCC source that it | |||||
generates. The output of JJTree is run through JavaCC to create the parser.</p> | |||||
<p>Invokes the <a href="https://javacc.org/" target="_top">JJTree</a> preprocessor for the JavaCC | |||||
compiler compiler. It inserts parse tree building actions at various places in the JavaCC source | |||||
that it generates. The output of JJTree is run through JavaCC to create the parser.</p> | |||||
<p>To use the <code>jjtree</code> task, set the <var>target</var> attribute to the name of the | <p>To use the <code>jjtree</code> task, set the <var>target</var> attribute to the name of the | ||||
JJTree grammar file to process. You also need to specify the directory containing the JavaCC | JJTree grammar file to process. You also need to specify the directory containing the JavaCC | ||||
installation using the <var>javacchome</var> attribute, so that Ant can find the JavaCC | installation using the <var>javacchome</var> attribute, so that Ant can find the JavaCC | ||||
@@ -31,9 +31,10 @@ the task shipping with Tomcat instead.</em> This task is only tested against To | |||||
known problems with Tomcat 5.x that won't get fixed in Ant, please use Tomcat's <code>jspc</code> | known problems with Tomcat 5.x that won't get fixed in Ant, please use Tomcat's <code>jspc</code> | ||||
task instead.<br/> Instead of relying on container-specific JSP compilers we suggest deploying the | task instead.<br/> Instead of relying on container-specific JSP compilers we suggest deploying the | ||||
raw files (<samp>*.jsp</samp>) and use the container build-in functions: after deploying run a test | raw files (<samp>*.jsp</samp>) and use the container build-in functions: after deploying run a test | ||||
suite (e.g. with <a href="https://attic.apache.org/projects/jakarta-cactus.html">Cactus</a> | |||||
or <a href="http://httpunit.sourceforge.net/">HttpUnit</a>) against the deployed web application. So | |||||
you'll get the test result <em>and</em> the compiled JSPs.</p> | |||||
suite (e.g. with <a href="https://attic.apache.org/projects/jakarta-cactus.html" | |||||
target="_top">Cactus</a> or <a href="http://httpunit.sourceforge.net/" target="_top">HttpUnit</a>) | |||||
against the deployed web application. So you'll get the test result <em>and</em> the compiled | |||||
JSPs.</p> | |||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Apache Ant task to run the JSP compiler and turn JSP pages into Java source files.</p> | <p>Apache Ant task to run the JSP compiler and turn JSP pages into Java source files.</p> | ||||
@@ -47,8 +48,8 @@ dependencies, or <code><jsp:include></code> references.</p> | |||||
<p>By default the task uses the Jasper JSP compiler. This means the task | <p>By default the task uses the Jasper JSP compiler. This means the task | ||||
needs <samp>jasper.jar</samp> and <samp>jasper-runtime.jar</samp>, which come with builds of Tomcat | needs <samp>jasper.jar</samp> and <samp>jasper-runtime.jar</samp>, which come with builds of Tomcat | ||||
4/Catalina from the <a href="https://tomcat.apache.org/">Apache Tomcat project</a>, and any other | |||||
jar files which may be needed in future versions (it changes).</p> | |||||
4/Catalina from the <a href="https://tomcat.apache.org/" target="_top">Apache Tomcat project</a>, | |||||
and any other jar files which may be needed in future versions (it changes).</p> | |||||
<p>We recommend (in March 2003) Tomcat version 4.1.x for the most robust version of Jasper.</p> | <p>We recommend (in March 2003) Tomcat version 4.1.x for the most robust version of Jasper.</p> | ||||
@@ -25,9 +25,10 @@ | |||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>This task runs tests from the JUnit testing framework. The latest version of the framework can be | <p>This task runs tests from the JUnit testing framework. The latest version of the framework can be | ||||
found at <a href="https://junit.org">https://junit.org</a>. This task has been tested with JUnit | |||||
3.0 up to JUnit 3.8.2; it won't work with versions prior to JUnit 3.0. It also works with JUnit 4.x, | |||||
including "pure" JUnit 4 tests using only annotations and no <code>JUnit4TestAdapter</code>.</p> | |||||
found at <a href="https://junit.org" target="_top">https://junit.org</a>. This task has been tested | |||||
with JUnit 3.0 up to JUnit 3.8.2; it won't work with versions prior to JUnit 3.0. It also works with | |||||
JUnit 4.x, including "pure" JUnit 4 tests using only annotations and | |||||
no <code>JUnit4TestAdapter</code>.</p> | |||||
<p><strong>Note</strong>: This task depends on external libraries not included | <p><strong>Note</strong>: This task depends on external libraries not included | ||||
in the Apache Ant distribution. See <a href="../install.html#librarydependencies"> | in the Apache Ant distribution. See <a href="../install.html#librarydependencies"> | ||||
Library Dependencies</a> for more information.</p> | Library Dependencies</a> for more information.</p> | ||||
@@ -34,10 +34,10 @@ information.</p> | |||||
<h3>Requirements</h3> | <h3>Requirements</h3> | ||||
<p>The task needs Apache <a href="https://xml.apache.org/xalan-j/">Xalan 2.4.1+ or Xalan XSLTC</a> | |||||
(JDK 1.4 contains a version of Xalan 2.x, while JDK 1.5 ships with a version of XSLTC). JDK 1.4.2-01 | |||||
and later ships with a bundled Xalan 2.4.1+, meaning that JDKs prior to version 1.4.2-01 won't work | |||||
out of the box. The table below summarize the compatibility status.</p> | |||||
<p>The task needs Apache <a href="https://xml.apache.org/xalan-j/" target="_top">Xalan 2.4.1+ or | |||||
Xalan XSLTC</a> (JDK 1.4 contains a version of Xalan 2.x, while JDK 1.5 ships with a version of | |||||
XSLTC). JDK 1.4.2-01 and later ships with a bundled Xalan 2.4.1+, meaning that JDKs prior to version | |||||
1.4.2-01 won't work out of the box. The table below summarize the compatibility status.</p> | |||||
<table> | <table> | ||||
<tr><th>Xalan</th><th>Sun JDK Bundle</th><th>Status<th></tr> | <tr><th>Xalan</th><th>Sun JDK Bundle</th><th>Status<th></tr> | ||||
<tr><td>2.4.1+</td><td>JDK 1.4.2-01+</td><td>OK</td></tr> | <tr><td>2.4.1+</td><td>JDK 1.4.2-01+</td><td>OK</td></tr> | ||||
@@ -68,7 +68,7 @@ is not set.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<p>The LoadFile task supports nested <a href="../Types/filterchain.html"> FilterChain</a>s.</p> | |||||
<p>The LoadFile task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre> | <pre> | ||||
@@ -67,7 +67,7 @@ the property is not set.</p> | |||||
<td>No; default is <q>false</q></td> | <td>No; default is <q>false</q></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<p>The LoadResource task supports nested <a href="../Types/filterchain.html"> FilterChain</a>s.</p> | |||||
<p>The LoadResource task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre> | <pre> | ||||
@@ -107,9 +107,8 @@ | |||||
<tr> | <tr> | ||||
<td>doubleexpanding</td> | <td>doubleexpanding</td> | ||||
<td>Controls whether or not property references in the attribute are expanded twice or just | <td>Controls whether or not property references in the attribute are expanded twice or just | ||||
once. See | |||||
the <a href="https://ant.apache.org/faq.html#macrodef-property-expansion">FAQ</a> for | |||||
details. <em>Since Ant 1.8.3</em></td> | |||||
once. See the <a href="https://ant.apache.org/faq.html#macrodef-property-expansion" | |||||
target="_top">FAQ</a> for details. <em>Since Ant 1.8.3</em></td> | |||||
<td>No; default is <q>true</q></td> | <td>No; default is <q>true</q></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -205,7 +204,8 @@ | |||||
<p>The following fragment defines a task called <code><call-cc></code> which take the | <p>The following fragment defines a task called <code><call-cc></code> which take the | ||||
attributes <var>target</var>, <var>link</var> and <var>target.dir</var> and the nested | attributes <var>target</var>, <var>link</var> and <var>target.dir</var> and the nested | ||||
element <code>cc-elements</code>. The body of the task uses the <code><cc></code> task | element <code>cc-elements</code>. The body of the task uses the <code><cc></code> task | ||||
from the <a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> project.</p> | |||||
from the <a href="http://ant-contrib.sourceforge.net/" target="_top">ant-contrib</a> | |||||
project.</p> | |||||
<pre class="code"> | <pre class="code"> | ||||
<macrodef name="call-cc"> | <macrodef name="call-cc"> | ||||
<attribute name="target"/> | <attribute name="target"/> | ||||
@@ -84,8 +84,8 @@ more information.</p> | |||||
<tr> | <tr> | ||||
<td>messagefileinputencoding</td> | <td>messagefileinputencoding</td> | ||||
<td>Specifies the encoding of the input file. Please | <td>Specifies the encoding of the input file. Please | ||||
see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a> for a list of possible values. <em>Since Ant 1.9.4</em> | |||||
see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a> for a list of possible values. <em>Since Ant 1.9.4</em> | |||||
</td> | </td> | ||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
@@ -237,8 +237,8 @@ can contain email addresses of the form:</p> | |||||
<td>inputencoding</td> | <td>inputencoding</td> | ||||
<td> | <td> | ||||
Specifies the encoding of the input file. Please | Specifies the encoding of the input file. Please | ||||
see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a> for a list of possible values. <em>Since Ant 1.9.4</em> | |||||
see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a> for a list of possible values. <em>Since Ant 1.9.4</em> | |||||
</td> | </td> | ||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
@@ -32,8 +32,8 @@ | |||||
file.</p> | file.</p> | ||||
<p>Manifests are processed according to | <p>Manifests are processed according to | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html">Jar file | |||||
specification</a>. Specifically, a manifest element consists of a set of attributes and | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html" target="_top">Jar | |||||
file specification</a>. Specifically, a manifest element consists of a set of attributes and | |||||
sections. These sections in turn may contain attributes. Note in particular that this may result in | sections. These sections in turn may contain attributes. Note in particular that this may result in | ||||
manifest lines greater than 72 bytes being wrapped and continued on the next line.</p> | manifest lines greater than 72 bytes being wrapped and continued on the next line.</p> | ||||
@@ -151,8 +151,8 @@ sections.</p> | |||||
attribute will take the value of the Ant property <code>${user.name}</code>. The same is true for | attribute will take the value of the Ant property <code>${user.name}</code>. The same is true for | ||||
the <code>${version}</code> and <code>${TODAY}</code> properties. This example produces | the <code>${version}</code> and <code>${TODAY}</code> properties. This example produces | ||||
a <samp>MANIFEST.MF</samp> that | a <samp>MANIFEST.MF</samp> that | ||||
contains <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">package | |||||
version identification</a> for the package <samp>common</samp>.</p> | |||||
contains <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779" | |||||
target="_top">package version identification</a> for the package <samp>common</samp>.</p> | |||||
<p>The manifest produced by the above would look like this:</p> | <p>The manifest produced by the above would look like this:</p> | ||||
@@ -31,9 +31,10 @@ | |||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Sends SMTP mail with MIME | <p>Sends SMTP mail with MIME | ||||
attachments. <a href="https://www.oracle.com/technetwork/java/index-138643.html">JavaMail</a> | |||||
and <a href="https://www.oracle.com/technetwork/java/javase/jaf-135115.html">Java Activation | |||||
Framework</a> are required for this task.</p> | |||||
attachments. <a href="https://www.oracle.com/technetwork/java/index-138643.html" | |||||
target="_top">JavaMail</a> | |||||
and <a href="https://www.oracle.com/technetwork/java/javase/jaf-135115.html" target="_top">Java | |||||
Activation Framework</a> are required for this task.</p> | |||||
<p>Multiple files can be attached using <a href="../Types/fileset.html">FileSets.</a></p> | <p>Multiple files can be attached using <a href="../Types/fileset.html">FileSets.</a></p> | ||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -99,7 +99,7 @@ complete without waiting for other nested tasks to complete in other threads.</p | |||||
is not set, the remaining tasks in other threads will continue to run until all threads have | is not set, the remaining tasks in other threads will continue to run until all threads have | ||||
completed. In this situation, the <code>parallel</code> task will also fail.</p> | completed. In this situation, the <code>parallel</code> task will also fail.</p> | ||||
<p>The <code>parallel</code> task may be combined with the <a href="sequential.html"> sequential</a> | |||||
<p>The <code>parallel</code> task may be combined with the <a href="sequential.html">sequential</a> | |||||
task to define sequences of tasks to be executed on each thread within the parallel block</p> | task to define sequences of tasks to be executed on each thread within the parallel block</p> | ||||
<p>The <var>threadCount</var> attribute can be used to place a maximum number of available threads | <p>The <var>threadCount</var> attribute can be used to place a maximum number of available threads | ||||
@@ -118,7 +118,7 @@ any <var>from</var> values are prefixes of other <var>from</var> values.</p> | |||||
<p>If the <var>refid</var> attribute is not specified, then one or more | <p>If the <var>refid</var> attribute is not specified, then one or more | ||||
nested <a href="../Types/resources.html#collection">resource collections</a> must be supplied.</p> | nested <a href="../Types/resources.html#collection">resource collections</a> must be supplied.</p> | ||||
<h4>mapper</h4> | <h4>mapper</h4> | ||||
<p>A single nested <a href="../Types/mapper.html"> <code><mapper></code></a> element can be | |||||
<p>A single nested <a href="../Types/mapper.html"><code><mapper></code></a> element can be | |||||
specified to perform any of various filename transformations (<em>since Ant 1.6.2</em>).</p> | specified to perform any of various filename transformations (<em>since Ant 1.6.2</em>).</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
@@ -58,8 +58,8 @@ from a property file.</p> | |||||
<p>A list of predefined properties can be | <p>A list of predefined properties can be | ||||
found <a href="../properties.html#built-in-props">here</a>.</p> | found <a href="../properties.html#built-in-props">here</a>.</p> | ||||
<p><em>Since Apache Ant 1.8.0</em>, it is possible to load properties defined in XML according | <p><em>Since Apache Ant 1.8.0</em>, it is possible to load properties defined in XML according | ||||
to <a href="http://java.sun.com/dtd/properties.dtd">Sun DTD</a>, when running on Java 5+. For this | |||||
the name of the file, resource or url has to end with <samp>.xml</samp>.</p> | |||||
to <a href="http://java.sun.com/dtd/properties.dtd" target="_top">Sun DTD</a>, when running on Java | |||||
5+. For this the name of the file, resource or url has to end with <samp>.xml</samp>.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -166,8 +166,8 @@ local definition is available (the table priority order being PROCESS, JOB, GROU | |||||
<p><em>Since Ant 1.8.2</em>, if Ant detects it is running on a Java 5 or newer, Ant will | <p><em>Since Ant 1.8.2</em>, if Ant detects it is running on a Java 5 or newer, Ant will | ||||
use <code>System.getenv()</code> rather than its own OS dependent native implementation. For some | use <code>System.getenv()</code> rather than its own OS dependent native implementation. For some | ||||
OSes this causes minor differences when compared to older versions of Ant. For a full list | OSes this causes minor differences when compared to older versions of Ant. For a full list | ||||
see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=49366">Bugzilla Issue 49366</a>. In | |||||
particular:</p> | |||||
see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=49366" target="_top">Bugzilla Issue | |||||
49366</a>. In particular:</p> | |||||
<ul> | <ul> | ||||
<li>On Windows, Ant will now return additional "environment variables" that correspond to the | <li>On Windows, Ant will now return additional "environment variables" that correspond to the | ||||
drive specific current working directories when Ant is run from the command line. The keys of | drive specific current working directories when Ant is run from the command line. The keys of | ||||
@@ -244,7 +244,8 @@ on a classpath. Here are some interesting facts about this feature</p> | |||||
<li>If the file is not there, nothing is printed except at <code>-verbose</code> log level. This | <li>If the file is not there, nothing is printed except at <code>-verbose</code> log level. This | ||||
lets you have optional configuration files for every project, that team members can customize. | lets you have optional configuration files for every project, that team members can customize. | ||||
<li>The rules for this format | <li>The rules for this format | ||||
match <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.InputStream-">java.util.Properties</a>.</li> | |||||
match <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.InputStream-" | |||||
target="_top">java.util.Properties</a>.</li> | |||||
<li>Trailing spaces are not stripped. It may have been what you wanted.</li> | <li>Trailing spaces are not stripped. It may have been what you wanted.</li> | ||||
<li>Want unusual characters? Escape them <code>\u0456</code> or <code>\"</code> style.</li> | <li>Want unusual characters? Escape them <code>\u0456</code> or <code>\"</code> style.</li> | ||||
<li>Ant Properties are expanded in the file</li> | <li>Ant Properties are expanded in the file</li> | ||||
@@ -265,8 +266,8 @@ deploy.url=http://${deploy.server}:${deploy.port}/</pre> | |||||
variables. So it starts a command in a new process which prints the environment variables, analyzes | variables. So it starts a command in a new process which prints the environment variables, analyzes | ||||
the output and creates the properties.<br/> There are commands for the following operating systems | the output and creates the properties.<br/> There are commands for the following operating systems | ||||
implemented | implemented | ||||
in <a href="https://git-wip-us.apache.org/repos/asf?p=ant.git;a=blob;f=src/main/org/apache/tools/ant/taskdefs/Execute.java;hb=refs/heads/master">Execute.java</a> | |||||
(method <code>getProcEnvCommand()</code>): | |||||
in <a href="https://git-wip-us.apache.org/repos/asf?p=ant.git;a=blob;f=src/main/org/apache/tools/ant/taskdefs/Execute.java;hb=refs/heads/master" | |||||
target="_top">Execute.java</a> (method <code>getProcEnvCommand()</code>): | |||||
</p> | </p> | ||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -54,7 +54,7 @@ an <var>updateonly</var> argument introduced.</p> | |||||
<h2 id="introduction">Introduction</h2> | <h2 id="introduction">Introduction</h2> | ||||
<p>The <code>pvcs</code> task allows the user of Ant to extract the latest edition of the source | <p>The <code>pvcs</code> task allows the user of Ant to extract the latest edition of the source | ||||
code from a PVCS repository. PVCS is a version control system developed | code from a PVCS repository. PVCS is a version control system developed | ||||
by <a href="http://www.serena.com/products/pvcs">Merant</a>.</p> | |||||
by <a href="http://www.serena.com/products/pvcs" target="_top">Merant</a>.</p> | |||||
<p>This version has been tested against PVCS version 6.5 and 6.6 under Windows and Solaris.</p> | <p>This version has been tested against PVCS version 6.5 and 6.6 under Windows and Solaris.</p> | ||||
<hr/> | <hr/> | ||||
@@ -66,16 +66,16 @@ are the choices:</p> | |||||
platform is chosen. If <code>build.rmic</code> is set to this, you get the default.</li> | platform is chosen. If <code>build.rmic</code> is set to this, you get the default.</li> | ||||
</ul> | </ul> | ||||
<p>The <a href="https://web.archive.org/web/20131225023602/http://dione.zcu.cz/~toman40/miniRMI/">miniRMI</a> | |||||
project contains a compiler implementation for this task as well, please consult miniRMI's | |||||
documentation to learn how to use it.</p> | |||||
<p>The <a href="https://web.archive.org/web/20131225023602/http://dione.zcu.cz/~toman40/miniRMI/" | |||||
target="_top">miniRMI</a> project contains a compiler implementation for this task as well, please | |||||
consult miniRMI's documentation to learn how to use it.</p> | |||||
<h4>CORBA support</h4> | <h4>CORBA support</h4> | ||||
<p>Java 11 removes the CORBA and JavaEE packages and <code>rmic</code> no longer supports | |||||
either <code>iiop</code> nor <code>idl</code>. Starting with Ant 1.10.3, the <code>rmic</code> task | |||||
will fail when using either while running Java 11+ unless you fork the task and explicitly specify an | |||||
executable.</p> | |||||
<p>Java 11 <a href="http://openjdk.java.net/jeps/320" target="_top">removes</a> the Java EE and | |||||
CORBA packages and <code>rmic</code> no longer supports either <code>iiop</code> | |||||
or <code>idl</code>. Starting with Ant 1.10.3, the <code>rmic</code> task will fail when using | |||||
either while running Java 11+ unless you fork the task and explicitly specify an executable.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -49,12 +49,13 @@ their URL equivalents.</p> | |||||
<li><code><dtd></code> elements which are used to resolve DTDs and entities.</li> | <li><code><dtd></code> elements which are used to resolve DTDs and entities.</li> | ||||
<li><code><attribute></code> elements which are used to set features on the parser. These | <li><code><attribute></code> elements which are used to set features on the parser. These | ||||
can be any number | can be any number | ||||
of <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><code>http://xml.org/sax/features/</code></a> | |||||
or other features that your parser may support.</li> | |||||
of <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description" | |||||
target="_top"><code>http://xml.org/sax/features/</code></a> or other features that your parser | |||||
may support.</li> | |||||
<li><code><property></code> elements, containing string properties</li> | <li><code><property></code> elements, containing string properties</li> | ||||
</ul> | </ul> | ||||
<p>The task only supports SAX2 or later parsers: it is an error to specify a esSAX1 parser.</p> | |||||
<p>The task only supports SAX2 or later parsers: it is an error to specify a SAX1 parser.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -168,10 +169,10 @@ their URL equivalents.</p> | |||||
perform entity resolution.</p> | perform entity resolution.</p> | ||||
<h4>attribute</h4> | <h4>attribute</h4> | ||||
<p>The <code><attribute></code> element is used to set parser features.<br/>Features usable | <p>The <code><attribute></code> element is used to set parser features.<br/>Features usable | ||||
with the xerces parser are defined | |||||
here: <a href="https://xml.apache.org/xerces-j/features.html">Setting features</a><br/>SAX features | |||||
are defined | |||||
here: <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><code>http://xml.org/sax/features/</code></a></p> | |||||
with the xerces parser are defined here: <a href="https://xml.apache.org/xerces-j/features.html" | |||||
target="_top">Setting features</a><br/>SAX features are defined | |||||
here: <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description" | |||||
target="_top"><code>http://xml.org/sax/features/</code></a></p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
<th>Attribute</th> | <th>Attribute</th> | ||||
@@ -193,8 +194,8 @@ here: <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html | |||||
<h4>property</h4> | <h4>property</h4> | ||||
<p>The <code><property></code> element is used to set properties. These properties are | <p>The <code><property></code> element is used to set properties. These properties are | ||||
defined here for the Xerces XML parser | defined here for the Xerces XML parser | ||||
implementation: <a href="https://xml.apache.org/xerces-j/properties.html">XML Parser properties</a> | |||||
Properties can be used to set the schema used to validate the XML file. | |||||
implementation: <a href="https://xml.apache.org/xerces-j/properties.html" target="_top">XML Parser | |||||
properties</a>. Properties can be used to set the schema used to validate the XML file. | |||||
</p> | </p> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -237,7 +238,7 @@ is why the <var>noNamespaceFile</var> is needed.</p> | |||||
documents against the relevant specifications. To validate XSD documents, you also | documents against the relevant specifications. To validate XSD documents, you also | ||||
need <samp>XMLSchema.dtd</samp> and <samp>datatypes.dtd</samp> in the same directory | need <samp>XMLSchema.dtd</samp> and <samp>datatypes.dtd</samp> in the same directory | ||||
as <samp>XMLSchema.xsd</samp>, or pointed to via the catalog. All these files can be fetched | as <samp>XMLSchema.xsd</samp>, or pointed to via the catalog. All these files can be fetched | ||||
from <a href="https://www.w3.org/2001/XMLSchema">W3C</a>.</p> | |||||
from <a href="https://www.w3.org/2001/XMLSchema" target="_top">W3C</a>.</p> | |||||
<pre><validate-soap file="xml/test.xsd"/></pre> | <pre><validate-soap file="xml/test.xsd"/></pre> | ||||
<p>Use the preset task defined above to validate an XML Schema document.</p> | <p>Use the preset task defined above to validate an XML Schema document.</p> | ||||
@@ -27,8 +27,8 @@ | |||||
<h2 id="script">Script</h2> | <h2 id="script">Script</h2> | ||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Execute a script in a <a href="https://jakarta.apache.org/bsf" target="_top">Apache BSF</a> | <p>Execute a script in a <a href="https://jakarta.apache.org/bsf" target="_top">Apache BSF</a> | ||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html">JSR | |||||
223</a> supported language. | |||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html" | |||||
target="_top">JSR 223</a> supported language. | |||||
</p> | </p> | ||||
<p><strong>Note</strong>: This task depends on external libraries not included in the Apache Ant | <p><strong>Note</strong>: This task depends on external libraries not included in the Apache Ant | ||||
distribution. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more | distribution. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more | ||||
@@ -46,15 +46,16 @@ Java API, see the <a href="../api/index.html">JavaDoc</a> (especially | |||||
for <a href="../api/org/apache/tools/ant/Project.html">Project</a> | for <a href="../api/org/apache/tools/ant/Project.html">Project</a> | ||||
and <a href="../api/org/apache/tools/ant/taskdefs/optional/Script.html">Script</a>) for more | and <a href="../api/org/apache/tools/ant/taskdefs/optional/Script.html">Script</a>) for more | ||||
information.</p> | information.</p> | ||||
<p>If you are using JavaScript under BSF, a good resource is <a target="_blank" | |||||
href="https://www.mozilla.org/rhino/doc.html">https://www.mozilla.org/rhino/doc.html</a> as we are | |||||
using their JavaScript interpreter.</p> | |||||
<p>If you are using JavaScript under BSF, a good resource | |||||
is <a href="https://www.mozilla.org/rhino/doc.html" | |||||
target="_top">https://www.mozilla.org/rhino/doc.html</a> as we are using their JavaScript | |||||
interpreter.</p> | |||||
<p>Scripts can do almost anything a task written in Java could do.</p> | <p>Scripts can do almost anything a task written in Java could do.</p> | ||||
<p>Rhino provides a special construct—the <code>JavaAdapter</code>. With that you can create | <p>Rhino provides a special construct—the <code>JavaAdapter</code>. With that you can create | ||||
an object which implements several interfaces, extends classes and for which you can overwrite | an object which implements several interfaces, extends classes and for which you can overwrite | ||||
methods. Because this is an undocumented feature (yet), here is the link to an | methods. Because this is an undocumented feature (yet), here is the link to an | ||||
explanation: <a href="https://groups.google.com/forum/#!msg/netscape.public.mozilla.jseng/YlRQE0OvM8c/F8Mvq-XkpxcJ">Google | |||||
Groups: "Rhino, enum.js, JavaAdapter?"</a> by Norris Boyd in the | |||||
explanation: <a href="https://groups.google.com/forum/#!msg/netscape.public.mozilla.jseng/YlRQE0OvM8c/F8Mvq-XkpxcJ" | |||||
target="_top">Google Groups: "Rhino, enum.js, JavaAdapter?"</a> by Norris Boyd in the | |||||
newsgroup <em>netscape.public.mozilla.jseng</em>.</p> | newsgroup <em>netscape.public.mozilla.jseng</em>.</p> | ||||
<p>If you are creating Targets programmatically, make sure you set the Location to a useful value. | <p>If you are creating Targets programmatically, make sure you set the Location to a useful value. | ||||
@@ -273,9 +274,9 @@ with <code>importClass(<strong>Packages</strong>.org.apache.tools.ant.util.FileU | |||||
The <code><script></code> task populates the Project instance under the | The <code><script></code> task populates the Project instance under the | ||||
name <code>project</code>, so we can use that reference. Another way is to use its given name or | name <code>project</code>, so we can use that reference. Another way is to use its given name or | ||||
getting its reference from the task itself.<br/> The Project provides methods for accessing and | getting its reference from the task itself.<br/> The Project provides methods for accessing and | ||||
setting properties, creating DataTypes and Tasks and much more.<br/> After creating a FileSet object | |||||
we initialize that by calling its set-methods. Then we can use that object like a normal Ant task | |||||
(<code><copy></code> for example).<br/> For getting the size of a file we instantiate | |||||
setting properties, creating DataTypes and Tasks and much more.<br/> After creating a FileSet | |||||
object we initialize that by calling its set-methods. Then we can use that object like a normal Ant | |||||
task (<code><copy></code> for example).<br/> For getting the size of a file we instantiate | |||||
a <code>java.io.File</code>. So we are using normal Java API here.<br/> Finally we use | a <code>java.io.File</code>. So we are using normal Java API here.<br/> Finally we use | ||||
the <code><echo></code> task for producing the output. The task is not executed by | the <code><echo></code> task for producing the output. The task is not executed by | ||||
its <code>execute()</code> method, because the <code>perform()</code> method (implemented in Task | its <code>execute()</code> method, because the <code>perform()</code> method (implemented in Task | ||||
@@ -312,8 +313,8 @@ paths to a referenced path. If the path does not exist, it will be created.</p> | |||||
project.addTaskDefinition("addtopath", AddToPath.class); | project.addTaskDefinition("addtopath", AddToPath.class); | ||||
</script></pre> | </script></pre> | ||||
<p>An example of using this task to create a path from a list of directories (using | <p>An example of using this task to create a path from a list of directories (using | ||||
antcontrib's <a href="http://ant-contrib.sourceforge.net/tasks/tasks/for.html"> <for></a> | |||||
task) follows:</p> | |||||
ant-contrib's <a href="http://ant-contrib.sourceforge.net/tasks/tasks/for.html" | |||||
target="_top"><for></a> task) follows:</p> | |||||
<pre> | <pre> | ||||
<path id="main.path"> | <path id="main.path"> | ||||
<fileset dir="build/classes"/> | <fileset dir="build/classes"/> | ||||
@@ -28,14 +28,13 @@ | |||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p><code>Scriptdef</code> can be used to define an Apache Ant task using a scripting language. Ant | <p><code>Scriptdef</code> can be used to define an Apache Ant task using a scripting language. Ant | ||||
scripting languages supported by <a href="https://jakarta.apache.org/bsf" target="_top">Apache | scripting languages supported by <a href="https://jakarta.apache.org/bsf" target="_top">Apache | ||||
BSF</a> | |||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html">JSR | |||||
223</a> may be used to define the script. <code>Scriptdef</code> provides a mechanism to encapsulate | |||||
control logic from a build within an Ant task minimizing the need for providing control style tasks | |||||
in Ant itself. Complex logic can be made available while retaining the simple structure of an Ant | |||||
build file. <code>Scriptdef</code> is also useful for prototyping new custom tasks. Certainly as the | |||||
complexity of the script increases it would be better to migrate the task definition into a Java | |||||
based custom task.</p> | |||||
BSF</a> or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html" | |||||
target="_top">JSR 223</a> may be used to define the script. <code>Scriptdef</code> provides a | |||||
mechanism to encapsulate control logic from a build within an Ant task minimizing the need for | |||||
providing control style tasks in Ant itself. Complex logic can be made available while retaining the | |||||
simple structure of an Ant build file. <code>Scriptdef</code> is also useful for prototyping new | |||||
custom tasks. Certainly as the complexity of the script increases it would be better to migrate the | |||||
task definition into a Java based custom task.</p> | |||||
<p><strong>Note</strong>: This task depends on external libraries not included in the Ant | <p><strong>Note</strong>: This task depends on external libraries not included in the Ant | ||||
distribution. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more | distribution. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more | ||||
@@ -282,9 +281,9 @@ beanshell jar.</p> | |||||
<h3>Testing scripts</h3> | <h3>Testing scripts</h3> | ||||
<p>The easiest way to test scripts is to use | |||||
the <a href="https://ant.apache.org/antlibs/antunit/">AntUnit</a> Ant library. This will run all | |||||
targets in a script that begin with <q>test</q> (and their dependencies).</p> | |||||
<p>The easiest way to test scripts is to use the <a href="https://ant.apache.org/antlibs/antunit/" | |||||
target="_top">AntUnit</a> Ant library. This will run all targets in a script that begin | |||||
with <q>test</q> (and their dependencies).</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -49,8 +49,8 @@ different sets of permissions to apply to either type of resource.</p> | |||||
<tr> | <tr> | ||||
<td>permissions</td> | <td>permissions</td> | ||||
<td>The permissions to set as comma separated list of names | <td>The permissions to set as comma separated list of names | ||||
of <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/PosixFilePermission.html">PosixFilePermission</a> | |||||
values.</td> | |||||
of <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/PosixFilePermission.html" | |||||
target="_top">PosixFilePermission</a> values.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -27,12 +27,13 @@ | |||||
<h2 id="signjar">SignJar</h2> | <h2 id="signjar">SignJar</h2> | ||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p>Signing a jar allows users to authenticate the publisher.</p> | <p>Signing a jar allows users to authenticate the publisher.</p> | ||||
<p>Signs JAR files with the <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jarsigner.html"><code>jarsigner</code> | |||||
command line tool</a>. It will take a named file in the <var>jar</var> attribute, and an | |||||
optional <var>destDir</var> or <var>signedJar</var> attribute. Nested paths are also supported; here | |||||
only an (optional) <var>destDir</var> is allowed. If a destination directory or explicit JAR file | |||||
name is not provided, JARs are signed in place.</p> | |||||
<p>Signs JAR files with | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jarsigner.html" | |||||
target="_top"><code>jarsigner</code> command line tool</a>. It will take a named file in | |||||
the <var>jar</var> attribute, and an optional <var>destDir</var> or <var>signedJar</var> | |||||
attribute. Nested paths are also supported; here only an (optional) <var>destDir</var> is | |||||
allowed. If a destination directory or explicit JAR file name is not provided, JARs are signed in | |||||
place.</p> | |||||
<p>Dependency rules</p> | <p>Dependency rules</p> | ||||
<ul> | <ul> | ||||
<li>Nonexistent destination JARs are created/signed</li> | <li>Nonexistent destination JARs are created/signed</li> | ||||
@@ -207,9 +208,9 @@ name is not provided, JARs are signed in place.</p> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<p>For instructions on generating a code signing certificate, see the <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/keytool.html">keytool | |||||
documentation</a> and/or instructions from your certificate authority.</p> | |||||
<p>For instructions on generating a code signing certificate, see | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/keytool.html" | |||||
target="_top">keytool documentation</a> and/or instructions from your certificate authority.</p> | |||||
<pre> | <pre> | ||||
<signjar jar="${dist}/lib/ant.jar" | <signjar jar="${dist}/lib/ant.jar" | ||||
alias="apache-group" storepass="secret"/></pre> | alias="apache-group" storepass="secret"/></pre> | ||||
@@ -40,8 +40,8 @@ | |||||
<p>These tasks provide an interface to | <p>These tasks provide an interface to | ||||
the <a href="https://msdn.microsoft.com/en-us/library/3h0544kx(v=vs.80).aspx" | the <a href="https://msdn.microsoft.com/en-us/library/3h0544kx(v=vs.80).aspx" | ||||
target="_top">Microsoft Visual SourceSafe</a> SCM | |||||
via <a href="https://sourcegear.com">SourceGear's</a> <a href="https://sourcegear.com/sos/">SourceOffSite</a> | |||||
target="_top">Microsoft Visual SourceSafe</a> SCM via <a href="https://sourcegear.com" | |||||
target="_top">SourceGear's</a> <a href="https://sourcegear.com/sos/" target="_top">SourceOffSite</a> | |||||
product. SourceOffSite is an add-on to Microsoft's VSS, that allows remote development teams and | product. SourceOffSite is an add-on to Microsoft's VSS, that allows remote development teams and | ||||
tele-commuters that need fast and secure read/write access to a centralized SourceSafe database via | tele-commuters that need fast and secure read/write access to a centralized SourceSafe database via | ||||
any TCP/IP connection. SOS provides Linux, Solaris & Windows | any TCP/IP connection. SOS provides Linux, Solaris & Windows | ||||
@@ -173,8 +173,8 @@ disabled with <code>-noproxy</code> option.</p> | |||||
<tr> | <tr> | ||||
<td>escapeprocessing</td> | <td>escapeprocessing</td> | ||||
<td>Control whether the Java statement object will perform escape substitution.<br/> | <td>Control whether the Java statement object will perform escape substitution.<br/> | ||||
See <a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#setEscapeProcessing-boolean-">Statement's | |||||
API docs</a> for details. <em>Since Ant 1.6</em>. | |||||
See <a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#setEscapeProcessing-boolean-" | |||||
target="_top">Statement's API docs</a> for details. <em>Since Ant 1.6</em>. | |||||
<td>No; defaults to <q>true</q></td> | <td>No; defaults to <q>true</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -319,7 +319,7 @@ for primitive types).</p> | |||||
<h4>outputproperty (<var>trax</var> processors only)</h4> | <h4>outputproperty (<var>trax</var> processors only)</h4> | ||||
<p>Used to specify how you wish the result tree to be output as specified in | <p>Used to specify how you wish the result tree to be output as specified in | ||||
the <a href="https://www.w3.org/TR/xslt#output"> XSLT specifications</a>. | |||||
the <a href="https://www.w3.org/TR/xslt#output" target="_top">XSLT specifications</a>. | |||||
<h5>Parameters</h5> | <h5>Parameters</h5> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -131,8 +131,8 @@ to <q>gzip</q>, <q>bzip2</q>, or <q>xz</q>.</p> | |||||
<td>encoding</td> | <td>encoding</td> | ||||
<td>The character encoding to use for filenames inside the tar file. For a list of possible | <td>The character encoding to use for filenames inside the tar file. For a list of possible | ||||
values see | values see | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a>.<br/><em>Since Ant 1.9.5</em> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a>.<br/><em>Since Ant 1.9.5</em> | |||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -98,7 +98,7 @@ a <var>type</var> selector to suppress this. This only applies to filesets nest | |||||
directly, not to filesets nested into a path or any other resource collection.</p> | directly, not to filesets nested into a path or any other resource collection.</p> | ||||
<h4>mapper</h4> | <h4>mapper</h4> | ||||
<p><em>Since Ant 1.6.3</em>, a nested <a href="../Types/mapper.html"> mapper</a> can be specified. | |||||
<p><em>Since Ant 1.6.3</em>, a nested <a href="../Types/mapper.html">mapper</a> can be specified. | |||||
Files specified via nested <code>fileset</code>s, <code>filelist</code>s, or the <code>file</code> | Files specified via nested <code>fileset</code>s, <code>filelist</code>s, or the <code>file</code> | ||||
attribute are mapped using the specified mapper. For each file mapped, the resulting files are | attribute are mapped using the specified mapper. For each file mapped, the resulting files are | ||||
touched. If no time has been specified and the original file exists its timestamp will be used. If | touched. If no time has been specified and the original file exists its timestamp will be used. If | ||||
@@ -59,12 +59,11 @@ ignored.</p> | |||||
</table> | </table> | ||||
<h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
<p>The task supports a <code><format></code> nested element that allows a | |||||
property to be set to the current date and time in a given format. The date/time patterns are as | |||||
defined in the | |||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a> | |||||
class. The format element also allows offsets to be applied to the time to generate different time | |||||
values.</p> | |||||
<p>The task supports a <code><format></code> nested element that allows a property to be set | |||||
to the current date and time in a given format. The date/time patterns are as defined in the | |||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html" | |||||
target="_top">SimpleDateFormat</a> class. The format element also allows offsets to be applied to | |||||
the time to generate different time values.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
<th>Attribute</th> | <th>Attribute</th> | ||||
@@ -85,8 +84,8 @@ values.</p> | |||||
<tr> | <tr> | ||||
<td>timezone</td> | <td>timezone</td> | ||||
<td>The timezone to use for displaying time. The values are as defined by the | <td>The timezone to use for displaying time. The values are as defined by the | ||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html">TimeZone</a> | |||||
class.</td> | |||||
Java <a href="https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html" | |||||
target="_top">TimeZone</a> class.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -115,8 +114,8 @@ values.</p> | |||||
<td>The locale used to create date/time string. The general form is <q>language[, country[, | <td>The locale used to create date/time string. The general form is <q>language[, country[, | ||||
variant]]</q> (either <q>variant</q> or both <q>variant</q> and <q>country</q> may be | variant]]</q> (either <q>variant</q> or both <q>variant</q> and <q>country</q> may be | ||||
omitted). For more information please refer to documentation for | omitted). For more information please refer to documentation for | ||||
the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html">Locale</a> | |||||
class.</td> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html" | |||||
target="_top">Locale</a> class.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -45,17 +45,18 @@ attributes point to files in the format of Java property files or an xml format. | |||||
<p>If you are defining tasks or types that share the same classpath with | <p>If you are defining tasks or types that share the same classpath with | ||||
multiple <code>taskdef</code> or <code>typedef</code> tasks, the corresponding classes will be | multiple <code>taskdef</code> or <code>typedef</code> tasks, the corresponding classes will be | ||||
loaded by different | loaded by different | ||||
Java <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html">ClassLoaders</a>. | |||||
Two classes with the same name loaded via different ClassLoaders are not the same class from the | |||||
point of view of JVM, they don't share static variables and instances of these classes can't access | |||||
private methods or attributes of instances defined by "the other class" of the same name. They | |||||
don't even belong to the same Java package and can't access package private code, either.</p> | |||||
Java <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" | |||||
target="_top">ClassLoaders</a>. Two classes with the same name loaded via different ClassLoaders | |||||
are not the same class from the point of view of JVM, they don't share static variables and | |||||
instances of these classes can't access private methods or attributes of instances defined by "the | |||||
other class" of the same name. They don't even belong to the same Java package and can't access | |||||
package private code, either.</p> | |||||
<p>The best way to load several tasks/types that are supposed to cooperate with each other via | <p>The best way to load several tasks/types that are supposed to cooperate with each other via | ||||
shared Java code is to use the <var>resource</var> attribute and an <code>antlib</code> descriptor. | shared Java code is to use the <var>resource</var> attribute and an <code>antlib</code> descriptor. | ||||
If this is not possible, the second best option is to use the <var>loaderref</var> attribute and | If this is not possible, the second best option is to use the <var>loaderref</var> attribute and | ||||
specify the same name for each and every <code>typedef</code>/<code>taskdef</code> -- this way the | |||||
classes will share the same <code>ClassLoader</code>. Note that | |||||
specify the same name for each and every <code>typedef</code>/<code>taskdef</code>—this way | |||||
the classes will share the same <code>ClassLoader</code>. Note that | |||||
the <code>typedef</code>/<code>taskdef</code> tasks must use identical classpath definitions (this | the <code>typedef</code>/<code>taskdef</code> tasks must use identical classpath definitions (this | ||||
includes the order of path components) for the <var>loaderref</var> attribute to work.</p> | includes the order of path components) for the <var>loaderref</var> attribute to work.</p> | ||||
@@ -90,10 +90,10 @@ extract an Ant generated ZIP archive.</p> | |||||
<td>encoding</td> | <td>encoding</td> | ||||
<td>The character encoding that has been used for filenames inside the zip file. For a list of | <td>The character encoding that has been used for filenames inside the zip file. For a list of | ||||
possible values see | possible values see | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a>.<br/> Use the magic value <q>native-encoding</q> for default JVM character | |||||
encoding.<br/> See also the <a href="zip.html#encoding">discussion in the zip task | |||||
page</a></td> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a>.<br/> Use the magic value <q>native-encoding</q> for | |||||
default JVM character encoding.<br/> See also the <a href="zip.html#encoding">discussion in | |||||
the zip task page</a></td> | |||||
<td>No; defaults to <q>UTF8</q> for <code>unzip</code> and default JVM character encoding | <td>No; defaults to <q>UTF8</q> for <code>unzip</code> and default JVM character encoding | ||||
for <code>untar</code> task</td> | for <code>untar</code> task</td> | ||||
</tr> | </tr> | ||||
@@ -36,8 +36,9 @@ one can specify any SAX1/2 parser if needed.</p> | |||||
<li><code><dtd></code> elements which are used to resolve DTDs and entities</li> | <li><code><dtd></code> elements which are used to resolve DTDs and entities</li> | ||||
<li><code><attribute></code> elements which are used to set features on the parser. These | <li><code><attribute></code> elements which are used to set features on the parser. These | ||||
can be any number | can be any number | ||||
of <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><code>http://xml.org/sax/features/</code></a> | |||||
or other features that your parser may support.</li> | |||||
of <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description" | |||||
target="_top"><code>http://xml.org/sax/features/</code></a> or other features that your parser | |||||
may support.</li> | |||||
<li><code><property></code> elements, containing string properties</li> | <li><code><property></code> elements, containing string properties</li> | ||||
</ul> | </ul> | ||||
@@ -117,9 +118,10 @@ perform entity resolution.</p> | |||||
<h4>attribute</h4> | <h4>attribute</h4> | ||||
<p>The <code><attribute></code> element is used to set parser features.</p> | <p>The <code><attribute></code> element is used to set parser features.</p> | ||||
<p>Features usable with the Xerces parser are defined | <p>Features usable with the Xerces parser are defined | ||||
here: <a href="https://xml.apache.org/xerces-j/features.html">Setting features</a></p> | |||||
here: <a href="https://xml.apache.org/xerces-j/features.html" target="_top">Setting features</a></p> | |||||
<p>SAX features are defined | <p>SAX features are defined | ||||
here: <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"><code>http://xml.org/sax/features/</code></a></p> | |||||
here: <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description" | |||||
target="_top"><code>http://xml.org/sax/features/</code></a></p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
<th>Attribute</th> | <th>Attribute</th> | ||||
@@ -141,8 +143,8 @@ here: <a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html | |||||
<h4>property</h4> | <h4>property</h4> | ||||
<p>The <code><property></code> element is used to set properties. These properties are | <p>The <code><property></code> element is used to set properties. These properties are | ||||
defined here for the Xerces XML parser | defined here for the Xerces XML parser | ||||
implementation: <a href="https://xml.apache.org/xerces-j/properties.html">XML Parser properties</a> | |||||
Properties can be used to set the schema used to validate the XML file.</p> | |||||
implementation: <a href="https://xml.apache.org/xerces-j/properties.html" target="_top">XML Parser | |||||
properties</a>. Properties can be used to set the schema used to validate the XML file.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
<th>Attribute</th> | <th>Attribute</th> | ||||
@@ -81,10 +81,10 @@ see <a href="#encoding">below</a></p> | |||||
<p><em>Since Ant 1.5.2</em>, <code><zip></code> can store Unix permissions inside the archive | <p><em>Since Ant 1.5.2</em>, <code><zip></code> can store Unix permissions inside the archive | ||||
(see description of the <var>filemode</var> and <var>dirmode</var> attributes | (see description of the <var>filemode</var> and <var>dirmode</var> attributes | ||||
for <a href="../Types/zipfileset.html"><zipfileset></a>). Unfortunately there is no portable | for <a href="../Types/zipfileset.html"><zipfileset></a>). Unfortunately there is no portable | ||||
way to store these permissions. Ant uses the algorithm used | |||||
by <a href="http://www.info-zip.org">Info-Zip's</a> implementation of the <code>zip</code> | |||||
and <code>unzip</code> commands—these are the default versions of <code>zip</code> | |||||
and <code>unzip</code> for many Unix(-like) systems.</p> | |||||
way to store these permissions. Ant uses the algorithm used by <a href="http://www.info-zip.org" | |||||
target="_top">Info-Zip's</a> implementation of the <code>zip</code> and <code>unzip</code> | |||||
commands—these are the default versions of <code>zip</code> and <code>unzip</code> for many | |||||
Unix(-like) systems.</p> | |||||
<p><strong>Please note that the zip format allows multiple files of the same fully-qualified name to | <p><strong>Please note that the zip format allows multiple files of the same fully-qualified name to | ||||
exist within a single archive. This has been documented as causing various problems for | exist within a single archive. This has been documented as causing various problems for | ||||
@@ -143,8 +143,8 @@ extract an Ant generated ZIP archive.</p> | |||||
<td>encoding</td> | <td>encoding</td> | ||||
<td>The character encoding to use for filenames inside the zip file. For a list of possible | <td>The character encoding to use for filenames inside the zip file. For a list of possible | ||||
values see | values see | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a>.</td> | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a>.</td> | |||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -29,32 +29,31 @@ | |||||
The <code>assertions</code> type enables or disables the Java 1.4 assertions feature, on a whole | The <code>assertions</code> type enables or disables the Java 1.4 assertions feature, on a whole | ||||
Java program, or components of a program. It can be used | Java program, or components of a program. It can be used | ||||
in <a href="../Tasks/java.html"><code><java></code></a> | in <a href="../Tasks/java.html"><code><java></code></a> | ||||
and <a href="../Tasks/junit.html"><code><junit></code></a> to add extra validation to | |||||
code. | |||||
and <a href="../Tasks/junit.html"><code><junit></code></a> to add extra validation to code. | |||||
<p> | <p> | ||||
Assertions are covered in | Assertions are covered in | ||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html">Java | |||||
SE documentation</a>, and | |||||
the <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.10">Java | |||||
Language Specification</a>. | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html" | |||||
target="_top">Java SE documentation</a>, and | |||||
the <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.10" | |||||
target="_top">Java Language Specification</a>. | |||||
<p> | <p> | ||||
The key points to note are that a <code>java.lang.AssertionError</code> is thrown when an | |||||
assertion fails, and that the facility is only available on Java 1.4 and later. To enable | |||||
assertions one must set <var>source</var>=<q>1.4</q> (or later) in <code><javac></code> | |||||
when the source is being compiled, and that the code must contain <code>assert</code> statements | |||||
to be tested. The result of such an action is code that neither compiles or runs on earlier | |||||
versions of Java. For this reason Apache Ant itself currently contains no assertions. | |||||
The key points to note are that a <code>java.lang.AssertionError</code> is thrown when an assertion | |||||
fails, and that the facility is only available on Java 1.4 and later. To enable assertions one must | |||||
set <var>source</var>=<q>1.4</q> (or later) in <code><javac></code> when the source is being | |||||
compiled, and that the code must contain <code>assert</code> statements to be tested. The result of | |||||
such an action is code that neither compiles or runs on earlier versions of Java. For this reason | |||||
Apache Ant itself currently contains no assertions. | |||||
<p> | <p> | ||||
When assertions are enabled (or disabled) in a task through nested assertions elements, the | |||||
class loader or command line is modified with the appropriate options. This means that the JVM | |||||
executed must be of version 1.4 or later, even if there are no assertions in the | |||||
code. Attempting to enable assertions on earlier JVMs will result in an "Unrecognized option" | |||||
error and the JVM will not start. | |||||
<p> | <p> | ||||
When assertions are enabled (or disabled) in a task through nested assertions elements, the class | |||||
loader or command line is modified with the appropriate options. This means that the JVM executed | |||||
must be of version 1.4 or later, even if there are no assertions in the code. Attempting to enable | |||||
assertions on earlier JVMs will result in an "Unrecognized option" error and the JVM will not start. | |||||
</p> | |||||
<h4>Attributes</h4> | <h4>Attributes</h4> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -70,18 +69,19 @@ error and the JVM will not start. | |||||
</table> | </table> | ||||
<p> | <p> | ||||
When system assertions have been neither enabled nor disabled, then the JVM is not given any | When system assertions have been neither enabled nor disabled, then the JVM is not given any | ||||
assertion information—the default action of the current JVMs is to disable system | |||||
assertions. | |||||
assertion information—the default action of the current JVMs is to disable system assertions. | |||||
</p> | |||||
<p> | <p> | ||||
Note also that there is no apparent documentation for what parts of the JRE come with useful | Note also that there is no apparent documentation for what parts of the JRE come with useful | ||||
assertions. | assertions. | ||||
</p> | |||||
<h3>Nested elements</h3> | <h3>Nested elements</h3> | ||||
<h4>enable</h4> | <h4>enable</h4> | ||||
<p> | <p> | ||||
Enable assertions in portions of code. If neither a package nor class is specified, assertions | |||||
are turned on in <em>all</em> (user) code. | |||||
Enable assertions in portions of code. If neither a package nor class is specified, assertions are | |||||
turned on in <em>all</em> (user) code. | |||||
</p> | </p> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -96,10 +96,8 @@ are turned on in <em>all</em> (user) code. | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>package</td> | <td>package</td> | ||||
<td> | |||||
The name of a package in which to enable assertions on all classes. (Includes subpackages.) | |||||
Use <q>...</q> for the anonymous package. | |||||
</td> | |||||
<td>The name of a package in which to enable assertions on all classes. (Includes subpackages.) | |||||
Use <q>...</q> for the anonymous package.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -121,10 +119,8 @@ Disable assertions in portions of code. | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>package</td> | <td>package</td> | ||||
<td> | |||||
The name of a package in which to disable assertions on all classes. (Includes subpackages.) | |||||
Use <q>...</q> for the anonymous package. | |||||
</td> | |||||
<td>The name of a package in which to disable assertions on all classes. (Includes subpackages.) | |||||
Use <q>...</q> for the anonymous package.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -136,63 +132,57 @@ have been enabled in a parent package. | |||||
<h5>Example: enable assertions in all user classes</h5> | <h5>Example: enable assertions in all user classes</h5> | ||||
All classes not in the JRE (i.e. all non-system classes) will have assertions turned on. | |||||
<p>All classes not in the JRE (i.e. all non-system classes) will have assertions turned on.</p> | |||||
<pre> | <pre> | ||||
<assertions> | <assertions> | ||||
<enable/> | <enable/> | ||||
</assertions> | |||||
</pre> | |||||
</assertions></pre> | |||||
<h5>Example: enable a single class</h5> | <h5>Example: enable a single class</h5> | ||||
Enable assertions in a class called Test | |||||
<p>Enable assertions in a class called Test</p> | |||||
<pre> | <pre> | ||||
<assertions> | <assertions> | ||||
<enable class="Test"/> | <enable class="Test"/> | ||||
</assertions> | |||||
</pre> | |||||
</assertions></pre> | |||||
<h5>Example: enable a package</h5> | <h5>Example: enable a package</h5> | ||||
Enable assertions in the <code>org.apache</code> package and all packages starting with | |||||
the <code>org.apache.</code> prefix | |||||
<p>Enable assertions in the <code>org.apache</code> package and all packages starting with | |||||
the <code>org.apache.</code> prefix</p> | |||||
<pre> | <pre> | ||||
<assertions> | <assertions> | ||||
<enable package="org.apache"/> | <enable package="org.apache"/> | ||||
</assertions> | |||||
</pre> | |||||
</assertions></pre> | |||||
<h5>Example: System assertions</h5> | <h5>Example: System assertions</h5> | ||||
Enable system assertions and assertions in all <code>org.apache</code> packages except for Ant | |||||
(but including <code>org.apache.tools.ant.Main</code>) | |||||
<p>Enable system assertions and assertions in all <code>org.apache</code> packages except for Ant | |||||
(but including <code>org.apache.tools.ant.Main</code>)</p> | |||||
<pre> | <pre> | ||||
<assertions enableSystemAssertions="true"> | <assertions enableSystemAssertions="true"> | ||||
<enable package="org.apache"/> | <enable package="org.apache"/> | ||||
<disable package="org.apache.tools.ant"/> | <disable package="org.apache.tools.ant"/> | ||||
<enable class="org.apache.tools.ant.Main"/> | <enable class="org.apache.tools.ant.Main"/> | ||||
</assertions> | |||||
</pre> | |||||
</assertions></pre> | |||||
<h5>Example: disabled and anonymous package assertions</h5> | <h5>Example: disabled and anonymous package assertions</h5> | ||||
Disable system assertions; enable those in the anonymous package | |||||
<p>Disable system assertions; enable those in the anonymous package</p> | |||||
<pre> | <pre> | ||||
<assertions enableSystemAssertions="false"> | <assertions enableSystemAssertions="false"> | ||||
<enable package="..."/> | <enable package="..."/> | ||||
</assertions> | |||||
</pre> | |||||
</assertions></pre> | |||||
<h5>Example: referenced assertions</h5> | <h5>Example: referenced assertions</h5> | ||||
This type is a datatype, so you can declare assertions and use them later | |||||
<p>This type is a datatype, so you can declare assertions and use them later</p> | |||||
<pre> | <pre> | ||||
<assertions id="project.assertions"> | <assertions id="project.assertions"> | ||||
<enable package="org.apache.test"/> | <enable package="org.apache.test"/> | ||||
</assertions> | </assertions> | ||||
<assertions refid="project.assertions"/> | |||||
</pre> | |||||
<assertions refid="project.assertions"/></pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -23,15 +23,15 @@ | |||||
<body> | <body> | ||||
<h2 id="fileset">Extension</h2> | <h2 id="fileset">Extension</h2> | ||||
<p>Utility type that represents either an available "Optional Package" (formerly known as | |||||
"Standard Extension") as described in the manifest of a JAR file, or the requirement for such | |||||
an optional package.</p> | |||||
<p>Utility type that represents either an available "Optional Package" (formerly known as "Standard | |||||
Extension") as described in the manifest of a JAR file, or the requirement for such an optional | |||||
package.</p> | |||||
<p>Note that this type works with extensions as defined by the "Optional Package" specification. | <p>Note that this type works with extensions as defined by the "Optional Package" specification. | ||||
For more information about optional packages, see the document <em>Optional Package | |||||
Versioning</em> in the documentation bundle for your Java Standard Edition package, in | |||||
For more information about optional packages, see the document <em>Optional Package Versioning</em> | |||||
in the documentation bundle for your Java Standard Edition package, in | |||||
file <samp>guide/extensions/versioning.html</samp> or the | file <samp>guide/extensions/versioning.html</samp> or the | ||||
online <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">Package | |||||
Versioning documentation.</a></p> | |||||
online <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779" | |||||
target="_top">Package Versioning documentation.</a></p> | |||||
<h3>Attributes</h3> | <h3>Attributes</h3> | ||||
<p>The extension type supports the following attributes:</p> | <p>The extension type supports the following attributes:</p> | ||||
@@ -50,7 +50,7 @@ Versioning documentation.</a></p> | |||||
<tr> | <tr> | ||||
<td>specificationVersion</td> | <td>specificationVersion</td> | ||||
<td>The version of extension specification (must be in dewey decimal aka dotted decimal | <td>The version of extension specification (must be in dewey decimal aka dotted decimal | ||||
notation, eg <q>3.2.4</q>)</td> | |||||
notation, eg <q>3.2.4</q>)</td> | |||||
<td>no</td> | <td>no</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -61,7 +61,7 @@ Versioning documentation.</a></p> | |||||
<tr> | <tr> | ||||
<td>implementationVersion</td> | <td>implementationVersion</td> | ||||
<td>The version of extension implementation (must be in dewey decimal aka dotted decimal | <td>The version of extension implementation (must be in dewey decimal aka dotted decimal | ||||
notation, eg <q>3.2.4</q>)</td> | |||||
notation, eg <q>3.2.4</q>)</td> | |||||
<td>no</td> | <td>no</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -25,11 +25,11 @@ | |||||
<h2><a>ExtensionSet</a></h2> | <h2><a>ExtensionSet</a></h2> | ||||
<p>Utility type that represents a set of Extensions.</p> | <p>Utility type that represents a set of Extensions.</p> | ||||
<p>Note that this type works with extensions as defined by the "Optional Package" specification. | <p>Note that this type works with extensions as defined by the "Optional Package" specification. | ||||
For more information about optional packages, see the document <em>Optional Package | |||||
Versioning</em> in the documentation bundle for your Java Standard Edition package, in | |||||
For more information about optional packages, see the document <em>Optional Package Versioning</em> | |||||
in the documentation bundle for your Java Standard Edition package, in | |||||
file <samp>guide/extensions/versioning.html</samp> or online | file <samp>guide/extensions/versioning.html</samp> or online | ||||
at <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">Package | |||||
Versioning documentation.</a></p> | |||||
at <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779" | |||||
target="_top">Package Versioning documentation.</a></p> | |||||
<h3>Nested elements</h3> | <h3>Nested elements</h3> | ||||
@@ -37,13 +37,12 @@ Versioning documentation.</a></p> | |||||
<p><a href="extension.html">Extension</a> object to add to set.</p> | <p><a href="extension.html">Extension</a> object to add to set.</p> | ||||
<h4>fileset</h4> | <h4>fileset</h4> | ||||
<p><a href="fileset.html">FileSet</a>s all files contained contained within set that are jars | |||||
and implement an extension are added to extension set.</p> | |||||
<p><a href="fileset.html">FileSet</a>s all files contained contained within set that are jars and | |||||
implement an extension are added to extension set.</p> | |||||
<h4>libfileset</h4> | <h4>libfileset</h4> | ||||
<p>All files contained contained within set that are jars and implement an extension are added | |||||
to extension set. However, the extension information may be modified by attributes of | |||||
libfileset.</p> | |||||
<p>All files contained contained within set that are jars and implement an extension are added to | |||||
extension set. However, the extension information may be modified by attributes of libfileset.</p> | |||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<pre> | <pre> | ||||
@@ -28,22 +28,22 @@ that contained the string <q>blee</q> from the first 10 lines of a text file <sa | |||||
(<em>you wouldn't want to filter a binary file</em>) to a file <samp>bar</samp>, you would do | (<em>you wouldn't want to filter a binary file</em>) to a file <samp>bar</samp>, you would do | ||||
something like:</p> | something like:</p> | ||||
<pre>cat foo|head -n10|grep blee > bar</pre> | <pre>cat foo|head -n10|grep blee > bar</pre> | ||||
<p>Apache Ant was not flexible enough. There was no way for the <code><copy></code> task | |||||
to do something similar. If you wanted the <code><copy></code> task to get the first 10 | |||||
lines, you would have had to create special attributes:</p> | |||||
<p>Apache Ant was not flexible enough. There was no way for the <code><copy></code> task to | |||||
do something similar. If you wanted the <code><copy></code> task to get the first 10 lines, | |||||
you would have had to create special attributes:</p> | |||||
<pre><copy file="foo" tofile="bar" head="10" contains="blee"/></pre> | <pre><copy file="foo" tofile="bar" head="10" contains="blee"/></pre> | ||||
<p>The obvious problem thus surfaced: Ant tasks would not be able to accommodate such data | <p>The obvious problem thus surfaced: Ant tasks would not be able to accommodate such data | ||||
transformation attributes as they would be endless. The task would also not know in which order | transformation attributes as they would be endless. The task would also not know in which order | ||||
these attributes were to be interpreted. That is, must the task execute the contains attribute | these attributes were to be interpreted. That is, must the task execute the contains attribute | ||||
first and then the head attribute or vice-versa? What Ant tasks needed was a mechanism to allow | first and then the head attribute or vice-versa? What Ant tasks needed was a mechanism to allow | ||||
pluggable filter (data transformer) chains. Ant would provide a few filters for which there | |||||
have been repeated requests. Users with special filtering needs would be able to easily write | |||||
their own and plug them in.</p> | |||||
pluggable filter (data transformer) chains. Ant would provide a few filters for which there have | |||||
been repeated requests. Users with special filtering needs would be able to easily write their own | |||||
and plug them in.</p> | |||||
<p>The solution was to refactor data transformation oriented tasks to support FilterChains. A | <p>The solution was to refactor data transformation oriented tasks to support FilterChains. A | ||||
FilterChain is a group of ordered FilterReaders. Users can define their own FilterReaders by | |||||
just extending the <code>java.io.FilterReader</code> class. Such custom FilterReaders can be | |||||
easily plugged in as nested elements of <code><filterchain></code> by | |||||
FilterChain is a group of ordered FilterReaders. Users can define their own FilterReaders by just | |||||
extending the <code>java.io.FilterReader</code> class. Such custom FilterReaders can be easily | |||||
plugged in as nested elements of <code><filterchain></code> by | |||||
using <code><filterreader></code> elements.</p> | using <code><filterreader></code> elements.</p> | ||||
<p>Example:</p> | <p>Example:</p> | ||||
<pre> | <pre> | ||||
@@ -114,14 +114,13 @@ also.</p> | |||||
<h3 id="filterreader">FilterReader</h3> | <h3 id="filterreader">FilterReader</h3> | ||||
<p>The <code>filterreader</code> element is the generic way to define a filter. User defined | |||||
filter elements are defined in the build file using this. Please note that built in filter | |||||
readers can also be defined using this syntax.</p> | |||||
<p>The <code>filterreader</code> element is the generic way to define a filter. User defined filter | |||||
elements are defined in the build file using this. Please note that built in filter readers can | |||||
also be defined using this syntax.</p> | |||||
<p>A FilterReader element must be supplied with a class name as an attribute value. The class | <p>A FilterReader element must be supplied with a class name as an attribute value. The class | ||||
resolved by this name must extend <code>java.io.FilterReader</code>. If the custom filter | |||||
reader needs to be parameterized, it must | |||||
implement <code>org.apache.tools.type.Parameterizable</code>.</p> | |||||
resolved by this name must extend <code>java.io.FilterReader</code>. If the custom filter reader | |||||
needs to be parameterized, it must implement <code>org.apache.tools.type.Parameterizable</code>.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -138,23 +137,22 @@ implement <code>org.apache.tools.type.Parameterizable</code>.</p> | |||||
<h4>Nested elements</h4> | <h4>Nested elements</h4> | ||||
<p><code><filterreader></code> supports <code><classpath></code> | <p><code><filterreader></code> supports <code><classpath></code> | ||||
and <code><param></code> as nested elements. Each <code><param></code> element may | |||||
take in the following attributes—<var>name</var>, <var>type</var> and <var>value</var>.</p> | |||||
and <code><param></code> as nested elements. Each <code><param></code> element may take | |||||
in the following attributes—<var>name</var>, <var>type</var> and <var>value</var>.</p> | |||||
<p>The following FilterReaders are supplied with the default distribution.</p> | <p>The following FilterReaders are supplied with the default distribution.</p> | ||||
<h3 id="classconstants">ClassConstants</h3> | <h3 id="classconstants">ClassConstants</h3> | ||||
<p>This filters basic constants defined in a Java Class, and outputs them in lines composed of | |||||
the format <em>name</em>=<em>value</em>. This filter uses the BCEL library to understand the | |||||
Java Class file. See <a href="../install.html#librarydependencies">Library Dependencies</a>.</p> | |||||
<p><strong>Important</strong>: This filter is different from most of the other filters. Most of | |||||
the filters operate on a sequence of characters. This filter operates on the sequence of bytes | |||||
that makes up a class. However the bytes arrive to the filter as a sequence of characters. This | |||||
means that one must be careful on the choice of character encoding to use. Most encodings lose | |||||
information on conversion from an arbitrary sequence of bytes to characters and back again to | |||||
bytes. In particular, the usual default character encodings (CP1252 and UTF-8) do. For this | |||||
reason, <em>since Ant 1.7</em>, the character encoding <strong>ISO-8859-1</strong> is used to | |||||
convert from characters back to bytes, so one <strong>has</strong> to use this encoding for | |||||
reading the java class file.</p> | |||||
<p>This filters basic constants defined in a Java Class, and outputs them in lines composed of the | |||||
format <em>name</em>=<em>value</em>. This filter uses the BCEL library to understand the Java Class | |||||
file. See <a href="../install.html#librarydependencies">Library Dependencies</a>.</p> | |||||
<p><strong>Important</strong>: This filter is different from most of the other filters. Most of the | |||||
filters operate on a sequence of characters. This filter operates on the sequence of bytes that | |||||
makes up a class. However the bytes arrive to the filter as a sequence of characters. This means | |||||
that one must be careful on the choice of character encoding to use. Most encodings lose information | |||||
on conversion from an arbitrary sequence of bytes to characters and back again to bytes. In | |||||
particular, the usual default character encodings (CP1252 and UTF-8) do. For this reason, <em>since | |||||
Ant 1.7</em>, the character encoding <strong>ISO-8859-1</strong> is used to convert from characters | |||||
back to bytes, so one <strong>has</strong> to use this encoding for reading the Java class file.</p> | |||||
<h4>Example</h4> | <h4>Example</h4> | ||||
<p>This loads the basic constants defined in a Java class as Ant properties.</p> | <p>This loads the basic constants defined in a Java class as Ant properties.</p> | ||||
@@ -203,8 +201,8 @@ Unicode escape backslash u plus 4 digits.</p> | |||||
</loadproperties></pre> | </loadproperties></pre> | ||||
<h3 id="expandproperties">ExpandProperties</h3> | <h3 id="expandproperties">ExpandProperties</h3> | ||||
<p>If the data contains data that represents Ant properties (of the form <code>${...}</code>), | |||||
that is substituted with the property's actual value.</p> | |||||
<p>If the data contains data that represents Ant properties (of the form <code>${...}</code>), that | |||||
is substituted with the property's actual value.</p> | |||||
<h4>Example</h4> | <h4>Example</h4> | ||||
@@ -663,8 +661,8 @@ them.</p> | |||||
<h3 id="striplinecomments">StripLineComments</h3> | <h3 id="striplinecomments">StripLineComments</h3> | ||||
<p>This filter removes all those lines that begin with strings that represent comments as | |||||
specified by the user.</p> | |||||
<p>This filter removes all those lines that begin with strings that represent comments as specified | |||||
by the user.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -764,8 +762,8 @@ and <q>//</q></p> | |||||
<p> | <p> | ||||
<h4>Background</h4> | <h4>Background</h4> | ||||
<p>With HeadFilter and TailFilter you can extract each part of a text file you want. This | |||||
graphic shows the dependencies:</p> | |||||
<p>With HeadFilter and TailFilter you can extract each part of a text file you want. This graphic | |||||
shows the dependencies:</p> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -1120,15 +1118,14 @@ following are understood: <q>\n</q>, <q>\r</q>, <q>\f</q>, <q>\t</q> and <q>\\</ | |||||
</p> | </p> | ||||
<p> | <p> | ||||
Some of the filters may be used directly within a <code>filterchain</code>. In this case | Some of the filters may be used directly within a <code>filterchain</code>. In this case | ||||
a <code>tokenfilter</code> is created implicitly. An extra attribute <var>byline</var> is added | |||||
to the filter to specify whether to use a <code>linetokenizer</code> | |||||
(<var>byline</var>=<q>true</q>) or a <code>filetokenizer</code> | |||||
(<var>byline</var>=<q>false</q>). The default is <q>true</q>. | |||||
a <code>tokenfilter</code> is created implicitly. An extra attribute <var>byline</var> is added to | |||||
the filter to specify whether to use a <code>linetokenizer</code> (<var>byline</var>=<q>true</q>) or | |||||
a <code>filetokenizer</code> (<var>byline</var>=<q>false</q>). The default is <q>true</q>. | |||||
</p> | </p> | ||||
<h4 id="linetokenizer">LineTokenizer</h4> | <h4 id="linetokenizer">LineTokenizer</h4> | ||||
<p>This tokenizer splits the input into lines. The tokenizer delimits lines | |||||
by <q>\r</q>, <q>\n</q> or <q>\r\n</q>. This is the default tokenizer.</p> | |||||
<p>This tokenizer splits the input into lines. The tokenizer delimits lines by <q>\r</q>, <q>\n</q> | |||||
or <q>\r\n</q>. This is the default tokenizer.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
<th>Attribute</th> | <th>Attribute</th> | ||||
@@ -1451,8 +1448,8 @@ the <a href="../Tasks/native2ascii.html">native2ascii</a> task.</p> | |||||
<p> | <p> | ||||
This is an optional filter that executes a script in a <a href="https://jakarta.apache.org/bsf" | This is an optional filter that executes a script in a <a href="https://jakarta.apache.org/bsf" | ||||
target="_top">Apache BSF</a> | target="_top">Apache BSF</a> | ||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html">JSR | |||||
223</a> supported language. | |||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html" | |||||
target="_top">JSR 223</a> supported language. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
See the <a href="../Tasks/script.html">Script</a> task for an explanation of scripts and | See the <a href="../Tasks/script.html">Script</a> task for an explanation of scripts and | ||||
@@ -1460,8 +1457,8 @@ dependencies. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
The script is provided with an object <samp>self</samp> that has <code>getToken()</code> | The script is provided with an object <samp>self</samp> that has <code>getToken()</code> | ||||
and <code>setToken(String)</code> methods. The <code>getToken()</code> method returns the | |||||
current token. The <code>setToken(String)</code> method replaces the current token. | |||||
and <code>setToken(String)</code> methods. The <code>getToken()</code> method returns the current | |||||
token. The <code>setToken(String)</code> method replaces the current token. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
This filter may be used directly within a <code>filterchain</code>. | This filter may be used directly within a <code>filterchain</code>. | ||||
@@ -1474,14 +1471,14 @@ This filter may be used directly within a <code>filterchain</code>. | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>language</td> | <td>language</td> | ||||
<td>Programming language the script is written in. Must be a supported Apache BSF or | |||||
JSR 223 language</td> | |||||
<td>Programming language the script is written in. Must be a supported Apache BSF or JSR 223 | |||||
language</td> | |||||
<td>Yes</td> | <td>Yes</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>manager</td> | <td>manager</td> | ||||
<td>Script engine manager to use. See the <a href="../Tasks/script.html">script</a> | |||||
task for using this attribute.</td> | |||||
<td>Script engine manager to use. See the <a href="../Tasks/script.html">script</a> task for | |||||
using this attribute.</td> | |||||
<td>No; default is <q>auto</q></td> | <td>No; default is <q>auto</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -1507,8 +1504,8 @@ This filter may be used directly within a <code>filterchain</code>. | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>classpathref</td> | <td>classpathref</td> | ||||
<td>The classpath to use, given as a <a href="../using.html#references">reference</a> to a | |||||
path defined elsewhere. | |||||
<td>The classpath to use, given as a <a href="../using.html#references">reference</a> to a path | |||||
defined elsewhere. | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -26,16 +26,15 @@ | |||||
<h2 id="mapper">Mapping File Names</h2> | <h2 id="mapper">Mapping File Names</h2> | ||||
<p>Some tasks take source files and create target files. Depending on the task, it may be quite | <p>Some tasks take source files and create target files. Depending on the task, it may be quite | ||||
obvious which name a target file will have (using <a href="../Tasks/javac.html">javac</a>, you | |||||
know there will be <samp>.class</samp> files for your <samp>.java</samp> files)—in other | |||||
cases you may want to specify the target files, either to help Apache Ant or to get an extra bit | |||||
of functionality.</p> | |||||
obvious which name a target file will have (using <a href="../Tasks/javac.html">javac</a>, you know | |||||
there will be <samp>.class</samp> files for your <samp>.java</samp> files)—in other cases you | |||||
may want to specify the target files, either to help Apache Ant or to get an extra bit of | |||||
functionality.</p> | |||||
<p>While source files are usually specified as <a href="fileset.html">fileset</a>s, you don't | <p>While source files are usually specified as <a href="fileset.html">fileset</a>s, you don't | ||||
specify target files directly—instead, you tell Ant how to find the target file(s) for one | specify target files directly—instead, you tell Ant how to find the target file(s) for one | ||||
source file. An instance of <code>org.apache.tools.ant.util.FileNameMapper</code> is responsible | |||||
for this. It constructs target file names based on rules that can be parameterized | |||||
with <var>from</var> and <var>to</var> attributes—the exact meaning of which is | |||||
implementation-dependent.</p> | |||||
source file. An instance of <code>org.apache.tools.ant.util.FileNameMapper</code> is responsible for | |||||
this. It constructs target file names based on rules that can be parameterized with <var>from</var> | |||||
and <var>to</var> attributes—the exact meaning of which is implementation-dependent.</p> | |||||
<p>These instances are defined in <code><mapper></code> elements with the following | <p>These instances are defined in <code><mapper></code> elements with the following | ||||
attributes:</p> | attributes:</p> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -76,37 +75,37 @@ attributes:</p> | |||||
<td>Depends on implementation</td> | <td>Depends on implementation</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<p>Note that Ant will not automatically convert <q>/</q> or <q>\</q> characters in | |||||
the <var>to</var> and <var>from</var> attributes to the correct directory separator of your | |||||
current platform. If you need to specify this separator, use <code>${file.separator}</code> | |||||
instead. For the regexp mapper, <code>${file.separator}</code> will not work, as on Windows it | |||||
is the <q>\</q> character, and this is an escape character for regular expressions, one should | |||||
use the <code>handledirsep</code> attribute instead. | |||||
<p>Note that Ant will not automatically convert <q>/</q> or <q>\</q> characters in the <var>to</var> | |||||
and <var>from</var> attributes to the correct directory separator of your current platform. If you | |||||
need to specify this separator, use <code>${file.separator}</code> instead. For the regexp | |||||
mapper, <code>${file.separator}</code> will not work, as on Windows it is the <q>\</q> character, | |||||
and this is an escape character for regular expressions, one should use | |||||
the <code>handledirsep</code> attribute instead. | |||||
</p> | </p> | ||||
<h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
<p>The classpath can be specified via a nested <code><classpath></code>, as | |||||
well—that is, a <a href="../using.html#path">path</a>-like structure.</p> | |||||
<p>The classpath can be specified via a nested <code><classpath></code>, as well—that | |||||
is, a <a href="../using.html#path">path</a>-like structure.</p> | |||||
<p><em>Since Ant 1.7.0</em>, nested File Mappers can be supplied via | <p><em>Since Ant 1.7.0</em>, nested File Mappers can be supplied via | ||||
either <code><mapper></code> elements | either <code><mapper></code> elements | ||||
or <a href="../Tasks/typedef.html"><code><typedef></code></a>'d implementations | or <a href="../Tasks/typedef.html"><code><typedef></code></a>'d implementations | ||||
of <code>org.apache.tools.ant.util.FileNameMapper</code>. If nested File Mappers are specified | |||||
by either means, the mapper will be implicitly configured as | |||||
a <a href="#composite-mapper">composite mapper</a>.</p> | |||||
of <code>org.apache.tools.ant.util.FileNameMapper</code>. If nested File Mappers are specified by | |||||
either means, the mapper will be implicitly configured as a <a href="#composite-mapper">composite | |||||
mapper</a>.</p> | |||||
<h3>The built-in mapper types</h3> | <h3>The built-in mapper types</h3> | ||||
<p>All built-in mappers are case-sensitive.</p> | <p>All built-in mappers are case-sensitive.</p> | ||||
<p><em>Since Ant 1.7.0</em>, each of the built-in mapper implementation types is directly | |||||
accessible using a specific tagname. This makes it possible for filename mappers to support | |||||
attributes in addition to the generally available <var>to</var> and <var>from</var>.<br/> | |||||
The <code><mapper type|classname="..."></code> usage form remains valid for | |||||
reasons of backward compatibility.</p> | |||||
<p><em>Since Ant 1.7.0</em>, each of the built-in mapper implementation types is directly accessible | |||||
using a specific tagname. This makes it possible for filename mappers to support attributes in | |||||
addition to the generally available <var>to</var> and <var>from</var>.<br/> The <code><mapper | |||||
type|classname="..."></code> usage form remains valid for reasons of backward | |||||
compatibility.</p> | |||||
<!-- --> | <!-- --> | ||||
<!-- Identity Mapper --> | <!-- Identity Mapper --> | ||||
<!-- --> | <!-- --> | ||||
<h4 id="identity-mapper">identity</h4> | <h4 id="identity-mapper">identity</h4> | ||||
<p>The target file name is identical to the source file name. Both <var>to</var> | |||||
and <var>from</var> will be ignored.</p> | |||||
<p>The target file name is identical to the source file name. Both <var>to</var> and <var>from</var> | |||||
will be ignored.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<mapper type="identity"/> | <mapper type="identity"/> | ||||
@@ -139,8 +138,8 @@ and <var>from</var> will be ignored.</p> | |||||
<!-- --> | <!-- --> | ||||
<h4 id="flatten-mapper">flatten</h4> | <h4 id="flatten-mapper">flatten</h4> | ||||
<p>The target file name is identical to the source file name, with all leading directory | |||||
information stripped off. Both <var>to</var> and <var>from</var> will be ignored.</p> | |||||
<p>The target file name is identical to the source file name, with all leading directory information | |||||
stripped off. Both <var>to</var> and <var>from</var> will be ignored.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<mapper type="flatten"/> | <mapper type="flatten"/> | ||||
@@ -173,8 +172,8 @@ information stripped off. Both <var>to</var> and <var>from</var> will be ignored | |||||
<!-- --> | <!-- --> | ||||
<h4 id="merge-mapper">merge</h4> | <h4 id="merge-mapper">merge</h4> | ||||
<p>The target file name will always be the same, as defined | |||||
by <var>to</var>—<var>from</var> will be ignored.</p> | |||||
<p>The target file name will always be the same, as defined by <var>to</var>—<var>from</var> | |||||
will be ignored.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<mapper type="merge" to="archive.tar"/> | <mapper type="merge" to="archive.tar"/> | ||||
@@ -207,11 +206,11 @@ by <var>to</var>—<var>from</var> will be ignored.</p> | |||||
<!-- --> | <!-- --> | ||||
<h4 id="glob-mapper">glob</h4> | <h4 id="glob-mapper">glob</h4> | ||||
<p>Both <var>to</var> and <var>from</var> are required and define patterns that may contain at | |||||
most one <q>*</q>. For each source file that matches the <var>from</var> pattern, a target file | |||||
name will be constructed from the <var>to</var> pattern by substituting the <q>*</q> in | |||||
the <var>to</var> pattern with the text that matches the <q>*</q> in the <var>from</var> | |||||
pattern. Source file names that don't match the <var>from</var> pattern will be ignored.</p> | |||||
<p>Both <var>to</var> and <var>from</var> are required and define patterns that may contain at most | |||||
one <q>*</q>. For each source file that matches the <var>from</var> pattern, a target file name will | |||||
be constructed from the <var>to</var> pattern by substituting the <q>*</q> in the <var>to</var> | |||||
pattern with the text that matches the <q>*</q> in the <var>from</var> pattern. Source file names | |||||
that don't match the <var>from</var> pattern will be ignored.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<mapper type="glob" from="*.java" to="*.java.bak"/> | <mapper type="glob" from="*.java" to="*.java.bak"/> | ||||
@@ -273,9 +272,8 @@ pattern. Source file names that don't match the <var>from</var> pattern will be | |||||
<tr> | <tr> | ||||
<td>casesensitive</td> | <td>casesensitive</td> | ||||
<td> | <td> | ||||
This attribute can be <q>true</q> or <q>false</q>. If this is <q>false</q>, the mapper | |||||
will ignore case when matching the glob pattern. | |||||
<em>Since Ant 1.6.3</em> | |||||
This attribute can be <q>true</q> or <q>false</q>. If this is <q>false</q>, the mapper will | |||||
ignore case when matching the glob pattern. <em>Since Ant 1.6.3</em> | |||||
</td> | </td> | ||||
<td>No; default is <q>true</q></td> | <td>No; default is <q>true</q></td> | ||||
</tr> | </tr> | ||||
@@ -284,8 +282,8 @@ pattern. Source file names that don't match the <var>from</var> pattern will be | |||||
<td> | <td> | ||||
This attribute can be <q>true</q> or <q>false</q>. If this is specified, the mapper will | This attribute can be <q>true</q> or <q>false</q>. If this is specified, the mapper will | ||||
ignore the difference between the normal directory separator characters—<q>\</q> | ignore the difference between the normal directory separator characters—<q>\</q> | ||||
and <q>/</q>. This attribute is useful for cross-platform build files. | |||||
<em>Since Ant 1.6.3</em> | |||||
and <q>/</q>. This attribute is useful for cross-platform build files. <em>Since Ant | |||||
1.6.3</em> | |||||
<td>No; default is <q>false</q></td> | <td>No; default is <q>false</q></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -318,14 +316,14 @@ pattern. Source file names that don't match the <var>from</var> pattern will be | |||||
<h4 id="regexp-mapper">regexp</h4> | <h4 id="regexp-mapper">regexp</h4> | ||||
<p>Both <var>to</var> and <var>from</var> are required and define regular expressions. If the | |||||
source file name (as a whole or in part) matches the <var>from</var> pattern, the target file | |||||
name will be constructed from the <var>to</var> pattern, using <code>\0</code> | |||||
to <code>\9</code> as back-references for the full match (<code>\0</code>) or the matches of the | |||||
subexpressions in parentheses. The <var>to</var> pattern determines the <strong>whole</strong> | |||||
file name, so if you wanted to replace the extension of a file you should not | |||||
use <code>from="\.old$" to=".new"</code> but rather <code>from="(.*)\.old$" to="\1.new"</code> | |||||
(or rather use a glob mapper in this case).</p> | |||||
<p>Both <var>to</var> and <var>from</var> are required and define regular expressions. If the source | |||||
file name (as a whole or in part) matches the <var>from</var> pattern, the target file name will be | |||||
constructed from the <var>to</var> pattern, using <code>\0</code> to <code>\9</code> as | |||||
back-references for the full match (<code>\0</code>) or the matches of the subexpressions in | |||||
parentheses. The <var>to</var> pattern determines the <strong>whole</strong> file name, so if you | |||||
wanted to replace the extension of a file you should not use <code>from="\.old$" to=".new"</code> | |||||
but rather <code>from="(.*)\.old$" to="\1.new"</code> (or rather use a glob mapper in this | |||||
case).</p> | |||||
<p>Source files not matching the <var>from</var> pattern will be ignored.</p> | <p>Source files not matching the <var>from</var> pattern will be ignored.</p> | ||||
@@ -334,30 +332,29 @@ use <code>from="\.old$" to=".new"</code> but rather <code>from="(.*)\.old$" to=" | |||||
<p>The regexp mapper needs a supporting library and an implementation | <p>The regexp mapper needs a supporting library and an implementation | ||||
of <code>org.apache.tools.ant.util.regexp.RegexpMatcher</code> that hides the specifics of the | of <code>org.apache.tools.ant.util.regexp.RegexpMatcher</code> that hides the specifics of the | ||||
library. <em>Since Ant 1.8.0</em>, Java 1.4 or later is required, so the implementation based on | library. <em>Since Ant 1.8.0</em>, Java 1.4 or later is required, so the implementation based on | ||||
the <code>java.util.regex</code> package is always be available. You can still use the now | |||||
retired Jakarta ORO or Jakarta Regex instead if your provide the corresponding jar in | |||||
the <code>java.util.regex</code> package is always be available. You can still use the now retired | |||||
Jakarta ORO or Jakarta Regex instead if your provide the corresponding jar in | |||||
your <code>CLASSPATH</code>.</p> | your <code>CLASSPATH</code>.</p> | ||||
<p>For information about using <a href="https://savannah.gnu.org/projects/gnu-regexp/" | <p>For information about using <a href="https://savannah.gnu.org/projects/gnu-regexp/" | ||||
target="_top">gnu.regexp</a> or <a href="https://github.com/kzn/regex4j/" | |||||
target="_top">gnu.rex</a> with Ant, | |||||
see <a href="https://marc.info/?l=ant-dev&m=97550753813481&w=2" target="_top">this</a> | |||||
article. Please keep in mind that <a href="http://tusker.org/regex/regex_benchmark.html">your | |||||
mileage may vary</a> with different regexp engines.</p> | |||||
<p>If you want to use one of the <a href="../install.html#librarydependencies">regular | |||||
expression libraries</a> other than <code>java.util.regex</code> you need to also use the | |||||
corresponding <code>ant-[apache-oro, apache-regexp].jar</code> from the Ant release you are | |||||
using. Make sure that both will be loaded from the same classpath, that is either put them into | |||||
target="_top">gnu.regexp</a> or <a href="https://github.com/kzn/regex4j/" target="_top">gnu.rex</a> | |||||
with Ant, see <a href="https://marc.info/?l=ant-dev&m=97550753813481&w=2" target="_top">this</a> | |||||
article. Please keep in mind that <a href="http://tusker.org/regex/regex_benchmark.html" | |||||
target="_top">your mileage may vary</a> with different regexp engines.</p> | |||||
<p>If you want to use one of the <a href="../install.html#librarydependencies">regular expression | |||||
libraries</a> other than <code>java.util.regex</code> you need to also use the | |||||
corresponding <code>ant-[apache-oro, apache-regexp].jar</code> from the Ant release you are using. | |||||
Make sure that both will be loaded from the same classpath, that is either put them into | |||||
your <code>CLASSPATH</code>, <samp>ANT_HOME/lib</samp> directory or a | your <code>CLASSPATH</code>, <samp>ANT_HOME/lib</samp> directory or a | ||||
nested <code><classpath></code> element of the mapper—you cannot | nested <code><classpath></code> element of the mapper—you cannot | ||||
have <code>ant-[apache-oro, apache-regexp].jar</code> in <samp>ANT_HOME/lib</samp> and the | |||||
library in a nested <code><classpath></code>.</p> | |||||
have <code>ant-[apache-oro, apache-regexp].jar</code> in <samp>ANT_HOME/lib</samp> and the library | |||||
in a nested <code><classpath></code>.</p> | |||||
<p>Ant will choose the regular expression library based on the following algorithm:</p> | <p>Ant will choose the regular expression library based on the following algorithm:</p> | ||||
<ul> | <ul> | ||||
<li>If the system property <code>ant.regexp.matcherimpl</code> has been set, it is taken as the | |||||
name of the class implementing <code>org.apache.tools.ant.util.regexp.RegexpMatcher</code> that | |||||
should be used.</li> | |||||
<li>If the system property <code>ant.regexp.matcherimpl</code> has been set, it is taken as the name | |||||
of the class implementing <code>org.apache.tools.ant.util.regexp.RegexpMatcher</code> that should be | |||||
used.</li> | |||||
<li>If it has not been set, uses the JDK 1.4 classes.</li> | <li>If it has not been set, uses the JDK 1.4 classes.</li> | ||||
</ul> | </ul> | ||||
@@ -472,8 +469,8 @@ should be used.</li> | |||||
<tr> | <tr> | ||||
<td>casesensitive</td> | <td>casesensitive</td> | ||||
<td> | <td> | ||||
This attribute can be <q>true</q> or <q>false</q>. If this is <q>false</q>, the mapper | |||||
will ignore case when matching the pattern. | |||||
This attribute can be <q>true</q> or <q>false</q>. If this is <q>false</q>, the mapper will | |||||
ignore case when matching the pattern. | |||||
<em>Since Ant 1.6.3</em> | <em>Since Ant 1.6.3</em> | ||||
</td> | </td> | ||||
<td>No; default is <q>true</q></td> | <td>No; default is <q>true</q></td> | ||||
@@ -514,9 +511,9 @@ should be used.</li> | |||||
<h4 id="package-mapper">package</h4> | <h4 id="package-mapper">package</h4> | ||||
<p>Sharing the same syntax as the <a href="#glob-mapper">glob mapper</a>, the package mapper | <p>Sharing the same syntax as the <a href="#glob-mapper">glob mapper</a>, the package mapper | ||||
replaces directory separators found in the matched source pattern with dots in the target | |||||
pattern placeholder. This mapper is particularly useful in combination | |||||
with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
replaces directory separators found in the matched source pattern with dots in the target pattern | |||||
placeholder. This mapper is particularly useful in combination with <code><uptodate></code> | |||||
and <code><junit></code> output.</p> | |||||
<p>The <var>to</var> and <var>from</var> attributes are both required.</p> | <p>The <var>to</var> and <var>from</var> attributes are both required.</p> | ||||
<h5>Example</h5> | <h5>Example</h5> | ||||
<pre> | <pre> | ||||
@@ -543,9 +540,9 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
<h4 id="unpackage-mapper">unpackage</h4> | <h4 id="unpackage-mapper">unpackage</h4> | ||||
<p><em>Since Ant 1.6.0</em></p> | <p><em>Since Ant 1.6.0</em></p> | ||||
<p>This mapper is the inverse of the <a href="#package-mapper">package</a> mapper. It replaces | |||||
the dots in a package name with directory separators. This is useful for matching XML formatter | |||||
results against their JUnit test test cases. The mapper shares the sample syntax as | |||||
<p>This mapper is the inverse of the <a href="#package-mapper">package</a> mapper. It replaces the | |||||
dots in a package name with directory separators. This is useful for matching XML formatter results | |||||
against their JUnit test test cases. The mapper shares the sample syntax as | |||||
the <a href="#glob-mapper">glob mapper</a>.</p> | the <a href="#glob-mapper">glob mapper</a>.</p> | ||||
<p>The <var>to</var> and <var>from</var> attributes are both required.</p> | <p>The <var>to</var> and <var>from</var> attributes are both required.</p> | ||||
<h5>Example</h5> | <h5>Example</h5> | ||||
@@ -572,8 +569,8 @@ the <a href="#glob-mapper">glob mapper</a>.</p> | |||||
<p>This mapper implementation can contain multiple nested mappers. File mapping is performed by | <p>This mapper implementation can contain multiple nested mappers. File mapping is performed by | ||||
passing the source filename to each nested <code><mapper></code> in turn, returning all | passing the source filename to each nested <code><mapper></code> in turn, returning all | ||||
results. The <var>to</var> and <var>from</var> attributes are ignored.</p> | results. The <var>to</var> and <var>from</var> attributes are ignored.</p> | ||||
<p><em>Since Ant 1.8.0</em>, the order of the mapped results is the same as the order of the | |||||
nested mappers; prior to Ant 1.8.0 the order has been undefined.</p> | |||||
<p><em>Since Ant 1.8.0</em>, the order of the mapped results is the same as the order of the nested | |||||
mappers; prior to Ant 1.8.0 the order has been undefined.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<compositemapper> | <compositemapper> | ||||
@@ -603,9 +600,9 @@ attribute.</p> | |||||
<h4 id="chained-mapper">chained</h4> | <h4 id="chained-mapper">chained</h4> | ||||
<p><em>Since Ant 1.7.0</em></p> | <p><em>Since Ant 1.7.0</em></p> | ||||
<p>This mapper implementation can contain multiple nested mappers. File mapping is performed by | <p>This mapper implementation can contain multiple nested mappers. File mapping is performed by | ||||
passing the source filename to the first nested mapper, its results to the second, and so on. | |||||
The target filenames generated by the last nested mapper comprise the ultimate results of the | |||||
mapping operation. The <var>to</var> and <var>from</var> attributes are ignored.</p> | |||||
passing the source filename to the first nested mapper, its results to the second, and so on. The | |||||
target filenames generated by the last nested mapper comprise the ultimate results of the mapping | |||||
operation. The <var>to</var> and <var>from</var> attributes are ignored.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<chainedmapper> | <chainedmapper> | ||||
@@ -693,8 +690,8 @@ file name.</p> | |||||
<p><em>Since Ant 1.7</em></p> | <p><em>Since Ant 1.7</em></p> | ||||
<p>This mapper executes a script written in <a href="https://jakarta.apache.org/bsf" | <p>This mapper executes a script written in <a href="https://jakarta.apache.org/bsf" | ||||
target="_top">Apache BSF</a> | target="_top">Apache BSF</a> | ||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html">JSR | |||||
223</a> supported language, once per file to map.</p> | |||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html" | |||||
target="_top">JSR 223</a> supported language, once per file to map.</p> | |||||
<p>The script can be declared inline or in a specified file.</p> | <p>The script can be declared inline or in a specified file.</p> | ||||
<p>See the <a href="../Tasks/script.html">Script</a> task for an explanation of scripts and | <p>See the <a href="../Tasks/script.html">Script</a> task for an explanation of scripts and | ||||
dependencies.</p> | dependencies.</p> | ||||
@@ -800,9 +797,9 @@ every source file, with the list of mapped names reset after every invocation.</ | |||||
<h4 id="firstmatch-mapper">firstmatchmapper</h4> | <h4 id="firstmatch-mapper">firstmatchmapper</h4> | ||||
<p><em>Since Ant 1.8.0</em></p> | <p><em>Since Ant 1.8.0</em></p> | ||||
<p>This mapper supports an arbitrary number of nested mappers and returns the results of the | |||||
first mapper that matches. This is different from <a href="#composite-mapper">composite | |||||
mapper</a> which collects the results of all matching children.</p> | |||||
<p>This mapper supports an arbitrary number of nested mappers and returns the results of the first | |||||
mapper that matches. This is different from <a href="#composite-mapper">composite mapper</a> which | |||||
collects the results of all matching children.</p> | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<pre> | <pre> | ||||
<firstmatchmapper> | <firstmatchmapper> | ||||
@@ -846,8 +843,7 @@ attribute.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<p>The cutdirsmapper has no corresponding <code><mapper <var>type</var>></code> | |||||
attribute.</p> | |||||
<p>The cutdirsmapper has no corresponding <code><mapper <var>type</var>></code> attribute.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -43,25 +43,18 @@ Regexp represents a regular expression. | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre><regexp id="myregexp" pattern="alpha(.+)beta"/></pre> | <pre><regexp id="myregexp" pattern="alpha(.+)beta"/></pre> | ||||
<p> | |||||
Defines a regular expression for later use with <var>id</var> <q>myregexp</q>. | |||||
</p> | |||||
<p>Defines a regular expression for later use with <var>id</var> <q>myregexp</q>.</p> | |||||
<pre><regexp refid="myregexp"/></pre> | <pre><regexp refid="myregexp"/></pre> | ||||
<p> | |||||
Use the regular expression with <var>id</var> <q>myregexp</q>. | |||||
</p> | |||||
<p>Use the regular expression with <var>id</var> <q>myregexp</q>.</p> | |||||
<h3 id="implementation">Choice of regular expression implementation</h3> | <h3 id="implementation">Choice of regular expression implementation</h3> | ||||
<p> | |||||
Apache Ant comes with wrappers for | |||||
<p>Apache Ant comes with wrappers for | |||||
the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html" | the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html" | ||||
target="_top">java.util.regex | target="_top">java.util.regex | ||||
package</a>, <a href="https://attic.apache.org/projects/jakarta-regexp.html" | package</a>, <a href="https://attic.apache.org/projects/jakarta-regexp.html" | ||||
target="_top">jakarta-regexp</a> | |||||
and <a href="https://attic.apache.org/projects/jakarta-oro.html" target="_top">jakarta-ORO</a>, | |||||
see <a href="../install.html#librarydependencies">installation dependencies</a> concerning the | |||||
supporting libraries.</p> | |||||
<p> | |||||
The property <code>ant.regexp.regexpimpl</code> governs which regular expression implementation | |||||
target="_top">jakarta-regexp</a> and <a href="https://attic.apache.org/projects/jakarta-oro.html" | |||||
target="_top">jakarta-ORO</a>, see <a href="../install.html#librarydependencies">installation | |||||
dependencies</a> concerning the supporting libraries.</p> | |||||
<p>The property <code>ant.regexp.regexpimpl</code> governs which regular expression implementation | |||||
will be chosen. Possible values for this property are:</p> | will be chosen. Possible values for this property are:</p> | ||||
<ul> | <ul> | ||||
<li><code>org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp</code></li> | <li><code>org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp</code></li> | ||||
@@ -76,27 +69,23 @@ available.</p> | |||||
There are cross-platform issues for matches related to line terminator. For example if you | There are cross-platform issues for matches related to line terminator. For example if you | ||||
use <q>$</q> to anchor your regular expression on the end of a line the results might be very | use <q>$</q> to anchor your regular expression on the end of a line the results might be very | ||||
different depending on both your platform and the regular expression library you use. It | different depending on both your platform and the regular expression library you use. It | ||||
is <em>highly recommended</em> that you test your pattern on both Unix and Windows platforms | |||||
before you rely on it.</p> | |||||
is <em>highly recommended</em> that you test your pattern on both Unix and Windows platforms before | |||||
you rely on it.</p> | |||||
<ul> | <ul> | ||||
<li>Jakarta Oro defines a line terminator as <q>\n</q> and is consistent with Perl.</li> | <li>Jakarta Oro defines a line terminator as <q>\n</q> and is consistent with Perl.</li> | ||||
<li>Jakarta RegExp uses a system-dependent line terminator.</li> | <li>Jakarta RegExp uses a system-dependent line terminator.</li> | ||||
<li>JDK 1.4 uses <q>\n</q>, <q>\r\n</q>, <q>\u0085</q>, <q>\u2028</q>, <q>\u2029</q> as a | <li>JDK 1.4 uses <q>\n</q>, <q>\r\n</q>, <q>\u0085</q>, <q>\u2028</q>, <q>\u2029</q> as a | ||||
default but is configured in the wrapper to use only <q>\n</q> (UNIX_LINE)</li> | default but is configured in the wrapper to use only <q>\n</q> (UNIX_LINE)</li> | ||||
</ul> | </ul> | ||||
<p> | |||||
<em>We used to recommend that you use Jakarta ORO but since its development has been retired | |||||
Java's built-in regex package is likely the best choice going forward.</em> | |||||
</p> | |||||
<p><em>We used to recommend that you use Jakarta ORO but since its development has been retired | |||||
Java's built-in regex package is likely the best choice going forward.</em></p> | |||||
<h3>Usage</h3> The following tasks and types use the Regexp type: | <h3>Usage</h3> The following tasks and types use the Regexp type: | ||||
<ul> | <ul> | ||||
<li><a href="../Tasks/replaceregexp.html">ReplaceRegExp task</a></li> | <li><a href="../Tasks/replaceregexp.html">ReplaceRegExp task</a></li> | ||||
<li><a href="filterchain.html#linecontainsregexp">LineContainsRegexp filter</a></li> | <li><a href="filterchain.html#linecontainsregexp">LineContainsRegexp filter</a></li> | ||||
</ul> | </ul> | ||||
<p> | |||||
These string filters also use the mechanism of regexp to choose a regular expression | |||||
implementation: | |||||
</p> | |||||
<p>These string filters also use the mechanism of regexp to choose a regular expression | |||||
implementation:</p> | |||||
<ul> | <ul> | ||||
<li><a href="filterchain.html#containsregex">ContainsRegex string filter</a></li> | <li><a href="filterchain.html#containsregex">ContainsRegex string filter</a></li> | ||||
<li><a href="filterchain.html#replaceregex">ReplaceRegex string filter</a></li> | <li><a href="filterchain.html#replaceregex">ReplaceRegex string filter</a></li> | ||||
@@ -24,21 +24,20 @@ | |||||
<body> | <body> | ||||
<h2>Selectors</h2> | <h2>Selectors</h2> | ||||
<p>Selectors are a mechanism whereby the files that make up a <code><fileset></code> | |||||
can be selected based on criteria other than filename as provided by | |||||
<p>Selectors are a mechanism whereby the files that make up a <code><fileset></code> can | |||||
be selected based on criteria other than filename as provided by | |||||
the <code><include></code> and <code><exclude></code> tags.</p> | the <code><include></code> and <code><exclude></code> tags.</p> | ||||
<h3>How to use a Selector</h3> | <h3>How to use a Selector</h3> | ||||
<p>A selector is an element of FileSet, and appears within it. It can also be defined | |||||
outside of any target by using the <code><selector></code> tag and then using it as a | |||||
reference.</p> | |||||
<p>A selector is an element of FileSet, and appears within it. It can also be defined outside of | |||||
any target by using the <code><selector></code> tag and then using it as a reference.</p> | |||||
<p>Different selectors have different attributes. Some selectors can contain other | |||||
selectors, and these are called <a href="#selectcontainers"><code>Selector | |||||
Containers</code></a>. There is also a category of selectors that allow user-defined | |||||
extensions, called <a href="#customselect"><code>Custom Selectors</code></a>. The ones | |||||
built in to Apache Ant are called <a href="#coreselect"><code>Core Selectors</code></a>.</p> | |||||
<p>Different selectors have different attributes. Some selectors can contain other selectors, | |||||
and these are called <a href="#selectcontainers"><code>Selector Containers</code></a>. There is | |||||
also a category of selectors that allow user-defined extensions, | |||||
called <a href="#customselect"><code>Custom Selectors</code></a>. The ones built in to Apache | |||||
Ant are called <a href="#coreselect"><code>Core Selectors</code></a>.</p> | |||||
<h3 id="coreselect">Core Selectors</h3> | <h3 id="coreselect">Core Selectors</h3> | ||||
@@ -52,29 +51,29 @@ | |||||
contain a particular text string</li> | contain a particular text string</li> | ||||
<li><a href="#dateselect"><code><date></code></a>—Select files that have been | <li><a href="#dateselect"><code><date></code></a>—Select files that have been | ||||
modified either before or after a particular date and time</li> | modified either before or after a particular date and time</li> | ||||
<li><a href="#dependselect"><code><depend></code></a>—Select files that have | |||||
been modified more recently than equivalent files elsewhere</li> | |||||
<li><a href="#depthselect"><code><depth></code></a>—Select files that appear | |||||
so many directories down in a directory tree</li> | |||||
<li><a href="#differentselect"><code><different></code></a>—Select files that | |||||
are different from those elsewhere</li> | |||||
<li><a href="#filenameselect"><code><filename></code></a>—Select files whose | |||||
name matches a particular pattern. Equivalent to the include and exclude elements of a | |||||
<li><a href="#dependselect"><code><depend></code></a>—Select files that have been | |||||
modified more recently than equivalent files elsewhere</li> | |||||
<li><a href="#depthselect"><code><depth></code></a>—Select files that appear so | |||||
many directories down in a directory tree</li> | |||||
<li><a href="#differentselect"><code><different></code></a>—Select files that are | |||||
different from those elsewhere</li> | |||||
<li><a href="#filenameselect"><code><filename></code></a>—Select files whose name | |||||
matches a particular pattern. Equivalent to the include and exclude elements of a | |||||
patternset.</li> | patternset.</li> | ||||
<li><a href="#presentselect"><code><present></code></a>—Select files that | |||||
either do or do not exist in some other location</li> | |||||
<li><a href="#regexpselect"><code><containsregexp></code></a>—Select files | |||||
that match a regular expression</li> | |||||
<li><a href="#sizeselect"><code><size></code></a>—Select files that are larger | |||||
or smaller than a particular number of bytes.</li> | |||||
<li><a href="#presentselect"><code><present></code></a>—Select files that either | |||||
do or do not exist in some other location</li> | |||||
<li><a href="#regexpselect"><code><containsregexp></code></a>—Select files that | |||||
match a regular expression</li> | |||||
<li><a href="#sizeselect"><code><size></code></a>—Select files that are larger or | |||||
smaller than a particular number of bytes.</li> | |||||
<li><a href="#typeselect"><code><type></code></a>—Select files that are either | <li><a href="#typeselect"><code><type></code></a>—Select files that are either | ||||
regular files or directories.</li> | regular files or directories.</li> | ||||
<li><a href="#modified"><code><modified></code></a>—Select files if the return | <li><a href="#modified"><code><modified></code></a>—Select files if the return | ||||
value of the configured algorithm is different from that stored in a cache.</li> | value of the configured algorithm is different from that stored in a cache.</li> | ||||
<li><a href="#signedselector"><code><signedselector></code></a>—Select files | |||||
if they are signed, and optionally if they have a signature of a certain name.</li> | |||||
<li><a href="#scriptselector"><code><scriptselector></code></a>—Use a BSF or | |||||
JSR 223 scripting language to create your own selector</li> | |||||
<li><a href="#signedselector"><code><signedselector></code></a>—Select files if | |||||
they are signed, and optionally if they have a signature of a certain name.</li> | |||||
<li><a href="#scriptselector"><code><scriptselector></code></a>—Use a BSF or JSR | |||||
223 scripting language to create your own selector</li> | |||||
<li><a href="#readable"><code><readable></code></a>—Select files if they are | <li><a href="#readable"><code><readable></code></a>—Select files if they are | ||||
readable.</li> | readable.</li> | ||||
<li><a href="#writable"><code><writable></code></a>—Select files if they are | <li><a href="#writable"><code><writable></code></a>—Select files if they are | ||||
@@ -82,16 +81,15 @@ | |||||
<li><a href="#executable"><code><executable></code></a>—Select files if they | <li><a href="#executable"><code><executable></code></a>—Select files if they | ||||
are executable.</li> | are executable.</li> | ||||
<li><a href="#symlink"><code><symlink></code></a>—Select files if they are | <li><a href="#symlink"><code><symlink></code></a>—Select files if they are | ||||
symlink.</li> | |||||
<li><a href="#ownedBy"><code><ownedBy></code></a>—Select files if they are | |||||
owned by a given user.</li> | |||||
symlinks.</li> | |||||
<li><a href="#ownedBy"><code><ownedBy></code></a>—Select files if they are owned | |||||
by a given user.</li> | |||||
</ul> | </ul> | ||||
<h4 id="containsselect">Contains Selector</h4> | <h4 id="containsselect">Contains Selector</h4> | ||||
<p>The <code><contains></code> tag in a FileSet limits the files defined by that | |||||
fileset to only those which contain the string specified by the <code>text</code> | |||||
attribute.</p> | |||||
<p>The <code><contains></code> tag in a FileSet limits the files defined by that fileset | |||||
to only those which contain the string specified by the <code>text</code> attribute.</p> | |||||
<p>The <code><contains></code> selector can be used as a ResourceSelector (see | <p>The <code><contains></code> selector can be used as a ResourceSelector (see | ||||
the <a href="resources.html#restrict"><restrict></a> ResourceCollection).</p> | the <a href="resources.html#restrict"><restrict></a> ResourceCollection).</p> | ||||
@@ -115,8 +113,8 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>ignorewhitespace</td> | <td>ignorewhitespace</td> | ||||
<td>Whether to eliminate whitespace before checking for the string in | |||||
the <var>text</var> attribute.</td> | |||||
<td>Whether to eliminate whitespace before checking for the string in the <var>text</var> | |||||
attribute.</td> | |||||
<td>No; default is <q>false</q></td> | <td>No; default is <q>false</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -139,9 +137,9 @@ | |||||
<h4 id="dateselect">Date Selector</h4> | <h4 id="dateselect">Date Selector</h4> | ||||
<p>The <code><date></code> tag in a FileSet will put a limit on the files specified by | |||||
the include tag, so that tags whose last modified date does not meet the date limits | |||||
specified by the selector will not end up being selected.</p> | |||||
<p>The <code><date></code> tag in a FileSet will put a limit on the files specified by the | |||||
include tag, so that tags whose last modified date does not meet the date limits specified by | |||||
the selector will not end up being selected.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -151,9 +149,9 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>datetime</td> | <td>datetime</td> | ||||
<td>Specifies the date and time to test for. Should be in the format <q>MM/dd/yyyy | |||||
hh:mm a</q> using the US locale, or an alternative pattern specified via | |||||
the <var>pattern</var> attribute. | |||||
<td>Specifies the date and time to test for. Should be in the format <q>MM/dd/yyyy hh:mm | |||||
a</q> using the US locale, or an alternative pattern specified via the <var>pattern</var> | |||||
attribute. | |||||
</td> | </td> | ||||
<td rowspan="2">At least one of the two</td> | <td rowspan="2">At least one of the two</td> | ||||
</tr> | </tr> | ||||
@@ -169,17 +167,19 @@ | |||||
whose last modified times should be before, after, or equal to the specified | whose last modified times should be before, after, or equal to the specified | ||||
value. Acceptable values for this attribute are: | value. Acceptable values for this attribute are: | ||||
<ul> | <ul> | ||||
<li><q>before</q>—select files whose last modified date is before the indicated date</li> | |||||
<li><q>after</q>—select files whose last modified date is after the indicated date</li> | |||||
<li><q>equal</q>—select files whose last modified date is this exact date</li> | |||||
<li><q>before</q>—select files whose last modified date is before the indicated | |||||
date</li> | |||||
<li><q>after</q>—select files whose last modified date is after the indicated | |||||
date</li> | |||||
<li><q>equal</q>—select files whose last modified date is this exact date</li> | |||||
</ul></td> | </ul></td> | ||||
<td>No; default is <q>equal</q></td> | <td>No; default is <q>equal</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>granularity</td> | <td>granularity</td> | ||||
<td>The number of milliseconds leeway to use when comparing file modification | |||||
times. This is needed because not every file system supports tracking the last | |||||
modified time to the millisecond level.</td> | |||||
<td>The number of milliseconds leeway to use when comparing file modification times. This is | |||||
needed because not every file system supports tracking the last modified time to the | |||||
millisecond level.</td> | |||||
<td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td> | <td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -211,9 +211,9 @@ | |||||
another, equivalent file in another location.</p> | another, equivalent file in another location.</p> | ||||
<p>The <code><depend></code> tag supports the use of a | <p>The <code><depend></code> tag supports the use of a | ||||
contained <a href="mapper.html"><code><mapper></code></a> element to define the | |||||
location of the file to be compared against. If no <code><mapper></code> element is | |||||
specified, the <code>identity</code> type mapper is used.</p> | |||||
contained <a href="mapper.html"><code><mapper></code></a> element to define the location | |||||
of the file to be compared against. If no <code><mapper></code> element is specified, | |||||
the <code>identity</code> type mapper is used.</p> | |||||
<p>The <code><depend></code> selector is case-sensitive.</p> | <p>The <code><depend></code> selector is case-sensitive.</p> | ||||
@@ -226,15 +226,15 @@ | |||||
<tr> | <tr> | ||||
<td>targetdir</td> | <td>targetdir</td> | ||||
<td>The base directory to look for the files to compare against. The precise location | <td>The base directory to look for the files to compare against. The precise location | ||||
depends on a combination of this attribute and the <code><mapper></code> | |||||
element, if any.</td> | |||||
depends on a combination of this attribute and the <code><mapper></code> element, if | |||||
any.</td> | |||||
<td>Yes</td> | <td>Yes</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>granularity</td> | <td>granularity</td> | ||||
<td>The number of milliseconds leeway to give before deciding a file is out of | |||||
date. This is needed because not every file system supports tracking the last modified | |||||
time to the millisecond level.</td> | |||||
<td>The number of milliseconds leeway to give before deciding a file is out of date. This is | |||||
needed because not every file system supports tracking the last modified time to the | |||||
millisecond level.</td> | |||||
<td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td> | <td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -250,8 +250,8 @@ | |||||
<h4 id="depthselect">Depth Selector</h4> | <h4 id="depthselect">Depth Selector</h4> | ||||
<p>The <code><depth></code> tag selects files based on how many directory levels deep | |||||
they are in relation to the base directory of the fileset.</p> | |||||
<p>The <code><depth></code> tag selects files based on how many directory levels deep they | |||||
are in relation to the base directory of the fileset.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -261,14 +261,14 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>min</td> | <td>min</td> | ||||
<td>The minimum number of directory levels below the base directory that a file must be | |||||
in order to be selected.</td> | |||||
<td>The minimum number of directory levels below the base directory that a file must be in | |||||
order to be selected.</td> | |||||
<td rowspan="2">At least one of the two; default is no limit</td> | <td rowspan="2">At least one of the two; default is no limit</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>max</td> | <td>max</td> | ||||
<td class="left">The maximum number of directory levels below the base directory that a | |||||
file can be and still be selected.</td> | |||||
<td class="left">The maximum number of directory levels below the base directory that a file | |||||
can be and still be selected.</td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -279,14 +279,13 @@ | |||||
<depth max="1"/> | <depth max="1"/> | ||||
</fileset></pre> | </fileset></pre> | ||||
<p>Selects all files in the base directory and one directory below | |||||
that.</p> | |||||
<p>Selects all files in the base directory and one directory below that.</p> | |||||
<h4 id="differentselect">Different Selector</h4> | <h4 id="differentselect">Different Selector</h4> | ||||
<p>The <code><different></code> selector will select a file if it is deemed to be | <p>The <code><different></code> selector will select a file if it is deemed to be | ||||
'different' from an equivalent file in another location. The rules for determining | |||||
difference between the two files are as follows:<p> | |||||
'different' from an equivalent file in another location. The rules for determining difference | |||||
between the two files are as follows:<p> | |||||
<ol> | <ol> | ||||
<li>If a file is only present in the resource collection you apply the selector to but not | <li>If a file is only present in the resource collection you apply the selector to but not | ||||
in <var>targetdir</var> (or after applying the mapper) the file is selected.</li> | in <var>targetdir</var> (or after applying the mapper) the file is selected.</li> | ||||
@@ -295,22 +294,21 @@ | |||||
<li>Files with different lengths are different.</li> | <li>Files with different lengths are different.</li> | ||||
<li>If <var>ignoreFileTimes</var> is turned <q>off</q>, then differing file timestamps will | <li>If <var>ignoreFileTimes</var> is turned <q>off</q>, then differing file timestamps will | ||||
cause files to be regarded as different.</li> | cause files to be regarded as different.</li> | ||||
<li>Unless <var>ignoreContents</var> is set to <q>true</q>, a byte-for-byte check is run | |||||
against the two files.</li> | |||||
<li>Unless <var>ignoreContents</var> is set to <q>true</q>, a byte-for-byte check is run against | |||||
the two files.</li> | |||||
</ol> | </ol> | ||||
<p>This is a useful selector to work with programs and tasks that don't handle dependency | <p>This is a useful selector to work with programs and tasks that don't handle dependency | ||||
checking properly; even if a predecessor task always creates its output files, followup | |||||
tasks can be driven off copies made with a different selector, so their dependencies are | |||||
driven on the absolute state of the files, not just a timestamp. For example: anything | |||||
fetched from a web site, or the output of some program. To reduce the amount of checking, | |||||
when using this task inside a <code><copy></code> task, | |||||
set <var>preservelastmodified</var> to <q>true</q> to propagate the timestamp from the | |||||
source file to the destination file.</p> | |||||
checking properly; even if a predecessor task always creates its output files, followup tasks | |||||
can be driven off copies made with a different selector, so their dependencies are driven on the | |||||
absolute state of the files, not just a timestamp. For example: anything fetched from a web | |||||
site, or the output of some program. To reduce the amount of checking, when using this task | |||||
inside a <code><copy></code> task, set <var>preservelastmodified</var> to <q>true</q> to | |||||
propagate the timestamp from the source file to the destination file.</p> | |||||
<p>The <code><different></code> selector supports the use of a | <p>The <code><different></code> selector supports the use of a | ||||
contained <a href="mapper.html"><code><mapper></code></a> element to define the | |||||
location of the file to be compared against. If no <code><mapper></code> element is | |||||
specified, the <code>identity</code> type mapper is used.</p> | |||||
contained <a href="mapper.html"><code><mapper></code></a> element to define the location | |||||
of the file to be compared against. If no <code><mapper></code> element is specified, | |||||
the <code>identity</code> type mapper is used.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -321,8 +319,8 @@ | |||||
<tr> | <tr> | ||||
<td>targetdir</td> | <td>targetdir</td> | ||||
<td>The base directory to look for the files to compare against. The precise location | <td>The base directory to look for the files to compare against. The precise location | ||||
depends on a combination of this attribute and the <code><mapper></code> | |||||
element, if any.</td> | |||||
depends on a combination of this attribute and the <code><mapper></code> element, if | |||||
any.</td> | |||||
<td>Yes</td> | <td>Yes</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -338,9 +336,9 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>granularity</td> | <td>granularity</td> | ||||
<td>The number of milliseconds leeway to give before deciding a file is out of | |||||
date. This is needed because not every file system supports tracking the last modified | |||||
time to the millisecond level.</td> | |||||
<td>The number of milliseconds leeway to give before deciding a file is out of date. This is | |||||
needed because not every file system supports tracking the last modified time to the | |||||
millisecond level.</td> | |||||
<td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td> | <td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -353,14 +351,14 @@ | |||||
ignoreFileTimes="true"/> | ignoreFileTimes="true"/> | ||||
</fileset></pre> | </fileset></pre> | ||||
<p>Compares all the Java source files between the 1.4.1 and the 1.5 release and selects | |||||
those who are different, disregarding file times.</p> | |||||
<p>Compares all the Java source files between the 1.4.1 and the 1.5 release and selects those | |||||
who are different, disregarding file times.</p> | |||||
<h4 id="filenameselect">Filename Selector</h4> | <h4 id="filenameselect">Filename Selector</h4> | ||||
<p>The <code><filename></code> tag acts like the <code><include></code> | <p>The <code><filename></code> tag acts like the <code><include></code> | ||||
and <code><exclude></code> tags within a fileset. By using a selector instead, | |||||
however, one can combine it with all the other selectors using | |||||
and <code><exclude></code> tags within a fileset. By using a selector instead, however, | |||||
one can combine it with all the other selectors using | |||||
whatever <a href="#selectcontainers">selector container</a> is desired.</p> | whatever <a href="#selectcontainers">selector container</a> is desired.</p> | ||||
<p>The <code><filename></code> selector is case-sensitive.</p> | <p>The <code><filename></code> selector is case-sensitive.</p> | ||||
@@ -373,8 +371,8 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>name</td> | <td>name</td> | ||||
<td>The name of files to select. The name parameter can contain the standard Ant | |||||
wildcard characters.</td> | |||||
<td>The name of files to select. The name parameter can contain the standard Ant wildcard | |||||
characters.</td> | |||||
<td rowspan="2">Exactly one of the two</td> | <td rowspan="2">Exactly one of the two</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -388,8 +386,8 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>negate</td> | <td>negate</td> | ||||
<td>Whether to reverse the effects of this filename selection, therefore emulating an | |||||
<code>exclude</code> rather than <code>include</code> tag.</td> | |||||
<td>Whether to reverse the effects of this filename selection, therefore emulating | |||||
an <code>exclude</code> rather than <code>include</code> tag.</td> | |||||
<td>No; default is <q>false</q></td> | <td>No; default is <q>false</q></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -409,9 +407,9 @@ | |||||
another directory tree.</p> | another directory tree.</p> | ||||
<p>The <code><present></code> tag supports the use of a | <p>The <code><present></code> tag supports the use of a | ||||
contained <a href="mapper.html"><code><mapper></code></a> element to define the | |||||
location of the file to be tested against. If no <code><mapper></code> element is | |||||
specified, the <code>identity</code> type mapper is used.</p> | |||||
contained <a href="mapper.html"><code><mapper></code></a> element to define the location | |||||
of the file to be tested against. If no <code><mapper></code> element is specified, | |||||
the <code>identity</code> type mapper is used.</p> | |||||
<p>The <code><present></code> selector is case-sensitive.</p> | <p>The <code><present></code> selector is case-sensitive.</p> | ||||
@@ -424,19 +422,19 @@ | |||||
<tr> | <tr> | ||||
<td>targetdir</td> | <td>targetdir</td> | ||||
<td>The base directory to look for the files to compare against. The precise location | <td>The base directory to look for the files to compare against. The precise location | ||||
depends on a combination of this attribute and the <code><mapper></code> | |||||
element, if any.</td> | |||||
depends on a combination of this attribute and the <code><mapper></code> element, if | |||||
any.</td> | |||||
<td>Yes</td> | <td>Yes</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>present</td> | <td>present</td> | ||||
<td>Whether we are requiring that a file is present in the source directory tree only, | |||||
or in both the source and the target directory tree. Valid values are: | |||||
<td>Whether we are requiring that a file is present in the source directory tree only, or in | |||||
both the source and the target directory tree. Valid values are: | |||||
<ul> | <ul> | ||||
<li><q>srconly</q>—select files only if they are in the source directory tree | |||||
but not in the target directory tree</li> | |||||
<li><q>both</q >-- select files only if they are present both in the source and | |||||
target directory trees</li> | |||||
<li><q>srconly</q>—select files only if they are in the source directory tree but | |||||
not in the target directory tree</li> | |||||
<li><q>both</q >-- select files only if they are present both in the source and target | |||||
directory trees</li> | |||||
</ul> | </ul> | ||||
Setting this attribute to <q>srconly</q> is equivalent to wrapping the selector in | Setting this attribute to <q>srconly</q> is equivalent to wrapping the selector in | ||||
the <code><not></code> selector container.</td> | the <code><not></code> selector container.</td> | ||||
@@ -499,14 +497,14 @@ | |||||
<containsregexp expression="[4-6]\.[0-9]"/> | <containsregexp expression="[4-6]\.[0-9]"/> | ||||
</fileset></pre> | </fileset></pre> | ||||
<p>Selects all the text files that match the regular expression (have a 4, 5 or 6 followed | |||||
by a period and a number from 0 to 9). | |||||
<p>Selects all the text files that match the regular expression (have a 4, 5 or 6 followed by a | |||||
period and a number from 0 to 9). | |||||
<h4 id="sizeselect">Size Selector</h4> | <h4 id="sizeselect">Size Selector</h4> | ||||
<p>The <code><size></code> tag in a FileSet will put a limit on the files specified by | |||||
the include tag, so that tags which do not meet the size limits specified by the selector | |||||
will not end up being selected.</p> | |||||
<p>The <code><size></code> tag in a FileSet will put a limit on the files specified by the | |||||
include tag, so that tags which do not meet the size limits specified by the selector will not | |||||
end up being selected.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -522,17 +520,17 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>units</td> | <td>units</td> | ||||
<td>The units that the <code>value</code> attribute is expressed in. When using the | |||||
standard single letter SI designations, such as <q>k</q>, <q>M</q>, or <q>G</q>, | |||||
multiples of 1000 are used. If you want to use power of 2 units, use the IEC | |||||
standard: <q>Ki</q> for 1024, <q>Mi</q> for 1048576, and so on. The default is no units, | |||||
which means the <var>value</var> attribute expresses the exact number of bytes.</td> | |||||
<td>The units that the <code>value</code> attribute is expressed in. When using the standard | |||||
single letter SI designations, such as <q>k</q>, <q>M</q>, or <q>G</q>, multiples of 1000 | |||||
are used. If you want to use power of 2 units, use the IEC standard: <q>Ki</q> for | |||||
1024, <q>Mi</q> for 1048576, and so on. The default is no units, which means | |||||
the <var>value</var> attribute expresses the exact number of bytes.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>when</td> | <td>when</td> | ||||
<td>Indicates how to interpret the size, whether the files to be selected should be | |||||
larger, smaller, or equal to that value. Acceptable values for this attribute are: | |||||
<td>Indicates how to interpret the size, whether the files to be selected should be larger, | |||||
smaller, or equal to that value. Acceptable values for this attribute are: | |||||
<ul> | <ul> | ||||
<li><q>less</q>—select files less than the indicated size</li> | <li><q>less</q>—select files less than the indicated size</li> | ||||
<li><q>more</q>—select files greater than the indicated size</li> | <li><q>more</q>—select files greater than the indicated size</li> | ||||
@@ -584,8 +582,8 @@ | |||||
<type type="dir"/> | <type type="dir"/> | ||||
</fileset></pre> | </fileset></pre> | ||||
<p>The Type Selector is often used in conjunction with other selectors. For example, to | |||||
select files that also exist in a <samp>template</samp> directory, but avoid selecting empty | |||||
<p>The Type Selector is often used in conjunction with other selectors. For example, to select | |||||
files that also exist in a <samp>template</samp> directory, but avoid selecting empty | |||||
directories, use:</p> | directories, use:</p> | ||||
<pre> | <pre> | ||||
@@ -597,10 +595,9 @@ | |||||
</fileset></pre> | </fileset></pre> | ||||
<h4 id="modified">Modified Selector</h4> | <h4 id="modified">Modified Selector</h4> | ||||
<p>The <code><modified></code> selector computes a value for a file, compares that to | |||||
the value stored in a cache and select the file, if these two values differ.</p> | |||||
<p>Because this selector is highly configurable the order in which the selection is done | |||||
is:</p> | |||||
<p>The <code><modified></code> selector computes a value for a file, compares that to the | |||||
value stored in a cache and select the file, if these two values differ.</p> | |||||
<p>Because this selector is highly configurable the order in which the selection is done is:</p> | |||||
<ol> | <ol> | ||||
<li>get the absolute path for the file</li> | <li>get the absolute path for the file</li> | ||||
<li>get the cached value from the configured cache (absolute path as key)</li> | <li>get the cached value from the configured cache (absolute path as key)</li> | ||||
@@ -609,15 +606,14 @@ | |||||
<li>update the cache if needed and requested</li> | <li>update the cache if needed and requested</li> | ||||
<li>do the selection according to the comparison result</li> | <li>do the selection according to the comparison result</li> | ||||
</ol> | </ol> | ||||
<p>The comparison, computing of the hashvalue and the store is done by implementation of | |||||
special interfaces. Therefore they may provide additional parameters.</p> | |||||
<p>The comparison, computing of the hashvalue and the store is done by implementation of special | |||||
interfaces. Therefore they may provide additional parameters.</p> | |||||
<p>The <code><modified></code> selector can be used as a ResourceSelector (see | <p>The <code><modified></code> selector can be used as a ResourceSelector (see | ||||
the <a href="resources.html#restrict"><restrict></a> ResourceCollection). In that | |||||
case it maps simple file resources to files and does its job. If the resource is from | |||||
another type, the <code><modified></code> selector tries to | |||||
(<strong>attention!</strong>) copy the content into a local file for computing the | |||||
hashvalue.</p> | |||||
the <a href="resources.html#restrict"><restrict></a> ResourceCollection). In that case it | |||||
maps simple file resources to files and does its job. If the resource is from another type, | |||||
the <code><modified></code> selector tries to (<strong>attention!</strong>) copy the | |||||
content into a local file for computing the hashvalue.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -688,27 +684,26 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>selres</td> | <td>selres</td> | ||||
<td>Should Resources without an InputStream, and therefore without checking, be | |||||
selected? (boolean)</td> | |||||
<td>Should Resources without an InputStream, and therefore without checking, be selected? | |||||
(boolean)</td> | |||||
<td>No; defaults to <q>true</q>. Only relevant when used as ResourceSelector.</td> | <td>No; defaults to <q>true</q>. Only relevant when used as ResourceSelector.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>delayupdate</td> | <td>delayupdate</td> | ||||
<td>If set to <q>true</q>, the storage of the cache will be delayed until the next | |||||
finished BuildEvent; task finished, target finished or build finished, whichever comes | |||||
first. This is provided for increased performance. If set to <q>false</q>, the | |||||
storage of the cache will happen with each change. This attribute depends upon | |||||
the <var>update</var> attribute. (boolean)</td> | |||||
<td>If set to <q>true</q>, the storage of the cache will be delayed until the next finished | |||||
BuildEvent; task finished, target finished or build finished, whichever comes first. This | |||||
is provided for increased performance. If set to <q>false</q>, the storage of the cache | |||||
will happen with each change. This attribute depends upon the <var>update</var> | |||||
attribute. (boolean)</td> | |||||
<td>No; defaults to <q>true</q></td> | <td>No; defaults to <q>true</q></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h5>Parameters specified as nested elements</h5> | <h5>Parameters specified as nested elements</h5> | ||||
<p>The <code><modified></code> selector supports a | |||||
nested <code><classpath></code> element that represents | |||||
a <a href="../using.html#path">path-like structure</a> for finding custom interface | |||||
implementations.</p> | |||||
<p>The <code><modified></code> selector supports a nested <code><classpath></code> | |||||
element that represents a <a href="../using.html#path">path-like structure</a> for finding | |||||
custom interface implementations.</p> | |||||
<p>All attributes of a <code><modified></code> selector an be set with | <p>All attributes of a <code><modified></code> selector an be set with | ||||
nested <code><param/></code> tags. Additional values can be set | nested <code><param/></code> tags. Additional values can be set | ||||
@@ -758,8 +753,8 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>propertyfile</td> | <td>propertyfile</td> | ||||
<td>Use the <code>java.util.Properties</code> class and its possibility to load and store | |||||
to file. This Cache implementation supports the following attributes: | |||||
<td>Use the <code>java.util.Properties</code> class and its possibility to load and store to | |||||
file. This Cache implementation supports the following attributes: | |||||
<ul> | <ul> | ||||
<li><var>cache.cachefile</var> (optional): Name of the properties file; default | <li><var>cache.cachefile</var> (optional): Name of the properties file; default | ||||
is <q>cache.properties</q></li> | is <q>cache.properties</q></li> | ||||
@@ -808,8 +803,8 @@ | |||||
</fileset> | </fileset> | ||||
</copy></pre> | </copy></pre> | ||||
<p>This is the same example rewritten as CoreSelector with setting the all the values (same | |||||
as defaults are).</p> | |||||
<p>This is the same example rewritten as CoreSelector with setting the all the values (same as | |||||
defaults are).</p> | |||||
<pre> | <pre> | ||||
<copy todir="dest"> | <copy todir="dest"> | ||||
@@ -842,9 +837,9 @@ | |||||
</target></pre> | </target></pre> | ||||
<p>A useful scenario for this selector inside a build environment for homepage generation | <p>A useful scenario for this selector inside a build environment for homepage generation | ||||
(e.g. with <a href="https://forrest.apache.org/">Apache Forrest</a>). Here | |||||
all <strong>changed</strong> files are uploaded to the server. The CacheSelector saves | |||||
therefore much upload time.</p> | |||||
(e.g. with <a href="https://forrest.apache.org/" target="_top">Apache Forrest</a>). Here | |||||
all <strong>changed</strong> files are uploaded to the server. The CacheSelector saves therefore | |||||
much upload time.</p> | |||||
<pre> | <pre> | ||||
<modified cacheclassname="com.mycompany.MyCache"> | <modified cacheclassname="com.mycompany.MyCache"> | ||||
@@ -857,14 +852,14 @@ | |||||
cache implementation</p> | cache implementation</p> | ||||
<h4 id="ModSelNote">Note on RuleBasedCollator</h4> | <h4 id="ModSelNote">Note on RuleBasedCollator</h4> | ||||
<p>The RuleBasedCollator needs a format for its work, but its needed while | |||||
instantiation. There is a problem in the initialization algorithm for this case. Therefore | |||||
you should not use this (or tell me the workaround :-).</p> | |||||
<p>The RuleBasedCollator needs a format for its work, but its needed while instantiation. There | |||||
is a problem in the initialization algorithm for this case. Therefore you should not use this | |||||
(or tell me the workaround :-).</p> | |||||
<h4 id="signedselector">Signed Selector</h4> | <h4 id="signedselector">Signed Selector</h4> | ||||
<p>The <code><signedselector></code> tag selects signed files and optionally signed | |||||
with a certain name.</p> | |||||
<p>The <code><signedselector></code> tag selects signed files and optionally signed with a | |||||
certain name.</p> | |||||
<p><em>Since Apache Ant 1.7</em></p> | <p><em>Since Apache Ant 1.7</em></p> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -881,37 +876,37 @@ | |||||
<h4 id="readable">Readable Selector</h4> | <h4 id="readable">Readable Selector</h4> | ||||
<p>The <code><readable></code> selector selects only files that are readable. Ant | |||||
only invokes <code>java.io.File#canRead</code> so if a file is unreadable but JVM cannot | |||||
detect this state, this selector will still select the file.</p> | |||||
<p>The <code><readable></code> selector selects only files that are readable. Ant only | |||||
invokes <code>java.io.File#canRead</code> so if a file is unreadable but JVM cannot detect this | |||||
state, this selector will still select the file.</p> | |||||
<h4 id="writable">Writable Selector</h4> | <h4 id="writable">Writable Selector</h4> | ||||
<p>The <code><writable></code> selector selects only files that are writable. Ant | |||||
only invokes <code>java.io.File#canWrite</code> so if a file is nonwritable but JVM cannot | |||||
detect this state, this selector will still select the file.</p> | |||||
<p>The <code><writable></code> selector selects only files that are writable. Ant only | |||||
invokes <code>java.io.File#canWrite</code> so if a file is nonwritable but JVM cannot detect | |||||
this state, this selector will still select the file.</p> | |||||
<h4 id="executable">Executable Selector</h4> | <h4 id="executable">Executable Selector</h4> | ||||
<p>The <code><executable></code> selector selects only files that are executable. Ant | <p>The <code><executable></code> selector selects only files that are executable. Ant | ||||
only invokes <code>java.nio.file.Files#isExecutable</code> so if a file is not executable | |||||
but JVM cannot detect this state, this selector will still select the file.</p> | |||||
only invokes <code>java.nio.file.Files#isExecutable</code> so if a file is not executable but | |||||
JVM cannot detect this state, this selector will still select the file.</p> | |||||
<p><em>Since Ant 1.10.0</em></p> | <p><em>Since Ant 1.10.0</em></p> | ||||
<h4 id="symlink">Symlink Selector</h4> | <h4 id="symlink">Symlink Selector</h4> | ||||
<p>The <code><symlink></code> selector selects only files that are symbolic links. | |||||
Ant only invokes <code>java.nio.file.Files#isSymbolicLink</code> so if a file is a symbolic | |||||
link but JVM cannot detect this state, this selector will not select the file.</p> | |||||
<p>The <code><symlink></code> selector selects only files that are symbolic links. Ant | |||||
only invokes <code>java.nio.file.Files#isSymbolicLink</code> so if a file is a symbolic link but | |||||
JVM cannot detect this state, this selector will not select the file.</p> | |||||
<p><em>Since Ant 1.10.0</em></p> | <p><em>Since Ant 1.10.0</em></p> | ||||
<h4 id="ownedBy">OwnedBy Selector</h4> | <h4 id="ownedBy">OwnedBy Selector</h4> | ||||
<p>The <code><ownedBy></code> selector selects only files that are owned by the given | <p>The <code><ownedBy></code> selector selects only files that are owned by the given | ||||
user. Ant only invokes <code>java.nio.file.Files#getOwner</code> so if a file system | |||||
doesn't support the operation this selector will not select the file.</p> | |||||
user. Ant only invokes <code>java.nio.file.Files#getOwner</code> so if a file system doesn't | |||||
support the operation this selector will not select the file.</p> | |||||
<p><em>Since Ant 1.10.0</em></p> | <p><em>Since Ant 1.10.0</em></p> | ||||
@@ -932,9 +927,9 @@ | |||||
<p>The <code><scriptselector></code> element enables you to write a complex selection | <p>The <code><scriptselector></code> element enables you to write a complex selection | ||||
algorithm in any <a href="https://jakarta.apache.org/bsf" target="_top">Apache BSF</a> | algorithm in any <a href="https://jakarta.apache.org/bsf" target="_top">Apache BSF</a> | ||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html">JSR | |||||
223</a> supported language. See the <a href="../Tasks/script.html">Script</a> task for an | |||||
explanation of scripts and dependencies.</p> | |||||
or <a href="https://jcp.org/aboutJava/communityprocess/maintenance/jsr223/223ChangeLog.html" | |||||
target="_top">JSR 223</a> supported language. See the <a href="../Tasks/script.html">Script</a> | |||||
task for an explanation of scripts and dependencies.</p> | |||||
<p><em>Since Apache Ant 1.7</em></p> | <p><em>Since Apache Ant 1.7</em></p> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -985,12 +980,12 @@ | |||||
the <a href="../Tasks/script.html">script</a> task on how to use this element.</p> | the <a href="../Tasks/script.html">script</a> task on how to use this element.</p> | ||||
<p>If no <var>src</var> attribute is supplied, the script must be nested inside the selector | <p>If no <var>src</var> attribute is supplied, the script must be nested inside the selector | ||||
declaration.</p> | declaration.</p> | ||||
<p>The embedded script is invoked for every test, with the bean <code>self</code> is bound | |||||
to the selector. It has an attribute <var>selected</var> which can be set | |||||
<p>The embedded script is invoked for every test, with the bean <code>self</code> is bound to | |||||
the selector. It has an attribute <var>selected</var> which can be set | |||||
using <code>setSelected(boolean)</code> to select a file.</p> | using <code>setSelected(boolean)</code> to select a file.</p> | ||||
<p>The following beans are configured for every script, alongside the classic set of | |||||
project, properties, and targets.</p> | |||||
<p>The following beans are configured for every script, alongside the classic set of project, | |||||
properties, and targets.</p> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -1065,8 +1060,8 @@ | |||||
<h3 id="selectcontainers">Selector Containers</h3> | <h3 id="selectcontainers">Selector Containers</h3> | ||||
<p>To create more complex selections, a variety of selectors that contain other selectors | |||||
are available for your use. They combine the selections of their child selectors in various | |||||
<p>To create more complex selections, a variety of selectors that contain other selectors are | |||||
available for your use. They combine the selections of their child selectors in various | |||||
ways.</p> | ways.</p> | ||||
<p>The selector containers are:</p> | <p>The selector containers are:</p> | ||||
@@ -1078,21 +1073,21 @@ | |||||
majority of its selectors select it.</li> | majority of its selectors select it.</li> | ||||
<li><a href="#noneselect"><code><none></code></a>—select a file only if none | <li><a href="#noneselect"><code><none></code></a>—select a file only if none | ||||
of the contained selectors select it.</li> | of the contained selectors select it.</li> | ||||
<li><a href="#notselect"><code><not></code></a>—can contain only one | |||||
selector, and reverses what it selects and doesn't select.</li> | |||||
<li><a href="#notselect"><code><not></code></a>—can contain only one selector, and | |||||
reverses what it selects and doesn't select.</li> | |||||
<li><a href="#orselect"><code><or></code></a>—selects a file if any one of the | <li><a href="#orselect"><code><or></code></a>—selects a file if any one of the | ||||
contained selectors selects it.</li> | contained selectors selects it.</li> | ||||
<li><a href="#selectorselect"><code><selector></code></a>—contains only one | <li><a href="#selectorselect"><code><selector></code></a>—contains only one | ||||
selector and forwards all requests to it without alteration, provided that | selector and forwards all requests to it without alteration, provided that | ||||
any <code>"if"</code> or <code>"unless"</code> conditions are | |||||
met. This is the selector to use if you want to define a reference. It is usable as an | |||||
element of <code><project></code>. It is also the one to use if you want selection | |||||
of files to be dependent on Ant property settings.</li> | |||||
any <code>"if"</code> or <code>"unless"</code> conditions are met. This | |||||
is the selector to use if you want to define a reference. It is usable as an element | |||||
of <code><project></code>. It is also the one to use if you want selection of files to | |||||
be dependent on Ant property settings.</li> | |||||
</ul> | </ul> | ||||
<p>All selector containers can contain any other selector, including other containers, as an | <p>All selector containers can contain any other selector, including other containers, as an | ||||
element. Using containers, the selector tags can be arbitrarily deep. Here is a complete | |||||
list of allowable selector elements within a container:</p> | |||||
element. Using containers, the selector tags can be arbitrarily deep. Here is a complete list of | |||||
allowable selector elements within a container:</p> | |||||
<ul> | <ul> | ||||
<li><code><and></code></li> | <li><code><and></code></li> | ||||
@@ -1113,9 +1108,9 @@ | |||||
<h4 id="andselect">And Selector</h4> | <h4 id="andselect">And Selector</h4> | ||||
<p>The <code><and></code> tag selects files that are selected by all of the elements | |||||
it contains. It returns as soon as it finds a selector that does not select the file, so it | |||||
is not guaranteed to check every selector.</p> | |||||
<p>The <code><and></code> tag selects files that are selected by all of the elements it | |||||
contains. It returns as soon as it finds a selector that does not select the file, so it is not | |||||
guaranteed to check every selector.</p> | |||||
<p>Here is an example of how to use the And Selector:</p> | <p>Here is an example of how to use the And Selector:</p> | ||||
@@ -1132,9 +1127,9 @@ | |||||
<h4 id="majorityselect">Majority Selector</h4> | <h4 id="majorityselect">Majority Selector</h4> | ||||
<p>The <code><majority></code> tag selects files provided that a majority of the | |||||
contained elements also select it. Ties are dealt with as specified by | |||||
the <var>allowtie</var> attribute.</p> | |||||
<p>The <code><majority></code> tag selects files provided that a majority of the contained | |||||
elements also select it. Ties are dealt with as specified by the <var>allowtie</var> | |||||
attribute.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
@@ -1144,8 +1139,8 @@ | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>allowtie</td> | <td>allowtie</td> | ||||
<td>Whether files should be selected if there are an even number of selectors selecting | |||||
them as are not selecting them.</td> | |||||
<td>Whether files should be selected if there are an even number of selectors selecting them | |||||
as are not selecting them.</td> | |||||
<td>No; default is <q>true</q></td> | <td>No; default is <q>true</q></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -1162,14 +1157,14 @@ | |||||
</fileset></pre> | </fileset></pre> | ||||
<p>Selects all the HTML files which contain at least two of the three | <p>Selects all the HTML files which contain at least two of the three | ||||
phrases <q>project</q>, <q>taskdef</q>, and <q>IntrospectionHelper</q> (this last phrase | |||||
must match case exactly).</p> | |||||
phrases <q>project</q>, <q>taskdef</q>, and <q>IntrospectionHelper</q> (this last phrase must | |||||
match case exactly).</p> | |||||
<h4 id="noneselect">None Selector</h4> | <h4 id="noneselect">None Selector</h4> | ||||
<p>The <code><none></code> tag selects files that are not selected by any of the | |||||
elements it contains. It returns as soon as it finds a selector that selects the file, so it | |||||
is not guaranteed to check every selector.</p> | |||||
<p>The <code><none></code> tag selects files that are not selected by any of the elements | |||||
it contains. It returns as soon as it finds a selector that selects the file, so it is not | |||||
guaranteed to check every selector.</p> | |||||
<p>Here is an example of how to use the None Selector:</p> | <p>Here is an example of how to use the None Selector:</p> | ||||
@@ -1204,9 +1199,9 @@ | |||||
<h4 id="orselect">Or Selector</h4> | <h4 id="orselect">Or Selector</h4> | ||||
<p>The <code><or></code> tag selects files that are selected by any one of the | |||||
elements it contains. It returns as soon as it finds a selector that selects the file, so it | |||||
is not guaranteed to check every selector.</p> | |||||
<p>The <code><or></code> tag selects files that are selected by any one of the elements it | |||||
contains. It returns as soon as it finds a selector that selects the file, so it is not | |||||
guaranteed to check every selector.</p> | |||||
<p>Here is an example of how to use the Or Selector:</p> | <p>Here is an example of how to use the Or Selector:</p> | ||||
@@ -1224,15 +1219,15 @@ | |||||
<h4 id="selectorselect">Selector Reference</h4> | <h4 id="selectorselect">Selector Reference</h4> | ||||
<p>The <code><selector></code> tag is used to create selectors that can be reused | |||||
through references. It is the only selector which can be used outside of any target, as an | |||||
element of the <code><project></code> tag. It can contain only one other selector, but | |||||
of course that selector can be a container.</p> | |||||
<p>The <code><selector></code> tag is used to create selectors that can be reused through | |||||
references. It is the only selector which can be used outside of any target, as an element of | |||||
the <code><project></code> tag. It can contain only one other selector, but of course that | |||||
selector can be a container.</p> | |||||
<p>The <code><selector></code> tag can also be used to select files conditionally | |||||
based on whether an Ant property exists or not. This functionality is realized using | |||||
the <var>if</var> and <var>unless</var> attributes in exactly the same way they are used on | |||||
targets or on the <code><include></code> and <code><exclude></code> tags within | |||||
<p>The <code><selector></code> tag can also be used to select files conditionally based on | |||||
whether an Ant property exists or not. This functionality is realized using the <var>if</var> | |||||
and <var>unless</var> attributes in exactly the same way they are used on targets or on | |||||
the <code><include></code> and <code><exclude></code> tags within | |||||
a <code><patternset></code>.</p> | a <code><patternset></code>.</p> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -1283,8 +1278,8 @@ | |||||
</project></pre> | </project></pre> | ||||
<p>Zips up all the java files which have an up-to-date equivalent class file and javadoc | |||||
file associated with them.</p> | |||||
<p>Zips up all the java files which have an up-to-date equivalent class file and javadoc file | |||||
associated with them.</p> | |||||
<p>And an example of selecting files conditionally, based on whether properties are set:</p> | <p>And an example of selecting files conditionally, based on whether properties are set:</p> | ||||
@@ -1312,14 +1307,14 @@ | |||||
<h3 id="customselect">Custom Selectors</h3> | <h3 id="customselect">Custom Selectors</h3> | ||||
<p>You can write your own selectors and use them within the selector containers by | |||||
specifying them within the <code><custom></code> tag.</p> | |||||
<p>You can write your own selectors and use them within the selector containers by specifying | |||||
them within the <code><custom></code> tag.</p> | |||||
<p>First, you have to write your selector class in Java. The only requirement it must meet | |||||
in order to be a selector is that it implements | |||||
the <code>org.apache.tools.ant.types.selectors.FileSelector</code> interface, which contains | |||||
a single method. See <a href="selectors-program.html">Programming Selectors in Ant</a> for | |||||
more information.</p> | |||||
<p>First, you have to write your selector class in Java. The only requirement it must meet in | |||||
order to be a selector is that it implements | |||||
the <code>org.apache.tools.ant.types.selectors.FileSelector</code> interface, which contains a | |||||
single method. See <a href="selectors-program.html">Programming Selectors in Ant</a> for more | |||||
information.</p> | |||||
<p>Once that is written, you include it in your build file by using | <p>Once that is written, you include it in your build file by using | ||||
the <code><custom></code> tag.</p> | the <code><custom></code> tag.</p> | ||||
@@ -1340,15 +1335,15 @@ | |||||
<tr> | <tr> | ||||
<td>classpath</td> | <td>classpath</td> | ||||
<td>The classpath to use in order to load the custom selector class. If | <td>The classpath to use in order to load the custom selector class. If | ||||
neither <var>classpath</var> nor <var>classpathref</var> are specified, the class will | |||||
be loaded from the classpath that Ant uses.</td> | |||||
neither <var>classpath</var> nor <var>classpathref</var> are specified, the class will be | |||||
loaded from the classpath that Ant uses.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>classpathref</td> | <td>classpathref</td> | ||||
<td>A reference to a classpath previously defined. If neither <var>classpathref</var> | <td>A reference to a classpath previously defined. If neither <var>classpathref</var> | ||||
nor <var>classpath</var> are specified, the class will be loaded from the classpath that | |||||
Ant uses.</td> | |||||
nor <var>classpath</var> are specified, the class will be loaded from the classpath that Ant | |||||
uses.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -26,20 +26,19 @@ | |||||
<p><code>TarFileSet</code> has been a stand-alone type <em>since Apache Ant 1.7</em>.</p> | <p><code>TarFileSet</code> has been a stand-alone type <em>since Apache Ant 1.7</em>.</p> | ||||
<p>A <code><tarfileset></code> is a special form of | <p>A <code><tarfileset></code> is a special form of | ||||
a <code><<a href="fileset.html">fileset</a>></code> which can behave in 2 different | |||||
ways:</p> | |||||
a <code><<a href="fileset.html">fileset</a>></code> which can behave in 2 different ways:</p> | |||||
<ul> | <ul> | ||||
<li>When the <var>src</var> attribute is used—or a nested resource collection has been | <li>When the <var>src</var> attribute is used—or a nested resource collection has been | ||||
specified, the tarfileset is populated with tar entries found in the file <var>src</var>.</li> | specified, the tarfileset is populated with tar entries found in the file <var>src</var>.</li> | ||||
<li>When the <var>dir</var> attribute is used, the tarfileset is populated with filesystem | |||||
files found under <var>dir</var>.</li> | |||||
<li>When the <var>dir</var> attribute is used, the tarfileset is populated with filesystem files | |||||
found under <var>dir</var>.</li> | |||||
</ul> | </ul> | ||||
<p><code><tarfileset></code> supports all attributes | <p><code><tarfileset></code> supports all attributes | ||||
of <code><<a href="fileset.html">fileset</a>></code> in addition to those listed below. | |||||
Note that tar archives in general don't contain entries with leading slashes so you shouldn't | |||||
use include/exclude patterns that start with slashes either.</p> | |||||
<p><em>Since Ant 1.7</em>, a tarfileset can be defined with the <var>id</var> attribute and | |||||
referred to with the <var>refid</var> attribute.</p> | |||||
of <code><<a href="fileset.html">fileset</a>></code> in addition to those listed below. Note | |||||
that tar archives in general don't contain entries with leading slashes so you shouldn't use | |||||
include/exclude patterns that start with slashes either.</p> | |||||
<p><em>Since Ant 1.7</em>, a tarfileset can be defined with the <var>id</var> attribute and referred | |||||
to with the <var>refid</var> attribute.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
<tbody> | <tbody> | ||||
@@ -55,14 +54,13 @@ referred to with the <var>refid</var> attribute.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>fullpath</td> | <td>fullpath</td> | ||||
<td>the file described by the fileset is placed at that exact location in the | |||||
archive.</td> | |||||
<td>the file described by the fileset is placed at that exact location in the archive.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>src</td> | <td>src</td> | ||||
<td>may be used in place of the <var>dir</var> attribute to specify a tar file whose | |||||
contents will be extracted and included in the archive.</td> | |||||
<td>may be used in place of the <var>dir</var> attribute to specify a tar file whose contents | |||||
will be extracted and included in the archive.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -100,18 +98,16 @@ referred to with the <var>refid</var> attribute.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>erroronmissingarchive</td> | <td>erroronmissingarchive</td> | ||||
<td>Specify what happens if the archive does not exist. If <q>true</q>, a build error | |||||
will happen; if <q>false</q>, the fileset will be ignored/empty. | |||||
<em>Since Ant 1.8.0</em></td> | |||||
<td>Specify what happens if the archive does not exist. If <q>true</q>, a build error will | |||||
happen; if <q>false</q>, the fileset will be ignored/empty. <em>Since Ant 1.8.0</em></td> | |||||
<td>No; defaults to <q>true</q></td> | <td>No; defaults to <q>true</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>encoding</td> | <td>encoding</td> | ||||
<td>The character encoding to use for filenames inside the zip file. For a list of | |||||
possible values see | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a>. | |||||
<em>Since Ant 1.9.5</em></td> | |||||
<td>The character encoding to use for filenames inside the zip file. For a list of possible | |||||
values see | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a>. <em>Since Ant 1.9.5</em></td> | |||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
@@ -119,12 +115,12 @@ referred to with the <var>refid</var> attribute.</p> | |||||
<p>The <var>fullpath</var> attribute can only be set for filesets that represent a single | <p>The <var>fullpath</var> attribute can only be set for filesets that represent a single | ||||
file. The <var>prefix</var> and <var>fullpath</var> attributes cannot both be set on the same | file. The <var>prefix</var> and <var>fullpath</var> attributes cannot both be set on the same | ||||
fileset.</p> | fileset.</p> | ||||
<p>When using the <var>src</var> attribute, <var>include</var> and <var>exclude</var> patterns | |||||
may be used to specify a subset of the archive for inclusion in the archive as with | |||||
the <var>dir</var> attribute.</p> | |||||
<p>When using the <var>src</var> attribute, <var>include</var> and <var>exclude</var> patterns may | |||||
be used to specify a subset of the archive for inclusion in the archive as with the <var>dir</var> | |||||
attribute.</p> | |||||
<p>Please note that currently only the <a href="../Tasks/tar.html">tar</a> task uses the | |||||
permission and ownership attributes.</p> | |||||
<p>Please note that currently only the <a href="../Tasks/tar.html">tar</a> task uses the permission | |||||
and ownership attributes.</p> | |||||
<h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
@@ -143,11 +139,10 @@ permission and ownership attributes.</p> | |||||
</tarfileset> | </tarfileset> | ||||
</copy></pre> | </copy></pre> | ||||
<p>downloads the archive <samp>some-archive.tar.bz2</samp>, uncompresses and extracts it on the | |||||
fly, copies the contents of the <samp>lib</samp> directory into <samp>some-dir</samp> and | |||||
discards the rest of the archive. File timestamps will be compared between the archive's | |||||
entries and files inside the target directory, no files get overwritten unless they are | |||||
out-of-date.</p> | |||||
<p>downloads the archive <samp>some-archive.tar.bz2</samp>, uncompresses and extracts it on the fly, | |||||
copies the contents of the <samp>lib</samp> directory into <samp>some-dir</samp> and discards the | |||||
rest of the archive. File timestamps will be compared between the archive's entries and files | |||||
inside the target directory, no files get overwritten unless they are out-of-date.</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -26,23 +26,22 @@ | |||||
<h2 id="XMLCatalog">XMLCatalog</h2> | <h2 id="XMLCatalog">XMLCatalog</h2> | ||||
<p>An XMLCatalog is a catalog of public resources such as DTDs or entities that are referenced | |||||
in an XML document. Catalogs are typically used to make web references to resources point to a | |||||
locally cached copy of the resource.</p> | |||||
<p>An XMLCatalog is a catalog of public resources such as DTDs or entities that are referenced in an | |||||
XML document. Catalogs are typically used to make web references to resources point to a locally | |||||
cached copy of the resource.</p> | |||||
<p>This allows the XML Parser, XSLT Processor or other consumer of XML documents to efficiently | <p>This allows the XML Parser, XSLT Processor or other consumer of XML documents to efficiently | ||||
allow a local substitution for a resource available on the web.</p> | allow a local substitution for a resource available on the web.</p> | ||||
<p><strong>Note:</strong> This task <em>uses, but does not depend on</em> external libraries not | <p><strong>Note:</strong> This task <em>uses, but does not depend on</em> external libraries not | ||||
included in the Apache Ant distribution. | |||||
See <a href="../install.html#librarydependencies">Library Dependencies</a> for more | |||||
information.</p> | |||||
included in the Apache Ant distribution. See <a href="../install.html#librarydependencies">Library | |||||
Dependencies</a> for more information.</p> | |||||
<p>This data type provides a catalog of resource locations based on | <p>This data type provides a catalog of resource locations based on | ||||
the <a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">OASIS | |||||
XML Catalog standard</a>. The catalog entries are used both for Entity resolution and URI | |||||
resolution, in accordance with the <code>org.xml.sax.EntityResolver</code> | |||||
the <a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html" | |||||
target="_top">OASIS XML Catalog standard</a>. The catalog entries are used both for Entity | |||||
resolution and URI resolution, in accordance with the <code>org.xml.sax.EntityResolver</code> | |||||
and <code>javax.xml.transform.URIResolver</code> interfaces as defined in | and <code>javax.xml.transform.URIResolver</code> interfaces as defined in | ||||
the <a href="https://download.oracle.com/otn-pub/jcp/jaxp-1_6-mrel3-spec/JAXP1_6-FinalSpec.pdf">Java | |||||
API for XML Processing (JAXP) Specification</a>.</p> | |||||
the <a href="https://download.oracle.com/otn-pub/jcp/jaxp-1_6-mrel3-spec/JAXP1_6-FinalSpec.pdf" | |||||
target="_top">Java API for XML Processing (JAXP) Specification</a>.</p> | |||||
<p>For example, in a <code>web.xml</code> file, the DTD is referenced as:</p> | <p>For example, in a <code>web.xml</code> file, the DTD is referenced as:</p> | ||||
<pre> | <pre> | ||||
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" | <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" | ||||
@@ -75,64 +74,62 @@ the system classpath is used for this as well.</p> | |||||
<p>XMLCatalogs can also be nested inside other XMLCatalogs. For example, a "superset" | <p>XMLCatalogs can also be nested inside other XMLCatalogs. For example, a "superset" | ||||
XMLCatalog could be made by including several nested XMLCatalogs that referred to other, | XMLCatalog could be made by including several nested XMLCatalogs that referred to other, | ||||
previously defined XMLCatalogs.</p> | previously defined XMLCatalogs.</p> | ||||
<p>Resource locations can be specified either in-line or in external catalog file(s), or both. | |||||
In order to use an external catalog file, the xml-commons resolver library | |||||
(<samp>resolver.jar</samp>) must be in your path. External catalog files may be | |||||
either <a href="https://oasis-open.org/committees/entity/background/9401.html">plain text | |||||
format</a> or <a href="https://www.oasis-open.org/committees/entity/spec-2001-08-06.html">XML | |||||
format</a>. If the xml-commons resolver library is not found in the classpath, external catalog | |||||
files, specified in <code>catalogpath</code>, will be ignored and a warning will be logged. In | |||||
this case, however, processing of inline entries will proceed normally.</p> | |||||
<p>Resource locations can be specified either in-line or in external catalog file(s), or both. In | |||||
order to use an external catalog file, the xml-commons resolver library (<samp>resolver.jar</samp>) | |||||
must be in your path. External catalog files may be | |||||
either <a href="https://oasis-open.org/committees/entity/background/9401.html" target="_top">plain | |||||
text format</a> or <a href="https://www.oasis-open.org/committees/entity/spec-2001-08-06.html" | |||||
target="_top">XML format</a>. If the xml-commons resolver library is not found in the classpath, | |||||
external catalog files, specified in <code>catalogpath</code>, will be ignored and a warning will be | |||||
logged. In this case, however, processing of inline entries will proceed normally.</p> | |||||
<p>Currently, only <code><dtd></code> and <code><entity></code> elements may be | <p>Currently, only <code><dtd></code> and <code><entity></code> elements may be | ||||
specified inline; these roughly correspond to OASIS catalog entry types <code>PUBLIC</code> | specified inline; these roughly correspond to OASIS catalog entry types <code>PUBLIC</code> | ||||
and <code>URI</code> respectively. By contrast, external catalog files may use any of the entry | and <code>URI</code> respectively. By contrast, external catalog files may use any of the entry | ||||
types defined in | types defined in | ||||
the <a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">OASIS | |||||
specification</a>.</p> | |||||
the <a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html" | |||||
target="_top">OASIS specification</a>.</p> | |||||
<h3 id="ResolverAlgorithm">Entity/DTD/URI resolution algorithm</h3> | <h3 id="ResolverAlgorithm">Entity/DTD/URI resolution algorithm</h3> | ||||
<p>When an entity, DTD, or URI is looked up by the XML processor, the XMLCatalog searches its | |||||
list of entries to see if any match. That is, it attempts to match the <var>publicId</var> | |||||
attribute of each entry with the PublicID or URI of the entity to be resolved. Assuming a | |||||
matching entry is found, XMLCatalog then executes the following steps:</p> | |||||
<p>When an entity, DTD, or URI is looked up by the XML processor, the XMLCatalog searches its list | |||||
of entries to see if any match. That is, it attempts to match the <var>publicId</var> attribute of | |||||
each entry with the PublicID or URI of the entity to be resolved. Assuming a matching entry is | |||||
found, XMLCatalog then executes the following steps:</p> | |||||
<h4>1. Filesystem lookup</h4> | <h4>1. Filesystem lookup</h4> | ||||
<p>The <var>location</var> is first looked up in the filesystem. If the <var>location</var> is | |||||
a relative path, the Ant project <var>basedir</var> attribute is used as the base directory. If | |||||
the <var>location</var> specifies an absolute path, it is used as is. Once we have an absolute | |||||
path in hand, we check to see if a valid and readable file exists at that path. If so, we are | |||||
done. If not, we proceed to the next step.</p> | |||||
<p>The <var>location</var> is first looked up in the filesystem. If the <var>location</var> is a | |||||
relative path, the Ant project <var>basedir</var> attribute is used as the base directory. If | |||||
the <var>location</var> specifies an absolute path, it is used as is. Once we have an absolute path | |||||
in hand, we check to see if a valid and readable file exists at that path. If so, we are done. If | |||||
not, we proceed to the next step.</p> | |||||
<h4>2. Classpath lookup</h4> | <h4>2. Classpath lookup</h4> | ||||
<p>The <var>location</var> is next looked up in the classpath. Recall that jar files are merely | <p>The <var>location</var> is next looked up in the classpath. Recall that jar files are merely | ||||
fancy zip files. For classpath lookup, the <var>location</var> is used as is (no base is | fancy zip files. For classpath lookup, the <var>location</var> is used as is (no base is | ||||
prepended). We use a Classloader to attempt to load the resource from the classpath. For | |||||
example, if <samp>hello.jar</samp> is in the classpath and it | |||||
contains <samp>foo/bar/blat.dtd</samp> it will resolve an entity whose <var>location</var> | |||||
is <samp>foo/bar/blat.dtd</samp>. Of course, it will <em>not</em> resolve an entity | |||||
whose <var>location</var> is <code>blat.dtd</code>.</p> | |||||
prepended). We use a Classloader to attempt to load the resource from the classpath. For example, | |||||
if <samp>hello.jar</samp> is in the classpath and it contains <samp>foo/bar/blat.dtd</samp> it will | |||||
resolve an entity whose <var>location</var> is <samp>foo/bar/blat.dtd</samp>. Of course, it | |||||
will <em>not</em> resolve an entity whose <var>location</var> is <code>blat.dtd</code>.</p> | |||||
<h4>3a. Apache xml-commons resolver lookup</h4> | <h4>3a. Apache xml-commons resolver lookup</h4> | ||||
<p>What happens next depends on whether the resolver library from xml-commons is available on | |||||
the classpath. If so, we defer all further attempts at resolving to it. The resolver library | |||||
supports extremely sophisticated functionality like URL rewriting and so on, which can be | |||||
accessed by making the appropriate entries in external catalog files (XMLCatalog does not yet | |||||
provide inline support for all of the entries defined in | |||||
the <a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html">OASIS | |||||
standard</a>).</p> | |||||
<p>What happens next depends on whether the resolver library from xml-commons is available on the | |||||
classpath. If so, we defer all further attempts at resolving to it. The resolver library supports | |||||
extremely sophisticated functionality like URL rewriting and so on, which can be accessed by making | |||||
the appropriate entries in external catalog files (XMLCatalog does not yet provide inline support | |||||
for all of the entries defined in | |||||
the <a href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html" | |||||
target="_top">OASIS standard</a>).</p> | |||||
<h4>3. URL-space lookup</h4> | <h4>3. URL-space lookup</h4> | ||||
<p>Finally, we attempt to make a URL out of the <var>location</var>. At first this may seem | |||||
like this would defeat the purpose of XMLCatalogs—why go back out to the internet? But in | |||||
fact, this can be used to (in a sense) implement HTTP redirects, substituting one URL for | |||||
another. The mapped-to URL might also be served by a local web server. If the URL resolves to | |||||
a valid and readable resource, we are done. Otherwise, we give up. In this case, the XML | |||||
processor will perform its normal resolution algorithm. Depending on the processor | |||||
configuration, further resolution failures may or may not result in fatal (i.e. build-ending) | |||||
errors.</p> | |||||
<p>Finally, we attempt to make a URL out of the <var>location</var>. At first this may seem like | |||||
this would defeat the purpose of XMLCatalogs—why go back out to the internet? But in fact, | |||||
this can be used to (in a sense) implement HTTP redirects, substituting one URL for another. The | |||||
mapped-to URL might also be served by a local web server. If the URL resolves to a valid and | |||||
readable resource, we are done. Otherwise, we give up. In this case, the XML processor will | |||||
perform its normal resolution algorithm. Depending on the processor configuration, further | |||||
resolution failures may or may not result in fatal (i.e. build-ending) errors.</p> | |||||
<h3>XMLCatalog attributes</h3> | <h3>XMLCatalog attributes</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -173,26 +170,25 @@ identical in their structure</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>location</td> | <td>location</td> | ||||
<td>The location of the local replacement to be used for the public identifier | |||||
specified. This may be specified as a file name, resource name found on the classpath, or a | |||||
URL. Relative paths will be resolved according to the base, which by default is the Ant | |||||
<td>The location of the local replacement to be used for the public identifier specified. This | |||||
may be specified as a file name, resource name found on the classpath, or a URL. Relative paths | |||||
will be resolved according to the base, which by default is the Ant | |||||
project <var>basedir</var>.</td> | project <var>basedir</var>.</td> | ||||
<td>Yes</td> | <td>Yes</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h4>classpath</h4> | <h4>classpath</h4> | ||||
<p>The classpath to use for <a href="#ResolverAlgorithm">entity resolution</a>. The | <p>The classpath to use for <a href="#ResolverAlgorithm">entity resolution</a>. The | ||||
nested <code><classpath></code> is a <a href="../using.html#path">path</a>-like | |||||
structure.</p> | |||||
nested <code><classpath></code> is a <a href="../using.html#path">path</a>-like structure.</p> | |||||
<h4>catalogpath</h4> | <h4>catalogpath</h4> | ||||
<p>The nested <code>catalogpath</code> element is a <a href="../using.html#path">path</a>-like | <p>The nested <code>catalogpath</code> element is a <a href="../using.html#path">path</a>-like | ||||
structure listing catalog files to search. All files in this path are assumed to be OASIS | |||||
catalog files, in | |||||
either <a href="https://oasis-open.org/committees/entity/background/9401.html">plain text | |||||
format</a> or <a href="https://www.oasis-open.org/committees/entity/spec-2001-08-06.html">XML | |||||
structure listing catalog files to search. All files in this path are assumed to be OASIS catalog | |||||
files, in either <a href="https://oasis-open.org/committees/entity/background/9401.html" | |||||
target="_top">plain text format</a> | |||||
or <a href="https://www.oasis-open.org/committees/entity/spec-2001-08-06.html" target="_top">XML | |||||
format</a>. Entries specifying nonexistent files will be ignored. If the resolver library from | format</a>. Entries specifying nonexistent files will be ignored. If the resolver library from | ||||
xml-commons is not available in the classpath, all <code>catalogpath</code>s will be ignored and | |||||
a warning will be logged.</p> | |||||
xml-commons is not available in the classpath, all <code>catalogpath</code>s will be ignored and a | |||||
warning will be logged.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<p>Set up an XMLCatalog with a single DTD referenced locally in a user's home directory:</p> | <p>Set up an XMLCatalog with a single DTD referenced locally in a user's home directory:</p> | ||||
<pre> | <pre> | ||||
@@ -24,22 +24,21 @@ | |||||
<h2 id="fileset">ZipFileSet</h2> | <h2 id="fileset">ZipFileSet</h2> | ||||
<p>A <code><zipfileset></code> is a special form of | <p>A <code><zipfileset></code> is a special form of | ||||
a <code><<a href="fileset.html">fileset</a>></code> which can behave in 2 different | |||||
ways:</p> | |||||
a <code><<a href="fileset.html">fileset</a>></code> which can behave in 2 different ways:</p> | |||||
<ul> | <ul> | ||||
<li>When the <var>src</var> attribute is used—or a nested resource collection has been | <li>When the <var>src</var> attribute is used—or a nested resource collection has been | ||||
specified (<em>since Apache Ant 1.7</em>), the zipfileset is populated with zip entries found | |||||
in the file <var>src</var>.</li> | |||||
<li>When the <var>dir</var> attribute is used, the zipfileset is populated with filesystem | |||||
files found under <var>dir</var>.</li> | |||||
specified (<em>since Apache Ant 1.7</em>), the zipfileset is populated with zip entries found in | |||||
the file <var>src</var>.</li> | |||||
<li>When the <var>dir</var> attribute is used, the zipfileset is populated with filesystem files | |||||
found under <var>dir</var>.</li> | |||||
</ul> | </ul> | ||||
<p><code><zipfileset></code> supports all attributes | <p><code><zipfileset></code> supports all attributes | ||||
of <code><<a href="fileset.html">fileset</a>></code> in addition to those listed below. | |||||
Note that zip archives in general don't contain entries with leading slashes so you shouldn't | |||||
of <code><<a href="fileset.html">fileset</a>></code> in addition to those listed below. Note | |||||
that zip archives in general don't contain entries with leading slashes so you shouldn't | |||||
use <var>includes</var>/<var>excludes</var> patterns that start with slashes either.</p> | use <var>includes</var>/<var>excludes</var> patterns that start with slashes either.</p> | ||||
<p><em>Since Ant 1.6</em>, a zipfileset can be defined with the <var>id</var> attribute and | |||||
referred to with the <var>refid</var> attribute.</p> | |||||
<p><em>Since Ant 1.6</em>, a zipfileset can be defined with the <var>id</var> attribute and referred | |||||
to with the <var>refid</var> attribute.</p> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table class="attr"> | <table class="attr"> | ||||
@@ -61,37 +60,34 @@ referred to with the <var>refid</var> attribute.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>src</td> | <td>src</td> | ||||
<td>may be used in place of the <var>dir</var> attribute to specify a zip file whose | |||||
contents will be extracted and included in the archive.</td> | |||||
<td>may be used in place of the <var>dir</var> attribute to specify a zip file whose contents | |||||
will be extracted and included in the archive.</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>filemode</td> | <td>filemode</td> | ||||
<td>A 3 digit octal string, specify the user, group and other modes in the standard Unix | <td>A 3 digit octal string, specify the user, group and other modes in the standard Unix | ||||
fashion. Only applies to plain files. <em>Since Ant 1.5.2</em></td> | |||||
fashion. Only applies to plain files. <em>Since Ant 1.5.2</em></td> | |||||
<td>No; default is <q>644</q></td> | <td>No; default is <q>644</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>dirmode</td> | <td>dirmode</td> | ||||
<td>A 3 digit octal string, specify the user, group and other modes in the standard Unix | <td>A 3 digit octal string, specify the user, group and other modes in the standard Unix | ||||
fashion. Only applies to directories. <em>Since Ant 1.5.2</em></td> | |||||
fashion. Only applies to directories. <em>Since Ant 1.5.2</em></td> | |||||
<td>No; default is <q>755</q></td> | <td>No; default is <q>755</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>encoding</td> | <td>encoding</td> | ||||
<td>The character encoding to use for filenames inside the zip file. For a list of | |||||
possible values see | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported | |||||
Encodings</a>. | |||||
<td>The character encoding to use for filenames inside the zip file. For a list of possible | |||||
values see | |||||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html" | |||||
target="_top">Supported Encodings</a>. | |||||
<td>No; defaults to default JVM character encoding</td> | <td>No; defaults to default JVM character encoding</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>erroronmissingarchive</td> | <td>erroronmissingarchive</td> | ||||
<td> | |||||
Specify what happens if the archive does not exist. If <q>true</q>, a build error will | |||||
happen; if <q>false</q>, the fileset will be ignored/empty. | |||||
<em>Since Ant 1.8.0</em> | |||||
</td> | |||||
<td>Specify what happens if the archive does not exist. If <q>true</q>, a build error will | |||||
happen; if <q>false</q>, the fileset will be ignored/empty. <em>Since Ant 1.8.0</em></td> | |||||
<td>No; defaults to <q>true</q></td> | <td>No; defaults to <q>true</q></td> | ||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
@@ -22,14 +22,13 @@ | |||||
<body> | <body> | ||||
<h2>Apache Ant API has not been generated</h2> | <h2>Apache Ant API has not been generated</h2> | ||||
<p>If you see this page online | |||||
at <a href="https://ant.apache.org/">ant.apache.org</a>, it is not a bug, but | |||||
on purpose. We do not provide an online version of the API docs, they | |||||
are included with all our distributions.</p> | |||||
<p>If you see this page online at <a target="_top" | |||||
href="https://ant.apache.org/">ant.apache.org</a>, it is not a bug, but on purpose. We do not | |||||
provide an online version of the API docs, they are included with all our distributions.</p> | |||||
<p>Ant's manual and API documentation is part of | <p>Ant's manual and API documentation is part of | ||||
the <a href="https://ant.apache.org/bindownload.cgi">binary</a> | |||||
distributions or available as a | |||||
separate <a href="https://ant.apache.org/manualdownload.cgi">archive</a>.</p> | |||||
the <a href="https://ant.apache.org/bindownload.cgi" target="_top">binary</a> distributions or | |||||
available as a separate <a href="https://ant.apache.org/manualdownload.cgi" | |||||
target="_top">archive</a>.</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -25,22 +25,20 @@ | |||||
<body> | <body> | ||||
<h1 class="center"><img src="images/ant_logo_large.gif" width="190" height="120"></h1> | <h1 class="center"><img src="images/ant_logo_large.gif" width="190" height="120"></h1> | ||||
<h1 class="center">Apache Ant™ 1.10.3 Manual</h1> | <h1 class="center">Apache Ant™ 1.10.3 Manual</h1> | ||||
<p>This is the manual for version 1.10.3 | |||||
of <a target="_top" href="https://ant.apache.org/">Apache Ant</a>. If your version | |||||
of Ant (as verified with <code>ant -version</code>) is older or newer | |||||
than this version then this is not the correct manual set. Please | |||||
use the documentation appropriate to your current version. Also, | |||||
if you are using a version older than the most recent release, we | |||||
recommend an upgrade to fix bugs as well as provide new functionality.</p> | |||||
<p>This is the manual for version 1.10.3 of <a href="https://ant.apache.org/" target="_top">Apache Ant</a>. If your | |||||
version of Ant (as verified with <code>ant -version</code>) is older or newer than this version then this is not the | |||||
correct manual set. Please use the documentation appropriate to your current version. Also, if you are using a | |||||
version older than the most recent release, we recommend an upgrade to fix bugs as well as provide new | |||||
functionality.</p> | |||||
<p>Ant's manual and API documentation is part of | |||||
the <a href="https://ant.apache.org/bindownload.cgi">binary</a> | |||||
distributions or available as a | |||||
separate <a href="https://ant.apache.org/manualdownload.cgi">archive</a>. | |||||
Manuals for older releases are available for | |||||
download <a href="https://ant.apache.org/bindownload.cgi#Old Ant Releases">as well</a>.</p> | |||||
<p>Ant's manual and API documentation is part of the <a href="https://ant.apache.org/bindownload.cgi" | |||||
target="_top">binary</a> distributions or available as a | |||||
separate <a href="https://ant.apache.org/manualdownload.cgi" target="_top">archive</a>. Manuals for older releases | |||||
are available for download <a href="https://ant.apache.org/bindownload.cgi#Old Ant Releases" target="_top">as | |||||
well</a>.</p> | |||||
<p class="center">Apache Ant, Apache Ivy, Ant, Ivy, Apache, the Apache feather logo, and the Apache Ant project logos are trademarks of The Apache Software Foundation.</p> | |||||
<p class="center">Apache Ant, Apache Ivy, Ant, Ivy, Apache, the Apache feather logo, and the Apache Ant project logos | |||||
are trademarks of The Apache Software Foundation.</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -473,13 +473,13 @@ public class MyLogAdapter implements BuildListener { | |||||
positively encouraged. Both changes to the existing source and new tasks can be incorporated back | 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.</p> | into the Ant codebase, which benefits all users and spreads the maintenance load around.</p> | ||||
<p>Please consult the <a href="https://www.apache.org/foundation/getinvolved.html">Getting | |||||
Involved</a> pages on the Apache web site for details on how to fetch the latest source and how to | |||||
submit changes for reincorporation into the source tree.</p> | |||||
<p>Please consult the <a href="https://www.apache.org/foundation/getinvolved.html" | |||||
target="_top">Getting Involved</a> pages on the Apache web site 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 <a href="https://ant.apache.org/ant_task_guidelines.html">task guidelines</a> | |||||
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.</p> | |||||
<p>Ant also has some <a href="https://ant.apache.org/ant_task_guidelines.html" target="_top">task | |||||
guidelines</a> 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.</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -30,8 +30,8 @@ | |||||
<h3>Developing with Apache Ant</h3> | <h3>Developing with Apache Ant</h3> | ||||
<ul class="inlinelist"> | <ul class="inlinelist"> | ||||
<li><a href="https://ant.apache.org/ant_in_anger.html">Ant in Anger</a> <small>(online)</small></li> | |||||
<li><a href="https://ant.apache.org/ant_task_guidelines.html">Ant Task Guidelines</a> <small>(online)</small></li> | |||||
<li><a href="https://ant.apache.org/ant_in_anger.html" target="_top">Ant in Anger</a> <small>(online)</small></li> | |||||
<li><a href="https://ant.apache.org/ant_task_guidelines.html" target="_top">Ant Task Guidelines</a> <small>(online)</small></li> | |||||
<li><a href="develop.html#writingowntask">Writing Your Own Task</a></li> | <li><a href="develop.html#writingowntask">Writing Your Own Task</a></li> | ||||
<li><a href="base_task_classes.html">Tasks Designed for Extension</a></li> | <li><a href="base_task_classes.html">Tasks Designed for Extension</a></li> | ||||
<li><a href="develop.html#buildevents">Build Events</a></li> | <li><a href="develop.html#buildevents">Build Events</a></li> | ||||
@@ -25,45 +25,44 @@ | |||||
<body> | <body> | ||||
<h1 id="feedback">Feedback and Troubleshooting</h1> | <h1 id="feedback">Feedback and Troubleshooting</h1> | ||||
<p>If things do not work, especially simple things like <code>ant -version</code>, | |||||
then something is wrong with your configuration. Before filing bug reports and | |||||
emailing all the Apache Ant mailing lists</p> | |||||
<p>If things do not work, especially simple things like <code>ant -version</code>, then something is | |||||
wrong with your configuration. Before filing bug reports and emailing all the Apache Ant mailing | |||||
lists</p> | |||||
<ol> | <ol> | ||||
<li>Check your environment variables. Are <code>ANT_HOME</code> and <code>JAVA_HOME</code> correct? If | |||||
they have quotes or trailing slashes, remove them.</li> | |||||
<li>Unset <code>CLASSPATH</code>; if that is wrong things go horribly wrong. Ant does not | |||||
need the <code>CLASSPATH</code> variable defined to anything to work.</li> | |||||
<li>Make sure there are no versions of <samp>crimson.jar</samp> or other XML parsers in <samp>JAVA_HOME/jre/lib/ext</samp></li> | |||||
<li>Check your environment variables. Are <code>ANT_HOME</code> and <code>JAVA_HOME</code> | |||||
correct? If they have quotes or trailing slashes, remove them.</li> | |||||
<li>Unset <code>CLASSPATH</code>; if that is wrong things go horribly wrong. Ant does not need | |||||
the <code>CLASSPATH</code> variable defined to anything to work.</li> | |||||
<li>Make sure there are no versions of <samp>crimson.jar</samp> or other XML parsers | |||||
in <samp>JAVA_HOME/jre/lib/ext</samp></li> | |||||
<li>Is your path correct? is Ant on it? What about <samp>JAVA_HOME/bin</samp>? have you tested | <li>Is your path correct? is Ant on it? What about <samp>JAVA_HOME/bin</samp>? have you tested | ||||
this? If you are using Jikes, is it on the path? A CreateProcess error (especially | this? If you are using Jikes, is it on the path? A CreateProcess error (especially | ||||
with <code>error=2</code>) on Windows usually means executable not found on the path.</li> | with <code>error=2</code>) on Windows usually means executable not found on the path.</li> | ||||
<li>Which version of ant are you running? Other applications distribute a copy | |||||
-it may be being picked up by accident.</li> | |||||
<li>If a task failing to run is from <samp>optional.jar</samp> in <samp>ANT_HOME/lib</samp>? Are there any | |||||
libraries which it depends on missing?</li> | |||||
<li>If a task doesn't do what you expect, run <code>ant -verbose</code> or <code>ant | |||||
-debug</code> to see what is happening</li> | |||||
<li>Which version of ant are you running? Other applications distribute a copy—it may be | |||||
being picked up by accident.</li> | |||||
<li>If a task failing to run is from <samp>optional.jar</samp> in <samp>ANT_HOME/lib</samp>? Are | |||||
there any libraries which it depends on missing?</li> | |||||
<li>If a task doesn't do what you expect, run <code>ant -verbose</code> or <code>ant -debug</code> | |||||
to see what is happening</li> | |||||
</ol> | </ol> | ||||
<p>If you can't fix your problem, start with the <a href="https://ant.apache.org/mail.html" target="_top">Ant | |||||
User Mailing List</a>. These are other ant users who will help you learn to | |||||
use ant. If they cannot fix it then someone may suggest filing a bug report, | |||||
which will escalate the issue. Remember of course, that support, like all open | |||||
source development tasks, is voluntary. If you haven't invested time in helping | |||||
yourself by following the steps above, it is unlikely that anyone will invest | |||||
the time in helping you.</p> | |||||
<p>Also, if you don't understand something, the <a href="https://ant.apache.org/mail.html" target="_top">Ant | |||||
User Mailing List</a> is the place to ask questions. Not the developer list, | |||||
nor the individuals whose names appears in the source and documentation. If | |||||
they answered all such emails, nobody would have any time to improve Ant.</p> | |||||
<p>To provide feedback on this software, please subscribe to the <a href="https://ant.apache.org/mail.html" target="_top">Ant | |||||
User Mailing List</a></p> | |||||
<p>If you want to contribute to Ant or stay current with the latest | |||||
development, join | |||||
<p>If you can't fix your problem, start with the <a href="https://ant.apache.org/mail.html" | |||||
target="_top">Ant User Mailing List</a>. These are other ant users who will help you learn to use | |||||
ant. If they cannot fix it then someone may suggest filing a bug report, which will escalate the | |||||
issue. Remember of course, that support, like all open source development tasks, is voluntary. If | |||||
you haven't invested time in helping yourself by following the steps above, it is unlikely that | |||||
anyone will invest the time in helping you.</p> | |||||
<p>Also, if you don't understand something, the <a href="https://ant.apache.org/mail.html" | |||||
target="_top">Ant User Mailing List</a> is the place to ask questions. Not the developer list, nor | |||||
the individuals whose names appears in the source and documentation. If they answered all such | |||||
emails, nobody would have any time to improve Ant.</p> | |||||
<p>To provide feedback on this software, please subscribe to | |||||
the <a href="https://ant.apache.org/mail.html" target="_top">Ant User Mailing List</a></p> | |||||
<p>If you want to contribute to Ant or stay current with the latest development, join | |||||
the <a href="https://ant.apache.org/mail.html" target="_top">Ant Development Mailing List</a></p> | the <a href="https://ant.apache.org/mail.html" target="_top">Ant Development Mailing List</a></p> | ||||
<p>A searchable archive can be found | |||||
at <a href="https://marc.info" target="_top">https://marc.info</a>. Other | |||||
archives will be documented online | |||||
at <a href="https://ant.apache.org/mail.html#Archives" target="_top">Mailing Lists Archives</a></p> | |||||
<p>A searchable archive can be found at <a href="https://marc.info" | |||||
target="_top">https://marc.info</a>. Other archives will be documented online | |||||
at <a href="https://ant.apache.org/mail.html#Archives" target="_top">Mailing Lists | |||||
Archives</a></p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -34,38 +34,40 @@ All the modern Java IDEs support Apache Ant almost out of the box. | |||||
<ul> | <ul> | ||||
<li> | <li> | ||||
<a href="Integration/jext-plugin.html">AntWork Plugin for the Jext Java Text Editor (unbundled)</a> | |||||
<a href="Integration/jext-plugin.html">AntWork Plugin for the Jext Java Text Editor | |||||
(unbundled)</a> | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="http://jdee.sourceforge.net/">JDEE (Java Development Environment for Emacs)</a> | |||||
has built-in text Ant integration: selection of target through text | |||||
field, execution, hyperlink to compilation errors. Installation: built-in | |||||
JDEE 2.2.8 or later. Configuration: through customize menu | |||||
"Jde Build Function" | |||||
<a href="http://jdee.sourceforge.net/" target="_top">JDEE (Java Development Environment for | |||||
Emacs)</a> has built-in text Ant integration: selection of target through text field, execution, | |||||
hyperlink to compilation errors. Installation: built-in JDEE 2.2.8 or later. Configuration: | |||||
through customize menu "Jde Build Function" | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="https://www.jetbrains.com/idea/">IDEA</a> has built-in | |||||
GUI ANT integration: GUI selection of targets, execution, hyperlink to compilation errors | |||||
<a href="https://www.jetbrains.com/idea/" target="_top">IDEA</a> has built-in GUI ANT | |||||
integration: GUI selection of targets, execution, hyperlink to compilation errors | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="http://ant.netbeans.org/">NetBeans</a> | |||||
IDE uses Ant as the basis for its project system starting with the 4.0 release | |||||
<a href="http://ant.netbeans.org/" target="_top">NetBeans</a> IDE uses Ant as the basis for its | |||||
project system starting with the 4.0 release | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="http://jedit.org/">jEdit</a> | |||||
is an open source Java IDE with some great plugins for Java dev, a | |||||
good XML editor and the Antfarm plugin to execute targets in a build file | |||||
<a href="http://jedit.org/" target="_top">jEdit</a> is an open source Java IDE with some great | |||||
plugins for Java dev, a good XML editor and the Antfarm plugin to execute targets in a build | |||||
file | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="https://eclipse.org/">Eclipse</a> | |||||
is IBM's counterpoint to NetBeans; an open source IDE with Java and Ant support | |||||
<a href="https://eclipse.org/" target="_top">Eclipse</a> is IBM's counterpoint to NetBeans; an | |||||
open source IDE with Java and Ant support | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="http://www.placidsystems.com/virtualant/">Virtual Ant</a> | |||||
GUI allows you to work on a Virtual File System without dealing with the XML; plugs into Eclipse, Netbeans & IntelliJ | |||||
<a href="http://www.placidsystems.com/virtualant/" target="_top">Virtual Ant</a> GUI allows you | |||||
to work on a Virtual File System without dealing with the XML; plugs into Eclipse, Netbeans | |||||
& IntelliJ | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<a href="https://www.ibm.com/developerworks/offers/wsad2.html">WebSphere Studio Application Developer</a> | |||||
<a href="https://www.ibm.com/developerworks/offers/wsad2.html" target="_top">WebSphere Studio | |||||
Application Developer</a> | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -169,21 +169,21 @@ target="_top">https://archive.apache.org/dist/ant/</a>. The files are organized | |||||
<td><samp>ant-current-*.asc</samp></td> | <td><samp>ant-current-*.asc</samp></td> | ||||
<td> | <td> | ||||
Security file for checking the correctness of the zip file. This one is | Security file for checking the correctness of the zip file. This one is | ||||
the <a href="https://en.wikipedia.org/wiki/Pretty_Good_Privacy" target="_blank">PGP</a> signature. | |||||
the <a href="https://en.wikipedia.org/wiki/Pretty_Good_Privacy" target="_top">PGP</a> signature. | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><samp>ant-current-*.md5</samp></td> | <td><samp>ant-current-*.md5</samp></td> | ||||
<td> | <td> | ||||
Security file for checking the correctness of the zip file. This one is | Security file for checking the correctness of the zip file. This one is | ||||
the <a href="https://en.wikipedia.org/wiki/Md5" target="_blank">MD5</a> checksum. | |||||
the <a href="https://en.wikipedia.org/wiki/Md5" target="_top">MD5</a> checksum. | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><samp>ant-current-*.sha1</samp></td> | <td><samp>ant-current-*.sha1</samp></td> | ||||
<td> | <td> | ||||
Security file for checking the correctness of the zip file. This one is | Security file for checking the correctness of the zip file. This one is | ||||
the <a href="https://en.wikipedia.org/wiki/SHA-1" target="_blank">SHA1</a> checksum. | |||||
the <a href="https://en.wikipedia.org/wiki/SHA-1" target="_top">SHA1</a> checksum. | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -241,7 +241,7 @@ The more up-to-date the version of Java, the more Ant tasks you get. | |||||
<h3>Open Source Java Runtimes</h3> | <h3>Open Source Java Runtimes</h3> | ||||
<p> | <p> | ||||
The Ant team strongly supports users running Ant on <a target="_blank" href="http://openjdk.java.net/">OpenJDK</a> and | |||||
The Ant team strongly supports users running Ant on <a href="http://openjdk.java.net/" target="_top">OpenJDK</a> and | |||||
other open source Java runtimes, and so strives to have a product that works well on those platforms. | other open source Java runtimes, and so strives to have a product that works well on those platforms. | ||||
</p> | </p> | ||||
@@ -665,8 +665,8 @@ installed. See <a href="#installing">Installing Ant</a> for examples on how to d | |||||
</p> | </p> | ||||
<p> | <p> | ||||
<strong>Note</strong>: The bootstrap process of Ant requires a greedy compiler like OpenJDK or Oracle's javac. It does not work | |||||
with gcj or kjc. | |||||
<strong>Note</strong>: The bootstrap process of Ant requires a greedy compiler like OpenJDK or Oracle's javac. It does | |||||
not work with gcj or kjc. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
@@ -684,8 +684,8 @@ on how to do this. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
<em>Since Ant 1.7.0</em>, Ant has a hard dependency on JUnit. The <samp>fetch.xml</samp> build script will download JUnit | |||||
automatically, but if you don't use this you must install it manually into <samp>lib/optional</samp> (download it | |||||
<em>Since Ant 1.7.0</em>, Ant has a hard dependency on JUnit. The <samp>fetch.xml</samp> build script will download | |||||
JUnit automatically, but if you don't use this you must install it manually into <samp>lib/optional</samp> (download it | |||||
from <a href="https://junit.org/" target="_top">JUnit.org</a>) if you are using a source distribution of Ant. | from <a href="https://junit.org/" target="_top">JUnit.org</a>) if you are using a source distribution of Ant. | ||||
</p> | </p> | ||||
@@ -708,7 +708,7 @@ The above action does the following: | |||||
<li>If necessary it will bootstrap the Ant code. Bootstrapping involves the manual compilation of enough Ant code to be | <li>If necessary it will bootstrap the Ant code. Bootstrapping involves the manual compilation of enough Ant code to be | ||||
able to run Ant. The bootstrapped Ant is used for the remainder of the build steps.</li> | able to run Ant. The bootstrapped Ant is used for the remainder of the build steps.</li> | ||||
<li>Invokes the bootstrapped Ant with the parameters passed to the build script. In this case, these parameters define | <li>Invokes the bootstrapped Ant with the parameters passed to the build script. In this case, these parameters define | ||||
an Ant property value and specify the "dist" target in Ant's own <samp>build.xml</samp> file.</li> | |||||
an Ant property value and specify the <q>dist</q> target in Ant's own <samp>build.xml</samp> file.</li> | |||||
<li>Create the <samp>ant.jar</samp> and <samp>ant-launcher.jar</samp> JAR files</li> | <li>Create the <samp>ant.jar</samp> and <samp>ant-launcher.jar</samp> JAR files</li> | ||||
<li>Create optional JARs for which the build had the relevant libraries. If a particular library is missing | <li>Create optional JARs for which the build had the relevant libraries. If a particular library is missing | ||||
from <samp>lib/optional</samp>, then the matching ant-library JAR file will not be created. For | from <samp>lib/optional</samp>, then the matching ant-library JAR file will not be created. For | ||||
@@ -876,7 +876,7 @@ these tasks available. Please refer to the <a href="#optionalTasks">Installing A | |||||
and <a href="Tasks/telnet.html">telnet</a> tasks<br/> A minimum version of commons-net of 1.4.0 is needed to | and <a href="Tasks/telnet.html">telnet</a> tasks<br/> A minimum version of commons-net of 1.4.0 is needed to | ||||
compile Ant, earlier versions did not support the full range of configuration options.<br/>jakarta-oro 2.0.8 is | compile Ant, earlier versions did not support the full range of configuration options.<br/>jakarta-oro 2.0.8 is | ||||
required together with commons-net 1.4.x at run time.<br/><strong>Note</strong>: do not use commons-net 3.2 | required together with commons-net 1.4.x at run time.<br/><strong>Note</strong>: do not use commons-net 3.2 | ||||
because of <a href="https://issues.apache.org/jira/browse/NET-493">performance issues</a> | |||||
because of <a href="https://issues.apache.org/jira/browse/NET-493" target="_top">performance issues</a> | |||||
</td> | </td> | ||||
<td><a href="https://commons.apache.org/net/" target="_top">https://commons.apache.org/net/</a></td> | <td><a href="https://commons.apache.org/net/" target="_top">https://commons.apache.org/net/</a></td> | ||||
</tr> | </tr> | ||||
@@ -890,8 +890,7 @@ these tasks available. Please refer to the <a href="#optionalTasks">Installing A | |||||
<td>javax.mail-api.jar</td> | <td>javax.mail-api.jar</td> | ||||
<td><a href="Tasks/mail.html">mail</a> task with MIME encoding, | <td><a href="Tasks/mail.html">mail</a> task with MIME encoding, | ||||
and <em><u>deprecated</u></em> <a href="Tasks/mimemail.html">mimemail</a> task</td> | and <em><u>deprecated</u></em> <a href="Tasks/mimemail.html">mimemail</a> task</td> | ||||
<td><a href="https://javaee.github.io/javamail/" | |||||
target="_top">https://javaee.github.io/javamail/</a></td> | |||||
<td><a href="https://javaee.github.io/javamail/" target="_top">https://javaee.github.io/javamail/</a></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>activation.jar<br/>(included in Java 6 and later runtime)</td> | <td>activation.jar<br/>(included in Java 6 and later runtime)</td> | ||||
@@ -903,8 +902,7 @@ these tasks available. Please refer to the <a href="#optionalTasks">Installing A | |||||
<tr> | <tr> | ||||
<td>jdepend.jar</td> | <td>jdepend.jar</td> | ||||
<td><a href="Tasks/jdepend.html">jdepend</a> task</td> | <td><a href="Tasks/jdepend.html">jdepend</a> task</td> | ||||
<td><a href="https://github.com/clarkware/jdepend" | |||||
target="_top">https://github.com/clarkware/jdepend</a></td> | |||||
<td><a href="https://github.com/clarkware/jdepend" target="_top">https://github.com/clarkware/jdepend</a></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>resolver.jar <strong>1.1 or later</strong></td> | <td>resolver.jar <strong>1.1 or later</strong></td> | ||||
@@ -27,8 +27,8 @@ | |||||
<h2 id="Overview">Overview</h2> | <h2 id="Overview">Overview</h2> | ||||
<p>Apache Ant has two related features to allow the build process to be monitored: | |||||
listeners and loggers.</p> | |||||
<p>Apache Ant has two related features to allow the build process to be monitored: listeners and | |||||
loggers.</p> | |||||
<h3 id="Listeners">Listeners</h3> | <h3 id="Listeners">Listeners</h3> | ||||
@@ -44,19 +44,16 @@ listeners and loggers.</p> | |||||
<li>message logged</li> | <li>message logged</li> | ||||
</ul> | </ul> | ||||
<p> | |||||
These are used internally for various recording and housekeeping operations, | |||||
however new listeners may registered on the command line through the <code>-listener</code> | |||||
argument. | |||||
</p> | |||||
<p>These are used internally for various recording and housekeeping operations, however new | |||||
listeners may registered on the command line through the <code>-listener</code> argument.</p> | |||||
<h3 id="Loggers">Loggers</h3> | <h3 id="Loggers">Loggers</h3> | ||||
<p>Loggers extend the capabilities of listeners and add the following features:</p> | <p>Loggers extend the capabilities of listeners and add the following features:</p> | ||||
<ul> | <ul> | ||||
<li>Receives a handle to the standard output and error print streams and | |||||
therefore can log information to the console or the <code>-logfile</code> specified file.</li> | |||||
<li>Receives a handle to the standard output and error print streams and therefore can log | |||||
information to the console or the <code>-logfile</code> specified file.</li> | |||||
<li>Logging level (<code>-quiet</code>, <code>-verbose</code>, <code>-debug</code>) aware</li> | <li>Logging level (<code>-quiet</code>, <code>-verbose</code>, <code>-debug</code>) aware</li> | ||||
<li>Emacs-mode aware</li> | <li>Emacs-mode aware</li> | ||||
</ul> | </ul> | ||||
@@ -71,8 +68,8 @@ listeners and loggers.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code><a href="#DefaultLogger">org.apache.tools.ant.DefaultLogger</a></code></td> | <td><code><a href="#DefaultLogger">org.apache.tools.ant.DefaultLogger</a></code></td> | ||||
<td>The logger used implicitly unless overridden with the | |||||
<code>-logger</code> command-line switch.</td> | |||||
<td>The logger used implicitly unless overridden with the <code>-logger</code> command-line | |||||
switch.</td> | |||||
<td>BuildLogger</td> | <td>BuildLogger</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -82,8 +79,8 @@ listeners and loggers.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code><a href="#MailLogger">org.apache.tools.ant.listener.MailLogger</a></code></td> | <td><code><a href="#MailLogger">org.apache.tools.ant.listener.MailLogger</a></code></td> | ||||
<td>Extends DefaultLogger such that output is still generated | |||||
the same, and when the build is finished an e-mail can be sent.</td> | |||||
<td>Extends DefaultLogger such that output is still generated the same, and when the build is | |||||
finished an e-mail can be sent.</td> | |||||
<td>BuildLogger</td> | <td>BuildLogger</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -93,9 +90,9 @@ listeners and loggers.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code><a href="#Log4jListener">org.apache.tools.ant.listener.Log4jListener</a></code></td> | <td><code><a href="#Log4jListener">org.apache.tools.ant.listener.Log4jListener</a></code></td> | ||||
<td>Passes events to Apache Log4j for highly customizable logging.<br/> | |||||
<em><u>Deprecated</u></em>: Apache Log4j (1.x) is not developed any more. Last | |||||
release is 1.2.17 from 26 May 2012 and contains vulnerability issues.</td> | |||||
<td>Passes events to Apache Log4j for highly customizable | |||||
logging.<br/><em><u>Deprecated</u></em>: Apache Log4j (1.x) is not developed any more. Last | |||||
release is 1.2.17 from 26 May 2012 and contains vulnerability issues.</td> | |||||
<td>BuildListener</td> | <td>BuildListener</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -115,13 +112,14 @@ listeners and loggers.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code><a href="#SimpleBigProjectLogger">org.apache.tools.ant.listener.SimpleBigProjectLogger</a></code></td> | <td><code><a href="#SimpleBigProjectLogger">org.apache.tools.ant.listener.SimpleBigProjectLogger</a></code></td> | ||||
<td>Prints the project name for subprojects only, otherwise like NoBannerLogger <em>Since Ant 1.8.1</em></td> | |||||
<td>Prints the project name for subprojects only, otherwise like NoBannerLogger <em>Since Ant | |||||
1.8.1</em></td> | |||||
<td>BuildLogger</td> | <td>BuildLogger</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code><a href="#ProfileLogger">org.apache.tools.ant.listener.ProfileLogger</a></code></td> | <td><code><a href="#ProfileLogger">org.apache.tools.ant.listener.ProfileLogger</a></code></td> | ||||
<td>The default logger, with start times, end times and | |||||
durations added for each task and target.</td> | |||||
<td>The default logger, with start times, end times and durations added for each task and | |||||
target.</td> | |||||
<td>BuildLogger</td> | <td>BuildLogger</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -137,9 +135,9 @@ listeners and loggers.</p> | |||||
<pre>ant -logger org.apache.tools.ant.NoBannerLogger</pre> | <pre>ant -logger org.apache.tools.ant.NoBannerLogger</pre> | ||||
<h3 id="MailLogger">MailLogger</h3> | <h3 id="MailLogger">MailLogger</h3> | ||||
<p>The MailLogger captures all output logged through DefaultLogger (standard Ant | |||||
output) and will send success and failure messages to unique e-mail lists, with | |||||
control for turning off success or failure messages individually.</p> | |||||
<p>The MailLogger captures all output logged through DefaultLogger (standard Ant output) and will | |||||
send success and failure messages to unique e-mail lists, with control for turning off success or | |||||
failure messages individually.</p> | |||||
<p>Properties controlling the operation of MailLogger:</p> | <p>Properties controlling the operation of MailLogger:</p> | ||||
<table> | <table> | ||||
@@ -161,19 +159,18 @@ control for turning off success or failure messages individually.</p> | |||||
<tr> | <tr> | ||||
<td><code>MailLogger.user</code></td> | <td><code>MailLogger.user</code></td> | ||||
<td>user name for SMTP auth</td> | <td>user name for SMTP auth</td> | ||||
<td>Yes, if SMTP auth is required on your SMTP server<br/> | |||||
the email message will be then sent using MIME and requires JavaMail</td> | |||||
<td>Yes, if SMTP auth is required on your SMTP server<br/> the email message will be then sent | |||||
using MIME and requires JavaMail</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code>MailLogger.password</code></td> | <td><code>MailLogger.password</code></td> | ||||
<td>password for SMTP auth</td> | <td>password for SMTP auth</td> | ||||
<td>Yes, if SMTP auth is required on your SMTP server<br/> | |||||
the email message will be then sent using MIME and requires JavaMail</td> | |||||
<td>Yes, if SMTP auth is required on your SMTP server<br/> the email message will be then sent | |||||
using MIME and requires JavaMail</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code>MailLogger.ssl</code></td> | <td><code>MailLogger.ssl</code></td> | ||||
<td>on or true if SSL is needed<br/> | |||||
This feature requires JavaMail</td> | |||||
<td>on or true if SSL is needed<br/>This feature requires JavaMail</td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -258,7 +255,8 @@ control for turning off success or failure messages individually.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code>MailLogger.starttls.enable</code></td> | <td><code>MailLogger.starttls.enable</code></td> | ||||
<td>on or true if <code>STARTTLS</code> should be supported (requires JavaMail). <em>Since Ant 1.8.0</em></td> | |||||
<td>on or true if <code>STARTTLS</code> should be supported (requires JavaMail). <em>Since Ant | |||||
1.8.0</em></td> | |||||
<td>No; default is <q>false</q></td> | <td>No; default is <q>false</q></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -272,42 +270,35 @@ control for turning off success or failure messages individually.</p> | |||||
<h3 id="AnsiColorLogger">AnsiColorLogger</h3> | <h3 id="AnsiColorLogger">AnsiColorLogger</h3> | ||||
<p>The AnsiColorLogger adds color to the standard Ant output | |||||
by prefixing and suffixing ANSI color code escape sequences to | |||||
it. It is just an extension of <a href="#DefaultLogger">DefaultLogger</a> | |||||
<p>The AnsiColorLogger adds color to the standard Ant output by prefixing and suffixing ANSI color | |||||
code escape sequences to it. It is just an extension of <a href="#DefaultLogger">DefaultLogger</a> | |||||
and hence provides all features that DefaultLogger does.</p> | and hence provides all features that DefaultLogger does.</p> | ||||
<p>AnsiColorLogger differentiates the output by assigning | |||||
different colors depending upon the type of the message.</p> | |||||
<p>If used with the <code>-logfile</code> option, the output file | |||||
will contain all the necessary escape codes to | |||||
display the text in colorized mode when displayed | |||||
in the console using applications like <code>cat</code>, <code>more</code>, etc.</p> | |||||
<p>This is designed to work on terminals that support ANSI | |||||
color codes. It works on XTerm, ETerm, Win9x Console | |||||
(with ANSI.SYS loaded.), etc.</p> | |||||
<p><strong>Note</strong>: It doesn't work on WinNT and successors, | |||||
even when a <code>COMMAND.COM</code> console loaded with ANSI.SYS is used.</p> | |||||
<p>If the user wishes to override the default colors | |||||
with custom ones, a file containing zero or more of the | |||||
custom color key-value pairs must be created. The recognized keys | |||||
and their default values are shown below:</p> | |||||
<p>AnsiColorLogger differentiates the output by assigning different colors depending upon the type | |||||
of the message.</p> | |||||
<p>If used with the <code>-logfile</code> option, the output file will contain all the necessary | |||||
escape codes to display the text in colorized mode when displayed in the console using applications | |||||
like <code>cat</code>, <code>more</code>, etc.</p> | |||||
<p>This is designed to work on terminals that support ANSI color codes. It works on XTerm, ETerm, Win9x Console (with | |||||
ANSI.SYS loaded.), etc.</p> | |||||
<p><strong>Note</strong>: It doesn't work on WinNT and successors, even when | |||||
a <code>COMMAND.COM</code> console loaded with ANSI.SYS is used.</p> | |||||
<p>If the user wishes to override the default colors with custom ones, a file containing zero or | |||||
more of the custom color key-value pairs must be created. The recognized keys and their default | |||||
values are shown below:</p> | |||||
<pre> | <pre> | ||||
AnsiColorLogger.ERROR_COLOR=2;31 | AnsiColorLogger.ERROR_COLOR=2;31 | ||||
AnsiColorLogger.WARNING_COLOR=2;35 | AnsiColorLogger.WARNING_COLOR=2;35 | ||||
AnsiColorLogger.INFO_COLOR=2;36 | AnsiColorLogger.INFO_COLOR=2;36 | ||||
AnsiColorLogger.VERBOSE_COLOR=2;32 | AnsiColorLogger.VERBOSE_COLOR=2;32 | ||||
AnsiColorLogger.DEBUG_COLOR=2;34</pre> | AnsiColorLogger.DEBUG_COLOR=2;34</pre> | ||||
<p>Each key takes as value a color combination defined as | |||||
<q>Attribute;Foreground;Background</q>. In the above example, background | |||||
value has not been used.</p> | |||||
<p>Each key takes as value a color combination defined as <q>Attribute;Foreground;Background</q>. | |||||
In the above example, background value has not been used.</p> | |||||
<p>This file must be specified as the value of a system variable | <p>This file must be specified as the value of a system variable | ||||
named <code>ant.logger.defaults</code> and passed as an argument using | |||||
the <code>-D</code> option to the <code>java</code> command that | |||||
invokes the Ant application. An easy way to achieve this is to | |||||
add <code>-Dant.logger.defaults=</code><samp>/path/to/your/file</samp> | |||||
to the <code>ANT_OPTS</code> environment variable. Ant's launching | |||||
script recognizes this flag and will pass it to the <code>java</code> | |||||
command appropriately.</p> | |||||
named <code>ant.logger.defaults</code> and passed as an argument using the <code>-D</code> option to | |||||
the <code>java</code> command that invokes the Ant application. An easy way to achieve this is to | |||||
add <code>-Dant.logger.defaults=</code><samp>/path/to/your/file</samp> to the <code>ANT_OPTS</code> | |||||
environment variable. Ant's launching script recognizes this flag and will pass it to | |||||
the <code>java</code> command appropriately.</p> | |||||
<p>Format:</p> | <p>Format:</p> | ||||
<pre> | <pre> | ||||
AnsiColorLogger.*=Attribute;Foreground;Background | AnsiColorLogger.*=Attribute;Foreground;Background | ||||
@@ -344,34 +335,32 @@ Background is one of the following: | |||||
<pre>ant -logger org.apache.tools.ant.listener.AnsiColorLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.AnsiColorLogger</pre> | ||||
<h3 id="Log4jListener">Log4jListener</h3> | <h3 id="Log4jListener">Log4jListener</h3> | ||||
<p><em><u>Deprecated</u></em>: Apache Log4j (1) is not developed any more. Last | |||||
release is 1.2.17 from 26 May 2012 and contains vulnerability issues.</p> | |||||
<p>Passes build events to Log4j, using the full classname's of the generator of | |||||
each build event as the category:</p> | |||||
<p><em><u>Deprecated</u></em>: Apache Log4j (1) is not developed any more. Last release is 1.2.17 | |||||
from 26 May 2012 and contains vulnerability issues.</p> | |||||
<p>Passes build events to Log4j, using the full classname's of the generator of each build event as | |||||
the category:</p> | |||||
<ul> | <ul> | ||||
<li>build started / build finished—<code>org.apache.tools.ant.Project</code></li> | <li>build started / build finished—<code>org.apache.tools.ant.Project</code></li> | ||||
<li>target started / target finished—<code>org.apache.tools.ant.Target</code></li> | <li>target started / target finished—<code>org.apache.tools.ant.Target</code></li> | ||||
<li>task started / task finished—the fully qualified classname of the task</li> | <li>task started / task finished—the fully qualified classname of the task</li> | ||||
<li>message logged—the classname of one of the above, so if a task logs a | |||||
message, its classname is the category used, and so on.</li> | |||||
<li>message logged—the classname of one of the above, so if a task logs a message, its | |||||
classname is the category used, and so on.</li> | |||||
</ul> | </ul> | ||||
<p>All start events are logged as INFO. Finish events are either logged as | |||||
INFO or ERROR depending on whether the build failed during that stage. Message | |||||
events are logged according to their Ant logging level, mapping directly to a | |||||
corresponding Log4j level.</p> | |||||
<p>All start events are logged as INFO. Finish events are either logged as INFO or ERROR depending | |||||
on whether the build failed during that stage. Message events are logged according to their Ant | |||||
logging level, mapping directly to a corresponding Log4j level.</p> | |||||
<pre>ant -listener org.apache.tools.ant.listener.Log4jListener</pre> | <pre>ant -listener org.apache.tools.ant.listener.Log4jListener</pre> | ||||
<p>To use Log4j you will need the Log4j JAR file and a <samp>log4j.properties</samp> | |||||
configuration file. Both should be placed somewhere in your Ant | |||||
classpath. If the <samp>log4j.properties</samp> is in your project root folder you can | |||||
add this with <code>-lib</code> option:</p> | |||||
<p>To use Log4j you will need the Log4j JAR file and a <samp>log4j.properties</samp> configuration | |||||
file. Both should be placed somewhere in your Ant classpath. If the <samp>log4j.properties</samp> | |||||
is in your project root folder you can add this with <code>-lib</code> option:</p> | |||||
<pre>ant -listener org.apache.tools.ant.listener.Log4jListener -lib .</pre> | <pre>ant -listener org.apache.tools.ant.listener.Log4jListener -lib .</pre> | ||||
<p>If, for example, you wanted to capture the same information output to the | |||||
console by the DefaultLogger and send it to a file named <samp>build.log</samp>, you | |||||
could use the following configuration:</p> | |||||
<p>If, for example, you wanted to capture the same information output to the console by the | |||||
DefaultLogger and send it to a file named <samp>build.log</samp>, you could use the following | |||||
configuration:</p> | |||||
<pre> | <pre> | ||||
log4j.rootLogger=ERROR, LogFile | log4j.rootLogger=ERROR, LogFile | ||||
@@ -385,22 +374,22 @@ log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout | |||||
log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n | log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n | ||||
log4j.appender.LogFile.file=build.log</pre> | log4j.appender.LogFile.file=build.log</pre> | ||||
<p>For more information about configuring Log4J see <a href="https://logging.apache.org/log4j/1.2/">its | |||||
documentation page</a>.</p> | |||||
<p>For more information about configuring Log4J see <a href="https://logging.apache.org/log4j/1.2/" | |||||
target="_top">its documentation page</a>.</p> | |||||
<h4>Using the Log4j 1.2 Bridge</h4> | <h4>Using the Log4j 1.2 Bridge</h4> | ||||
You could use the <a href="https://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html">Log4j Bridge</a> | |||||
if your application is written against the Log4j (1.x) API, but you want to use the Log4j 2.x runtime. | |||||
For using the bridge with Ant you have to add | |||||
<p>You could use the <a href="https://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html" | |||||
target="_top">Log4j Bridge</a> if your application is written against the Log4j (1.x) API, but you | |||||
want to use the Log4j 2.x runtime. For using the bridge with Ant you have to add</p> | |||||
<ul> | <ul> | ||||
<li><samp>log4j-1.2-api-${log4j.version}.jar</samp></li> | <li><samp>log4j-1.2-api-${log4j.version}.jar</samp></li> | ||||
<li><samp>log4j-api-${log4j.version}.jar</samp></li> | <li><samp>log4j-api-${log4j.version}.jar</samp></li> | ||||
<li><samp>log4j-core-${log4j.version}.jar</samp></li> | <li><samp>log4j-core-${log4j.version}.jar</samp></li> | ||||
<li><samp>log4j2.xml</samp></li> | <li><samp>log4j2.xml</samp></li> | ||||
</ul> | </ul> | ||||
to your classpath, e.g. via the <code>-lib</code> option. | |||||
(For using the bridge, Ant 1.9.10/1.10.2 or higher is required.) | |||||
Translating the 1.x properties file into the 2.x xml syntax would result in | |||||
<p>to your classpath, e.g. via the <code>-lib</code> option. (For using the bridge, Ant | |||||
1.9.10/1.10.2 or higher is required.) Translating the 1.x properties file into the 2.x XML syntax | |||||
would result in</p> | |||||
<pre> | <pre> | ||||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
<Configuration status="WARN"> | <Configuration status="WARN"> | ||||
@@ -423,40 +412,31 @@ Translating the 1.x properties file into the 2.x xml syntax would result in | |||||
</Configuration></pre> | </Configuration></pre> | ||||
<h3 id="XmlLogger">XmlLogger</h3> | <h3 id="XmlLogger">XmlLogger</h3> | ||||
<p>Writes all build information out to an XML file | |||||
named <samp>log.xml</samp>, or the value of | |||||
the <code>XmlLogger.file</code> property if present, when used as a | |||||
listener. When used as a logger, it writes all output to either the | |||||
console or to the value of <code>-logfile</code>. Whether used as a | |||||
listener or logger, the output is not generated until the build is | |||||
complete, as it buffers the information in order to provide timing | |||||
information for task, targets, and the project.</p> | |||||
<p>By default the XML file creates a reference to an XSLT | |||||
file <samp>log.xsl</samp> in the current directory; look | |||||
in <samp>ANT_HOME/etc</samp> for one of these. You can set the | |||||
property <code>ant.XmlLogger.stylesheet.uri</code> to provide a URI | |||||
to a style sheet. This can be a relative or absolute file path, or | |||||
an HTTP URL. If you set the property to the empty string, <q></q>, | |||||
no XSLT transform is declared at all.</p> | |||||
<p>Writes all build information out to an XML file named <samp>log.xml</samp>, or the value of | |||||
the <code>XmlLogger.file</code> property if present, when used as a listener. When used as a logger, | |||||
it writes all output to either the console or to the value of <code>-logfile</code>. Whether used as | |||||
a listener or logger, the output is not generated until the build is complete, as it buffers the | |||||
information in order to provide timing information for task, targets, and the project.</p> | |||||
<p>By default the XML file creates a reference to an XSLT file <samp>log.xsl</samp> in the current | |||||
directory; look in <samp>ANT_HOME/etc</samp> for one of these. You can set the | |||||
property <code>ant.XmlLogger.stylesheet.uri</code> to provide a URI to a style sheet. This can be a | |||||
relative or absolute file path, or an HTTP URL. If you set the property to the empty | |||||
string, <q></q>, no XSLT transform is declared at all.</p> | |||||
<pre>ant -listener org.apache.tools.ant.XmlLogger | <pre>ant -listener org.apache.tools.ant.XmlLogger | ||||
ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | ||||
<h3 id="TimestampedLogger">TimestampedLogger</h3> | <h3 id="TimestampedLogger">TimestampedLogger</h3> | ||||
<p> | |||||
Acts like the default logger, except that the final success/failure message also includes | |||||
the time that the build completed. For example: | |||||
</p> | |||||
<p>Acts like the default logger, except that the final success/failure message also includes the | |||||
time that the build completed. For example:</p> | |||||
<pre>BUILD SUCCESSFUL - at 16/08/05 16:24</pre> | <pre>BUILD SUCCESSFUL - at 16/08/05 16:24</pre> | ||||
<p>To use this listener, use the command:</p> | <p>To use this listener, use the command:</p> | ||||
<pre>ant -logger org.apache.tools.ant.listener.TimestampedLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.TimestampedLogger</pre> | ||||
<h3 id="BigProjectLogger">BigProjectLogger</h3> | <h3 id="BigProjectLogger">BigProjectLogger</h3> | ||||
<p> | |||||
This logger is designed to make examining the logs of a big build easier, | |||||
especially those run under continuous integration tools. It | |||||
</p> | |||||
<p>This logger is designed to make examining the logs of a big build easier, especially those run | |||||
under continuous integration tools. It</p> | |||||
<ol> | <ol> | ||||
<li>When entering a child project, prints its name and directory</li> | <li>When entering a child project, prints its name and directory</li> | ||||
<li>When exiting a child project, prints its name</li> | <li>When exiting a child project, prints its name</li> | ||||
@@ -464,12 +444,9 @@ especially those run under continuous integration tools. It | |||||
<li>Omits logging the names of all targets that have no direct task output</li> | <li>Omits logging the names of all targets that have no direct task output</li> | ||||
<li>Includes the build finished timestamp of the TimeStamp logger</li> | <li>Includes the build finished timestamp of the TimeStamp logger</li> | ||||
</ol> | </ol> | ||||
<p> | |||||
This is useful when using <code><subant></code> to build a large project | |||||
from many smaller projects—the output shows which particular | |||||
project is building. Here is an example in which "clean" is being called | |||||
on all a number of child projects, only some of which perform work: | |||||
</p> | |||||
<p>This is useful when using <code><subant></code> to build a large project from many smaller | |||||
projects—the output shows which particular project is building. Here is an example in which | |||||
"clean" is being called on all a number of child projects, only some of which perform work:</p> | |||||
<pre> | <pre> | ||||
====================================================================== | ====================================================================== | ||||
Entering project "xunit" | Entering project "xunit" | ||||
@@ -493,20 +470,16 @@ In /home/ant/components/junit | |||||
Exiting project "junit" | Exiting project "junit" | ||||
======================================================================</pre> | ======================================================================</pre> | ||||
<p> | |||||
The entry and exit messages are very verbose in this example, but in | |||||
a big project compiling or testing many child components, the messages | |||||
are reduced to becoming clear delimiters of where different projects | |||||
are in charge—or, more importantly, which project is failing. | |||||
</p> | |||||
<p>The entry and exit messages are very verbose in this example, but in a big project compiling or | |||||
testing many child components, the messages are reduced to becoming clear delimiters of where | |||||
different projects are in charge—or, more importantly, which project is failing.</p> | |||||
<p>To use this listener, use the command:</p> | <p>To use this listener, use the command:</p> | ||||
<pre>ant -logger org.apache.tools.ant.listener.BigProjectLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.BigProjectLogger</pre> | ||||
<h3 id="SimpleBigProjectLogger">SimpleBigProjectLogger</h3> | <h3 id="SimpleBigProjectLogger">SimpleBigProjectLogger</h3> | ||||
<p><em>Since Ant 1.8.1</em></p> | <p><em>Since Ant 1.8.1</em></p> | ||||
<p>Like <code>BigProjectLogger</code>, project-qualified target names | |||||
are printed, useful for big builds with subprojects. Otherwise it is | |||||
as quiet as <code>NoBannerLogger</code>:</p> | |||||
<p>Like <code>BigProjectLogger</code>, project-qualified target names are printed, useful for big | |||||
builds with subprojects. Otherwise it is as quiet as <code>NoBannerLogger</code>:</p> | |||||
<pre> | <pre> | ||||
Buildfile: /sources/myapp/build.xml | Buildfile: /sources/myapp/build.xml | ||||
@@ -532,10 +505,9 @@ Total time: 1 second</pre> | |||||
<h3 id="ProfileLogger">ProfileLogger</h3> | <h3 id="ProfileLogger">ProfileLogger</h3> | ||||
<!-- This is the 'since' as described in the Loggers JavaDoc --> | <!-- This is the 'since' as described in the Loggers JavaDoc --> | ||||
<p><em>Since Ant 1.8.0</em></p> | <p><em>Since Ant 1.8.0</em></p> | ||||
<p>This logger stores the time needed for executing a task, target and | |||||
the whole build and prints these information. The output contains a | |||||
timestamp when entering the build, target or task and a timestamp | |||||
and the needed time when exiting.</p> | |||||
<p>This logger stores the time needed for executing a task, target and the whole build and prints | |||||
these information. The output contains a timestamp when entering the build, target or task and a | |||||
timestamp and the needed time when exiting.</p> | |||||
<h4>Example</h4> | <h4>Example</h4> | ||||
Having that buildfile | Having that buildfile | ||||
<pre> | <pre> | ||||
@@ -550,7 +522,8 @@ Having that buildfile | |||||
<echo>another-echo-task</echo> | <echo>another-echo-task</echo> | ||||
</target> | </target> | ||||
</project></pre> | </project></pre> | ||||
and executing with <code>ant -logger org.apache.tools.ant.listener.ProfileLogger anotherTarget</code> gives that output (with other timestamps and duration of course ;-): | |||||
<p>and executing with <code>ant -logger org.apache.tools.ant.listener.ProfileLogger | |||||
anotherTarget</code> gives that output (with other timestamps and duration of course ;-):</p> | |||||
<pre> | <pre> | ||||
Buildfile: ...\build.xml | Buildfile: ...\build.xml | ||||
@@ -588,22 +561,24 @@ Total time: 2 seconds</pre> | |||||
<ul> | <ul> | ||||
<li> | <li> | ||||
A listener or logger should not write to standard output or error in the <code>messageLogged()</code> method; | |||||
Ant captures these internally and it will trigger an infinite loop. | |||||
A listener or logger should not write to standard output or error in | |||||
the <code>messageLogged()</code> method; Ant captures these internally and it will trigger an | |||||
infinite loop. | |||||
</li> | </li> | ||||
<li> | <li> | ||||
Logging is synchronous; all listeners and loggers are called one after the other, with the build blocking until | |||||
the output is processed. Slow logging means a slow build. | |||||
Logging is synchronous; all listeners and loggers are called one after the other, with the build | |||||
blocking until the output is processed. Slow logging means a slow build. | |||||
</li> | </li> | ||||
<li>When a build is started, and <code>BuildListener.buildStarted(BuildEvent event)</code> is called, | |||||
the project is not fully functional. The build has started, yes, and the <code>event.getProject()</code> method call | |||||
returns the Project instance, but that project is initialized with JVM and Ant properties, nor has it | |||||
parsed the build file yet. You cannot call <code>Project.getProperty()</code> for property lookup, or | |||||
<li>When a build is started, and <code>BuildListener.buildStarted(BuildEvent event)</code> is | |||||
called, the project is not fully functional. The build has started, yes, and | |||||
the <code>event.getProject()</code> method call returns the Project instance, but that project | |||||
is initialized with JVM and Ant properties, nor has it parsed the build file yet. You cannot | |||||
call <code>Project.getProperty()</code> for property lookup, or | |||||
<code>Project.getName()</code> to get the project name (it will return null). | <code>Project.getName()</code> to get the project name (it will return null). | ||||
</li> | </li> | ||||
<li> | <li> | ||||
Classes that implement <code>org.apache.tools.ant.SubBuildListener</code> receive notifications when child projects | |||||
start and stop. | |||||
Classes that implement <code>org.apache.tools.ant.SubBuildListener</code> receive notifications | |||||
when child projects start and stop. | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -27,100 +27,83 @@ | |||||
<h2>Java versions</h2> | <h2>Java versions</h2> | ||||
<h3>Java 5</h3> | <h3>Java 5</h3> | ||||
<p> | <p> | ||||
You may need a bigger stack than default, especially if you are using | |||||
the built in XSLT engine. We recommend you use Apache Xalan; indeed, | |||||
some tasks (JUnit report in XML, for example) may not work against the | |||||
shipping XSL engine. | |||||
You may need a bigger stack than default, especially if you are using the built in XSLT engine. We | |||||
recommend you use Apache Xalan; indeed, some tasks (JUnit report in XML, for example) may not work | |||||
against the shipping XSL engine. | |||||
</p> | </p> | ||||
<h2>Unix and Linux</h2> | <h2>Unix and Linux</h2> | ||||
<ul> | <ul> | ||||
<li>You should use a GNU version of <code>tar</code> to untar the Apache | |||||
Ant source tree, if you have downloaded this as a tar file. If you get | |||||
weird errors about missing files, this is the problem.</li> | |||||
<li>Ant does not preserve file permissions when a file is copied, | |||||
moved or archived, because Java does not let it read or write the | |||||
permissions. Use <code><chmod></code> to set permissions, and | |||||
when creating a tar archive, use the <var>mode</var> attribute | |||||
of <code><tarfileset></code> to set the permissions in the tar | |||||
file, or <code><apply></code> the real tar program.</li> | |||||
<li>Ant is not symbolic link aware in moves, deletes and when | |||||
recursing down a tree of directories to build up a list of | |||||
files. Unexpected things can happen.</li> | |||||
<li>Linux on IA-64: apparently you need a larger heap than the default | |||||
one (64M) to compile big projects. If you get out of heap errors, | |||||
either increase the heap or use a forking javac. Better yet, use jikes | |||||
for extra compilation speed.</li> | |||||
<li>You should use a GNU version of <code>tar</code> to untar the Apache Ant source tree, if you | |||||
have downloaded this as a tar file. If you get weird errors about missing files, this is the | |||||
problem.</li> | |||||
<li>Ant does not preserve file permissions when a file is copied, moved or archived, because Java | |||||
does not let it read or write the permissions. Use <code><chmod></code> to set permissions, | |||||
and when creating a tar archive, use the <var>mode</var> attribute | |||||
of <code><tarfileset></code> to set the permissions in the tar file, | |||||
or <code><apply></code> the real tar program.</li> | |||||
<li>Ant is not symbolic link aware in moves, deletes and when recursing down a tree of directories | |||||
to build up a list of files. Unexpected things can happen.</li> | |||||
<li>Linux on IA-64: apparently you need a larger heap than the default one (64M) to compile big | |||||
projects. If you get out of heap errors, either increase the heap or use a | |||||
forking <code>javac</code>. Better yet, use jikes for extra compilation speed.</li> | |||||
</ul> | </ul> | ||||
<h2>Microsoft Windows</h2> | <h2>Microsoft Windows</h2> | ||||
<p> | <p> | ||||
Windows 9x (win95, win98, win98SE and winME) are not supported in Ant1.7, | |||||
Windows 9x (win95, win98, win98SE and winME) are not supported <em>since Ant 1.7</em>. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
The Ant team has retired support for these products because they are | |||||
outdated and can expose customers to security risks. We recommend that | |||||
customers who are still running Windows 98 or Windows Me upgrade to a | |||||
newer, more secure operating system, as soon as possible. | |||||
The Ant team has retired support for these products because they are outdated and can expose | |||||
customers to security risks. We recommend that customers who are still running Windows 98 or Windows | |||||
ME upgrade to a newer, more secure operating system, as soon as possible. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
Customers who upgrade to Linux report improved security, richer | |||||
functionality, and increased productivity. | |||||
Customers who upgrade to Linux report improved security, richer functionality, and increased | |||||
productivity. | |||||
</p> | </p> | ||||
<h2>Microsoft Windows 2K, XP and Server 2K03</h2> | <h2>Microsoft Windows 2K, XP and Server 2K03</h2> | ||||
<p> | <p> | ||||
Windows 9x (win95, win98, win98SE and winME) has a batch file system | |||||
which does not work fully with long file names, so we recommend that | |||||
ant and the JDK are installed into directories without spaces, and | |||||
with 8.3 filenames. The Perl and Python launcher scripts do not | |||||
suffer from this limitation. | |||||
Windows 9x (win95, win98, win98SE and winME) has a batch file system which does not work fully with | |||||
long file names, so we recommend that Ant and JDK are installed into directories without spaces, and | |||||
with 8.3 filenames. The Perl and Python launcher scripts do not suffer from this limitation. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
All versions of Windows are usually case insensitive, although mounted | |||||
file systems (Unix drives, ClearCase views) can be case sensitive | |||||
underneath, confusing patternsets. | |||||
All versions of Windows are usually case insensitive, although mounted file systems (Unix drives, | |||||
ClearCase views) can be case sensitive underneath, confusing patternsets. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
Ant can often not delete a directory which is open in an Explorer | |||||
window. There is nothing we can do about this short of spawning a | |||||
program to kill the shell before deleting directories. Nor can files | |||||
that are in use be overwritten. | |||||
Ant can often not delete a directory which is open in an Explorer window. There is nothing we can | |||||
do about this short of spawning a program to kill the shell before deleting directories. Nor can | |||||
files that are in use be overwritten. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
Finally, if any Ant task fails with an <code>error=2</code>, it | |||||
means that whatever native program Ant is trying to run, it is not | |||||
on the path. | |||||
Finally, if any Ant task fails with an <code>error=2</code>, it means that whatever native program | |||||
Ant is trying to run, it is not on the path. | |||||
</p> | </p> | ||||
<h2>Microsoft Windows Vista</h2> | <h2>Microsoft Windows Vista</h2> | ||||
<p> | <p> | ||||
There are reports of problems with Windows Vista security bringing | |||||
up dialog boxes asking if the user wants to run an untrusted | |||||
executable during an Ant run, such as when the <signjar> task | |||||
runs the <code>jarsigner.exe</code> program. This is beyond Ant's | |||||
control, and stems from the OS trying to provide some illusion of | |||||
security by being reluctant to run unsigned native executables. The | |||||
latest Java versions appear to resolve this problem by having signed | |||||
binaries. | |||||
There are reports of problems with Windows Vista security bringing up dialog boxes asking if the | |||||
user wants to run an untrusted executable during an Ant run, such as when the <signjar> task | |||||
runs the <code>jarsigner.exe</code> program. This is beyond Ant's control, and stems from the OS | |||||
trying to provide some illusion of security by being reluctant to run unsigned native executables. | |||||
The latest Java versions appear to resolve this problem by having signed binaries. | |||||
</p> | </p> | ||||
<h2>Cygwin</h2> | <h2>Cygwin</h2> | ||||
<p> | <p> | ||||
Cygwin is not an operating system; rather it is an application suite | |||||
running under Windows and providing some UNIX like functionality. Sun | |||||
has not created any specific Java Development Kit or Java Runtime | |||||
Environment for cygwin. See this | |||||
link: <a href="http://www.inonit.com/cygwin/faq/">http://www.inonit.com/cygwin/faq/</a>. | |||||
Only Windows path names are supported by JDK and JRE tools under | |||||
Windows or cygwin. Relative path names such as "src/org/apache/tools" | |||||
are supported, but Java tools do not | |||||
understand <samp>/cygdrive/c</samp> to mean <samp>c:\</samp>. | |||||
Cygwin is not an operating system; rather it is an application suite running under Windows and | |||||
providing some UNIX like functionality. Sun has not created any specific Java Development Kit or | |||||
Java Runtime Environment for cygwin. See this link: <a href="http://www.inonit.com/cygwin/faq/" | |||||
target="_top">http://www.inonit.com/cygwin/faq/</a>. Only Windows path names are supported by JDK | |||||
and JRE tools under Windows or cygwin. Relative path names such as <samp>src/org/apache/tools</samp> | |||||
are supported, but Java tools do not understand <samp>/cygdrive/c</samp> to mean <samp>c:\</samp>. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
The utility <code>cygpath</code> (used industrially in | |||||
the <code>ant</code> script to support cygwin) can convert cygwin path | |||||
names to Windows. You can use the <code><exec></code> task in | |||||
The utility <code>cygpath</code> (used industrially in the <code>ant</code> script to support | |||||
cygwin) can convert cygwin path names to Windows. You can use the <code><exec></code> task in | |||||
Ant to convert cygwin paths to Windows path, for instance like that: | Ant to convert cygwin paths to Windows path, for instance like that: | ||||
</p> | </p> | ||||
<pre> | <pre> | ||||
@@ -132,42 +115,38 @@ Ant to convert cygwin paths to Windows path, for instance like that: | |||||
<echo message="${windows.pathname}"/> | <echo message="${windows.pathname}"/> | ||||
</pre> | </pre> | ||||
<p> | <p> | ||||
We get lots of support calls from Cygwin users. Either it is | |||||
incredibly popular, or it is trouble. If you do use it, remember that | |||||
Java is a Windows application, so Ant is running in a Windows process, | |||||
not a Cygwin one. This will save us having to mark your bug reports as | |||||
invalid. | |||||
We get lots of support calls from Cygwin users. Either it is incredibly popular, or it is | |||||
trouble. If you do use it, remember that Java is a Windows application, so Ant is running in a | |||||
Windows process, not a Cygwin one. This will save us having to mark your bug reports as invalid. | |||||
</p> | </p> | ||||
<h2>Apple MacOS X/macOS</h2> | <h2>Apple MacOS X/macOS</h2> | ||||
<p> | <p> | ||||
MacOS X a.k.a. macOS is the first of the Apple platforms that Ant | |||||
supports completely; it is treated like any other Unix. | |||||
MacOS X a.k.a. macOS is the first of the Apple platforms that Ant supports completely; it is treated | |||||
like any other Unix. | |||||
</p> | </p> | ||||
<h2>Novell Netware</h2> | <h2>Novell Netware</h2> | ||||
<p> | <p> | ||||
To give the same level of sophisticated control as Ant's startup | |||||
scripts on other platforms, it was decided to make the main ant | |||||
startup on NetWare be via a Perl Script, <code>runant.pl</code>. This | |||||
is found in the <samp>bin</samp> directory (for | |||||
instance—<samp>bootstrap\bin</samp> | |||||
To give the same level of sophisticated control as Ant's startup scripts on other platforms, it was | |||||
decided to make the main ant startup on NetWare be via a Perl Script, <code>runant.pl</code>. This | |||||
is found in the <samp>bin</samp> directory (for instance—<samp>bootstrap\bin</samp> | |||||
or <samp>dist\bin</samp>). | or <samp>dist\bin</samp>). | ||||
</p> | </p> | ||||
<p>One important item of note is that you need to set up the following to run Ant:</p> | <p>One important item of note is that you need to set up the following to run Ant:</p> | ||||
<ul> | <ul> | ||||
<li><code>CLASSPATH</code>—put <samp>ant.jar</samp> and any other needed jars on the system classpath.</li> | |||||
<li><code>ANT_OPTS</code>—On NetWare, <code>ANT_OPTS</code> | |||||
needs to include a parameter of the | |||||
form, <code>-envCWD=<i>ANT_HOME</i></code>, | |||||
with <code><i>ANT_HOME</i></code> being the fully expanded location | |||||
of Ant, <strong>not</strong> an environment variable. This is due | |||||
to the fact that the NetWare System Console has no notion of a | |||||
current working directory.</li> | |||||
<li><code>CLASSPATH</code>—put <samp>ant.jar</samp> and any other needed jars on the system | |||||
classpath.</li> | |||||
<li><code>ANT_OPTS</code>—On NetWare, <code>ANT_OPTS</code> needs to include a parameter of | |||||
the form, <code>-envCWD=<i>ANT_HOME</i></code>, with <code><i>ANT_HOME</i></code> being the | |||||
fully expanded location of Ant, <strong>not</strong> an environment variable. This is due to | |||||
the fact that the NetWare System Console has no notion of a current working directory.</li> | |||||
</ul> | </ul> | ||||
<p>It is suggested that you create up an ant.ncf that sets up these parameters, and calls <samp>perl ANT_HOME/dist/bin/runant.pl</samp></p> | |||||
<p>The following is an example of such an NCF file (assuming Ant is installed in <samp>sys:/apache-ant/</samp>):</p> | |||||
<p>It is suggested that you create up an <samp>ant.ncf</samp> that sets up these parameters, and | |||||
calls <samp>perl ANT_HOME/dist/bin/runant.pl</samp></p> | |||||
<p>The following is an example of such an NCF file (assuming Ant is installed | |||||
in <samp>sys:/apache-ant/</samp>):</p> | |||||
<pre> | <pre> | ||||
envset CLASSPATH=sys:/apache-ant/bootstrap/lib/ant.jar | envset CLASSPATH=sys:/apache-ant/bootstrap/lib/ant.jar | ||||
envset CLASSPATH=$CLASSPATH;sys:/apache-ant/lib/optional/junit.jar | envset CLASSPATH=$CLASSPATH;sys:/apache-ant/lib/optional/junit.jar | ||||
@@ -180,18 +159,16 @@ envset ANT_HOME=sys:/apache-ant/dist/lib | |||||
perl sys:/apache-ant/dist/bin/runant.pl</pre> | perl sys:/apache-ant/dist/bin/runant.pl</pre> | ||||
<p>Ant works on JVM version 1.3 or higher. You may have some luck | |||||
running it on JVM 1.2, but serious problems have been found running | |||||
Ant on JVM 1.1.7B. These problems are caused by JVM bugs that will | |||||
not be fixed.</p> | |||||
<p>Ant works on JVM version 1.3 or higher. You may have some luck running it on JVM 1.2, but | |||||
serious problems have been found running Ant on JVM 1.1.7B. These problems are caused by JVM bugs | |||||
that will not be fixed.</p> | |||||
<p>JVM 1.3 is supported on Novell NetWare versions 5.1 and higher.</p> | <p>JVM 1.3 is supported on Novell NetWare versions 5.1 and higher.</p> | ||||
<h2>Other platforms</h2> | <h2>Other platforms</h2> | ||||
<p> | <p> | ||||
Support for other platforms is not guaranteed to be complete, as | |||||
certain techniques to hide platform details from build files need to | |||||
be written and tested on every particular platform. Contributions in | |||||
this area are welcome. | |||||
Support for other platforms is not guaranteed to be complete, as certain techniques to hide platform | |||||
details from build files need to be written and tested on every particular platform. Contributions | |||||
in this area are welcome. | |||||
</p> | </p> | ||||
</body> | </body> | ||||
@@ -25,67 +25,61 @@ | |||||
<body> | <body> | ||||
<h1>Properties</h1> | <h1>Properties</h1> | ||||
<p>Properties are key-value pairs where Apache Ant tries to | |||||
expand <code>${key}</code> to <code>value</code> at runtime.</p> | |||||
<p>There are many tasks that can set properties, the most common one | |||||
is the <a href="Tasks/property.html">property</a> task. In | |||||
addition properties can be defined | |||||
via <a href="running.html">command line arguments</a> or similar | |||||
mechanisms from outside of Ant.</p> | |||||
<p>Normally property values can not be changed, once a property is | |||||
set, most tasks will not allow its value to be modified. In | |||||
general properties are of global scope, i.e. once they have been | |||||
defined they are available for any task or target invoked | |||||
subsequently—it is not possible to set a property in a child | |||||
build process created via | |||||
<p>Properties are key-value pairs where Apache Ant tries to expand <code>${key}</code> | |||||
to <code>value</code> at runtime.</p> | |||||
<p>There are many tasks that can set properties, the most common one is | |||||
the <a href="Tasks/property.html">property</a> task. In addition properties can be defined | |||||
via <a href="running.html">command line arguments</a> or similar mechanisms from outside of | |||||
Ant.</p> | |||||
<p>Normally property values can not be changed, once a property is set, most tasks will not allow | |||||
its value to be modified. In general properties are of global scope, i.e. once they have been | |||||
defined they are available for any task or target invoked subsequently—it is not possible | |||||
to set a property in a child build process created via | |||||
the <a href="Tasks/ant.html">ant</a>, <a href="Tasks/antcall.html">antcall</a> | the <a href="Tasks/ant.html">ant</a>, <a href="Tasks/antcall.html">antcall</a> | ||||
or <a href="Tasks/subant.html">subant</a> tasks and make it | |||||
available to the calling build process, though.</p> | |||||
or <a href="Tasks/subant.html">subant</a> tasks and make it available to the calling build | |||||
process, though.</p> | |||||
<p><em>Since Ant 1.8.0</em> the <a href="Tasks/local.html">local</a> | |||||
task can be used to create properties that are locally scoped to a | |||||
target or a <a href="Tasks/sequential.html">sequential</a> element | |||||
like the one of the <a href="Tasks/macrodef.html">macrodef</a> | |||||
task.</p> | |||||
<p><em>Since Ant 1.8.0</em> the <a href="Tasks/local.html">local</a> task can be used to create | |||||
properties that are locally scoped to a target or | |||||
a <a href="Tasks/sequential.html">sequential</a> element like the one of | |||||
the <a href="Tasks/macrodef.html">macrodef</a> task.</p> | |||||
<h2 id="built-in-props">Built-in Properties</h2> | <h2 id="built-in-props">Built-in Properties</h2> | ||||
<p>Ant provides access to all system properties as if they had been | |||||
defined using a <code><property></code> task. For | |||||
example, <samp>${os.name}</samp> expands to the name of the | |||||
operating system.</p> | |||||
<p>Ant provides access to all system properties as if they had been defined using | |||||
a <code><property></code> task. For example, <samp>${os.name}</samp> expands to the name | |||||
of the operating system.</p> | |||||
<p>For a list of system properties, | <p>For a list of system properties, | ||||
see <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperties--">the javadoc of System.getProperties</a>. | |||||
see <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperties--" | |||||
target="_top">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> | ||||
<dl> | <dl> | ||||
<dt><code>basedir</code></dt> | <dt><code>basedir</code></dt> | ||||
<dd>the absolute path of the project's basedir (as set | |||||
with the <var>basedir</var> attribute of <a href="using.html#projects"><project></a>).</dd> | |||||
<dd>the absolute path of the project's basedir (as set with | |||||
the <var>basedir</var> attribute | |||||
of <a href="using.html#projects"><project></a>).</dd> | |||||
<dt><code>ant.file</code></dt> | <dt><code>ant.file</code></dt> | ||||
<dd>the absolute path of the buildfile.</dd> | <dd>the absolute path of the buildfile.</dd> | ||||
<dt><code>ant.version</code></dt> | <dt><code>ant.version</code></dt> | ||||
<dd>the version of Ant</dd> | <dd>the version of Ant</dd> | ||||
<dt><code>ant.project.name</code></dt> | <dt><code>ant.project.name</code></dt> | ||||
<dd>the name of the project that is currently executing; it is set | |||||
in the <var>name</var> attribute of <project>.</dd> | |||||
<dd>the name of the project that is currently executing; it is set in the <var>name</var> | |||||
attribute of <project>.</dd> | |||||
<dt><code>ant.project.default-target</code></dt> | <dt><code>ant.project.default-target</code></dt> | ||||
<dd>the name of the currently executing project's default target; | |||||
it is set via the <var>default</var> attribute | |||||
of <code><project></code>.</dd> | |||||
<dd>the name of the currently executing project's default target; it is set via | |||||
the <var>default</var> attribute of <code><project></code>.</dd> | |||||
<dt><code>ant.project.invoked-targets</code></dt> | <dt><code>ant.project.invoked-targets</code></dt> | ||||
<dd>a comma separated list of the targets that have been specified | |||||
on the command line (the IDE, an <code><ant></code> task | |||||
...) when invoking the current project.<br/> | |||||
This property is set properly when the first target is executed. | |||||
If you use it in the implicit target (directly under | |||||
the <code><project></code> tag) the list will be empty if | |||||
no target has been specified while it will contain the project's | |||||
default target in this case for tasks nested into targets.</dd> | |||||
<dd>a comma separated list of the targets that have been specified on the command line (the IDE, | |||||
an <code><ant></code> task ...) when invoking the current project.<br/> This property | |||||
is set properly when the first target is executed. If you use it in the implicit target | |||||
(directly under the <code><project></code> tag) the list will be empty if no target has | |||||
been specified while it will contain the project's default target in this case for tasks | |||||
nested into targets.</dd> | |||||
<dt><code>ant.java.version</code></dt> | <dt><code>ant.java.version</code></dt> | ||||
<dd>the JVM version Ant detected; currently it can hold the | <dd>the JVM version Ant detected; currently it can hold the | ||||
values <q>9</q>, <q>1.8</q>, <q>1.7</q>, <q>1.6</q>, <q>1.5</q>, <q>1.4</q>, <q>1.3</q> | values <q>9</q>, <q>1.8</q>, <q>1.7</q>, <q>1.6</q>, <q>1.5</q>, <q>1.4</q>, <q>1.3</q> | ||||
@@ -94,83 +88,69 @@ | |||||
<dd>the absolute path of the <samp>ant.jar</samp> file.</dd> | <dd>the absolute path of the <samp>ant.jar</samp> file.</dd> | ||||
</dl> | </dl> | ||||
<p>There is also another property, but this is set by the launcher | |||||
script and therefore maybe not set inside IDEs:</p> | |||||
<p>There is also another property, but this is set by the launcher script and therefore maybe not | |||||
set inside IDEs:</p> | |||||
<dl> | <dl> | ||||
<dt><code>ant.home</code></dt> | <dt><code>ant.home</code></dt> | ||||
<dd>home directory of Ant</dd> | <dd>home directory of Ant</dd> | ||||
</dl> | </dl> | ||||
<p>The following property is only set if Ant is started via the | |||||
Launcher class (which means it may not be set inside IDEs | |||||
either):</p> | |||||
<p>The following property is only set if Ant is started via the Launcher class (which means it may | |||||
not be set inside IDEs either):</p> | |||||
<dl> | <dl> | ||||
<dt><code>ant.library.dir</code></dt> | <dt><code>ant.library.dir</code></dt> | ||||
<dd>the directory that has been used to load Ant's | |||||
jars from. In most cases this is <samp>ANT_HOME/lib</samp>.</dd> | |||||
<dd>the directory that has been used to load Ant's jars from. In most cases this | |||||
is <samp>ANT_HOME/lib</samp>.</dd> | |||||
</dl> | </dl> | ||||
<h1 id="propertyHelper">PropertyHelpers</h1> | <h1 id="propertyHelper">PropertyHelpers</h1> | ||||
<p>Ant's property handling is accomplished by an instance | <p>Ant's property handling is accomplished by an instance | ||||
of <code>org.apache.tools.ant.PropertyHelper</code> associated | |||||
with the current Project. You can learn more about this class by | |||||
examining Ant's Java API. In Ant 1.8 the PropertyHelper class was | |||||
much reworked and now itself employs a number of helper classes | |||||
(actually instances of | |||||
the <code>org.apache.tools.ant.PropertyHelper$Delegate</code> | |||||
marker interface) to take care of discrete tasks such as property | |||||
setting, retrieval, parsing, etc. This makes Ant's property | |||||
of <code>org.apache.tools.ant.PropertyHelper</code> associated with the current Project. You | |||||
can learn more about this class by examining Ant's Java API. In Ant 1.8 the PropertyHelper class | |||||
was much reworked and now itself employs a number of helper classes (actually instances of | |||||
the <code>org.apache.tools.ant.PropertyHelper$Delegate</code> marker interface) to take care of | |||||
discrete tasks such as property setting, retrieval, parsing, etc. This makes Ant's property | |||||
handling highly extensible; also of interest is the | handling highly extensible; also of interest is the | ||||
new <a href="Tasks/propertyhelper.html">propertyhelper</a> task | |||||
used to manipulate the PropertyHelper and its delegates from the | |||||
context of the Ant buildfile.</p> | |||||
new <a href="Tasks/propertyhelper.html">propertyhelper</a> task used to manipulate the | |||||
PropertyHelper and its delegates from the context of the Ant buildfile.</p> | |||||
<p>There are three sub-interfaces of <code>Delegate</code> that may be | |||||
useful to implement.</p> | |||||
<p>There are three sub-interfaces of <code>Delegate</code> that may be useful to implement.</p> | |||||
<ul> | <ul> | ||||
<li><code>org.apache.tools.ant.property.PropertyExpander</code> is | |||||
responsible for finding the property name inside a string in the | |||||
first place (the default extracts <samp>foo</samp> | |||||
<li><code>org.apache.tools.ant.property.PropertyExpander</code> is responsible for finding the | |||||
property name inside a string in the first place (the default extracts <samp>foo</samp> | |||||
from <samp>${foo}</samp>). | from <samp>${foo}</samp>). | ||||
<p>This is the interface you'd implement if you wanted to invent | |||||
your own property syntax—or allow nested property expansions | |||||
since the default implementation doesn't balance braces | |||||
(see <a href="https://git-wip-us.apache.org/repos/asf?p=ant-antlibs-props.git;a=blob;f=src/main/org/apache/ant/props/NestedPropertyExpander.java;hb=HEAD"><code>NestedPropertyExpander</code> | |||||
in the <samp>props</samp> Antlib</a> for an example).</p> | |||||
<p>This is the interface you'd implement if you wanted to invent your own property | |||||
syntax—or allow nested property expansions since the default implementation doesn't | |||||
balance braces | |||||
(see <a href="https://git-wip-us.apache.org/repos/asf?p=ant-antlibs-props.git;a=blob;f=src/main/org/apache/ant/props/NestedPropertyExpander.java;hb=HEAD" | |||||
target="_top"><code>NestedPropertyExpander</code> in the <samp>props</samp> Antlib</a> for | |||||
an example).</p> | |||||
</li> | </li> | ||||
<li><code>org.apache.tools.ant.PropertyHelper$PropertyEvaluator</code> | |||||
is used to expand <samp>${some-string}</samp> into | |||||
an <code>Object</code>. | |||||
<p>This is the interface you'd implement if you want to provide | |||||
your own storage independent of Ant's project instance—the | |||||
interface represents the reading end. An example for this | |||||
would | |||||
be <code>org.apache.tools.ant.property.LocalProperties</code> | |||||
which implements storage | |||||
for <a href="Tasks/local.html">local properties</a>.</p> | |||||
<p>Another reason to implement this interface is if you wanted | |||||
to provide your own "property protocol" like | |||||
expanding <code>toString:foo</code> by looking up the project | |||||
reference <samp>foo</samp> and invoking <code>toString()</code> on it | |||||
(which is already implemented in Ant, see below).</p> | |||||
<li><code>org.apache.tools.ant.PropertyHelper$PropertyEvaluator</code> is used to | |||||
expand <samp>${some-string}</samp> into an <code>Object</code>. | |||||
<p>This is the interface you'd implement if you want to provide your own storage independent | |||||
of Ant's project instance—the interface represents the reading end. An example for | |||||
this would be <code>org.apache.tools.ant.property.LocalProperties</code> which implements | |||||
storage for <a href="Tasks/local.html">local properties</a>.</p> | |||||
<p>Another reason to implement this interface is if you wanted to provide your own "property | |||||
protocol" like expanding <code>toString:foo</code> by looking up the project | |||||
reference <samp>foo</samp> and invoking <code>toString()</code> on it (which is already | |||||
implemented in Ant, see below).</p> | |||||
</li> | </li> | ||||
<li><code>org.apache.tools.ant.PropertyHelper$PropertySetter</code> | |||||
is responsible for setting properties. | |||||
<li><code>org.apache.tools.ant.PropertyHelper$PropertySetter</code> is responsible for setting | |||||
properties. | |||||
<p>This is the interface you'd implement if you want to provide | |||||
your own storage independent of Ant's project instance—the | |||||
interface represents the reading end. An example for this | |||||
would | |||||
be <code>org.apache.tools.ant.property.LocalProperties</code> | |||||
which implements storage | |||||
for <a href="Tasks/local.html">local properties</a>.</p> | |||||
<p>This is the interface you'd implement if you want to provide your own storage independent | |||||
of Ant's project instance—the interface represents the reading end. An example for | |||||
this would be <code>org.apache.tools.ant.property.LocalProperties</code> which implements | |||||
storage for <a href="Tasks/local.html">local properties</a>.</p> | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
@@ -195,10 +175,9 @@ public class DefaultExpander implements PropertyExpander { | |||||
} | } | ||||
}</pre> | }</pre> | ||||
<p>The logic that replaces <samp>${toString:<i>some-id</i>}</samp> with the | |||||
stringified representation of the object with | |||||
<var>id</var> <samp>some-id</samp> inside the current build is contained in a | |||||
PropertyEvaluator similar to the following code:</p> | |||||
<p>The logic that replaces <samp>${toString:<i>some-id</i>}</samp> with the stringified | |||||
representation of the object with <var>id</var> <samp>some-id</samp> inside the current build is | |||||
contained in a PropertyEvaluator similar to the following code:</p> | |||||
<pre> | <pre> | ||||
public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | ||||
@@ -215,22 +194,17 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | |||||
<h1>Property Expansion</h1> | <h1>Property Expansion</h1> | ||||
<p>When Ant encounters a construct <samp>${some-text}</samp> the | |||||
exact parsing semantics are subject to the configured property | |||||
helper delegates.</p> | |||||
<p>When Ant encounters a construct <samp>${some-text}</samp> the exact parsing semantics are | |||||
subject to the configured property helper delegates.</p> | |||||
<h2><code>$$</code> Expansion</h2> | <h2><code>$$</code> Expansion</h2> | ||||
<p>In its default configuration Ant will expand the text <q>$$</q> | |||||
to a single <q>$</q> and suppress the normal property expansion | |||||
mechanism for the text immediately following it, | |||||
i.e. <samp>$${key}</samp> expands to <samp>${key}</samp> and | |||||
not <code>value</code> even though a property | |||||
named <code>key</code> was defined and had the | |||||
value <samp>value</samp>. This can be used to escape | |||||
literal <q>$</q> characters and is useful in constructs that only | |||||
look like property expansions or when you want to provide | |||||
diagnostic output like in</p> | |||||
<p>In its default configuration Ant will expand the text <q>$$</q> to a single <q>$</q> and | |||||
suppress the normal property expansion mechanism for the text immediately following it, | |||||
i.e. <samp>$${key}</samp> expands to <samp>${key}</samp> and not <code>value</code> even though | |||||
a property named <code>key</code> was defined and had the value <samp>value</samp>. This can be | |||||
used to escape literal <q>$</q> characters and is useful in constructs that only look like | |||||
property expansions or when you want to provide diagnostic output like in</p> | |||||
<pre><echo>$${builddir}=${builddir}</echo></pre> | <pre><echo>$${builddir}=${builddir}</echo></pre> | ||||
@@ -238,65 +212,50 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | |||||
<pre>${builddir}=build/classes</pre> | <pre>${builddir}=build/classes</pre> | ||||
<p>if the property <code>builddir</code> has the | |||||
value <samp>build/classes</samp>.</p> | |||||
<p>if the property <code>builddir</code> has the value <samp>build/classes</samp>.</p> | |||||
<p>In order to maintain backward compatibility with older Ant | |||||
releases, a single <q>$</q> character encountered apart from a | |||||
property-like construct (including a matched pair of french | |||||
braces) will be interpreted literally; that is, as <q>$</q>. The | |||||
"correct" way to specify this literal character, however, is by | |||||
using the escaping mechanism unconditionally, so that <q>$$</q> is | |||||
obtained by specifying <q>$$$$</q>. Mixing the two approaches | |||||
yields unpredictable results, as <q>$$$</q> results | |||||
in <q>$$</q>.</p> | |||||
<p>In order to maintain backward compatibility with older Ant releases, a single <q>$</q> | |||||
character encountered apart from a property-like construct (including a matched pair of french | |||||
braces) will be interpreted literally; that is, as <q>$</q>. The "correct" way to specify this | |||||
literal character, however, is by using the escaping mechanism unconditionally, so | |||||
that <q>$$</q> is obtained by specifying <q>$$$$</q>. Mixing the two approaches yields | |||||
unpredictable results, as <q>$$$</q> results in <q>$$</q>.</p> | |||||
<h2>Nesting of Braces</h2> | <h2>Nesting of Braces</h2> | ||||
<p>In its default configuration Ant will not try to balance braces | |||||
in property expansions, it will only consume the text up to the | |||||
first closing brace when creating a property name. I.e. when | |||||
expanding something like <samp>${a${b}}</samp> it will be | |||||
translated into two parts:</p> | |||||
<p>In its default configuration Ant will not try to balance braces in property expansions, it will | |||||
only consume the text up to the first closing brace when creating a property name. I.e. when | |||||
expanding something like <samp>${a${b}}</samp> it will be translated into two parts:</p> | |||||
<ol> | <ol> | ||||
<li>the expansion of property <samp>a${b</samp>—likely nothing | |||||
useful.</li> | |||||
<li>the literal text <samp>}</samp> resulting from the second | |||||
closing brace</li> | |||||
<li>the expansion of property <samp>a${b</samp>—likely nothing useful.</li> | |||||
<li>the literal text <samp>}</samp> resulting from the second closing brace</li> | |||||
</ol> | </ol> | ||||
<p>This means you can't use easily expand properties whose names are | |||||
given by properties, but there | |||||
are <a href="https://ant.apache.org/faq.html#propertyvalue-as-name-for-property">some | |||||
workarounds</a> for older versions of Ant. With Ant 1.8.0 and the | |||||
<a href="https://ant.apache.org/antlib/props/">the props Antlib</a> | |||||
you can configure Ant to use | |||||
the <code>NestedPropertyExpander</code> defined there if you need | |||||
such a feature.</p> | |||||
<p>This means you can't use easily expand properties whose names are given by properties, but | |||||
there are <a href="https://ant.apache.org/faq.html#propertyvalue-as-name-for-property" | |||||
target="_top">some workarounds</a> for older versions of Ant. With Ant 1.8.0 and | |||||
the <a href="https://ant.apache.org/antlib/props/" target="_top">the props Antlib</a> you can | |||||
configure Ant to use the <code>NestedPropertyExpander</code> defined there if you need such a | |||||
feature.</p> | |||||
<h2>Expanding a "Property Name"</h2> | <h2>Expanding a "Property Name"</h2> | ||||
<p>In its most simple form <samp>${key}</samp> is supposed to look | |||||
up a property named <code>key</code> and expand to the value of | |||||
the property. Additional <code>PropertyEvaluator</code>s may | |||||
result in a different interpretation of <code>key</code>, | |||||
though.</p> | |||||
<p>In its most simple form <samp>${key}</samp> is supposed to look up a property | |||||
named <code>key</code> and expand to the value of the property. | |||||
Additional <code>PropertyEvaluator</code>s may result in a different interpretation | |||||
of <code>key</code>, though.</p> | |||||
<p>The <a href="https://ant.apache.org/antlibs/props/">props Antlib</a> | |||||
provides a few interesting evaluators but there are | |||||
also a few built-in ones.</p> | |||||
<p>The <a href="https://ant.apache.org/antlibs/props/" target="_top">props Antlib</a> provides a | |||||
few interesting evaluators but there are also a few built-in ones.</p> | |||||
<h3 id="toString">Getting the value of a Reference with | |||||
<samp>${toString:}</samp></h3> | |||||
<h3 id="toString">Getting the value of a Reference with <samp>${toString:}</samp></h3> | |||||
<p>Any Ant type which has been declared with a reference can also | |||||
its string value extracted by using the <samp>${toString:}</samp> | |||||
operation, with the name of the reference listed after | |||||
the <code>toString:</code> text. The <code>toString()</code> | |||||
method of the Java class instance that is referenced is | |||||
invoked—all built in types strive to produce useful and | |||||
relevant output in such an instance.</p> | |||||
<p>Any Ant type which has been declared with a reference can also its string value extracted by | |||||
using the <samp>${toString:}</samp> operation, with the name of the reference listed after | |||||
the <code>toString:</code> text. The <code>toString()</code> method of the Java class instance | |||||
that is referenced is invoked—all built in types strive to produce useful and relevant | |||||
output in such an instance.</p> | |||||
<p>For example, here is how to get a listing of the files in a fileset,<p> | <p>For example, here is how to get a listing of the files in a fileset,<p> | ||||
@@ -304,49 +263,42 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | |||||
<fileset id="sourcefiles" dir="src" includes="**/*.java"/> | <fileset id="sourcefiles" dir="src" includes="**/*.java"/> | ||||
<echo> sourcefiles = ${toString:sourcefiles} </echo></pre> | <echo> sourcefiles = ${toString:sourcefiles} </echo></pre> | ||||
<p>There is no guarantee that external types provide meaningful | |||||
information in such a situation</p> | |||||
<p>There is no guarantee that external types provide meaningful information in such a | |||||
situation</p> | |||||
<h3 id="ant.refid">Getting the value of a Reference with <samp>${ant.refid:}</samp></h3> | <h3 id="ant.refid">Getting the value of a Reference with <samp>${ant.refid:}</samp></h3> | ||||
<p>Any Ant type which has been declared with a reference can also be | |||||
used as a property by using the <samp>${ant.refid:}</samp> | |||||
operation, with the name of the reference listed after | |||||
the <code>ant.refid:</code> text. The difference between this | |||||
operation and <a href="#toString"><samp>${toString:}</samp></a> is | |||||
that <samp>${ant.refid:}</samp> will expand to the referenced | |||||
object itself. In most circumstances the <code>toString</code> | |||||
method will be invoked anyway, for example if | |||||
the <samp>${ant.refid:}</samp> is surrounded by other text.</p> | |||||
<p>Any Ant type which has been declared with a reference can also be used as a property by using | |||||
the <samp>${ant.refid:}</samp> operation, with the name of the reference listed after | |||||
the <code>ant.refid:</code> text. The difference between this operation | |||||
and <a href="#toString"><samp>${toString:}</samp></a> is that <samp>${ant.refid:}</samp> will | |||||
expand to the referenced object itself. In most circumstances the <code>toString</code> method | |||||
will be invoked anyway, for example if the <samp>${ant.refid:}</samp> is surrounded by other | |||||
text.</p> | |||||
<p>This syntax is most useful when using a task with attribute | |||||
setters that accept objects other than String. For example, if | |||||
the setter accepts a Resource object as in</p> | |||||
<p>This syntax is most useful when using a task with attribute setters that accept objects other | |||||
than String. For example, if the setter accepts a Resource object as in</p> | |||||
<pre>public void setAttr(Resource r) { ... }</pre> | <pre>public void setAttr(Resource r) { ... }</pre> | ||||
<p>then the syntax can be used to pass in resource subclasses | |||||
previously defined as references like</p> | |||||
<p>then the syntax can be used to pass in resource subclasses previously defined as references | |||||
like</p> | |||||
<pre> | <pre> | ||||
<url url="http://ant.apache.org/" id="anturl"/> | <url url="http://ant.apache.org/" id="anturl"/> | ||||
<my:task attr="${ant.refid:anturl}"/></pre> | <my:task attr="${ant.refid:anturl}"/></pre> | ||||
<h2 id="if+unless">If/Unless Attributes</h2> | <h2 id="if+unless">If/Unless Attributes</h2> | ||||
<p> | <p> | ||||
The <code><target></code> element and various tasks (such | |||||
as <code><fail></code>) and task elements (such | |||||
as <code><test></code> in <code><junit></code>) | |||||
support <var>if</var> and <var>unless</var> attributes which can | |||||
be used to control whether the item is run or otherwise takes | |||||
effect. | |||||
The <code><target></code> element and various tasks (such as <code><fail></code>) | |||||
and task elements (such as <code><test></code> in <code><junit></code>) | |||||
support <var>if</var> and <var>unless</var> attributes which can be used to control whether the | |||||
item is run or otherwise takes effect. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
In Ant 1.7.1 and earlier, these attributes could only be property | |||||
names. The item was enabled if a property with that name was | |||||
defined—even to be the empty string | |||||
or <q>false</q>—and disabled if the property was not | |||||
defined. For example, the following works but there is no way to | |||||
override the file existence check negatively (only positively): | |||||
In Ant 1.7.1 and earlier, these attributes could only be property names. The item was enabled | |||||
if a property with that name was defined—even to be the empty string | |||||
or <q>false</q>—and disabled if the property was not defined. For example, the following | |||||
works but there is no way to override the file existence check negatively (only positively): | |||||
</p> | </p> | ||||
<pre> | <pre> | ||||
<target name="-check-use-file"> | <target name="-check-use-file"> | ||||
@@ -357,16 +309,14 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | |||||
</target> | </target> | ||||
<target name="lots-of-stuff" depends="use-file,other-unconditional-stuff"/></pre> | <target name="lots-of-stuff" depends="use-file,other-unconditional-stuff"/></pre> | ||||
<p> | <p> | ||||
<em>Since Ant 1.8.0</em>, you may instead use property expansion; | |||||
a value of <q>true</q> (or <q>on</q> or <q>yes</q>) will enable | |||||
the item, while <q>false</q> (or <q>off</q> or <q>no</q>) will | |||||
disable it. Other values are still assumed to be property names | |||||
and so the item is enabled only if the named property is defined. | |||||
<em>Since Ant 1.8.0</em>, you may instead use property expansion; a value of <q>true</q> | |||||
(or <q>on</q> or <q>yes</q>) will enable the item, while <q>false</q> (or <q>off</q> | |||||
or <q>no</q>) will disable it. Other values are still assumed to be property names and so the | |||||
item is enabled only if the named property is defined. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
Compared to the older style, this gives you additional | |||||
flexibility, because you can override the condition from the | |||||
command line or parent scripts: | |||||
Compared to the older style, this gives you additional flexibility, because you can override the | |||||
condition from the command line or parent scripts: | |||||
</p> | </p> | ||||
<pre> | <pre> | ||||
<target name="-check-use-file" <strong>unless="file.exists"</strong>> | <target name="-check-use-file" <strong>unless="file.exists"</strong>> | ||||
@@ -377,9 +327,8 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | |||||
</target> | </target> | ||||
<target name="lots-of-stuff" depends="use-file,other-unconditional-stuff"/></pre> | <target name="lots-of-stuff" depends="use-file,other-unconditional-stuff"/></pre> | ||||
<p> | <p> | ||||
Now <code>ant -Dfile.exists=false lots-of-stuff</code> will | |||||
run <q>other-unconditional-stuff</q> but not <q>use-file</q>, as | |||||
you might expect, and you can disable the condition from another | |||||
Now <code>ant -Dfile.exists=false lots-of-stuff</code> will run <q>other-unconditional-stuff</q> | |||||
but not <q>use-file</q>, as you might expect, and you can disable the condition from another | |||||
script too: | script too: | ||||
</p> | </p> | ||||
<pre> | <pre> | ||||
@@ -387,12 +336,10 @@ public class ToStringEvaluator implements PropertyHelper.PropertyEvaluator { | |||||
<param name="file.exists" value="false"/> | <param name="file.exists" value="false"/> | ||||
</antcall></pre> | </antcall></pre> | ||||
<p> | <p> | ||||
Similarly, an <var>unless</var> attribute disables the item if it | |||||
is either the name of property which is defined, or if it | |||||
evaluates to a <q>true</q>-like value. For example, the following | |||||
allows you to define <code>skip.printing.message=true</code> | |||||
in <samp>my-prefs.properties</samp> with the results you might | |||||
expect: | |||||
Similarly, an <var>unless</var> attribute disables the item if it is either the name of property | |||||
which is defined, or if it evaluates to a <q>true</q>-like value. For example, the following | |||||
allows you to define <code>skip.printing.message=true</code> in <samp>my-prefs.properties</samp> | |||||
with the results you might expect: | |||||
</p> | </p> | ||||
<pre> | <pre> | ||||
<property file="my-prefs.properties"/> | <property file="my-prefs.properties"/> | ||||
@@ -234,10 +234,10 @@ For csh/tcsh: | |||||
<p> | <p> | ||||
Any program that is executed with <code><java></code> without | Any program that is executed with <code><java></code> without | ||||
setting <var>fork</var>=<q>true</q> will pick up the Ant's | |||||
settings. If you need different values, | |||||
set <var>fork</var>=<q>false</q> and provide the values | |||||
in <code><sysproperty></code> elements. | |||||
setting <var>fork</var>=<q>true</q> will pick up the Ant's | |||||
settings. If you need different values, | |||||
set <var>fork</var>=<q>false</q> and provide the values | |||||
in <code><sysproperty></code> elements. | |||||
</p> | </p> | ||||
<p> | <p> | ||||
If you wish to have a forked process pick up the Ant's settings, use | If you wish to have a forked process pick up the Ant's settings, use | ||||
@@ -282,7 +282,8 @@ For csh/tcsh: | |||||
<h4>Further reading</h4> | <h4>Further reading</h4> | ||||
<ul> | <ul> | ||||
<li><a href="https://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html">Java Networking Properties</a>.</li> | |||||
<li><a href="https://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html" | |||||
target="_top">Java Networking Properties</a>.</li> | |||||
</ul> | </ul> | ||||
</body> | </body> | ||||
@@ -404,10 +404,9 @@ properties are available via Project instance, I searched for them with a</p> | |||||
for <var>srcencoding</var>, <var>destencoding</var> | for <var>srcencoding</var>, <var>destencoding</var> | ||||
and <var>bundleencoding</var> | and <var>bundleencoding</var> | ||||
in <a href="Tasks/translate.html">translate</a><br/> see JavaDoc | in <a href="Tasks/translate.html">translate</a><br/> see JavaDoc | ||||
of <a target="_blank" | |||||
href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html">java.nio.charset.Charset</a> | |||||
for more information about character sets (not used in Ant, but | |||||
has nice docs). | |||||
of <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" | |||||
target="_top">java.nio.charset.Charset</a> for more information | |||||
about character sets (not used in Ant, but has nice docs). | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -416,7 +415,7 @@ properties are available via Project instance, I searched for them with a</p> | |||||
<td>The specified path is added to the classpath if Jikes is used as compiler.</td> | <td>The specified path is added to the classpath if Jikes is used as compiler.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><code>MailLogger.properties.file, MailLogger.*</code></td> | |||||
<td><code>MailLogger.properties.file</code>, <code>MailLogger.*</code></td> | |||||
<td>filename (optional, defaults derived from Project instance)</td> | <td>filename (optional, defaults derived from Project instance)</td> | ||||
<td>Name of the file holding properties for sending emails by | <td>Name of the file holding properties for sending emails by | ||||
the <a href="listeners.html#MailLogger">MailLogger</a>. Override | the <a href="listeners.html#MailLogger">MailLogger</a>. Override | ||||
@@ -172,10 +172,10 @@ documentation.</p> | |||||
<tr> | <tr> | ||||
<td><a href="Tasks/jdepend.html">JDepend</a></td> | <td><a href="Tasks/jdepend.html">JDepend</a></td> | ||||
<td><p>Invokes | <td><p>Invokes | ||||
the <a href="http://www.clarkware.com/software/JDepend.html"> | |||||
JDepend</a> parser. This parser "traverses a set of Java | |||||
source-file directories and generates design-quality metrics for | |||||
each Java package".</p></td> | |||||
the <a href="http://www.clarkware.com/software/JDepend.html" | |||||
target="_top">JDepend</a> parser. This parser "traverses a | |||||
set of Java source-file directories and generates design-quality | |||||
metrics for each Java package".</p></td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -520,8 +520,7 @@ documentation.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><a href="Tasks/replaceregexp.html"> | |||||
ReplaceRegExp</a></td> | |||||
<td><a href="Tasks/replaceregexp.html">ReplaceRegExp</a></td> | |||||
<td><p>Replaces the occurrence of a given regular expression with | <td><p>Replaces the occurrence of a given regular expression with | ||||
a substitution pattern in a file or set of files.</p></td> | a substitution pattern in a file or set of files.</p></td> | ||||
</tr> | </tr> | ||||
@@ -788,23 +787,24 @@ documentation.</p> | |||||
<tr> | <tr> | ||||
<td><a href="Tasks/jjdoc.html">JJDoc</a></td> | <td><a href="Tasks/jjdoc.html">JJDoc</a></td> | ||||
<td><p>Invokes the <a href="https://javacc.org/">JJDoc</a> | |||||
documentation generator for the JavaCC compiler-compiler. JJDoc | |||||
takes a JavaCC parser specification and produces documentation | |||||
for the BNF grammar. It can operate in three modes, determined | |||||
by command line options. This task only invokes JJDoc if the | |||||
grammar file is newer than the generated BNF grammar | |||||
documentation.</p></td> | |||||
<td><p>Invokes the <a href="https://javacc.org/" | |||||
target="_top">JJDoc</a> documentation generator for the JavaCC | |||||
compiler-compiler. JJDoc takes a JavaCC parser specification and | |||||
produces documentation for the BNF grammar. It can operate in | |||||
three modes, determined by command line options. This task only | |||||
invokes JJDoc if the grammar file is newer than the generated BNF | |||||
grammar documentation.</p></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><a href="Tasks/jjtree.html">JJTree</a></td> | <td><a href="Tasks/jjtree.html">JJTree</a></td> | ||||
<td><p>Invokes the <a href="https://javacc.org/">JJTree</a> | |||||
preprocessor for the JavaCC compiler-compiler. It inserts | |||||
parse-tree building actions at various places in the JavaCC | |||||
source that it generates. The output of JJTree is run through | |||||
JavaCC to create the parser. This task only invokes JJTree if the | |||||
grammar file is newer than the generated JavaCC file.</p></td> | |||||
<td><p>Invokes the <a href="https://javacc.org/" | |||||
target="_top">JJTree</a> preprocessor for the JavaCC | |||||
compiler-compiler. It inserts parse-tree building actions at | |||||
various places in the JavaCC source that it generates. The output | |||||
of JJTree is run through JavaCC to create the parser. This task | |||||
only invokes JJTree if the grammar file is newer than the | |||||
generated JavaCC file.</p></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -813,8 +813,7 @@ documentation.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><a href="Tasks/native2ascii.html"> | |||||
Native2Ascii</a></td> | |||||
<td><a href="Tasks/native2ascii.html">Native2Ascii</a></td> | |||||
<td><p>Converts files from native encodings to ASCII with escaped | <td><p>Converts files from native encodings to ASCII with escaped | ||||
Unicode. A common usage is to convert source files maintained in | Unicode. A common usage is to convert source files maintained in | ||||
a native operating system encoding to ASCII, prior to | a native operating system encoding to ASCII, prior to | ||||
@@ -919,8 +918,7 @@ documentation.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><a href="Tasks/propertyfile.html"> | |||||
PropertyFile</a></td> | |||||
<td><a href="Tasks/propertyfile.html">PropertyFile</a></td> | |||||
<td><p>Creates or modifies property files. Useful when wanting to | <td><p>Creates or modifies property files. Useful when wanting to | ||||
make unattended modifications to configuration files for | make unattended modifications to configuration files for | ||||
application servers and applications. Typically used for things | application servers and applications. Typically used for things | ||||
@@ -1050,8 +1048,7 @@ documentation.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><a href="Tasks/vss.html"> | |||||
Microsoft Visual SourceSafe</a></td> | |||||
<td><a href="Tasks/vss.html">Microsoft Visual SourceSafe</a></td> | |||||
<td><p>Tasks to perform the Visual SourceSafe <em>vssget</em>, | <td><p>Tasks to perform the Visual SourceSafe <em>vssget</em>, | ||||
<em>vsslabel</em>, <em>vsshistory</em>, <em>vsscheckin</em>, | <em>vsslabel</em>, <em>vsshistory</em>, <em>vsscheckin</em>, | ||||
<em>vsscheckout</em>, <em>vssadd</em>, <em>vsscp</em>, | <em>vsscheckout</em>, <em>vssadd</em>, <em>vsscp</em>, | ||||
@@ -1084,9 +1081,10 @@ documentation.</p> | |||||
<tr> | <tr> | ||||
<td><a href="Tasks/junit.html">Junit</a></td> | <td><a href="Tasks/junit.html">Junit</a></td> | ||||
<td><p>Runs tests from the <a href="https://junit.org">Junit</a> | |||||
testing framework. This task has been tested with JUnit 3.0 and | |||||
later; it won't work with versions prior to JUnit 3.0.</p></td> | |||||
<td><p>Runs tests from the <a href="https://junit.org" | |||||
target="_top">Junit</a> testing framework. This task has been | |||||
tested with JUnit 3.0 and later; it won't work with versions | |||||
prior to JUnit 3.0.</p></td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -244,13 +244,13 @@ because</p> | |||||
<li>it's from Apache ;-)</li> | <li>it's from Apache ;-)</li> | ||||
</ul> | </ul> | ||||
<p>We store our external libraries in a new directory <samp>lib</samp>. Log4J can | <p>We store our external libraries in a new directory <samp>lib</samp>. Log4J can | ||||
be <a href="https://archive.apache.org/dist/logging/log4j/1.2.17/logging-log4j-1.2.17.zip">downloaded [1]</a> from | |||||
Logging's Homepage. Create the <samp>lib</samp> directory and extract the <samp>log4j-1.2.17.jar</samp> into that | |||||
directory. After that we have to modify our Java source file to use that library and our buildfile so that this library | |||||
could be accessed during compilation and run.</p> | |||||
<p>Working with Log4J is documented inside its manual. Here we use the <var>MyApp</var>-example from | |||||
the <a href="https://logging.apache.org/log4j/1.2/manual.html">Short Manual [2]</a>. First we have to modify the java | |||||
source to use the logging framework:</p> | |||||
be <a href="https://archive.apache.org/dist/logging/log4j/1.2.17/logging-log4j-1.2.17.zip" target="_top">downloaded | |||||
[1]</a> from Logging's Homepage. Create the <samp>lib</samp> directory and extract the <samp>log4j-1.2.17.jar</samp> | |||||
into that directory. After that we have to modify our Java source file to use that library and our buildfile so that | |||||
this library could be accessed during compilation and run.</p> | |||||
<p>Working with Log4J is documented inside its manual. Here we use the <samp>MyApp</samp>-example from | |||||
the <a href="https://logging.apache.org/log4j/1.2/manual.html" target="_top">Short Manual [2]</a>. First we have to | |||||
modify the java source to use the logging framework:</p> | |||||
<pre class="code"> | <pre class="code"> | ||||
package oata; | package oata; | ||||
@@ -413,9 +413,9 @@ junit instruction to our buildfile:</p> | |||||
...</pre> | ...</pre> | ||||
<p>We reuse the path to our own jar file as defined in run-target by giving it an ID and making it globally available. | <p>We reuse the path to our own jar file as defined in run-target by giving it an ID and making it globally available. | ||||
The <code>printsummary=yes</code> lets us see more detailed information than just a "FAILED" or "PASSED" message. How | |||||
much tests failed? Some errors? <var>printsummary</var> lets us know. The classpath is set up to find our classes. To | |||||
run tests the <code>batchtest</code> here is used, so you could easily add more test classes in the future just by | |||||
The <var>printsummary</var>=<q>yes</q> lets us see more detailed information than just a "FAILED" or "PASSED" message. | |||||
How much tests failed? Some errors? <var>printsummary</var> lets us know. The classpath is set up to find our classes. | |||||
To run tests the <code>batchtest</code> here is used, so you could easily add more test classes in the future just by | |||||
naming them <code>*Test.java</code>. This is a common naming scheme.</p> | naming them <code>*Test.java</code>. This is a common naming scheme.</p> | ||||
<p>After a <code>ant junit</code> you'll get:</p> | <p>After a <code>ant junit</code> you'll get:</p> | ||||
@@ -470,9 +470,11 @@ don't need the HTML report just for testing, e.g. if you are fixing an error or | |||||
<h2 id="resources">Resources</h2> | <h2 id="resources">Resources</h2> | ||||
<ol class="refs"> | <ol class="refs"> | ||||
<li><a href="https://archive.apache.org/dist/logging/log4j/1.2.17/logging-log4j-1.2.17.zip">https://archive.apache.org/dist/logging/log4j/1.2.17/logging-log4j-1.2.17.zip</a></li> | |||||
<li><a href="https://logging.apache.org/log4j/1.2/manual.html">https://logging.apache.org/log4j/1.2/manual.html</a></li> | |||||
<li><a href="https://junit.org/junit4">https://junit.org/junit4</a></li> | |||||
<li><a href="https://archive.apache.org/dist/logging/log4j/1.2.17/logging-log4j-1.2.17.zip" | |||||
target="_top">https://archive.apache.org/dist/logging/log4j/1.2.17/logging-log4j-1.2.17.zip</a></li> | |||||
<li><a href="https://logging.apache.org/log4j/1.2/manual.html" | |||||
target="_top">https://logging.apache.org/log4j/1.2/manual.html</a></li> | |||||
<li><a href="https://junit.org/junit4" target="_top">https://junit.org/junit4</a></li> | |||||
</ol> | </ol> | ||||
</body> | </body> | ||||
@@ -322,8 +322,8 @@ the <code><path></code>. Filesets are easy if the files are all under a co | |||||
the case, you have a problem. Another disadvantage is its speed: if you have only a few files in a huge directory | the case, you have a problem. Another disadvantage is its speed: if you have only a few files in a huge directory | ||||
structure, why not use a <code><filelist></code> instead? <code><path></code>s combines these datatypes in | structure, why not use a <code><filelist></code> instead? <code><path></code>s combines these datatypes in | ||||
that way that a path contains other paths, filesets, dirsets and filelists. This is | that way that a path contains other paths, filesets, dirsets and filelists. This is | ||||
why <a href="http://ant-contrib.sourceforge.net/">Ant-Contrib [4]</a> <code><foreach></code> task is modified to | |||||
support paths instead of filesets. So we want that, too.</p> | |||||
why <a href="http://ant-contrib.sourceforge.net/" target="_top">Ant-Contrib [4]</a> <code><foreach></code> task is | |||||
modified to support paths instead of filesets. So we want that, too.</p> | |||||
<p>Changing from fileset to path support is very easy:</p> | <p>Changing from fileset to path support is very easy:</p> | ||||
<em><strong>Change Java code from:</strong></em> | <em><strong>Change Java code from:</strong></em> | ||||
@@ -659,8 +659,8 @@ After that it prints out the result (e.g. <samp>C:/ant-1.5.4/bin/ant.jar;C | |||||
<li>create a patch file</li> | <li>create a patch file</li> | ||||
<li>publishing that patch file</li> | <li>publishing that patch file</li> | ||||
</ul> | </ul> | ||||
<p>The <a href="https://ant.apache.org/ant_task_guidelines.html">Ant Task Guidelines [6]</a> support additional | |||||
information on that.</p> | |||||
<p>The <a href="https://ant.apache.org/ant_task_guidelines.html" target="_top">Ant Task Guidelines [6]</a> support | |||||
additional information on that.</p> | |||||
<p>Now we will check the "Checklist before submitting a new task" described in that guideline.</p> | <p>Now we will check the "Checklist before submitting a new task" described in that guideline.</p> | ||||
<ul> | <ul> | ||||
@@ -762,7 +762,7 @@ after <code>git clone</code> (without our modifications).</p> | |||||
<h3>Test on JDK 5</h3> | <h3>Test on JDK 5</h3> | ||||
<p>Ant 1.10 uses Java 8 for development, but Ant 1.9 is actively maintained, too. That means that Ant code must be able | <p>Ant 1.10 uses Java 8 for development, but Ant 1.9 is actively maintained, too. That means that Ant code must be able | ||||
to run on a JDK 5. So we have to test that. You can download older JDKs | to run on a JDK 5. So we have to test that. You can download older JDKs | ||||
from <a href="https://www.oracle.com/technetwork/java/archive-139210.html">Oracle [8]</a>.</p> | |||||
from <a href="https://www.oracle.com/technetwork/java/archive-139210.html" target="_top">Oracle [8]</a>.</p> | |||||
<p>Clean the <code>ANT_HOME</code> variable, delete the <samp>build</samp>, <samp>bootstrap</samp> and <samp>dist</samp> | <p>Clean the <code>ANT_HOME</code> variable, delete the <samp>build</samp>, <samp>bootstrap</samp> and <samp>dist</samp> | ||||
directories, and point <code>JAVA_HOME</code> to the JDK 5 home directory. Then create the patch with your commit, | directories, and point <code>JAVA_HOME</code> to the JDK 5 home directory. Then create the patch with your commit, | ||||
@@ -773,11 +773,11 @@ run <code>ant test</code> (like above).</p> | |||||
<h3>Checkstyle</h3> | <h3>Checkstyle</h3> | ||||
<p>There are many things we have to ensure. Indentation with 4 spaces, blanks here and there, ... (all described in | <p>There are many things we have to ensure. Indentation with 4 spaces, blanks here and there, ... (all described in | ||||
the <a href="https://ant.apache.org/ant_task_guidelines.html">Ant Task Guidelines [6]</a> which includes | |||||
the <a href="https://www.oracle.com/technetwork/java/codeconvtoc-136057.html">Sun code style [9]</a>). Because there are | |||||
so many things we would be happy to have a tool for do the checks. There is one: checkstyle. Checkstyle is available | |||||
at <a href="http://checkstyle.sourceforge.net/"> Sourceforge [10]</a> and Ant provides with the <samp>check.xml</samp> a | |||||
buildfile which will do the job for us.</p> | |||||
the <a href="https://ant.apache.org/ant_task_guidelines.html" target="_top">Ant Task Guidelines [6]</a> which includes | |||||
the <a href="https://www.oracle.com/technetwork/java/codeconvtoc-136057.html" target="_top">Sun code style | |||||
[9]</a>). Because there are so many things we would be happy to have a tool for do the checks. There is one: | |||||
checkstyle. Checkstyle is available at <a href="http://checkstyle.sourceforge.net/" target="_top">Sourceforge [10]</a> | |||||
and Ant provides with the <samp>check.xml</samp> a buildfile which will do the job for us.</p> | |||||
<p>Download it and put the <samp>checkstyle-*-all.jar</samp> into your <samp>%USERPROFILE%\.ant\lib</samp> directory. | <p>Download it and put the <samp>checkstyle-*-all.jar</samp> into your <samp>%USERPROFILE%\.ant\lib</samp> directory. | ||||
All jar's stored there are available to Ant so you haven't to add it to you <samp>%ANT_HOME%\lib</samp> directory (this | All jar's stored there are available to Ant so you haven't to add it to you <samp>%ANT_HOME%\lib</samp> directory (this | ||||
@@ -796,9 +796,9 @@ will find the next error place much more easier without redoing the checkstyle.< | |||||
run. Now our task isn't listed. That's fine :-)</p> | run. Now our task isn't listed. That's fine :-)</p> | ||||
<h3>Publish the task</h3> | <h3>Publish the task</h3> | ||||
<p>Finally we publish that archive. As described in the <a href="https://ant.apache.org/ant_task_guidelines.html">Ant | |||||
Task Guidelines [7]</a> we can announce it on the developer mailing list, create a BugZilla entry and open a GitHub pull | |||||
request. For both we need some information:</p> | |||||
<p>Finally we publish that archive. As described in the <a href="https://ant.apache.org/ant_task_guidelines.html" | |||||
target="_top">Ant Task Guidelines [7]</a> we can announce it on the developer mailing list, create a BugZilla entry and | |||||
open a GitHub pull request. For both we need some information:</p> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -826,13 +826,14 @@ request. For both we need some information:</p> | |||||
more difficult. But the advantage is that entries will not be forgotten (a report is generated once every weekend). So | more difficult. But the advantage is that entries will not be forgotten (a report is generated once every weekend). So | ||||
I will describe the process.</p> | I will describe the process.</p> | ||||
<p>First, you must have a BugZilla account. So open the <a href="https://issues.apache.org/bugzilla/">BugZilla Main Page | |||||
[11]</a> and follow the link <a href="https://issues.apache.org/bugzilla/createaccount.cgi">Open a new Bugzilla account | |||||
[12]</a> and the steps described there if you haven't one.</p> | |||||
<p>First, you must have a BugZilla account. So open the <a href="https://issues.apache.org/bugzilla/" | |||||
target="_top">BugZilla Main Page [11]</a> and follow the | |||||
link <a href="https://issues.apache.org/bugzilla/createaccount.cgi" target="_top">Open a new Bugzilla account [12]</a> | |||||
and the steps described there if you haven't one.</p> | |||||
<ol> | <ol> | ||||
<li>From the BugZilla main page choose <a href="https://issues.apache.org/bugzilla/enter_bug.cgi">Enter a new bug report | |||||
[13]</a></li> | |||||
<li>From the BugZilla main page choose <a href="https://issues.apache.org/bugzilla/enter_bug.cgi" target="_top">Enter a | |||||
new bug report [13]</a></li> | |||||
<li>Choose "Ant" as product</li> | <li>Choose "Ant" as product</li> | ||||
<li>Version is the last "Alpha (nightly)" (at this time 1.10)</li> | <li>Version is the last "Alpha (nightly)" (at this time 1.10)</li> | ||||
<li>Component is "Core tasks"</li> | <li>Component is "Core tasks"</li> | ||||
@@ -854,16 +855,21 @@ I will describe the process.</p> | |||||
<li><a href="tutorial-writing-tasks.html">tutorial-writing-tasks.html</a></li> | <li><a href="tutorial-writing-tasks.html">tutorial-writing-tasks.html</a></li> | ||||
<li><a href="tutorial-tasks-filesets-properties.zip">tutorial-tasks-filesets-properties.zip</a></li> | <li><a href="tutorial-tasks-filesets-properties.zip">tutorial-tasks-filesets-properties.zip</a></li> | ||||
<li><a href="properties.html#built-in-props">properties.html#built-in-props</a></li> | <li><a href="properties.html#built-in-props">properties.html#built-in-props</a></li> | ||||
<li><a href="http://ant-contrib.sourceforge.net/">http://ant-contrib.sourceforge.net/</a></li> | |||||
<li><a href="http://ant-contrib.sourceforge.net/" target="_top">http://ant-contrib.sourceforge.net/</a></li> | |||||
<li><a href="Tasks/java.html">Tasks/java.html</a></li> | <li><a href="Tasks/java.html">Tasks/java.html</a></li> | ||||
<li><a href="https://ant.apache.org/ant_task_guidelines.html">https://ant.apache.org/ant_task_guidelines.html</a></li> | |||||
<li><a href="https://github.com/apache/ant">https://github.com/apache/ant</a></li> | |||||
<li><a href="https://www.oracle.com/technetwork/java/archive-139210.html">https://www.oracle.com/technetwork/java/archive-139210.html</a></li> | |||||
<li><a href="https://www.oracle.com/technetwork/java/codeconvtoc-136057.html">https://www.oracle.com/technetwork/java/codeconvtoc-136057.html</a></li> | |||||
<li><a href="http://checkstyle.sourceforge.net/">http://checkstyle.sourceforge.net/</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/">https://issues.apache.org/bugzilla/</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/createaccount.cgi">https://issues.apache.org/bugzilla/createaccount.cgi</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/enter_bug.cgi">https://issues.apache.org/bugzilla/enter_bug.cgi</a></li> | |||||
<li><a href="https://ant.apache.org/ant_task_guidelines.html" | |||||
target="_top">https://ant.apache.org/ant_task_guidelines.html</a></li> | |||||
<li><a href="https://github.com/apache/ant" target="_top">https://github.com/apache/ant</a></li> | |||||
<li><a href="https://www.oracle.com/technetwork/java/archive-139210.html" | |||||
target="_top">https://www.oracle.com/technetwork/java/archive-139210.html</a></li> | |||||
<li><a href="https://www.oracle.com/technetwork/java/codeconvtoc-136057.html" | |||||
target="_top">https://www.oracle.com/technetwork/java/codeconvtoc-136057.html</a></li> | |||||
<li><a href="http://checkstyle.sourceforge.net/" target="_top">http://checkstyle.sourceforge.net/</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/" target="_top">https://issues.apache.org/bugzilla/</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/createaccount.cgi" | |||||
target="_top">https://issues.apache.org/bugzilla/createaccount.cgi</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/enter_bug.cgi" | |||||
target="_top">https://issues.apache.org/bugzilla/enter_bug.cgi</a></li> | |||||
</ol> | </ol> | ||||
</body> | </body> | ||||
@@ -99,7 +99,7 @@ fail; <q>jar</q> requires the execution of some steps before. So the refactored | |||||
</target> | </target> | ||||
</project></pre> | </project></pre> | ||||
<p><code>ant.project.name</code> is one of the <a href="properties.html#built-in-props" target="_blank">build-in | |||||
<p><code>ant.project.name</code> is one of the <a href="properties.html#built-in-props" target="_top">build-in | |||||
properties [1]</a> of Ant.</p> | properties [1]</a> of Ant.</p> | ||||
<h2 id="write1">Write the Task</h2> | <h2 id="write1">Write the Task</h2> | ||||
@@ -117,7 +117,7 @@ attribute the <q>compile</q> is executed before).</p> | |||||
<h2 id="use1">Use the Task</h2> | <h2 id="use1">Use the Task</h2> | ||||
<p>But after creating the jar we want to use our new Task. Therefore we need a new target <q>use</q>. Before we can use | <p>But after creating the jar we want to use our new Task. Therefore we need a new target <q>use</q>. Before we can use | ||||
our new task we have to declare it with <a href="Tasks/taskdef.html" target="_blank"><code><taskdef></code> | |||||
our new task we have to declare it with <a href="Tasks/taskdef.html" target="_top"><code><taskdef></code> | |||||
[2]</a>. And for easier process we change the <var>default</var> attribute:</p> | [2]</a>. And for easier process we change the <var>default</var> attribute:</p> | ||||
<pre class="code"> | <pre class="code"> | ||||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
@@ -724,9 +724,8 @@ of your custom task. Then set breakpoints in other methods. This will ensure t | |||||
JVM.</p> | JVM.</p> | ||||
<h2 id="resources">Resources</h2> | <h2 id="resources">Resources</h2> | ||||
<p>This tutorial and its resources are available | |||||
via <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=22570">BugZilla [5]</a>. The ZIP provided there | |||||
contains</p> | |||||
<p>This tutorial and its resources are available via <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=22570" | |||||
target="_top">BugZilla [5]</a>. The ZIP provided there contains</p> | |||||
<ul> | <ul> | ||||
<li>this initial version of this tutorial</li> | <li>this initial version of this tutorial</li> | ||||
<li>the buildfile (last version)</li> | <li>the buildfile (last version)</li> | ||||
@@ -746,7 +745,8 @@ the manual.</p> | |||||
<li><a href="Tasks/taskdef.html">https://ant.apache.org/manual/Tasks/taskdef.html</a></li> | <li><a href="Tasks/taskdef.html">https://ant.apache.org/manual/Tasks/taskdef.html</a></li> | ||||
<li><a href="develop.html#set-magic">https://ant.apache.org/manual/develop.html#set-magic</a></li> | <li><a href="develop.html#set-magic">https://ant.apache.org/manual/develop.html#set-magic</a></li> | ||||
<li><a href="develop.html#nested-elements">https://ant.apache.org/manual/develop.html#nested-elements</a></li> | <li><a href="develop.html#nested-elements">https://ant.apache.org/manual/develop.html#nested-elements</a></li> | ||||
<li><a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=22570">https://issues.apache.org/bugzilla/show_bug.cgi?id=22570</a></li> | |||||
<li><a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=22570" | |||||
target="_top">https://issues.apache.org/bugzilla/show_bug.cgi?id=22570</a></li> | |||||
<li><a href="tutorial-writing-tasks-src.zip">tutorial-writing-tasks-src.zip</a></li> | <li><a href="tutorial-writing-tasks-src.zip">tutorial-writing-tasks-src.zip</a></li> | ||||
</ol> | </ol> | ||||
@@ -25,12 +25,10 @@ | |||||
<body> | <body> | ||||
<h1>Using Apache Ant</h1> | <h1>Using Apache Ant</h1> | ||||
<h2 id="buildfile">Writing a Simple Buildfile</h2> | <h2 id="buildfile">Writing a Simple Buildfile</h2> | ||||
<p>Apache Ant's buildfiles are written in XML. Each buildfile contains one project | |||||
and at least one (default) target. Targets contain task elements. | |||||
Each task element of the buildfile can have an <var>id</var> attribute and | |||||
can later be referred to by the value supplied to this. The value has | |||||
to be unique. (For additional information, see the | |||||
<a href="#tasks">Tasks</a> section below.)</p> | |||||
<p>Apache Ant's buildfiles are written in XML. Each buildfile contains one project and at least one (default) | |||||
target. Targets contain task elements. Each task element of the buildfile can have an <var>id</var> attribute and can | |||||
later be referred to by the value supplied to this. The value has to be unique. (For additional information, see | |||||
the <a href="#tasks">Tasks</a> section below.)</p> | |||||
<h3 id="projects">Projects</h3> | <h3 id="projects">Projects</h3> | ||||
<p>A <em>project</em> has three attributes:</p> | <p>A <em>project</em> has three attributes:</p> | ||||
@@ -48,93 +46,69 @@ to be unique. (For additional information, see the | |||||
<tr> | <tr> | ||||
<td>default</td> | <td>default</td> | ||||
<td>the default target to use when no target is supplied.</td> | <td>the default target to use when no target is supplied.</td> | ||||
<td>No; however, <em>since Ant 1.6.0</em>, | |||||
every project includes an implicit target that contains any and | |||||
all top-level tasks and/or types. This target will always be | |||||
executed as part of the project's initialization, even when Ant is | |||||
run with the <a href="running.html#options"><code>-projecthelp</code></a> option. | |||||
<td>No; however, <em>since Ant 1.6.0</em>, every project includes an implicit target that contains any and all | |||||
top-level tasks and/or types. This target will always be executed as part of the project's initialization, even | |||||
when Ant is run with the <a href="running.html#options"><code>-projecthelp</code></a> option. | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>basedir</td> | <td>basedir</td> | ||||
<td>the base directory from which all path calculations are | |||||
done. A relative path is resolved relative to the directory containing | |||||
the buildfile. | |||||
<td>the base directory from which all path calculations are done. A relative path is resolved relative to the | |||||
directory containing the buildfile. | |||||
</td> | </td> | ||||
<td>No; defaults to the parent directory of the buildfile, | |||||
unless overridden by the project's <var>basedir</var> or the <code>basedir</code> | |||||
property</td> | |||||
<td>No; defaults to the parent directory of the buildfile, unless overridden by the project's <var>basedir</var> or | |||||
the <code>basedir</code> property</td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<p>Optionally, a description for the project can be provided as a | |||||
top-level <code><description></code> element (see the <a | |||||
href="Types/description.html">description</a> type).</p> | |||||
<p>Optionally, a description for the project can be provided as a top-level <code><description></code> element | |||||
(see the <a href="Types/description.html">description</a> type).</p> | |||||
<p>Each project defines one or more <em>targets</em>. | |||||
A target is a set of <em>tasks</em> you want | |||||
to be executed. When starting Ant, you can select which target(s) you | |||||
want to have executed. When no target is given, | |||||
the project's <var>default</var> is used.</p> | |||||
<p>Each project defines one or more <em>targets</em>. A target is a set of <em>tasks</em> you want to be executed. When | |||||
starting Ant, you can select which target(s) you want to have executed. When no target is given, the | |||||
project's <var>default</var> is used.</p> | |||||
<h3 id="targets">Targets</h3> | <h3 id="targets">Targets</h3> | ||||
<p>A target can depend on other targets. You might have a target for compiling, | |||||
for example, and a target for creating a distributable. You can only build a | |||||
distributable when you have compiled first, so the distribute target | |||||
<p>A target can depend on other targets. You might have a target for compiling, for example, and a target for creating a | |||||
distributable. You can only build a distributable when you have compiled first, so the distribute target | |||||
<em>depends on</em> the compile target. Ant resolves these dependencies.</p> | <em>depends on</em> the compile target. Ant resolves these dependencies.</p> | ||||
<p>It should be noted, however, that Ant's <var>depends</var> attribute | |||||
only specifies the <em>order</em> in which targets should be executed—it | |||||
does not affect whether the target that specifies the dependency(s) gets | |||||
executed if the dependent target(s) did not (need to) run. | |||||
</p> | |||||
<p>It should be noted, however, that Ant's <var>depends</var> attribute only specifies the <em>order</em> in which | |||||
targets should be executed—it does not affect whether the target that specifies the dependency(s) gets executed if | |||||
the dependent target(s) did not (need to) run.</p> | |||||
<p>More information can be found in the dedicated <a href="targets.html">manual page</a>.</p> | <p>More information can be found in the dedicated <a href="targets.html">manual page</a>.</p> | ||||
<h3 id="tasks">Tasks</h3> | <h3 id="tasks">Tasks</h3> | ||||
<p>A task is a piece of code that can be executed.</p> | <p>A task is a piece of code that can be executed.</p> | ||||
<p>A task can have multiple attributes (or arguments, if you prefer). The value | |||||
of an attribute might contain references to a property. These references will be | |||||
resolved before the task is executed.</p> | |||||
<p>A task can have multiple attributes (or arguments, if you prefer). The value of an attribute might contain references | |||||
to a property. These references will be resolved before the task is executed.</p> | |||||
<p>Tasks have a common structure:</p> | <p>Tasks have a common structure:</p> | ||||
<pre><<i>name</i> <var>attribute1</var>="<i>value1</i>" <var>attribute2</var>="<i>value2</i>" ... /></pre> | <pre><<i>name</i> <var>attribute1</var>="<i>value1</i>" <var>attribute2</var>="<i>value2</i>" ... /></pre> | ||||
<p>where <code><i>name</i></code> is the name of the task, | |||||
<var>attributeN</var> is the attribute name, and | |||||
<code><i>valueN</i></code> is the value for this attribute.</p> | |||||
<p>There is a set of <a href="tasklist.html" target="navFrame">built-in tasks</a>, but it is also very | |||||
easy to <a href="develop.html#writingowntask">write your own</a>.</p> | |||||
<p>All tasks can have a <var>name</var> attribute. The value of | |||||
this attribute will be used in the logging messages generated by | |||||
Ant.</p> | |||||
Tasks can be assigned an <var>id</var> attribute: | |||||
<p>where <code><i>name</i></code> is the name of the task, <var>attributeN</var> is the attribute name, | |||||
and <code><i>valueN</i></code> is the value for this attribute.</p> | |||||
<p>There is a set of <a href="tasklist.html" target="navFrame">built-in tasks</a>, but it is also very easy | |||||
to <a href="develop.html#writingowntask">write your own</a>.</p> | |||||
<p>All tasks can have a <var>name</var> attribute. The value of this attribute will be used in the logging messages | |||||
generated by Ant.</p> | |||||
<p>Tasks can be assigned an <var>id</var> attribute:</p> | |||||
<pre><<i>taskname</i> <var>id</var>="<i>taskID</i>" ... /></pre> | <pre><<i>taskname</i> <var>id</var>="<i>taskID</i>" ... /></pre> | ||||
where <code><i>taskname</i></code> is the name of the task, and <code><i>taskID</i></code> is | |||||
a unique identifier for this task. | |||||
You can refer to the | |||||
corresponding task object in scripts or other tasks via this name. | |||||
For example, in scripts you could do: | |||||
<p>where <code><i>taskname</i></code> is the name of the task, and <code><i>taskID</i></code> is a unique identifier for | |||||
this task. You can refer to the corresponding task object in scripts or other tasks via this name. For example, in | |||||
scripts you could do:</p> | |||||
<pre> | <pre> | ||||
<script ... > | <script ... > | ||||
task1.setFoo("bar"); | task1.setFoo("bar"); | ||||
</script></pre> | </script></pre> | ||||
to set the <code>foo</code> attribute of this particular task instance. | |||||
In another task (written in Java), you can access the instance via | |||||
<code>project.getReference("task1")</code>. | |||||
<p> | |||||
Note 1: If <q>task1</q> has not been run yet, then | |||||
it has not been configured (ie., no attributes have been set), and if it is | |||||
going to be configured later, anything you've done to the instance may | |||||
be overwritten. | |||||
</p> | |||||
<p> | |||||
Note 2: Future versions of Ant will most likely <em>not</em> | |||||
be backward-compatible with this behaviour, since there will likely be no | |||||
task instances at all, only proxies. | |||||
</p> | |||||
<p>to set the <code>foo</code> attribute of this particular task instance. In another task (written in Java), you can | |||||
access the instance via <code>project.getReference("task1")</code>.</p> | |||||
<p>Note 1: If <q>task1</q> has not been run yet, then it has not been configured (ie., no attributes have been set), and | |||||
if it is going to be configured later, anything you've done to the instance may be overwritten.</p> | |||||
<p>Note 2: Future versions of Ant will most likely <em>not</em> be backward-compatible with this behaviour, since there | |||||
will likely be no task instances at all, only proxies.</p> | |||||
<h3 id="properties">Properties</h3> | <h3 id="properties">Properties</h3> | ||||
@@ -200,70 +174,49 @@ task instances at all, only proxies. | |||||
</target> | </target> | ||||
</project></pre> | </project></pre> | ||||
<p>Notice that we are declaring properties outside any target. <em>Since | |||||
Ant 1.6</em>, all tasks can be declared outside targets (earlier version | |||||
only allowed <code><property></code>, <code><typedef></code> and | |||||
<code><taskdef></code>). When you do this they are evaluated before | |||||
any targets are executed. Some tasks will generate build failures if | |||||
they are used outside of targets as they may cause infinite loops | |||||
otherwise (<code><antcall></code> for example).</p> | |||||
<p> | |||||
We have given some targets descriptions; this causes the <code>-projecthelp</code> | |||||
invocation option to list them as public targets with the descriptions; the | |||||
other target is internal and not listed. | |||||
<p> | |||||
Finally, for this target to work the source in the <samp>src</samp> subdirectory | |||||
should be stored in a directory tree which matches the package names. Check the | |||||
<code><javac></code> task for details. | |||||
<p>Notice that we are declaring properties outside any target. <em>Since Ant 1.6</em>, all tasks can be declared outside | |||||
targets (earlier version only allowed <code><property></code>, <code><typedef></code> | |||||
and <code><taskdef></code>). When you do this they are evaluated before any targets are executed. Some tasks | |||||
will generate build failures if they are used outside of targets as they may cause infinite loops otherwise | |||||
(<code><antcall></code> for example).</p> | |||||
<p>We have given some targets descriptions; this causes the <code>-projecthelp</code> invocation option to list them as | |||||
public targets with the descriptions; the other target is internal and not listed.</p> | |||||
<p>Finally, for this target to work the source in the <samp>src</samp> subdirectory should be stored in a directory tree | |||||
which matches the package names. Check the <code><javac></code> task for details.</p> | |||||
<h3 id="filters">Token Filters</h3> | <h3 id="filters">Token Filters</h3> | ||||
<p>A project can have a set of tokens that might be automatically expanded if | |||||
found when a file is copied, when the filtering-copy behavior is selected in the | |||||
tasks that support this. These might be set in the buildfile | |||||
by the <a href="Tasks/filter.html">filter</a> task.</p> | |||||
<p>Since this can potentially be a very harmful behavior, | |||||
the tokens in the files <strong>must</strong> | |||||
be of the form <code>@<var>token</var>@</code>, where | |||||
<var>token</var> is the token name that is set | |||||
in the <code><filter></code> task. This token syntax matches the syntax of other build systems | |||||
that perform such filtering and remains sufficiently orthogonal to most | |||||
programming and scripting languages, as well as with documentation systems.</p> | |||||
<p><strong>Note</strong>: If a token with the format <code>@<var>token</var>@</code> | |||||
is found in a file, but no | |||||
filter is associated with that token, no changes take place; | |||||
therefore, no escaping | |||||
method is available—but as long as you choose appropriate names for your | |||||
tokens, this should not cause problems.</p> | |||||
<p><strong>Warning</strong>: If you copy binary files with filtering turned on, you can corrupt the | |||||
files. This feature should be used with text files <em>only</em>.</p> | |||||
<p>A project can have a set of tokens that might be automatically expanded if found when a file is copied, when the | |||||
filtering-copy behavior is selected in the tasks that support this. These might be set in the buildfile by | |||||
the <a href="Tasks/filter.html">filter</a> task.</p> | |||||
<p>Since this can potentially be a very harmful behavior, the tokens in the files <strong>must</strong> be of the | |||||
form <code>@<var>token</var>@</code>, where <var>token</var> is the token name that is set in | |||||
the <code><filter></code> task. This token syntax matches the syntax of other build systems that perform such | |||||
filtering and remains sufficiently orthogonal to most programming and scripting languages, as well as with documentation | |||||
systems.</p> | |||||
<p><strong>Note</strong>: If a token with the format <code>@<var>token</var>@</code> is found in a file, but no filter | |||||
is associated with that token, no changes take place; therefore, no escaping method is available—but as long as | |||||
you choose appropriate names for your tokens, this should not cause problems.</p> | |||||
<p><strong>Warning</strong>: If you copy binary files with filtering turned on, you can corrupt the files. This feature | |||||
should be used with text files <em>only</em>.</p> | |||||
<h3 id="path">Path-like Structures</h3> | <h3 id="path">Path-like Structures</h3> | ||||
<p>You can specify <code>PATH</code>- and <code>CLASSPATH</code>-type | |||||
references using both <q>:</q> and <q>;</q> as separator | |||||
characters. Ant will | |||||
convert the separator to the correct character of the current operating | |||||
system.</p> | |||||
<p>Wherever path-like values need to be specified, a nested element can | |||||
be used. This takes the general form of:</p> | |||||
<p>You can specify <code>PATH</code>- and <code>CLASSPATH</code>-type references using both <q>:</q> and <q>;</q> as | |||||
separator characters. Ant will convert the separator to the correct character of the current operating system.</p> | |||||
<p>Wherever path-like values need to be specified, a nested element can be used. This takes the general form of:</p> | |||||
<pre> | <pre> | ||||
<classpath> | <classpath> | ||||
<pathelement path="${classpath}"/> | <pathelement path="${classpath}"/> | ||||
<pathelement location="lib/helper.jar"/> | <pathelement location="lib/helper.jar"/> | ||||
</classpath></pre> | </classpath></pre> | ||||
<p>The <var>location</var> attribute specifies a single file or | |||||
directory relative to the project's base directory (or an absolute | |||||
filename), while the <var>path</var> attribute accepts colon- | |||||
or semicolon-separated lists of locations. The <var>path</var> | |||||
attribute is intended to be used with predefined paths—in any other | |||||
case, multiple elements with <var>location</var> attributes should be | |||||
preferred.</p> | |||||
<p><em>Since Ant 1.8.2</em> the <var>location</var> attribute can also contain a | |||||
wildcard in its last path component (i.e. it can end in a | |||||
<q>*</q>) in order to support wildcard <code>CLASSPATH</code>s introduced | |||||
with Java 6. Ant will not expand or evaluate the wildcards and the | |||||
resulting path may not work as anything else but a <code>CLASSPATH</code>—or | |||||
even as a <code>CLASSPATH</code> for JVM prior to Java 6.</p> | |||||
<p>The <var>location</var> attribute specifies a single file or directory relative to the project's base directory (or | |||||
an absolute filename), while the <var>path</var> attribute accepts colon- or semicolon-separated lists of | |||||
locations. The <var>path</var> attribute is intended to be used with predefined paths—in any other case, multiple | |||||
elements with <var>location</var> attributes should be preferred.</p> | |||||
<p><em>Since Ant 1.8.2</em> the <var>location</var> attribute can also contain a wildcard in its last path component | |||||
(i.e. it can end in a <q>*</q>) in order to support wildcard <code>CLASSPATH</code>s introduced with Java 6. Ant will | |||||
not expand or evaluate the wildcards and the resulting path may not work as anything else but | |||||
a <code>CLASSPATH</code>—or even as a <code>CLASSPATH</code> for JVM prior to Java 6.</p> | |||||
<p>As a shortcut, the <code><classpath></code> tag | <p>As a shortcut, the <code><classpath></code> tag | ||||
supports <var>path</var> and | supports <var>path</var> and | ||||
<var>location</var> attributes of its own, so:</p> | <var>location</var> attributes of its own, so:</p> | ||||
@@ -274,16 +227,11 @@ supports <var>path</var> and | |||||
</pre> | </pre> | ||||
<p>can be abbreviated to:</p> | <p>can be abbreviated to:</p> | ||||
<pre><classpath path="${classpath}"/></pre> | <pre><classpath path="${classpath}"/></pre> | ||||
<p>In addition, one or more | |||||
<a href="Types/resources.html#collection">resource collections</a> | |||||
can be specified as nested elements (these must consist of | |||||
<a href="Types/resources.html#file">file</a>-type resources only). | |||||
Additionally, it should be noted that although resource collections are | |||||
processed in the order encountered, certain resource collection types | |||||
such as <a href="Types/fileset.html">fileset</a>, | |||||
<a href="Types/dirset.html">dirset</a> and | |||||
<a href="Types/resources.html#files">files</a> | |||||
are undefined in terms of order.</p> | |||||
<p>In addition, one or more <a href="Types/resources.html#collection">resource collections</a> can be specified as | |||||
nested elements (these must consist of <a href="Types/resources.html#file">file</a>-type resources only). Additionally, | |||||
it should be noted that although resource collections are processed in the order encountered, certain resource | |||||
collection types such as <a href="Types/fileset.html">fileset</a>, <a href="Types/dirset.html">dirset</a> | |||||
and <a href="Types/resources.html#files">files</a> are undefined in terms of order.</p> | |||||
<pre> | <pre> | ||||
<classpath> | <classpath> | ||||
<pathelement path="${classpath}"/> | <pathelement path="${classpath}"/> | ||||
@@ -297,33 +245,24 @@ are undefined in terms of order.</p> | |||||
</dirset> | </dirset> | ||||
<filelist refid="third-party_jars"/> | <filelist refid="third-party_jars"/> | ||||
</classpath></pre> | </classpath></pre> | ||||
<p>This builds a path that holds the value of <samp>${classpath}</samp>, | |||||
followed by all jar files in the <samp>lib</samp> directory, | |||||
the <samp>classes</samp> directory, all directories named | |||||
<samp>classes</samp> under the <samp>apps</samp> subdirectory of | |||||
<samp>${build.dir}</samp>, except those | |||||
that have the text <code>Test</code> in their name, and | |||||
the files specified in the referenced FileList.</p> | |||||
<p>If you want to use the same path-like structure for several tasks, | |||||
you can define them with a <code><path></code> element at the | |||||
same level as <code><target></code>s, and reference them via their | |||||
<p>This builds a path that holds the value of <samp>${classpath}</samp>, followed by all jar files in | |||||
the <samp>lib</samp> directory, the <samp>classes</samp> directory, all directories named <samp>classes</samp> under | |||||
the <samp>apps</samp> subdirectory of <samp>${build.dir}</samp>, except those that have the text <code>Test</code> in | |||||
their name, and the files specified in the referenced FileList.</p> | |||||
<p>If you want to use the same path-like structure for several tasks, you can define them with | |||||
a <code><path></code> element at the same level as <code><target></code>s, and reference them via their | |||||
<var>id</var> attribute—see <a href="#references">References</a> for an | <var>id</var> attribute—see <a href="#references">References</a> for an | ||||
example.</p> | example.</p> | ||||
<p>By default a path-like structure will re-evaluate all nested | |||||
resource collections whenever it is used, which may lead to | |||||
unnecessary re-scanning of the filesystem. <em>Since Ant 1.8.0</em>, path has | |||||
an optional <var>cache</var> attribute, if it is set to <q>true</q>, the path | |||||
instance will only scan its nested resource collections once and | |||||
assume it doesn't change during the build anymore (the default | |||||
for <var>cache</var> still is <q>false</q>). Even if you are using the | |||||
path only in a single task it may improve overall performance to set | |||||
<var>cache</var> to <q>true</q> if you are using complex nested | |||||
constructs.</p> | |||||
<p>A path-like structure can include a reference to another path-like | |||||
structure (a path being itself a resource collection) | |||||
via nested <code><path></code> elements:</p> | |||||
<p>By default a path-like structure will re-evaluate all nested resource collections whenever it is used, which may lead | |||||
to unnecessary re-scanning of the filesystem. <em>Since Ant 1.8.0</em>, path has an optional <var>cache</var> | |||||
attribute, if it is set to <q>true</q>, the path instance will only scan its nested resource collections once and assume | |||||
it doesn't change during the build anymore (the default for <var>cache</var> still is <q>false</q>). Even if you are | |||||
using the path only in a single task it may improve overall performance to set <var>cache</var> to <q>true</q> if you | |||||
are using complex nested constructs.</p> | |||||
<p>A path-like structure can include a reference to another path-like structure (a path being itself a resource | |||||
collection) via nested <code><path></code> elements:</p> | |||||
<pre> | <pre> | ||||
<path id="base.path"> | <path id="base.path"> | ||||
<pathelement path="${classpath}"/> | <pathelement path="${classpath}"/> | ||||
@@ -337,21 +276,18 @@ via nested <code><path></code> elements:</p> | |||||
<path refid="base.path"/> | <path refid="base.path"/> | ||||
<pathelement location="testclasses"/> | <pathelement location="testclasses"/> | ||||
</path></pre> | </path></pre> | ||||
The shortcuts previously mentioned for <code><classpath></code> | |||||
are also valid for <code><path></code>. For example: | |||||
<p>The shortcuts previously mentioned for <code><classpath></code> are also valid | |||||
for <code><path></code>. For example:</p> | |||||
<pre> | <pre> | ||||
<path id="base.path"> | <path id="base.path"> | ||||
<pathelement path="${classpath}"/> | <pathelement path="${classpath}"/> | ||||
</path></pre> | </path></pre> | ||||
can be written as: | |||||
<p>can be written as:</p> | |||||
<pre><path id="base.path" path="${classpath}"/></pre> | <pre><path id="base.path" path="${classpath}"/></pre> | ||||
<h4 id="pathshortcut">Path Shortcut</h4> | <h4 id="pathshortcut">Path Shortcut</h4> | ||||
<p> | |||||
<em>Since Ant 1.6</em>, there is a shortcut for converting paths to OS specific | |||||
strings in properties. One can use the expression | |||||
<samp>${toString:<em>pathreference</em>}</samp> to convert a path element | |||||
reference to a string that can be used for a path argument. For example: | |||||
</p> | |||||
<p><em>Since Ant 1.6</em>, there is a shortcut for converting paths to OS specific strings in properties. One can use | |||||
the expression <samp>${toString:<em>pathreference</em>}</samp> to convert a path element reference to a string that can | |||||
be used for a path argument. For example:</p> | |||||
<pre> | <pre> | ||||
<path id="lib.path.ref"> | <path id="lib.path.ref"> | ||||
<fileset dir="lib" includes="*.jar"/> | <fileset dir="lib" includes="*.jar"/> | ||||
@@ -361,9 +297,8 @@ can be written as: | |||||
</javac></pre> | </javac></pre> | ||||
<h3 id="arg">Command-line Arguments</h3> | <h3 id="arg">Command-line Arguments</h3> | ||||
<p>Several tasks take arguments that will be passed to another | |||||
process on the command line. To make it easier to specify arguments | |||||
that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
<p>Several tasks take arguments that will be passed to another process on the command line. To make it easier to specify | |||||
arguments that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
<table class="attr"> | <table class="attr"> | ||||
<tr> | <tr> | ||||
<th>Attribute</th> | <th>Attribute</th> | ||||
@@ -372,28 +307,23 @@ that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>value</td> | <td>value</td> | ||||
<td>a single command-line argument; can contain space | |||||
characters.</td> | |||||
<td>a single command-line argument; can contain space characters.</td> | |||||
<td rowspan="5">Exactly one of these.</td> | <td rowspan="5">Exactly one of these.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>file</td> | <td>file</td> | ||||
<td class="left">The name of a file as a single command-line | |||||
argument; will be replaced with the absolute filename of the file.</td> | |||||
<td class="left">The name of a file as a single command-line argument; will be replaced with the absolute filename | |||||
of the file.</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>path</td> | <td>path</td> | ||||
<td class="left">A string that will be treated as a path-like | |||||
string as a single command-line argument; you can use <q>;</q> | |||||
or <q>:</q> as | |||||
path separators and Ant will convert it to the platform's local | |||||
conventions.</td> | |||||
<td class="left">A string that will be treated as a path-like string as a single command-line argument; you can | |||||
use <q>;</q> or <q>:</q> as path separators and Ant will convert it to the platform's local conventions.</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>pathref</td> | <td>pathref</td> | ||||
<td class="left"><a href="#references">Reference</a> to a path | |||||
defined elsewhere. Ant will convert it to the platform's local | |||||
conventions.</td> | |||||
<td class="left"><a href="#references">Reference</a> to a path defined elsewhere. Ant will convert it to the | |||||
platform's local conventions.</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>line</td> | <td>line</td> | ||||
@@ -401,44 +331,38 @@ that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>prefix</td> | <td>prefix</td> | ||||
<td>A fixed string to be placed in front of the | |||||
argument. In the case of a line broken into parts, it will be | |||||
placed in front of every part. <em>Since Ant 1.8.</em></td> | |||||
<td>A fixed string to be placed in front of the argument. In the case of a line broken into parts, it will be placed | |||||
in front of every part. <em>Since Ant 1.8.</em></td> | |||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>suffix</td> | <td>suffix</td> | ||||
<td>A fixed string to be placed immediately after the | |||||
argument. In the case of a line broken into parts, it will be | |||||
<td>A fixed string to be placed immediately after the argument. In the case of a line broken into parts, it will be | |||||
placed after every part. <em>Since Ant 1.8.</em></td> | placed after every part. <em>Since Ant 1.8.</em></td> | ||||
<td>No</td> | <td>No</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<p>It is highly recommended to avoid the <var>line</var> version | |||||
when possible. Ant will try to split the command line in a way | |||||
similar to what a (Unix) shell would do, but may create something that | |||||
is very different from what you expect under some circumstances.</p> | |||||
<p>It is highly recommended to avoid the <var>line</var> version when possible. Ant will try to split the command line | |||||
in a way similar to what a (Unix) shell would do, but may create something that is very different from what you expect | |||||
under some circumstances.</p> | |||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<pre><arg value="-l -a"/></pre> | <pre><arg value="-l -a"/></pre> | ||||
<p>is a single command-line argument containing a space character, | |||||
<em>not</em> separate options <q>-l</q> and <q>-a</q>.</p> | |||||
<p>is a single command-line argument containing a space character, <em>not</em> separate options <q>-l</q> | |||||
and <q>-a</q>.</p> | |||||
<pre><arg line="-l -a"/></pre> | <pre><arg line="-l -a"/></pre> | ||||
<p>This is a command line with two separate options, <q>-l</q> and <q>-a</q>.</p> | <p>This is a command line with two separate options, <q>-l</q> and <q>-a</q>.</p> | ||||
<pre><arg path="/dir;/dir2:\dir3"/></pre> | <pre><arg path="/dir;/dir2:\dir3"/></pre> | ||||
<p>is a single command-line argument with the value | |||||
<code>\dir;\dir2;\dir3</code> on DOS-based systems and | |||||
<code>/dir:/dir2:/dir3</code> on Unix(-like) systems.</p> | |||||
<p>is a single command-line argument with the value <code>\dir;\dir2;\dir3</code> on DOS-based systems | |||||
and <code>/dir:/dir2:/dir3</code> on Unix(-like) systems.</p> | |||||
<h3 id="references">References</h3> | <h3 id="references">References</h3> | ||||
<p>Any project element can be assigned an identifier using its | |||||
<var>id</var> attribute. In most cases the element can subsequently | |||||
be referenced by specifying the <var>refid</var> attribute on an | |||||
element of the same type. This can be useful if you are going to | |||||
replicate the same snippet of XML over and over again—using a | |||||
<code><classpath></code> structure more than once, for example.</p> | |||||
<p>Any project element can be assigned an identifier using its <var>id</var> attribute. In most cases the element can | |||||
subsequently be referenced by specifying the <var>refid</var> attribute on an element of the same type. This can be | |||||
useful if you are going to replicate the same snippet of XML over and over again—using | |||||
a <code><classpath></code> structure more than once, for example.</p> | |||||
<p>The following example:</p> | <p>The following example:</p> | ||||
<pre> | <pre> | ||||
<project ... > | <project ... > | ||||
@@ -483,70 +407,56 @@ replicate the same snippet of XML over and over again—using a | |||||
</javac> | </javac> | ||||
</target> | </target> | ||||
</project></pre> | </project></pre> | ||||
<p>All tasks that use nested elements for | |||||
<a href="Types/patternset.html">PatternSet</a>s, | |||||
<a href="Types/fileset.html">FileSet</a>s, | |||||
<a href="Types/zipfileset.html">ZipFileSet</a>s or | |||||
<a href="#path">path-like structures</a> accept references to these structures | |||||
as shown in the examples. Using <var>refid</var> on a task will ordinarily | |||||
have the same effect (referencing a task already declared), but the user | |||||
should be aware that the interpretation of this attribute is dependent on the | |||||
implementation of the element upon which it is specified. Some tasks (the | |||||
<a href="Tasks/property.html">property</a> task is a handy example) | |||||
<p>All tasks that use nested elements | |||||
for <a href="Types/patternset.html">PatternSet</a>s, <a href="Types/fileset.html">FileSet</a>s, <a href="Types/zipfileset.html">ZipFileSet</a>s | |||||
or <a href="#path">path-like structures</a> accept references to these structures as shown in the | |||||
examples. Using <var>refid</var> on a task will ordinarily have the same effect (referencing a task already declared), | |||||
but the user should be aware that the interpretation of this attribute is dependent on the implementation of the element | |||||
upon which it is specified. Some tasks (the <a href="Tasks/property.html">property</a> task is a handy example) | |||||
deliberately assign a different meaning to <var>refid</var>.</p> | deliberately assign a different meaning to <var>refid</var>.</p> | ||||
<h3 id="external-tasks">Use of external tasks</h3> | <h3 id="external-tasks">Use of external tasks</h3> | ||||
Ant supports a plugin mechanism for using third party tasks. For using them you | |||||
have to do two steps: | |||||
<p>Ant supports a plugin mechanism for using third party tasks. For using them you have to do two steps:</p> | |||||
<ol> | <ol> | ||||
<li>place their implementation somewhere where Ant can find them.</li> | <li>place their implementation somewhere where Ant can find them.</li> | ||||
<li>declare them.</li> | <li>declare them.</li> | ||||
</ol> | </ol> | ||||
Don't add anything to the <code>CLASSPATH</code> environment variable—this is often the | |||||
reason for very obscure errors. Use Ant's own <a href="install.html#optionalTasks">mechanisms</a> | |||||
for adding libraries: | |||||
<p>Don't add anything to the <code>CLASSPATH</code> environment variable—this is often the reason for very obscure | |||||
errors. Use Ant's own <a href="install.html#optionalTasks">mechanisms</a> for adding libraries:</p> | |||||
<ul> | <ul> | ||||
<li>via command line argument <code>-lib</code></li> | <li>via command line argument <code>-lib</code></li> | ||||
<li>adding to <code>${user.home}/.ant/lib</code></li> | <li>adding to <code>${user.home}/.ant/lib</code></li> | ||||
<li>adding to <code>${ant.home}/lib</code></li> | <li>adding to <code>${ant.home}/lib</code></li> | ||||
</ul> | </ul> | ||||
For the declaration there are several ways: | |||||
<p>For the declaration there are several ways:</p> | |||||
<ul> | <ul> | ||||
<li>declare a single task per using instruction using | <li>declare a single task per using instruction using | ||||
<code><<a href="Tasks/taskdef.html">taskdef</a> name="taskname" | |||||
classname="ImplementationClass"/></code> | |||||
<br/> | |||||
<code><taskdef name="for" classname="net.sf.antcontrib.logic.For"/> | |||||
<for ... /></code> | |||||
<code><<a href="Tasks/taskdef.html">taskdef</a> name="taskname" | |||||
classname="ImplementationClass"/></code><br/> | |||||
<code><taskdef name="for" classname="net.sf.antcontrib.logic.For"/> <for | |||||
... /></code> | |||||
</li> | </li> | ||||
<li>declare a bundle of tasks using a <samp>properties</samp> file holding these | |||||
taskname-ImplementationClass-pairs and <code><taskdef></code> | |||||
<br/> | |||||
<code><taskdef resource="net/sf/antcontrib/antcontrib.properties"/> | |||||
<for ... /></code> | |||||
<li>declare a bundle of tasks using a <samp>properties</samp> file holding these taskname–ImplementationClass | |||||
pairs and <code><taskdef></code><br/> | |||||
<code><taskdef resource="net/sf/antcontrib/antcontrib.properties"/> <for ... /></code> | |||||
</li> | </li> | ||||
<li>declare a bundle of tasks using | |||||
an <a href="Types/antlib.html">xml file</a> holding these | |||||
taskname-ImplementationClass-pairs and <code><taskdef></code> | |||||
<br/> | |||||
<code><taskdef resource="net/sf/antcontrib/antlib.xml"/> | |||||
<for ... /></code> | |||||
<li>declare a bundle of tasks using an <a href="Types/antlib.html">xml file</a> holding these | |||||
taskname-ImplementationClass-pairs and <code><taskdef></code><br/> | |||||
<code><taskdef resource="net/sf/antcontrib/antlib.xml"/> <for ... /></code> | |||||
</li> | </li> | ||||
<li>declare a bundle of tasks using an xml file named <samp>antlib.xml</samp>, XML namespace and | |||||
<a href="Types/antlib.html#antlibnamespace"><code>antlib:</code> protocol handler</a> | |||||
<br/> | |||||
<code><project xmlns:ac="antlib:net.sf.antcontrib"/> | |||||
<ac:for ... /></code> | |||||
<li>declare a bundle of tasks using an xml file named <samp>antlib.xml</samp>, XML namespace | |||||
and <a href="Types/antlib.html#antlibnamespace"><code>antlib:</code> protocol handler</a><br/> | |||||
<code><project xmlns:ac="antlib:net.sf.antcontrib"/> <ac:for ... /></code> | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
If you need a special function, you should | If you need a special function, you should | ||||
<ol> | <ol> | ||||
<li>have a look at this manual, because Ant provides lot of tasks</li> | <li>have a look at this manual, because Ant provides lot of tasks</li> | ||||
<li>have a look at the external task page <a href="https://ant.apache.org/external.html">online</a></li> | |||||
<li>have a look at the external task <a href="https://wiki.apache.org/ant/AntExternalTaskdefs">wiki | |||||
page</a></li> | |||||
<li>ask on the <a href="https://ant.apache.org/mail.html#User%20List">Ant user</a> list</li> | |||||
<li>have a look at the external task page <a href="https://ant.apache.org/external.html" target="_top">online</a></li> | |||||
<li>have a look at the external task <a href="https://wiki.apache.org/ant/AntExternalTaskdefs" target="_top">wiki | |||||
page</a></li> | |||||
<li>ask on the <a href="https://ant.apache.org/mail.html#User%20List" target="_top">Ant user</a> list</li> | |||||
<li><a href="tutorial-writing-tasks.html">implement</a> (and share) your own</li> | <li><a href="tutorial-writing-tasks.html">implement</a> (and share) your own</li> | ||||
</ol> | </ol> | ||||