Browse Source

Use HTML 5(-ish), fix links

master
Gintas Grigelionis 7 years ago
parent
commit
66b52f99e4
100 changed files with 12385 additions and 15119 deletions
  1. +10
    -10
      manual/Integration/jext-plugin.html
  2. +70
    -74
      manual/Tasks/BorlandEJBTasks.html
  3. +35
    -36
      manual/Tasks/BorlandGenerateClient.html
  4. +196
    -248
      manual/Tasks/ant.html
  5. +89
    -110
      manual/Tasks/antcall.html
  6. +69
    -122
      manual/Tasks/antlr.html
  7. +36
    -42
      manual/Tasks/antstructure.html
  8. +33
    -40
      manual/Tasks/antversion.html
  9. +252
    -315
      manual/Tasks/apply.html
  10. +68
    -75
      manual/Tasks/attrib.html
  11. +24
    -33
      manual/Tasks/augment.html
  12. +71
    -80
      manual/Tasks/available.html
  13. +29
    -39
      manual/Tasks/basename.html
  14. +33
    -40
      manual/Tasks/bindtargets.html
  15. +16
    -27
      manual/Tasks/buildnumber.html
  16. +63
    -81
      manual/Tasks/cab.html
  17. +71
    -56
      manual/Tasks/ccm.html
  18. +145
    -160
      manual/Tasks/changelog.html
  19. +127
    -155
      manual/Tasks/checksum.html
  20. +73
    -96
      manual/Tasks/chgrp.html
  21. +107
    -140
      manual/Tasks/chmod.html
  22. +74
    -97
      manual/Tasks/chown.html
  23. +444
    -467
      manual/Tasks/clearcase.html
  24. +13
    -13
      manual/Tasks/common.html
  25. +18
    -29
      manual/Tasks/componentdef.html
  26. +236
    -315
      manual/Tasks/concat.html
  27. +46
    -55
      manual/Tasks/condition.html
  28. +535
    -708
      manual/Tasks/conditions.html
  29. +194
    -271
      manual/Tasks/copy.html
  30. +69
    -74
      manual/Tasks/copydir.html
  31. +23
    -25
      manual/Tasks/copyfile.html
  32. +119
    -126
      manual/Tasks/cvs.html
  33. +24
    -23
      manual/Tasks/cvspass.html
  34. +137
    -136
      manual/Tasks/cvstagdiff.html
  35. +43
    -46
      manual/Tasks/cvsversion.html
  36. +38
    -41
      manual/Tasks/defaultexcludes.html
  37. +122
    -151
      manual/Tasks/delete.html
  38. +13
    -15
      manual/Tasks/deltree.html
  39. +115
    -144
      manual/Tasks/depend.html
  40. +70
    -98
      manual/Tasks/dependset.html
  41. +6
    -12
      manual/Tasks/diagnostics.html
  42. +23
    -30
      manual/Tasks/dirname.html
  43. +160
    -193
      manual/Tasks/ear.html
  44. +87
    -105
      manual/Tasks/echo.html
  45. +53
    -67
      manual/Tasks/echoproperties.html
  46. +18
    -22
      manual/Tasks/echoxml.html
  47. +1147
    -1355
      manual/Tasks/ejb.html
  48. +211
    -273
      manual/Tasks/exec.html
  49. +46
    -55
      manual/Tasks/fail.html
  50. +33
    -33
      manual/Tasks/filter.html
  51. +153
    -234
      manual/Tasks/fixcrlf.html
  52. +438
    -526
      manual/Tasks/ftp.html
  53. +43
    -46
      manual/Tasks/genkey.html
  54. +149
    -173
      manual/Tasks/get.html
  55. +35
    -49
      manual/Tasks/hostinfo.html
  56. +106
    -121
      manual/Tasks/image.html
  57. +153
    -210
      manual/Tasks/import.html
  58. +142
    -200
      manual/Tasks/include.html
  59. +106
    -123
      manual/Tasks/input.html
  60. +398
    -466
      manual/Tasks/jar.html
  61. +66
    -74
      manual/Tasks/jarlib-available.html
  62. +25
    -30
      manual/Tasks/jarlib-display.html
  63. +40
    -48
      manual/Tasks/jarlib-manifest.html
  64. +116
    -125
      manual/Tasks/jarlib-resolve.html
  65. +254
    -306
      manual/Tasks/java.html
  66. +638
    -816
      manual/Tasks/javac.html
  67. +104
    -118
      manual/Tasks/javacc.html
  68. +591
    -640
      manual/Tasks/javadoc.html
  69. +135
    -148
      manual/Tasks/javah.html
  70. +64
    -70
      manual/Tasks/jdepend.html
  71. +41
    -43
      manual/Tasks/jjdoc.html
  72. +137
    -173
      manual/Tasks/jjtree.html
  73. +66
    -93
      manual/Tasks/jlink.html
  74. +139
    -192
      manual/Tasks/jspc.html
  75. +475
    -569
      manual/Tasks/junit.html
  76. +96
    -101
      manual/Tasks/junitreport.html
  77. +54
    -54
      manual/Tasks/length.html
  78. +64
    -75
      manual/Tasks/loadfile.html
  79. +57
    -69
      manual/Tasks/loadproperties.html
  80. +30
    -38
      manual/Tasks/loadresource.html
  81. +96
    -107
      manual/Tasks/local.html
  82. +154
    -232
      manual/Tasks/macrodef.html
  83. +161
    -200
      manual/Tasks/mail.html
  84. +33
    -74
      manual/Tasks/makeurl.html
  85. +90
    -107
      manual/Tasks/manifest.html
  86. +45
    -59
      manual/Tasks/manifestclasspath.html
  87. +48
    -49
      manual/Tasks/mimemail.html
  88. +9
    -9
      manual/Tasks/mkdir.html
  89. +129
    -175
      manual/Tasks/move.html
  90. +107
    -151
      manual/Tasks/native2ascii.html
  91. +180
    -216
      manual/Tasks/netrexxc.html
  92. +21
    -28
      manual/Tasks/nice.html
  93. +25
    -35
      manual/Tasks/pack.html
  94. +116
    -147
      manual/Tasks/parallel.html
  95. +46
    -51
      manual/Tasks/patch.html
  96. +101
    -144
      manual/Tasks/pathconvert.html
  97. +47
    -77
      manual/Tasks/presetdef.html
  98. +10
    -13
      manual/Tasks/projecthelper.html
  99. +178
    -207
      manual/Tasks/property.html
  100. +140
    -150
      manual/Tasks/propertyfile.html

+ 10
- 10
manual/Integration/jext-plugin.html View File

@@ -29,26 +29,26 @@ by
</ul>
<hr>

<p>You can download the plugin at: <a
href="ftp://jext.sourceforge.net/pub/jext/plugins/AntWork.zip">ftp://jext.sourceforge.net/pub/jext/plugins/AntWork.zip</a></p>
<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>

<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:
Edit-&gt;Options... - General Panel), because the Ant messages are
Edit&rarr;Options&hellip;&ndash;General Panel), because Ant messages are
redirected to the Jext console.</p>

<p>You can configure the Ant call in the Jext menu: Edit-&gt;Options... -
Plugin Options - Antwork Plugin Panel; here you can set the ant home
<p>You can configure the Ant call in the Jext menu: Edit&rarr;Options&hellip;&ndash;
Plugin Options&ndash;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-&gt;Ant-&gt;Work Now! In the
<p>You can start AntWork in the menu: Plugins&rarr;Ant&rarr;Work Now! In the
appearing dialog box you can enter the target which you want to
compile.</p>

<p>If a javac 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 text 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>
</html>

+ 70
- 74
manual/Tasks/BorlandEJBTasks.html View File

@@ -30,111 +30,107 @@

<h3>Description</h3>
<p>The BorlandDeployTool is a vendor specific nested element for the Ejbjar optional task.</p>
<p>BorlandDeploymentTool is dedicated to the Borland Application Server 4.5.x and Borland
Enterprise Server 5.x. It generates and compiles the stubs and skeletons for all ejb described into the
Deployment Descriptor, builds the jar file including the support files and
verify whether the produced jar is valid or not.</p>
<p>BorlandDeploymentTool is dedicated to the Borland Application Server 4.5.x and Borland Enterprise
Server 5.x. It generates and compiles the stubs and skeletons for all EJBs described in the
Deployment Descriptor, builds the jar file including the support files and verifies whether the
produced jar is valid or not.</p>

<p>Benoit Moussaud maintains a separate <a
href="http://www.moussaud.org/ejbjar.html">FAQ</a> for this task at
his homepage.</p>
<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>

<h3>Borland element</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">destdir</td>
<td valign="top">The base directory into which the generated borland
ready jar files are deposited</td>
<td align="center" valign="middle">yes</td>
<td>destdir</td>
<td>The base directory in which the generated Borland ready jar files are stored</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">debug</td>
<td valign="top">If true, turn on the debug mode for each borland
tools (java2iiop, iastool ...) default = false</td>
<td align="center" valign="middle">no</td>
<td>debug</td>
<td>If <q>true</q>, turn on the debug mode for each Borland tools
(<code>java2iiop</code>, <code>iastool</code>, ...)</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">verify</td>
<td valign="top">If true, turn on the verification at the end
of the jar production (default = false)</td>
<td align="center" valign="middle">no</td>
<td>verify</td>
<td>If <q>true</q>, turn on the verification at the end of the jar production.</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">verifyargs</td>
<td valign="top">extra parameter for verify command</td>
<td align="center" valign="middle">no</td>
<td>verifyargs</td>
<td>extra parameter for verify command</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suffix</td>
<td valign="top">String value appended to the basename of the
deployment descriptor to create the filename of the Borland EJB jar file.</td>
<td align="center" valign="middle">No, defaults to '-ejb.jar'.</td>
<td>suffix</td>
<td>String value appended to the basename of the deployment descriptor to create the filename of
the Borland EJB jar file.</td>
<td>No; defaults to <q class="no-break">-ejb.jar</q></td>
</tr>
<tr>
<td valign="top">basdtd</td>
<td valign="top"><b>Deprecated</b>. Defines the location of the
DTD which covers the Borland specific deployment descriptors.
This should not be necessary if you have borland in your classpath. If you
do not, you should use a nested
<td>basdtd</td>
<td><em><u>Deprecated</u></em>. Defines the location of the DTD which covers the Borland
specific deployment descriptors. This should not be necessary if you have borland in your
classpath. If you do not, you should use a nested
<a href="ejb.html#ejbjar-dtd"><code>&lt;dtd&gt;</code></a> element, described
in the ejbjar task documentation.</td>
<td align="center" valign="middle">no</td>
<td>No</td>
</tr>
<tr>
<td valign="top">ejbdtd</td>
<td valign="top"><b>Deprecated</b>. Defines the location of the
ejb-jar DTD in the class hierarchy. This should not be necessary
if you have borland in your classpath. If you do not, you should use a
nested <a href="ejb.html#ejbjar-dtd"><code>&lt;dtd&gt;</code></a> element,
described in the ejbjar task
documentation.</td>
<td align="center" valign="middle">no</td>
<td>ejbdtd</td>
<td><em><u>Deprecated</u></em>. Defines the location of the ejb-jar DTD in the class
hierarchy. This should not be necessary if you have borland in your classpath. If you do not,
you should use a nested <a href="ejb.html#ejbjar-dtd"><code>&lt;dtd&gt;</code></a> element,
described in the ejbjar task documentation.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">generateclient</td>
<td valign="top">If true, turn on the generation of the corresponding
ejbjar (default = false)</td>
<td align="center" valign="middle">no</td>
<td>generateclient</td>
<td>If <q>true</q>, turn on the generation of the corresponding EJB jar.</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">version</td>
<td valign="top">set the Borland Application Version.
<ul>
<li>4 means B.A.S (Borland Application Server) 4.x, target will add ejb-inprise.xml file</li>
<li>5 means B.E.S (Borland Application Server) 5.x, target will add ejb-borland.xml file</li>
</ul>
</td>
<td align="center" valign="middle">No, defaults to 4</td>
<td>version</td>
<td>set the Borland Application Version.
<ul>
<li>4 means B.A.S (Borland Application Server) 4.x, target will add ejb-inprise.xml file</li>
<li>5 means B.E.S (Borland Application Server) 5.x, target will add ejb-borland.xml file</li>
</ul>
</td>
<td>No; defaults to <q>4</q></td>
</tr>
<tr>
<td valign="top">java2iiopParams</td>
<td valign="top">If filled, the params are added to the java2iiop command (ex: -no_warn_missing_define)</td>
<td align="center" valign="middle">no</td>
<td>java2iiopParams</td>
<td>If filled, the params are added to the <code>java2iiop</code> command
(ex: <code>-no_warn_missing_define</code>)</td>
<td>No</td>
</tr>

</table>

<h3>Examples</h3>
<p>The following build.xml snippet is an example of how to use Borland element
into the ejbjar task</p>
<pre> &lt;ejbjar srcdir=&quot;${build.classes}&quot; basejarname=&quot;vsmp&quot; descriptordir=&quot;${rsc.dir}/hrmanager&quot;&gt;
&lt;borland destdir=&quot;lib&quot; verify=&quot;on&quot; generateclient=&quot;on&quot; version=&quot;5&quot;&gt;
&lt;classpath refid=&quot;classpath&quot;/&gt;
&lt;/borland&gt;
&lt;include name=&quot;**\ejb-jar.xml&quot;/&gt;
&lt;support dir=&quot;${build.classes}&quot;&gt;
&lt;include name=&quot;demo\*.class&quot;/&gt;
&lt;include name=&quot;demo\helper\*.class&quot;/&gt;
&lt;/support&gt;
&lt;/ejbjar&gt;</pre>
<pre>The borland element will generate into the lib dir an ejb jar file using the deployment descriptor placed into the ${rsc.dir}/hrmanager directory.
The verify phase is turned on and the generate client phase as well.
</pre>
<p>The following <samp>build.xml</samp> snippet is an example of how to use Borland element in
the <code>ejbjar</code> task</p>
<pre>
&lt;ejbjar srcdir=&quot;${build.classes}&quot; basejarname=&quot;vsmp&quot; descriptordir=&quot;${rsc.dir}/hrmanager&quot;&gt;
&lt;borland destdir=&quot;lib&quot; verify=&quot;on&quot; generateclient=&quot;on&quot; version=&quot;5&quot;&gt;
&lt;classpath refid=&quot;classpath&quot;/&gt;
&lt;/borland&gt;
&lt;include name=&quot;**\ejb-jar.xml&quot;/&gt;
&lt;support dir=&quot;${build.classes}&quot;&gt;
&lt;include name=&quot;demo\*.class&quot;/&gt;
&lt;include name=&quot;demo\helper\*.class&quot;/&gt;
&lt;/support&gt;
&lt;/ejbjar&gt;</pre>
<p>The <code>borland</code> element will generate into the <samp>lib</samp> directory an EJB jar
file using the deployment descriptor placed into the <samp>${rsc.dir}/hrmanager</samp> directory.
The verify phase is turned on and the generate client phase as well.</p>

</body>
</html>

+ 35
- 36
manual/Tasks/BorlandGenerateClient.html View File

@@ -27,62 +27,61 @@
<h2 id="log">BorlandGenerateClient</h2>
<p>by Benoit Moussaud (<a href="mailto:benoit.moussaud@criltelecom.com">benoit.moussaud@criltelecom.com</a>)</p>
<h3>Description</h3>
<p>The BorlandGenerateClient is a task dedicated to Borland Application Server
v 4.5. It offers to generate the client jar file corresponding to an ejb jar
file.</p>
<p>The BorlandGenerateClient is a task dedicated to Borland Application Server v 4.5. It offers to
generate the client jar file corresponding to an EJB jar file.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">ejbjar</td>
<td valign="top">ejb jar file</td>
<td align="center" valign="middle">yes</td>
<td>ejbjar</td>
<td>EJB jar file</td>
<td>yes</td>
</tr>
<tr>
<td valign="top">debug</td>
<td valign="top">If true, turn on the debug mode for each borland
tools (java2iiop, iastool ...) default = false</td>
<td align="center" valign="middle">no</td>
<td>debug</td>
<td>If <q>true</q>, turn on the debug mode for each Borland tool
(<code>java2iiop</code>, <code>iastool</code>, ...)</td>
<td>no; default <q>false</q></td>
</tr>
<tr>
<td valign="top">clientjar</td>
<td valign="top">client jar file name. If missing the client jar
file name is build using the ejbjar file name: ejbjar = hellobean-ejb.jar
=&gt; hellobean-ejbclient.jar</td>
<td align="center" valign="middle">no</td>
<td>clientjar</td>
<td>client jar file name. If missing the client jar file name is build using
the <var>ejbjar</var> file name: <var>ejbjar</var>=<q>hellobean-ejb.jar</q>
&rArr; <q>hellobean-ejbclient.jar</q></td>
<td>no</td>
</tr>
<tr>
<td valign="top">mode</td>
<td valign="top">choose the command launching mode. Two values:
java or fork. default = fork. java is not supported for version=5.Possibility to specify a classpath.</td>
<td align="center" valign="middle">no</td>
<td>mode</td>
<td>choose the command launching mode. Two values: <q>java</q> or <q>fork</q>
(default). <q>java</q> is not supported for <var>version</var>=<q>5</q>. Possibility to
specify a classpath.</td>
<td>no</td>
</tr>
<tr>
<td valign="top">version</td>
<td valign="top">set the Borland Application Version.
<ul>
<li>4 means B.A.S (Borland Application Server 4.x)</li>
<li>5 means B.E.S (Borland Application Server 5.x)</li>
</ul>
</td>
<td align="center" valign="middle">No, defaults to 4</td>
<td>version</td>
<td>set the Borland Application Version.
<ul>
<li><q>4</q> means B.A.S (Borland Application Server 4.x)</li>
<li><q>5</q> means B.E.S (Borland Application Server 5.x)</li>
</ul>
</td>
<td>No; defaults to <q>4</q></td>
</tr>
</table>

<h3>Examples</h3>
<p>The following build.xml snippet is an example of how to use Borland element
into the ejbjar task using the java mode.</p>
<p>The following <samp>build.xml</samp> snippet is an example of how to use Borland element in
the <code>ejbjar</code> task using the <q>fork</q> <var>mode</var>.</p>
<pre>
&lt;blgenclient ejbjar=&quot;lib/secutest-ejb.jar&quot; clientjar=&quot;lib/client.jar&quot; debug=&quot;true&quot; mode=&quot;fork&quot;&gt; version=&quot;5&quot;&gt;
&lt;blgenclient ejbjar=&quot;lib/secutest-ejb.jar&quot; clientjar=&quot;lib/client.jar&quot; debug=&quot;true&quot; mode=&quot;fork&quot; version=&quot;5&quot;&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;mymodule.jar&quot;/&gt;
&lt;/classpath&gt;
&lt;/blgenclient&gt;
</pre>
&lt;/blgenclient&gt;</pre>

</body>
</html>

+ 196
- 248
manual/Tasks/ant.html View File

@@ -27,307 +27,270 @@
<h2 id="ant">Ant</h2>
<h3>Description</h3>

<p>Runs Apache Ant on a supplied buildfile. This can be used to build
subprojects. <strong>This task must not be used outside of a
<code>target</code> if it invokes the same build file it is part
<p>Runs Apache Ant on a supplied buildfile. This can be used to build subprojects. <strong>This
task must not be used outside of a <code>target</code> if it invokes the same build file it is part
of.</strong></p>

<p>When the <i>antfile</i> attribute is omitted, the file &quot;build.xml&quot;
in the supplied directory (<i>dir</i> attribute) is used.</p>
<p>If no target attribute is supplied, the default target of the new project is
used.</p>
<p>By default, all of the properties of the current project will be
available in the new project. Alternatively, you can set the
<i>inheritAll</i> attribute to <code>false</code> and only
&quot;user&quot; properties (i.e., those passed on the command-line)
will be passed to the new project. In either case, the set of
properties passed to the new project will override the properties that
are set in the new project (See also the <a
href="property.html">property task</a>).</p>

<p>You can also set properties in the new project from the old project
by using nested property tags. These properties are always passed
to the new project and any project created in that project
regardless of the setting of <i>inheritAll</i>. This allows you to
parameterize your subprojects.</p>

<p>When more than one nested <code>&lt;property&gt;</code> element
would set a property of the same name, the one declared last will
win. This is for backwards compatibility reasons even so it is
different from the way <code>&lt;property&gt;</code> tasks in build
files behave.</p>
<p>When the <var>antfile</var> attribute is omitted, the file <samp>build.xml</samp> in the supplied
directory (<var>dir</var> attribute) is used.</p>
<p>If no target attribute is supplied, the default target of the new project is used.</p>
<p>By default, all of the properties of the current project will be available in the new project.
Alternatively, you can set the <var>inheritAll</var> attribute to <q>false</q> and only
&quot;user&quot; properties (i.e., those passed on the command-line) will be passed to the new
project. In either case, the set of properties passed to the new project will override the
properties that are set in the new project (See also the <a href="property.html">property</a>
task).</p>

<p>You can also set properties in the new project from the old project by using
nested <code>property</code> tags. These properties are always passed to the new project and any
project created in that project regardless of the setting of <var>inheritAll</var>. This allows you
to parameterize your subprojects.</p>

<p>When more than one nested <code>&lt;property&gt;</code> element would set a property of the same
name, the one declared last will win. This is for backwards compatibility reasons even though it is
different from the way <code>&lt;property&gt;</code> tasks in build files behave.</p>

<p>Properties defined on the command line cannot be overridden by
nested <code>&lt;property&gt;</code> elements. <em>Since Ant
1.8.0</em> the same is true for nested structures
of <code>&lt;ant&gt;</code> tasks: if a build file <em>A</em>
invokes <em>B</em> via an <code>&lt;ant&gt;</code> task setting a
property with a nested <code>&lt;property&gt;</code> element
and <em>B</em> contains an <code>&lt;ant&gt;</code> tasks
invoking <em>C</em>, <em>C</em> will see the value set
in <em>A</em>, even if <em>B</em> used a
nested <code>&lt;property&gt;</code> element as well.</p>

<p>References to data types can also be passed to the new project, but
by default they are not. If you set the inheritrefs attribute to
true, all references will be copied, but they will not override
references defined in the new project.</p>

<p>Nested <a href="#reference"><i><code>&lt;reference&gt;</code></i></a> elements
can also be used to copy references from the calling project to the
new project, optionally under a different id. References taken from
nested elements will override existing references that have been
defined outside of targets in the new project - but not those defined
inside of targets.</p>
nested <code>&lt;property&gt;</code> elements. <em>Since Ant 1.8.0</em>, the same is true for
nested structures of <code>&lt;ant&gt;</code> tasks: if a build file <var>A</var>
invokes <var>B</var> via an <code>&lt;ant&gt;</code> task setting a property with a
nested <code>&lt;property&gt;</code> element and <var>B</var> contains an <code>&lt;ant&gt;</code>
tasks invoking <var>C</var>, <var>C</var> will see the value set in <var>A</var>, even
if <var>B</var> used a nested <code>&lt;property&gt;</code> element as well.</p>

<p>References to data types can also be passed to the new project, but by default they are not. If
you set the <var>inheritrefs</var> attribute to <q>true</q>, all references will be copied, but they
will not override references defined in the new project.</p>

<p>Nested <a href="#reference"><code>&lt;reference&gt;</code></a> elements can also be used to copy
references from the calling project to the new project, optionally under a different <var>id</var>.
References taken from nested elements will override existing references that have been defined
outside of targets in the new project&mdash;but not those defined inside of targets.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">antfile</td>
<td valign="top">the buildfile to use. Defaults to
&quot;build.xml&quot;. This file is expected to be a filename
relative to the dir attribute given.</td>
<td valign="top" align="center">No</td>
<td>antfile</td>
<td>the buildfile to use. This file is expected to be a filename relative to the <var>dir</var>
attribute given.</td>
<td>No; defaults to <q>build.xml</q></td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">the directory to use as a basedir for the new Ant
project (unless useNativeBasedir is set to true).
Defaults to the current project's basedir, unless
inheritall has been set to false, in which case it doesn't
have a default value. This will override the basedir
setting of the called project.<br/>
Also serves as the directory to resolve the antfile and output
attribute's values (if any).
<td>dir</td>
<td>the directory to use as a <var>basedir</var> for the new Ant project
(unless <var>useNativeBasedir</var> is set to <q>true</q>). This will override
the <var>basedir</var> setting of the called project.<br/> Also serves as the directory to
resolve the <var>antfile</var> and <var>output</var> attribute's values (if any).
</td>
<td valign="top" align="center">No</td>
<td>No; defaults to the current project's <var>basedir</var>, unless <var>inheritall</var> has
been set to <q>false</q>, in which case it doesn't have a default value</td>
</tr>
<tr>
<td valign="top">target</td>
<td valign="top">the target of the new Ant project that should be executed.
Defaults to the new project's default target.</td>
<td valign="top" align="center">No</td>
<td>target</td>
<td>the target of the new Ant project that should be executed.</td>
<td>No; defaults to the new project's default target</td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">Filename to write the Ant output to. This is
relative to the value of the dir attribute if it has been set or
to the base directory of the current project otherwise.
<td>output</td>
<td>Filename to write the Ant output to. This is relative to the value of the <var>dir</var>
attribute if it has been set or to the <var>basedir</var> of the current project otherwise.
</td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">inheritAll</td>
<td valign="top">If <code>true</code>, pass all properties to the
new Ant project. Defaults to <code>true</code>.</td>
<td align="center" valign="top">No</td>
<td>inheritAll</td>
<td>If <q>true</q>, pass all properties to the new Ant project.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">inheritRefs</td>
<td valign="top">If <code>true</code>, pass all references to the
new Ant project. Defaults to <code>false</code>.</td>
<td align="center" valign="top">No</td>
<td>inheritRefs</td>
<td>If <q>true</q>, pass all references to the new Ant project.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">useNativeBasedir</td>
<td valign="top">If set to true, the child build will use the same
basedir as it would have used when run from the command line
(i.e. the basedir one would expect when looking at the child
build's buildfile). Defaults to <code>false</code>. <em>since
Ant 1.8.0</em></td>
<td valign="top" align="center">No</td>
<td>useNativeBasedir</td>
<td>If set to <q>true</q>, the child build will use the same <var>basedir</var> as it would have
used when run from the command line (i.e. the <var>basedir</var> one would expect when looking
at the child build's buildfile). <em>Since Ant 1.8.0</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>

<h4>property</h4>
<p>See the description of the <a href="property.html">property
task</a>. <br>
These properties become equivalent to properties you define on
the command line. These are special properties and they will always get passed
down, even through additional <code>&lt;*ant*&gt;</code> tasks with inheritall set to
false (see above). <br>
Note that the <code>refid</code> attribute points to a
reference in the calling project, not in the new one.</p>
<p>See the description of the <a href="property.html">property</a> task.<br> These properties
become equivalent to properties you define on the command line. These are special properties and
they will always get passed down, even through additional <code>&lt;*ant*&gt;</code> tasks
with <var>inheritAll</var> set to <q>false</q> (see above).<br/> Note that the <var>refid</var>
attribute points to a reference in the calling project, not in the new one.</p>

<h4 id="reference">reference</h4>
<p>Used to choose references that shall be copied into the new project,
optionally changing their id.</p>
<p>Used to choose references that shall be copied into the new project, optionally changing
their <var>id</var>.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top">The id of the reference in the calling project.</td>
<td valign="top" align="center">Yes</td>
<td>refid</td>
<td>The <var>id</var> of the reference in the calling project.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">torefid</td>
<td valign="top">The id of the reference in the new project.</td>
<td valign="top" align="center">No, defaults to the value of refid.</td>
<td>torefid</td>
<td>The <var>id</var> of the reference in the new project.</td>
<td>No; defaults to the value of <var>refid</var></td>
</tr>
</table>

<h4>propertyset</h4>

<p>You can specify a set of properties to be copied into the new
project with <a
href="../Types/propertyset.html">propertyset</a>s.</p>
<p>You can specify a set of properties to be copied into the new project
with <a href="../Types/propertyset.html">propertyset</a>s.</p>

<p><em>since Ant 1.6</em>.</p>

<h4>target</h4>

<p>You can specify multiple targets using nested <code>&lt;target&gt;</code> elements
instead of using the target attribute. These will be executed as if
Ant had been invoked with a single target whose dependencies are the
targets so specified, in the order specified.</p>
<table>
<p>You can specify multiple targets using nested <code>&lt;target&gt;</code> elements instead of
using the <var>target</var> attribute. These will be executed as if Ant had been invoked with a
single target whose dependencies are the targets so specified, in the order specified.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name of the called target.</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The name of the called target.</td>
<td>Yes</td>
</tr>
</table>
<p><em>since Ant 1.6.3</em>.</p>

<h3>Basedir of the new project</h3>

<p>If you set <code>useNativeBasedir</code> to true, the basedir of
the new project will be whatever the basedir attribute of
the <code>&lt;project&gt;</code> element of the new project says (or
the new project's directory if the there is no basedir attribute) -
no matter what any other attribute of this task says and no matter
how deeply nested into levels of
<code>&lt;ant&gt;</code> invocations this task lives.</p>

<p>If you haven't set <code>useNativeBasedir</code> or set it to
false, the following rules apply:</p>

<p>The basedir value of the new project is affected by the two
attributes dir and inheritall as well as
the <code>&lt;ant&gt;</code> task's history. The current behaviour
is known to be confusing but cannot be changed without breaking
backwards compatibility in subtle ways.</p>

<p>If the <code>&lt;ant&gt;</code> task is in a "top level" build
file, i.e. the project containing the <code>&lt;ant&gt;</code> task
has not itself been invoked as part of a
different <code>&lt;ant&gt;</code> (or <code>&lt;antcall&gt;</code>)
task "higher up", the following table shows the details:</p>
<p>If you set <var>useNativeBasedir</var> to true, the <var>basedir</var> of the new project will be
whatever the <var>basedir</var> attribute of the <code>&lt;project&gt;</code> element of the new
project says (or the new project's directory if the there is no <var>basedir</var>
attribute)&mdash;no matter what any other attribute of this task says and no matter how deeply
nested into levels of <code>&lt;ant&gt;</code> invocations this task lives.</p>

<p>If you haven't set <var>useNativeBasedir</var> or set it to <q>false</q>, the following rules
apply:</p>

<p>The <var>basedir</var> value of the new project is affected by the two attributes, <var>dir</var>
and <var>inheritall</var>, as well as the <code>&lt;ant&gt;</code> task's history. The current
behaviour is known to be confusing but cannot be changed without breaking backwards compatibility in
subtle ways.</p>

<p>If the <code>&lt;ant&gt;</code> task is in a "top level" build file, i.e. the project containing
the <code>&lt;ant&gt;</code> task has not itself been invoked as part of a
different <code>&lt;ant&gt;</code> (or <code>&lt;antcall&gt;</code>) task "higher up", the following
table shows the details:</p>

<table>
<tr>
<td valign="top"><b>dir attribute</b></td>
<td valign="top"><b>inheritAll attribute</b></td>
<td valign="top"><b>new project's basedir</b></td>
<th><var>dir</var> attribute</th>
<th><var>inheritAll</var> attribute</th>
<th>new project's <var>basedir</var></th>
</tr>
<tr>
<td valign="top">value provided</td>
<td valign="top">true</td>
<td valign="top">value of dir attribute</td>
<td>value provided</td>
<td><q>true</q></td>
<td>value of <var>dir</var> attribute</td>
</tr>
<tr>
<td valign="top">value provided</td>
<td valign="top">false</td>
<td valign="top">value of dir attribute</td>
<td>value provided</td>
<td><q>false</q></td>
<td>value of <var>dir</var> attribute</td>
</tr>
<tr>
<td valign="top">omitted</td>
<td valign="top">true</td>
<td valign="top">basedir of calling project (the one whose build
file contains the <code>&lt;ant&gt;</code> task).</td>
<td>omitted</td>
<td><q>true</q></td>
<td><var>basedir</var> of calling project (the one whose build
file contains the <code>&lt;ant&gt;</code> task).</td>
</tr>
<tr>
<td valign="top">omitted</td>
<td valign="top">false</td>
<td valign="top">basedir attribute of the <code>&lt;project&gt;</code> element
of the new project</td>
<td>omitted</td>
<td><q>false</q></td>
<td><var>basedir</var> attribute of the <code>&lt;project&gt;</code> element
of the new project</td>
</tr>
</table>

<p>If on the other hand the <code>&lt;ant&gt;</code> task is already
nested into another invocation, the parent invocation's settings
affect the outcome of the basedir value. The current task's dir
attribute will always win, but if the dir attribute has been omitted
an even more complex situation arises:</p>
<p>If on the other hand the <code>&lt;ant&gt;</code> task is already nested into another invocation,
the parent invocation's settings affect the outcome of the <var>basedir</var> value. The current
task's <var>dir</var> attribute will always win, but if the <var>dir</var> attribute has been
omitted an even more complex situation arises:</p>

<table>
<tr>
<td valign="top"><b>parent dir attribute</b></td>
<td valign="top"><b>parent inheritAll attribute</b></td>
<td valign="top"><b>current inheritAll attribute</b></td>
<td valign="top"><b>new project's basedir</b></td>
<th>parent <var>dir</var> attribute</th>
<th>parent <var>inheritAll</var> attribute</th>
<th>current <var>inheritAll</var> attribute</th>
<th>new project's <var>basedir</var></th>
</tr>
<tr>
<td valign="top">value provided</td>
<td valign="top">any</td>
<td valign="top">any</td>
<td valign="top">value of parent's dir attribute</td>
<td>value provided</td>
<td>any</td>
<td>any</td>
<td>value of parent's <var>dir</var> attribute</td>
</tr>
<tr>
<td valign="top">omitted</td>
<td valign="top">true</td>
<td valign="top">true</td>
<td valign="top">basedir of parent project (the one whose build
file called the build file that contains
the current <code>&lt;ant&gt;</code> task).</td>
<td>omitted</td>
<td><q>true</q></td>
<td><q>true</q></td>
<td><var>basedir</var> of parent project (the one whose build file called the build file that
contains the current <code>&lt;ant&gt;</code> task).</td>
</tr>
<tr>
<td valign="top">omitted</td>
<td valign="top">true</td>
<td valign="top">false</td>
<td valign="top">basedir of parent project (the one whose build
file called the build file that contains
the current <code>&lt;ant&gt;</code> task).</td>
<td>omitted</td>
<td><q>true</q></td>
<td><q>false</q></td>
<td><var>basedir</var> of parent project (the one whose build file called the build file that
contains the current <code>&lt;ant&gt;</code> task).</td>
</tr>
<tr>
<td valign="top">omitted</td>
<td valign="top">false</td>
<td valign="top">true</td>
<td valign="top">basedir of calling project (the one whose build
file contains the current <code>&lt;ant&gt;</code> task).</td>
<td>omitted</td>
<td><q>false</q></td>
<td><q>true</q></td>
<td><var>basedir</var> of calling project (the one whose build file contains the
current <code>&lt;ant&gt;</code> task).</td>
</tr>
<tr>
<td valign="top">omitted</td>
<td valign="top">false</td>
<td valign="top">false</td>
<td valign="top">basedir attribute of the <code>&lt;project&gt;</code> element
of the new project</td>
<td>omitted</td>
<td><q>false</q></td>
<td><q>false</q></td>
<td><var>basedir</var> attribute of the <code>&lt;project&gt;</code> element of the new
project</td>
</tr>
</table>

<p>If you add even deeper levels of nesting, things get even more
complicated and you need to apply the above table recursively.</p>
<p>If you add even deeper levels of nesting, things get even more complicated and you need to apply
the above table recursively.</p>

<p>If the basedir of the outer most build has been specified as a
property on the command line (i.e. <code>-Dbasedir=some-value</code>
or a <code>-propertyfile</code> argument) the value provided will
get an even higher priority. For any <code>&lt;ant&gt;</code> task
that doesn't specify a dir attribute, the new project's basedir will
be the value specified on the command line - no matter how deeply
nested into layers of build files the task may be.</p>
<p>If the <var>basedir</var> of the outermost build has been specified as a property on the command
line (i.e. <code>-Dbasedir=some-value</code> or a <code>-propertyfile</code> argument) the value
provided will get an even higher priority. For any <code>&lt;ant&gt;</code> task that doesn't
specify a <var>dir</var> attribute, the new project's <var>basedir</var> will be the value specified
on the command line&mdash;no matter how deeply nested into layers of build files the task may
be.</p>

<p>The same happens if the basedir is specified as a
nested <code>&lt;property&gt;</code> of an <code>&lt;ant&gt;</code>
task. The basedir of build files started at deeper levels will be
set to the specified value of the property element unless the
corresponding Ant tasks set the dir attribute explicitly.</p>
<p>The same happens if the <var>basedir</var> is specified as a nested <code>&lt;property&gt;</code>
of an <code>&lt;ant&gt;</code> task. The <var>basedir</var> of build files started at deeper levels
will be set to the specified value of the property element unless the corresponding Ant tasks set
the <var>dir</var> attribute explicitly.</p>

<h3>Examples</h3>
<pre>
@@ -342,18 +305,16 @@ targets so specified, in the order specified.</p>

&lt;ant inheritAll=&quot;false&quot; antfile=&quot;subproject/subbuild.xml&quot;&gt;
&lt;property name=&quot;output.type&quot; value=&quot;html&quot;/&gt;
&lt;/ant&gt;
</pre>
&lt;/ant&gt;</pre>

<p>These lines invoke the same build file:</p>
<pre>
&lt;ant antfile=&quot;sub1/sub2/build.xml&quot; /&gt;
&lt;ant antfile=&quot;sub2/build.xml&quot; dir=&quot;sub1&quot; /&gt;
&lt;ant antfile=&quot;build.xml&quot; dir=&quot;sub1/sub2&quot; /&gt;
</pre>
&lt;ant antfile=&quot;sub1/sub2/build.xml&quot;/&gt;
&lt;ant antfile=&quot;sub2/build.xml&quot; dir=&quot;sub1&quot;/&gt;
&lt;ant antfile=&quot;build.xml&quot; dir=&quot;sub1/sub2&quot;/&gt;</pre>

<p>The build file of the calling project defines some
<code>&lt;path&gt;</code> elements like this:</p>
<p>The build file of the calling project defines some <code>&lt;path&gt;</code> elements like
this:</p>

<pre>
&lt;path id="path1"&gt;
@@ -361,51 +322,38 @@ targets so specified, in the order specified.</p>
&lt;/path&gt;
&lt;path id="path2"&gt;
...
&lt;/path&gt;
</pre>
&lt;/path&gt;</pre>

<p>and the called build file (<code>subbuild.xml</code>) also defines
a <code>&lt;path&gt;</code> with the id <code>path1</code>, but
<code>path2</code> is not defined:</p>
<p>and the called build file (<samp>subbuild.xml</samp>) also defines a <code>&lt;path&gt;</code>
with the <var>id</var> <samp>path1</samp>, but <samp>path2</samp> is not defined:</p>

<pre>
&lt;ant antfile=&quot;subbuild.xml&quot; inheritrefs=&quot;true&quot;/&gt;
</pre>
<pre>&lt;ant antfile=&quot;subbuild.xml&quot; inheritrefs=&quot;true&quot;/&gt;</pre>

<p>will not override <code>subbuild</code>'s definition of
<code>path1</code>, but make the parent's definition of
<code>path2</code> available in the subbuild.</p>
<p>will not override <samp>subbuild</samp>'s definition of <samp>path1</samp>, but make the parent's
definition of <samp>path2</samp> available in the <samp>subbuild</samp>.</p>

<pre>
&lt;ant antfile=&quot;subbuild.xml&quot;/&gt;
</pre>
<pre>&lt;ant antfile=&quot;subbuild.xml&quot;/&gt;</pre>

<p>as well as</p>

<pre>
&lt;ant antfile=&quot;subbuild.xml&quot; inheritrefs=&quot;false&quot;/&gt;
</pre>
<pre>&lt;ant antfile=&quot;subbuild.xml&quot; inheritrefs=&quot;false&quot;/&gt;</pre>

<p>will neither override <code>path1</code> nor copy
<code>path2</code>.</p>
<p>will neither override <samp>path1</samp> nor copy <samp>path2</samp>.</p>

<pre>
&lt;ant antfile=&quot;subbuild.xml&quot; inheritrefs=&quot;false&quot;&gt;
&lt;reference refid=&quot;path1&quot;/&gt;
&lt;/ant&gt;
</pre>
&lt;/ant&gt;</pre>

<p>will override <code>subbuild</code>'s definition of
<code>path1</code>.</p>
<p>will override <samp>subbuild</samp>'s definition of <samp>path1</samp>.</p>

<pre>
&lt;ant antfile=&quot;subbuild.xml&quot; inheritrefs=&quot;false&quot;&gt;
&lt;reference refid=&quot;path1&quot; torefid=&quot;path2&quot;/&gt;
&lt;/ant&gt;
</pre>
&lt;/ant&gt;</pre>

<p>will copy the parent's definition of <code>path1</code> into the
new project using the id <code>path2</code>.</p>
<p>will copy the parent's definition of <samp>path1</samp> into the new project using
the <var>id</var> <samp>path2</samp>.</p>

</body>
</html>

+ 89
- 110
manual/Tasks/antcall.html View File

@@ -27,147 +27,128 @@
<h2 id="antcall">AntCall</h2>
<h3>Description</h3>

<p>Call another target within the same buildfile optionally
specifying some properties (params in this context). <strong>This
task must not be used outside of a <code>target</code>.</strong></p>

<p>By default, all of the properties of the current project will be
available in the new project. Alternatively, you can
set the <i>inheritAll</i> attribute to <code>false</code> and only
&quot;user&quot; properties (i.e., those passed on the command-line)
will be passed to the new project. In either case, the set of
properties passed to the new project will override the properties that
are set in the new project (See also the <a href="property.html">property task</a>).</p>
<p>You can also set properties in the new project from the old project
by using nested param tags. These properties are always passed
to the new project and any project created in that project
regardless of the setting of <i>inheritAll</i>. This allows you to
parameterize your subprojects. Properties defined on the command line
can not be overridden by nested <code>&lt;param&gt;</code> elements.</p>

<p>When more than one nested <code>&lt;param&gt;</code> element
would set a property of the same name, the one declared last will
win. This is for backwards compatibility reasons even so it is
different from the way <code>&lt;property&gt;</code> tasks in build
files behave.</p>

<p>Nested <a href="#reference"><i><code>&lt;reference&gt</code>;</i></a> elements can
be used to copy references from the calling project to the new
project, optionally under a different id. References taken from
nested elements will override existing references that have been
defined outside of targets in the new project - but not those defined
inside of targets.</p>

<p>
When a target is invoked by antcall, all of its dependent targets will
also be called within the context of any new parameters. For example. if
the target &quot;doSomethingElse&quot; depended on the target &quot;init&quot;, then the
<i>antcall</i> of &quot;doSomethingElse&quot; will call &quot;init&quot; during the call.
Of course, any properties defined in the antcall task or inherited from the calling target
will be fixed and not overridable in the init task--or indeed in the &quot;doSomethingElse&quot; task.
</p>

<p>The called target(s) are run in a new project; be aware that this
means properties, references, etc. set by called targets will not
persist back to the calling project.</p>

<p>If the build file changes after you've started the build, the
behavior of this task is undefined.</p>
<p>Call another target within the same buildfile optionally specifying some properties (params in
this context). <strong>This task must not be used outside of a <code>target</code>.</strong></p>

<p>By default, all of the properties of the current project will be available in the new project.
Alternatively, you can set the <var>inheritAll</var> attribute to <q>false</q> and only
&quot;user&quot; properties (i.e., those passed on the command-line) will be passed to the new
project. In either case, the set of properties passed to the new project will override the
properties that are set in the new project (see also the <a href="property.html">property</a>
task).</p>
<p>You can also set properties in the new project from the old project by using
nested <code>&lt;param&gt;</code> tags. These properties are always passed to the new project and
any project created in that project regardless of the setting of <var>inheritAll</var>. This allows
you to parameterize your subprojects. Properties defined on the command line can not be overridden
by nested <code>&lt;param&gt;</code> elements.</p>

<p>When more than one nested <code>&lt;param&gt;</code> element would set a property of the same
name, the one declared last will win. This is for backwards compatibility reasons even so it is
different from the way <code>&lt;property&gt;</code> tasks in build files behave.</p>

<p>Nested <a href="#reference"><code>&lt;reference&gt</code>;</a> elements can be used to copy
references from the calling project to the new project, optionally under a different <var>id</var>.
References taken from nested elements will override existing references that have been defined
outside of targets in the new project&mdash;but not those defined inside of targets.</p>

<p>When a target is invoked by <code>antcall</code>, all of its dependent targets will also be
called within the context of any new parameters. For example. if the target <q>doSomethingElse</q>;
depended on the target <q>init</q>, then the <code>antcall</code> of <q>doSomethingElse</q> will
call <q>init</q> during the call. Of course, any properties defined in the <code>antcall</code>
task or inherited from the calling target will be fixed and not overridable in the <q>init</q>
target&mdash;or indeed in the <q>doSomethingElse</q> target.</p>

<p>The called target(s) are run in a new project; be aware that this means properties, references,
etc. set by called targets will not persist back to the calling project.</p>

<p>If the build file changes after you've started the build, the behavior of this task is
undefined.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">target</td>
<td valign="top">The target to execute.</td>
<td valign="top" align="center">Yes</td>
<td>target</td>
<td>The target to execute.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">inheritAll</td>
<td valign="top">If <code>true</code>, pass all properties to the new Apache Ant
project. Defaults to <code>true</code>.
</td>
<td align="center" valign="top">No</td>
<td>inheritAll</td>
<td>If <q>true</q>, pass all properties to the new Apache Ant project.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">inheritRefs</td>
<td valign="top">If <code>true</code>, pass all references to the
new Ant project. Defaults to <code>false</code>.</td>
<td align="center" valign="top">No</td>
<td>inheritRefs</td>
<td>If <q>true</q>, pass all references to the new Ant project.</td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>

<h3>Note on <code>inheritRefs</code></h3>

<p><code>&lt;antcall&gt;</code> will not override existing references,
even if you set <code>inheritRefs</code> to true. As the called build
files is the same build file as the calling one, this means it will
not override any reference set via an <code>id</code> attribute at
all. The only references that can be inherited by the child project
are those defined by nested <code>&lt;reference&gt;</code> elements or
references defined by tasks directly (not using the <code>id</code>
attribute).</p>
<p><code>&lt;antcall&gt;</code> will not override existing references, even if you
set <var>inheritRefs</var> to true. As the called build files is the same build file as the calling
one, this means it will not override any reference set via an <var>id</var> attribute at all. The
only references that can be inherited by the child project are those defined by
nested <code>&lt;reference&gt;</code> elements or references defined by tasks directly (not using
the <var>id</var> attribute).</p>

<h3>Parameters specified as nested elements</h3>
<h4>param</h4>
<p>Specifies the properties to set before running the specified target. See <a
href="property.html">property</a> for usage guidelines.<br>
These properties become equivalent to properties you define on
the command line. These are special properties and they will always get passed
down, even through additional <code>&lt;*ant*&gt;</code> tasks with inheritall set to
false (see above).
</p>
<p>Specifies the properties to set before running the specified
target. See <a href="property.html">property</a> for usage guidelines.<br> These properties become
equivalent to properties you define on the command line. These are special properties and they will
always get passed down, even through additional <code>&lt;*ant*&gt;</code> tasks
with <var>inheritAll</var> set to <q>false</q> (see above).</p>

<h4 id="reference">reference</h4>
<p>Used to choose references that shall be copied into the new project,
optionally changing their id.</p>
<p>Used to choose references that shall be copied into the new project, optionally changing
their <var>id</var>.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top">The id of the reference in the calling project.</td>
<td valign="top" align="center">Yes</td>
<td>refid</td>
<td>The <var>id</var> of the reference in the calling project.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">torefid</td>
<td valign="top">The id of the reference in the new project.</td>
<td valign="top" align="center">No, defaults to the value of refid.</td>
<td>torefid</td>
<td>The <var>id</var> of the reference in the new project.</td>
<td>No; defaults to the value of <var>refid</var></td>
</tr>
</table>

<h4>propertyset</h4>

<p>You can specify a set of properties to be copied into the new
project with <a
href="../Types/propertyset.html">propertyset</a>s.</p>
<p>You can specify a set of properties to be copied into the new project
with <a href="../Types/propertyset.html">propertyset</a>s.</p>

<p><em>since Ant 1.6</em>.</p>

<h4>target</h4>

<p>You can specify multiple targets using nested <code>&lt;target&gt;</code> elements
instead of using the target attribute. These will be executed as if
Ant had been invoked with a single target whose dependencies are the
targets so specified, in the order specified.</p>
<table>
<p>You can specify multiple targets using nested <code>&lt;target&gt;</code> elements instead of
using the <var>target</var> attribute. These will be executed as if Ant had been invoked with a
single target whose dependencies are the targets so specified, in the order specified.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name of the called target.</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The name of the called target.</td>
<td>Yes</td>
</tr>
</table>
<p><em>since Ant 1.6.3</em>.</p>
@@ -182,18 +163,16 @@ targets so specified, in the order specified.</p>

&lt;target name=&quot;doSomethingElse&quot;&gt;
&lt;echo message=&quot;param1=${param1}&quot;/&gt;
&lt;/target&gt;
</pre>
<p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p>
&lt;/target&gt;</pre>
<p>Will run the target <var>doSomethingElse</var> and echo <code>param1=value</code>.</p>

<pre>
&lt;antcall ... &gt;
&lt;reference refid=&quot;path1&quot; torefid=&quot;path2&quot;/&gt;
&lt;/antcall&gt;
</pre>
&lt;/antcall&gt;</pre>

<p>will copy the parent's definition of <code>path1</code> into the
new project using the id <code>path2</code>.</p>
<p>will copy the parent's definition of <samp>path1</samp> into the new project using
the <var>id</var> <samp>path2</samp>.</p>

</body>
</html>

+ 69
- 122
manual/Tasks/antlr.html View File

@@ -26,175 +26,122 @@

<h2 id="antlr">ANTLR</h2>
<h3>Description</h3>
<p>
Invokes the <a HREF="http://www.antlr.org/" target="_top">ANTLR</a> Translator generator
on a grammar file.
</p>
<p>
To use the ANTLR task, set the <i>target</i> attribute to the name of the
grammar file to process. Optionally, you can also set the
<i>outputdirectory</i> to write the generated file to a specific directory.
Otherwise ANTLR writes the generated files to the directory containing
the grammar file.
</p>
<p>
This task only invokes ANTLR if the grammar file (or the
supergrammar specified by the glib attribute) is newer than the
generated files.
</p>
<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 information.</p>
<p>Antlr 2.7.1 Note:
<i>
To successfully run ANTLR, your best option is probably to build the whole
jar with the provided script <b>mkalljar</b> and drop the resulting jar (about 300KB)
into ${ant.home}/lib. Dropping the default jar (70KB) is probably not enough
for most needs and your only option will be to add ANTLR home directory
to your classpath as described in ANTLR <tt>install.html</tt> document.
</i>
</p>
<p>Antlr 2.7.2 Note:
<i>
Instead of the above, you will need antlrall.jar that can be created
by the <b>antlr-all.jar</b> target of the Makefile provided with the
download.
</i>
</p>
<p>Invokes the <a href="https://www.antlr.org/" target="_top">ANTLR</a> Translator generator on a
grammar file.</p>
<p>To use the ANTLR task, set the <var>target</var> attribute to the name of the grammar file to
process. Optionally, you can also set the <var>outputdirectory</var> to write the generated file to
a specific directory. Otherwise ANTLR writes the generated files to the directory containing the
grammar file.</p>
<p>This task only invokes ANTLR if the grammar file (or the supergrammar specified by
the <var>glib</var> attribute) is newer than the generated files.</p>
<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
information.</p>
<p>Antlr 2.7.2 Note: <em>You will need <samp>antlrall.jar</samp> that can be created by
the <code>antlr-all.jar</code> target of the Makefile provided with the download.</em></p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">target</td>
<td valign="top">The grammar file to process.</td>
<td valign="top" align="center">Yes</td>
<td>target</td>
<td>The grammar file to process.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">outputdirectory</td>
<td valign="top">
The directory to write the generated files to. If not set, the files
are written to the directory containing the grammar file.
</td>
<td valign="top" align="center">No</td>
<td>outputdirectory</td>
<td>The directory to write the generated files to.</td>
<td>No; defaults to the directory containing the grammar file</td>
</tr>
<tr>
<td valign="top">glib</td>
<td valign="top">
An optional super grammar file that the target grammar overrides. This
feature is only needed for advanced vocabularies.
</td>
<td valign="top" align="center">No</td>
<td>glib</td>
<td>An optional super grammar file that the target grammar overrides. This feature is only
needed for advanced vocabularies.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">debug</td>
<td valign="top">
When set to "yes", this flag adds code to the generated parser that will
launch the ParseView debugger upon invocation. The default is "no".
<br>
Note: ParseView is a separate component that needs to be installed or your
grammar will have compilation errors.
</td>
<td valign="top" align="center">No</td>
<td>debug</td>
<td>When set to <q>yes</q>, this flag adds code to the generated parser that will launch the
ParseView debugger upon invocation.<br/> Note: ParseView is a separate component that needs
to be installed or your grammar will have compilation errors.</td>
<td>No; default is <q>no</q></td>
</tr>
<tr>
<td valign="top">html</td>
<td valign="top">
Emit an html version of the grammar with hyperlinked actions.
</td>
<td valign="top" align="center">No</td>
<td>html</td>
<td>Emit an HTML version of the grammar with hyperlinked actions.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">diagnostic</td>
<td valign="top">
Generates a text file with debugging information based on the target grammar.
</td>
<td valign="top" align="center">No</td>
<td>diagnostic</td>
<td>Generate a text file with debugging information based on the target grammar.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">trace</td>
<td valign="top">
Forces <b>all</b> rules to call traceIn/traceOut if set to "yes".
The default is "no".
</td>
<td valign="top" align="center">No</td>
<td>trace</td>
<td>Force <strong>all</strong> rules to call traceIn/traceOut if set to <q>yes</q>.</td>
<td>No; default is <q>no</q></td>
</tr>
<tr>
<td valign="top">traceParser</td>
<td valign="top">
Only forces parser rules to call traceIn/traceOut if set to "yes".
The default is "no".
</td>
<td valign="top" align="center">No</td>
<td>traceParser</td>
<td>Only force parser rules to call traceIn/traceOut if set to <q>yes</q>.</td>
<td>No; default is <q>no</q></td>
</tr>
<tr>
<td valign="top">traceLexer</td>
<td valign="top">
Only forces lexer rules to call traceIn/traceOut if set to "yes".
The default is "no".
</td>
<td valign="top" align="center">No</td>
<td>traceLexer</td>
<td>Only force lexer rules to call traceIn/traceOut if set to <q>yes</q>.</td>
<td>No; default is <q>no</q></td>
</tr>
<tr>
<td valign="top">traceTreeWalker</td>
<td valign="top">
Only forces tree walker rules to call traceIn/traceOut if set to
"yes". The default is "no".
</td>
<td valign="top" align="center">No</td>
<td>traceTreeWalker</td>
<td>Only force tree walker rules to call traceIn/traceOut if set to <q>yes</q>.</td>
<td>No; default is <q>no</q></td>
</tr>
<!--tr>
<td valign="top">fork</td>
<td valign="top">Run ANTLR in a separate VM.</td>
<td align="center" valign="top">No, default is &quot;off&quot;</td>
<td>fork</td>
<td>Run ANTLR in a separate JVM.</td>
<td>No; default is <q>off</q></td>
</tr-->
<tr>
<td valign="top">dir</td>
<td valign="top">The directory to invoke the VM in. <!--(ignored if
fork is disabled)--></td>
<td align="center" valign="top">No</td>
<td>dir</td>
<td>The directory to invoke JVM in.<!--(ignored if fork is disabled)--></td>
<td>No</td>
</tr>
</table>

<h3 id="nested">Nested Elements</h3>

<p><code>ANTLR</code> supports a nested <code>&lt;classpath&gt;</code>
element, that represents a <a href="../using.html#path">PATH like
structure</a>. It is given as a convenience if you have to specify
the original ANTLR directory. In most cases, dropping the appropriate
ANTLR jar in the normal Ant lib repository will be enough.</p>
<p><code>ANTLR</code> supports a nested <code>&lt;classpath&gt;</code> element, that represents
a <a href="../using.html#path">path-like structure</a>. It is given as a convenience if you have to
specify the original ANTLR directory. In most cases, dropping the appropriate ANTLR jar in the
normal Ant lib repository will be enough.</p>

<h4>jvmarg</h4>

<p><!--If fork is enabled, -->Additional parameters may be passed to the new
VM via nested <code>&lt;jvmarg&gt;</code> attributes, for example:</p>
<p><!--If fork is enabled, -->Additional parameters may be passed to the new JVM via
nested <code>&lt;jvmarg&gt;</code> attributes, for example:</p>

<pre>
&lt;antlr target="..."&gt;
&lt;jvmarg value=&quot;-Djava.compiler=NONE&quot;/&gt;
...
&lt;/antlr&gt;
</pre>
&lt;/antlr&gt;</pre>

<p>would run ANTLR in a VM without JIT.</p>
<p>would run ANTLR in a JVM without JIT.</p>

<p><code>&lt;jvmarg&gt;</code> allows all attributes described in <a
href="../using.html#arg">Command line arguments</a>.</p>
<p><code>&lt;jvmarg&gt;</code> allows all attributes described
in <a href="../using.html#arg">Command line arguments</a>.</p>

<h3>Example</h3>
<pre>
&lt;antlr
target=&quot;etc/java.g&quot;
outputdirectory=&quot;build/src&quot;/&gt;
</pre>
<p>
This invokes ANTLR on grammar file etc/java.g, writing the generated
files to build/src.
</p>
outputdirectory=&quot;build/src&quot;/&gt;</pre>
<p>This invokes ANTLR on grammar file <samp>etc/java.g</samp>, writing the generated files
to <samp>build/src</samp>.</p>

</body>
</html>

+ 36
- 42
manual/Tasks/antstructure.html View File

@@ -27,50 +27,46 @@
<h2 id="antstructure">AntStructure</h2>
<h3>Description</h3>

<p>Generates an DTD for Apache Ant buildfiles which contains information
about all tasks currently known to Ant.</p>

<p>Actually the DTD will not be a real DTD for buildfiles since Ant's
usage of XML cannot be captured with a DTD. Several elements in Ant
can have different attribute lists depending on the element that
contains them. &quot;fail&quot; for example can be <a
href="fail.html">the task</a> or the nested child element of the <a
href="../Tasks/sound.html">sound</a> task. Don't consider the
generated DTD something to rely upon.</p>

<p>Also note that the DTD generated by this task is incomplete, you can
always add XML entities using <a
href="taskdef.html"><code>&lt;taskdef&gt;</code></a> or <a
href="typedef.html"><code>&lt;typedef&gt;</code></a>. See <a
href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html"
<p>Generates an DTD for Apache Ant buildfiles which contains information about all tasks currently
known to Ant.</p>

<p>Actually the DTD will not be a real DTD for buildfiles since Ant's usage of XML cannot be
captured with a DTD. Several elements in Ant can have different attribute lists depending on the
element that contains them. <a href="fail.html"><code>&lt;fail&gt;</code></a> for example can be a
task or a nested child element of the <a href="../Tasks/sound.html"><code>&lt;sound&gt;</code></a>
task. Don't consider the generated DTD something to rely upon.</p>

<p>Also note that the DTD generated by this task is incomplete, you can always add XML entities
using <a href="taskdef.html"><code>&lt;taskdef&gt;</code></a>
or <a href="typedef.html"><code>&lt;typedef&gt;</code></a>.
See <a href="https://web.archive.org/web/20071231061243/http://www.sdv.fr/pages/casa/html/ant-dtd.en.html"
target="_top">here</a> for a way to get around this problem.</p>
<p>This task doesn't know about required attributes, all will be
listed as <code>#IMPLIED</code>.</p>
<p>This task doesn't know about required attributes, all will be listed
as <code>#IMPLIED</code>.</p>

<p><em>Since Ant 1.7</em> custom structure printers can be used
instead of the one that emits a DTD. In order to plug in your own
structure, you have to implement the interface
<code>org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter</code>
and <code>&lt;typedef&gt;</code> your class and use the new type as a nested
element of this task - see the example below.
<p><em>Since Ant 1.7</em> custom structure printers can be used instead of the one that emits a DTD.
In order to plug in your own structure, you have to implement the
interface <code>org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter</code>
and <code>&lt;typedef&gt;</code> your class and use the new type as a nested element of this
task&mdash;see the example below.

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">file to write the DTD to.</td>
<td valign="top" align="center">Yes</td>
<td>output</td>
<td>file to write the DTD to.</td>
<td>Yes</td>
</tr>
</table>
<h3>Examples</h3>
<pre>&lt;antstructure output=&quot;project.dtd&quot;/&gt;</pre>

<p><b>Emitting your own structure instead of a DTD</b></p>
<p><strong>Emitting your own structure instead of a DTD</strong></p>

<p>First you need to implement the interface</p>

@@ -79,20 +75,18 @@ package org.example;
import org.apache.tools.ant.taskdefs.AntStructure;
public class MyPrinter implements AntStructure.StructurePrinter {
...
}
</pre>
}</pre>

<p>and then use it via typedef</p>

<pre>
&lt;typedef name="myprinter" classname="org.example.MyPrinter" /&gt;
&lt;antstructure output="project.my"&gt;
&lt;myprinter /&gt;
&lt;/antstructure&gt;
</pre>

<p>Your own StructurePrinter can accept attributes and nested elements
just like any other Ant type or task.</p>
&lt;typedef name="myprinter" classname="org.example.MyPrinter"/&gt;
&lt;antstructure output="project.my"&gt;
&lt;myprinter/&gt;
&lt;/antstructure&gt;</pre>

<p>Your own StructurePrinter can accept attributes and nested elements just like any other Ant type
or task.</p>

</body>
</html>

+ 33
- 40
manual/Tasks/antversion.html View File

@@ -26,57 +26,51 @@

<h2 id="antversion">Antversion</h2>
<h3>Description</h3>
<p>
Stores the Apache Ant version (when used as task) or checks for a specific Ant version
(when used as condition).
<em>Since Ant 1.7.0</em>
</p>
<p>Stores the Apache Ant version (when used as task) or checks for a
specific Ant version (when used as condition). <em>Since Ant
1.7.0</em></p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required (Task)</b></td>
<td align="center" valign="top"><b>Required (Condition)</b></td>
<th rowspan="2">Attribute</th>
<th rowspan="2">Description</th>
<th colspan="2">Required</th>
</tr>
<tr>
<td valign="top">atleast</td>
<td valign="top">The version that this Ant is of at least.
The format is <code>major.minor.point</code>.</td>
<td valign="top" align="center">No</td>
<td valign="top" rowspan="2" align="center">Exactly one of these</td>
<th>Task</th>
<th>Condition</th>
</tr>
<tr>
<td valign="top">exactly</td>
<td valign="top">The version that this Ant is of exactly.
The format is <code>major.minor.point</code>.</td>
<td valign="top" align="center">No</td>
<td>atleast</td>
<td>The version that this Ant is of at least. The format
is <code>major.minor.point</code>.</td>
<td class="center">No</td>
<td rowspan="2">Exactly one of these</td>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of the property to set.</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No (ignored)</td>
<td>exactly</td>
<td>The version that this Ant is of exactly. The format is <code>major.minor.point</code>.</td>
<td>No</td>
</tr>
<tr>
<td>property</td>
<td>The name of the property to set.</td>
<td class="center">Yes</td>
<td>Ignored</td>
</tr>
</table>

<h3>Examples</h3>

<pre>
&lt;antversion property=&quot;antversion&quot;/&gt;
</pre>
<p>Stores the current Ant version in the property <i>antversion</i>.</p>
<pre>&lt;antversion property=&quot;antversion&quot;/&gt;</pre>
<p>Stores the current Ant version in the property <code>antversion</code>.</p>

<pre>
&lt;antversion property=&quot;antversion&quot; atleast=&quot;1.6&quot;/&gt;
</pre>
<p>Stores the Ant version in the property <i>antversion</i> if the current Ant version is 1.6.0
or higher. Otherwise the property remains unset.</p>
<pre>&lt;antversion property=&quot;antversion&quot; atleast=&quot;1.6&quot;/&gt;</pre>
<p>Stores the Ant version in the property <code>antversion</code> if the current Ant version is
1.6.0 or higher. Otherwise the property remains unset.</p>

<pre>
&lt;antversion property=&quot;ant-is-exact-7&quot; exactly=&quot;1.7.0&quot;/&gt;
</pre>
<p>Sets the property <i>ant-is-exact-7</i> if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.0
<pre>&lt;antversion property=&quot;ant-is-exact-7&quot; exactly=&quot;1.7.0&quot;/&gt;</pre>
<p>Sets the property <code>ant-is-exact-7</code> if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.0
would match.</p>

<pre>
@@ -85,10 +79,9 @@ would match.</p>
&lt;antversion exactly=&quot;1.7.0&quot;/&gt;
&lt;http url=&quot;http://ant.apache.org&quot;/&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>Sets <i>Ant17isOnline</i> if Ant 1.7.0 is running and can get a non-error-response from
the Ant homepage.</p>
&lt;/condition&gt;</pre>
<p>Sets <code>Ant17isOnline</code> if Ant 1.7.0 is running and can get a non-error-response from the
Ant homepage.</p>

</body>
</html>

+ 252
- 315
manual/Tasks/apply.html View File

@@ -24,380 +24,327 @@

<body>

<h2 id="apply">Apply/<i>ExecOn</i></h2>
<p><i>The name <code>execon</code> is deprecated and only kept for backwards
compatibility.</i></p>
<h2 id="apply">Apply</h2>
<p><em>The name <code>execon</code> is <u>deprecated</u> and only kept for backwards
compatibility.</em></p>
<h3>Description</h3>
<p>Executes a system command. When the <i>os</i> attribute is specified, then
the command is only executed when Apache Ant is run on one of the specified operating
systems.</p>
<p>Executes a system command. When the <var>os</var> attribute is specified, then the command is
only executed when Apache Ant is run on one of the specified operating systems.</p>

<p>The files and/or directories of a number of <a
href="../Types/resources.html#collection">Resource Collection</a>s
&ndash; including but not restricted to
<a href="../Types/fileset.html">FileSet</a>s,
<a href="../Types/dirset.html">DirSet</a>s
(<em>since Ant 1.6</em>) or
<a href="../Types/filelist.html">FileList</a>s
(<em>since Ant 1.6</em>)
&ndash; are passed as arguments to the system command.</p>
<p>If you specify a nested <a href="../Types/mapper.html">mapper</a>,
the timestamp of each source file is compared to the timestamp of a
target file which is defined by the nested mapper element and searched
for in the given <i>dest</i>, if specified.</p>
<p>At least one fileset or filelist is required,
and you must not specify more than one mapper.</p>
<p>The files and/or directories of a number of <a href="../Types/resources.html#collection">Resource
Collection</a>s &ndash;- including but not restricted
to <a href="../Types/fileset.html">FileSet</a>s, <a href="../Types/dirset.html">DirSet</a>s
(<em>since Ant 1.6</em>) or <a href="../Types/filelist.html">FileList</a>s (<em>since Ant 1.6</em>)
&ndash;- are passed as arguments to the system command.</p>
<p>If you specify a nested <a href="../Types/mapper.html">mapper</a>, the timestamp of each source
file is compared to the timestamp of a target file which is defined by the
nested <code>mapper</code> element and searched for in the given <var>dest</var>, if specified.</p>
<p>At least one <code>fileset</code> or <code>filelist</code> is required, and you must not specify
more than one <code>mapper</code>.</p>

<p>Note that you cannot interact with the forked program, the only way
to send input to it is via the input and inputstring attributes.</p>
<p>Note that you cannot interact with the forked program, the only way to send input to it is via
the <var>input</var> and <var>inputstring</var> attributes.</p>

<h4 id="background">Running Ant as a background process on
Unix(-like) systems</h4>
<h4 id="background">Running Ant as a background process on Unix(-like) systems</h4>

<p>If you run Ant as a background process (like <code>ant &</code>)
and use the <code>&lt;apply&gt;</code> task with <code>spawn</code>
set to <code>false</code>, you must provide explicit input to the
forked process or Ant will be suspended because it tries to read
from the standard input.</p>
<p>If you run Ant as a background process (like <code>ant &</code>) and use
the <code>&lt;apply&gt;</code> task with <var>spawn</var> set to <q>false</q>, you must provide
explicit input to the forked process or Ant will be suspended because it tries to read from the
standard input.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">executable</td>
<td valign="top">the command to execute without any command line
arguments.</td>
<td align="center" valign="top">Yes</td>
<td>executable</td>
<td>the command to execute without any command line arguments.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">the directory where the command is expected to place
target files when it is executed. This attribute is valid only when used
in conjunction with a nested mapper; if omitted, the target filenames
returned by the mapper will be interpreted as absolute paths.</td>
<td align="center" valign="top">No</td>
<td>dest</td>
<td>the directory where the command is expected to place target files when it is executed.</td>
<td>No; ignored unless a nested mapper is specified; by default, the target filenames returned
by the mapper will be interpreted as absolute paths</td>
</tr>
<tr>
<td valign="top">spawn</td>
<td valign="top">whether or not you want the commands to be spawned.<br>
If you spawn a command, its output will not be logged by Ant.<br>
The input, output, error, and result property settings are not active when spawning a process.<br>
<em>since Ant 1.6</em>
</td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>spawn</td>
<td>whether or not you want the commands to be spawned.<br> If you spawn a command, its output
will not be logged by Ant.<br/> The input, output, error, and result property settings are not
active when spawning a process.<br/> <em>since Ant 1.6</em></td>
<td>No; default is <q>false</q></td>
</tr>

<tr>
<td valign="top">dir</td>
<td valign="top">the directory in which the command should be executed.</td>
<td align="center" valign="top">No.<br/>
<strong>Note</strong>: the default used when dir has not been
specified depends on the <code>vmlauncher</code> attribute. If
<code>vmlauncher</code> is <code>true</code> the task will use
the current working directory, otherwise it uses the project's basedir.
</td>
<td>dir</td>
<td>the directory in which the command should be executed.</td>
<td>No; if <var>vmlauncher</var> is <q>true</q>, defaults to the current working directory,
otherwise the project's <var>basedir</var></td>
</tr>
<tr>
<td valign="top">relative</td>
<td valign="top">whether the filenames should be passed on the
command line as relative pathnames (relative to the base directory
of the corresponding fileset/list for source files or the
<i>dest</i> attribute for target files).</td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>relative</td>
<td>whether the filenames should be passed on the command line as relative pathnames (relative
to the base directory of the corresponding fileset/list for source files or
the <var>dest</var> attribute for target files).</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">forwardslash</td>
<td valign="top">whether the file names should be passed
with forward slashes even if the operating system requires other
file separator. The option is ignored if the system file separator
is a forward slash.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>forwardslash</td>
<td>whether the file names should be passed with forward slashes even if the operating system
requires other file separator. The option is ignored if the system file separator is a forward
slash.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed.</td>
<td align="center" valign="top">No</td>
<td>os</td>
<td>list of Operating Systems on which the command may be executed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in the &lt;os&gt; condition.
<td>osfamily</td>
<td>OS family as used in the <code>&lt;os&gt;</code> condition.
<em>since Ant 1.7</em></td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">the file to which the output of the command
should be redirected. If the error stream is not also redirected
to a file or property, it will appear in this output.</td>
<td align="center" valign="top">No</td>
<td>output</td>
<td>the file to which the output of the command should be redirected. If the error stream is
not also redirected to a file or property, it will appear in this output.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">error</td>
<td valign="top">The file to which the standard error of the
command should be redirected. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>error</td>
<td>The file to which the standard error of the command should be redirected. <em>since Ant
1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">logError</td>
<td valign="top">This attribute is used when you wish to see error
output in Ant's log and you are redirecting output to a
file/property. The error output will not be included in the output
file/property. If you redirect error with the &quot;error&quot; or
&quot;errorProperty&quot; attributes, this will have no effect.
<em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>logError</td>
<td>This attribute is used when you wish to see error output in Ant's log and you are
redirecting output to a file/property. The error output will not be included in the output
file/property. If you redirect error with the <var>error</var> or <var>errorProperty</var>
attributes, this will have no effect. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">whether output should be appended to or overwrite
an existing file. If you set parallel to false, you will probably
want to set this one to true.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>append</td>
<td>whether output should be appended to or overwrite an existing file. If you
set <var>parallel</var> to <q>false</q>, you will probably want to set this one
to <q>true</q>.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">outputproperty</td>
<td valign="top">the name of a property in which the output of the
command should be stored. Unless the error stream is redirected
to a separate file or stream, this property will include the error
<td>outputproperty</td>
<td>the name of a property in which the output of the command should be stored. Unless the
error stream is redirected to a separate file or stream, this property will include the error
output.</td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">errorproperty</td>
<td valign="top">The name of a property in which the standard error of the
command should be stored. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>errorproperty</td>
<td>The name of a property in which the standard error of the command should be
stored. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">input</td>
<td valign="top">A file from which the executed command's standard
input is taken. This attribute is mutually exclusive with the
inputstring attribute. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>input</td>
<td>A file from which the executed command's standard input is taken. This attribute is mutually
exclusive with the <var>inputstring</var> attribute. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">inputstring</td>
<td valign="top">A string which serves as the input stream for the
executed command. This attribute is mutually exclusive with the
input attribute. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>inputstring</td>
<td>A string which serves as the input stream for the executed command. This attribute is
mutually exclusive with the <var>input</var> attribute. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">resultproperty</td>
<td valign="top">the name of a property in which the return code
of the command should be stored. Only of interest if
failonerror=false. If you set parallel to false, only the result
of the first execution will be stored.</td>
<td align="center" valign="top">No</td>
<td>resultproperty</td>
<td>the name of a property in which the return code of the command should be stored. Only of
interest if <var>failonerror</var> is <q>false</q>. If you set <var>parallel</var>
to <q>false</q>, only the result of the first execution will be stored.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">timeout</td>
<td valign="top">Stop the command if it doesn't finish within the
specified time (given in milliseconds).</td>
<td align="center" valign="top">No</td>
<td>timeout</td>
<td>Stop the command if it doesn't finish within the specified time (given in
milliseconds).</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a
returncode other than 0.</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code other than 0.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failifexecutionfails</td>
<td valign="top">Stop the build if we can't start the program.
Defaults to true.</td>
<td align="center" valign="top">No</td>
<td>failifexecutionfails</td>
<td>Stop the build if we can't start the program.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">skipemptyfilesets</td>
<td valign="top">Don't run the command, if no source files have
been found or are newer than their corresponding target
files. Despite its name, this attribute applies to filelists as
<td>skipemptyfilesets</td>
<td>Don't run the command, if no source files have been found or are newer than their
corresponding target files. Despite its name, this attribute applies to filelists as
well.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
</tr>
<tr>
<td valign="top">parallel</td>
<td valign="top">Run the command only once, appending all files as
arguments. If false, command will be executed once for every file.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of <i>file</i>, <i>dir</i> or
<i>both</i>. If set to <i>file</i>, only the names of plain
files will be sent to the command. If set to <i>dir</i>, only
the names of directories are considered.<br>
<strong>Note</strong>: The type attribute does not apply to
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
assume type to be <i>dir</i>.</td>
<td align="center" valign="top">No, default is <i>file</i></td>
</tr>
<tr>
<td valign="top">newenvironment</td>
<td valign="top">Do not propagate old environment when new environment
variables are specified.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
</tr>
<tr>
<td valign="top">vmlauncher</td>
<td valign="top">Run command using the Java VM's execution facilities
where available. If set to false the underlying OS's shell,
either directly or through the antRun scripts, will be used.
Under some operating systems, this gives access to facilities
not normally available through the VM including, under Windows,
being able to execute scripts, rather than their associated
interpreter. If you want to specify the name of the
executable as a relative path to the directory given by the
dir attribute, it may become necessary to set vmlauncher to
false as well.</td>
<td align="center" valign="top">No, default is <i>true</i></td>
</tr>
<tr>
<td valign="top">resolveExecutable</td>
<td valign="top">When this attribute is true, the name of the
executable if resolved firstly against the project basedir and if
that does not exist, against the execution directory if
specified. On Unix systems, if you only want to allow execution of
commands in the user's path, set this to false.
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td>parallel</td>
<td>Run the command only once, appending all files as arguments. If <q>false</q>, command will
be executed once for every file.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td>type</td>
<td>One of <q>file</q>, <q>dir</q> or <q>both</q>. If set to <q>file</q>, only the names of
plain files will be sent to the command. If set to <q>dir</q>, only the names of directories
are considered.<br>
<strong>Note</strong>: The <var>type</var> attribute does not apply to
nested <code>dirset</code>s&mdash;<code>dirset</code>s always implicitly assume type to
be <q>dir</q>.</td>
<td>No; default is <q>file</q></td>
</tr>
<tr>
<td>newenvironment</td>
<td>Do not propagate old environment when new environment variables are specified.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td>vmlauncher</td>
<td>Run command using the JVM's execution facilities where available. If set to <q>false</q> the
underlying OS's shell, either directly or through the <code>antRun</code> scripts, will be
used. Under some operating systems, this gives access to facilities not normally available
through JVM including, under Windows, being able to execute scripts, rather than their
associated interpreter. If you want to specify the name of the executable as a relative path
to the directory given by the <var>dir</var> attribute, it may become necessary to
set <var>vmlauncher</var> to <q>false</q> as well.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td>resolveExecutable</td>
<td>When this attribute is <q>true</q>, the name of the executable if resolved firstly against
the project <var>basedir</var> and if that does not exist, against the execution directory if
specified. On Unix systems, if you only want to allow execution of commands in the user's
path, set this to <q>false</q>.
<em>since Ant 1.6</em></td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">maxparallel</td>
<td valign="top">Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to &lt;= 0 for
unlimited. <em>Since Ant 1.6</em>.</td>
<td align="center" valign="top">No, unlimited by default</td>
<td>maxparallel</td>
<td>Limit the amount of parallelism by passing at most this many sourcefiles at once. Set it to
negative integer for unlimited. <em>Since Ant 1.6</em>.</td>
<td>No, unlimited by default</td>
</tr>
<tr>
<td valign="top">addsourcefile</td>
<td valign="top">Whether source file names should be added to the
command automatically. <em>Since Ant 1.6</em>.</td>
<td align="center" valign="top">No, default is <i>true</i></td>
<td>addsourcefile</td>
<td>Whether source file names should be added to the command automatically. <em>Since Ant
1.6</em>.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to print a summary after execution or not.
<em>Since Ant 1.6</em>.</td>
<td align="center" valign="top">No, default <i>false</i></td>
<td>verbose</td>
<td>Whether to print a summary after execution or not. <em>Since Ant 1.6</em>.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">ignoremissing</td>
<td valign="top">Whether to ignore nonexistent files specified
via filelists. <em>Since Ant 1.6.2</em>.</td>
<td align="center" valign="top">No, default is <i>true</i></td>
<td>ignoremissing</td>
<td>Whether to ignore nonexistent files specified via filelists. <em>Since Ant 1.6.2</em>.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">Whether to bypass timestamp comparisons
for target files. <em>Since Ant 1.6.3</em>.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>force</td>
<td>Whether to bypass timestamp comparisons for target files. <em>Since Ant 1.6.3</em>.</td>
<td>No; default is <q>false</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>fileset</h4>
<p>You can use any number of nested <code>&lt;fileset&gt;</code>
elements to define the files for this task and refer to
<code>&lt;fileset&gt;</code>s defined elsewhere.</p>
<p>You can use any number of nested <code>&lt;fileset&gt;</code> elements to define the files for
this task and refer to <code>&lt;fileset&gt;</code>s defined elsewhere.</p>
<h4>filelist</h4>
<p><em>Since Ant 1.6</em></p>
<p>You can use any number of nested <code>&lt;filelist&gt;</code>
elements to define the files for this task and refer to
<code>&lt;filelist&gt;</code>s defined elsewhere.</p>
<p>You can use any number of nested <code>&lt;filelist&gt;</code> elements to define the files for
this task and refer to <code>&lt;filelist&gt;</code>s defined elsewhere.</p>
<h4>dirset</h4>
<p><em>Since Ant 1.6</em></p>
<p>You can use any number of nested <code>&lt;dirset&gt;</code>
elements to define the directories for this task and refer to
<code>&lt;dirset&gt;</code>s defined elsewhere.</p>
<p>You can use any number of nested <code>&lt;dirset&gt;</code> elements to define the directories
for this task and refer to <code>&lt;dirset&gt;</code>s defined elsewhere.</p>

<h4>Any other <a href="../Types/resources.html#collection">Resource
Collection</a></h4>
<h4>Any other <a href="../Types/resources.html#collection">Resource Collection</a></h4>
<p><em>since Ant 1.7</em></p>
<p>You can use any number of nested resource collections.</p>

<h4>mapper</h4>
<p>A single <code>&lt;mapper&gt;</code> specifies the target files relative
to the <code>dest</code> attribute for dependency checking. If the
<code>dest</code> attribute is specified it will be used as a base directory
for resolving relative pathnames returned by the mapper. At least one
<p>A single <code>&lt;mapper&gt;</code> specifies the target files relative to the <var>dest</var>
attribute for dependency checking. If the <var>dest</var> attribute is specified it will be used as
a base directory for resolving relative pathnames returned by the mapper. At least one
<code>&lt;fileset&gt;</code> or <code>&lt;filelist&gt;</code> is required.</p>
<h4>arg</h4>
<p>Command line arguments should be specified as nested
<code>&lt;arg&gt;</code> elements. See <a
href="../using.html#arg">Command line arguments</a>.</p>
<p>Command line arguments should be specified as nested <code>&lt;arg&gt;</code>
elements. See <a href="../using.html#arg">Command line arguments</a>.</p>
<h4>srcfile</h4>
<p>By default the file names of the source files will be added to the
end of the command line (unless you set addsourcefile to
<code>false</code>). If you need to place it somewhere different,
use a nested <code>&lt;srcfile&gt;</code> element between your
<code>&lt;arg&gt;</code> elements to mark the insertion point.</p>
<table>
<p>By default the file names of the source files will be added to the end of the command line
(unless you set addsourcefile to <q>false</q>). If you need to place it somewhere different, use a
nested <code>&lt;srcfile&gt;</code> element between your <code>&lt;arg&gt;</code> elements to mark
the insertion point.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">a prefix to place in front of the file name when
building the command line argument. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No.</td>
<td>prefix</td>
<td>a prefix to place in front of the file name when building the command line
argument. <em>Since Ant 1.8.0</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">suffix</td>
<td valign="top">a suffix to append to the file name when
building the command line argument. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No.</td>
<td>suffix</td>
<td>a suffix to append to the file name when building the command line argument. <em>Since Ant
1.8.0</em></td>
<td>No</td>
</tr>
</table>
<h4>targetfile</h4>
<p><code>&lt;targetfile&gt;</code> is similar to
<code>&lt;srcfile&gt;</code> and marks the position of the target
filename on the command line. If omitted, the target filenames will
not be added to the command line at all. This element can only be
specified if you also define a nested mapper.</p>
<table>
<p><code>&lt;targetfile&gt;</code> is similar to <code>&lt;srcfile&gt;</code> and marks the position
of the target filename on the command line. If omitted, the target filenames will not be added to
the command line at all. This element can only be specified if you also define a nested mapper.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">a prefix to place in front of the file name when
building the command line argument. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No.</td>
<td>prefix</td>
<td>a prefix to place in front of the file name when building the command line
argument. <em>Since Ant 1.8.0</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">suffix</td>
<td valign="top">a suffix to append to the file name when
building the command line argument. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No.</td>
<td>suffix</td>
<td>a suffix to append to the file name when building the command line argument. <em>Since Ant
1.8.0</em></td>
<td>No</td>
</tr>
</table>
<h4>env</h4>
<p>It is possible to specify environment variables to pass to the
system command via nested <code>&lt;env&gt;</code> elements. See the
description in the section about <a href="exec.html#env">exec</a></p>
<p>It is possible to specify environment variables to pass to the system command via
nested <code>&lt;env&gt;</code> elements. See the description in the section
about <a href="exec.html#env">exec</a></p>
<h4>redirector</h4>
<em>Since Ant 1.6.2</em>
<p>A nested <a href="../Types/redirector.html">I/O Redirector</a>
can be specified. &lt;apply&gt;'s behavior is like that of
<a href="exec.html#redirector">exec</a> with regard to
redirectors, with the exception that, in non-<i>parallel</i> mode,
file mapping will take place with each iteration. This grants the
user the capacity to receive input from, and send output to, different
files for each sourcefile.
</p>
<p>In <i>parallel</i>-mode the redirector will be reset for each batch
of executions (with <i>maxparallel</i> &gt; 0) and null will be used
a source file just like it is in the case of <code>exec</code>.</p>
<p>A nested <a href="../Types/redirector.html">I/O Redirector</a> can be specified. &lt;apply&gt;'s
behavior is like that of <a href="exec.html#redirector">exec</a> with regard to redirectors, with
the exception that, in non-<var>parallel</var> mode, file mapping will take place with each
iteration. This grants the user the capacity to receive input from, and send output to, different
files for each sourcefile.</p>
<p>In <var>parallel</var> mode the redirector will be reset for each batch of executions
(with <var>maxparallel</var> &gt; 0) and null will be used a source file just like it is in the case
of <code>exec</code>.</p>
<h3>Examples</h3>
<pre>
&lt;apply executable=&quot;ls&quot;&gt;
@@ -408,12 +355,10 @@ files for each sourcefile.
&lt;/patternset&gt;
&lt;/fileset&gt;
&lt;fileset refid=&quot;other.files&quot;/&gt;
&lt;/apply&gt;
</pre>
<p>invokes <code>ls -l</code>, adding the absolute filenames of all
files below <code>/tmp</code> not ending in <code>.txt</code> and all
files of the FileSet with <code>id</code> <code>other.files</code> to
the command line.</p>
&lt;/apply&gt;</pre>
<p>invokes <code>ls -l</code>, adding the absolute filenames of all files below <samp>/tmp</samp>
not ending in <samp>.txt</samp> and all files of the FileSet
with <var>id</var> <samp>other.files</samp> to the command line.</p>
<pre>
&lt;apply executable=&quot;somecommand&quot; parallel=&quot;false&quot;&gt;
&lt;arg value=&quot;arg1&quot;/&gt;
@@ -422,11 +367,10 @@ the command line.</p>
&lt;fileset dir=&quot;/tmp&quot;/&gt;
&lt;/apply&gt;
</pre>
<p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each
file in <code>/tmp</code> replacing SOURCEFILENAME with the absolute
filename of each file in turn. If <code>parallel</code> had been set
to true, SOURCEFILENAME would be replaced with the absolute filenames
of all files separated by spaces.</p>
<p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each file in <samp>/tmp</samp>
replacing <code>SOURCEFILENAME</code> with the absolute filename of each file in
turn. If <var>parallel</var> had been set to true, <code>SOURCEFILENAME</code> would be replaced
with the absolute filenames of all files separated by spaces.</p>
<pre>
&lt;apply executable=&quot;cc&quot; dest=&quot;src/C&quot; parallel=&quot;false&quot;&gt;
&lt;arg value=&quot;-c&quot;/&gt;
@@ -435,13 +379,11 @@ of all files separated by spaces.</p>
&lt;srcfile/&gt;
&lt;fileset dir=&quot;src/C&quot; includes=&quot;*.c&quot;/&gt;
&lt;mapper type=&quot;glob&quot; from=&quot;*.c&quot; to=&quot;*.o&quot;/&gt;
&lt;/apply&gt;
</pre>
<p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each
<code>.c</code> file that is newer than the corresponding
<code>.o</code>, replacing TARGETFILE with the absolute filename of
the <code>.o</code> and SOURCEFILE with the absolute name of the
<code>.c</code> file.</p>
&lt;/apply&gt;</pre>
<p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each <samp>.c</samp> file that is newer
than the corresponding <samp>.o</samp>, replacing <code>TARGETFILE</code> with the absolute filename
of the <samp>.o</samp> and <code>SOURCEFILE</code> with the absolute name of the <samp>.c</samp>
file.</p>
<pre>
&lt;mapper id=&quot;out&quot; type=&quot;glob&quot;
from=&quot;src${file.separator}*.file&quot;
@@ -453,17 +395,15 @@ the <code>.o</code> and SOURCEFILE with the absolute name of the
&lt;redirector&gt;
&lt;outputmapper refid=&quot;out&quot;/&gt;
&lt;/redirector&gt;
&lt;/apply&gt;
</pre>
Applies the fictitious &quot;processfile&quot; executable to all
files matching <code>*.file</code> in the <code>src</code> directory.
The <code>out</code> <code>&lt;mapper&gt;</code> has been set up to map
<code>*.file</code> to <code>*.out</code>, then this <code>&lt;mapper&gt;</code>
is used to specify <code>targetfile</code>s for this &lt;apply&gt;
task. A reference to <code>out</code> is then used as an
<code>&lt;outputmapper&gt;</code> nested in a <code>&lt;redirector&gt;</code>, which in turn is
nested beneath this <code>&lt;apply&gt;</code> instance. This allows us to perform
dependency checking against output files--the target files in this case.
&lt;/apply&gt;</pre>
<p>Applies the fictitious <code>processfile</code> executable to all files
matching <samp>*.file</samp> in the <samp>src</samp> directory.
The <samp>out</samp> <code>&lt;mapper&gt;</code> has been set up to map <samp>*.file</samp>
to <samp>*.out</samp>, then this <code>&lt;mapper&gt;</code> is used to
specify <code>targetfile</code>s for this &lt;apply&gt; task. A reference to <samp>out</samp> is
then used as an <code>&lt;outputmapper&gt;</code> nested in a <code>&lt;redirector&gt;</code>, which
in turn is nested beneath this <code>&lt;apply&gt;</code> instance. This allows us to perform
dependency checking against output files&mdash;the target files in this case.</p>
<pre>
&lt;apply executable="ls" parallel="true"
force="true" dest="${basedir}" append="true" type="both"&gt;
@@ -471,10 +411,9 @@ dependency checking against output files--the target files in this case.
&lt;pathelement path="${env.PATH}"/&gt;
&lt;/path&gt;
&lt;identitymapper/&gt;
&lt;/apply&gt;
</pre>
Applies the "ls" executable to all directories in the PATH, effectively
listing all executables that are available on the PATH.
&lt;/apply&gt;</pre>
<p>Applies the <code>ls</code> executable to all directories in the <code>PATH</code>, effectively
listing all executables that are available on the <code>PATH</code>.</p>

<pre>
&lt;apply executable="jsmin" addsourcefile="false"&gt;
@@ -487,12 +426,10 @@ listing all executables that are available on the PATH.
&lt;!-- redirect STDOUT to file in dest-dir --&gt;
&lt;outputmapper id="out" type="glob" from="*.js" to="dest/*.js"/&gt;
&lt;/redirector&gt;
&lt;/apply&gt;
</pre>
Conversion of the command <code>jsmin &lt; src/a.js &gt; dest/a.js</code> but for
all files in the src-directory. Because the filename itself should not be passed
to the <code>jsmin</code> program, the <code>addsourcefile</code> is set to
<code>false</code>.
&lt;/apply&gt;</pre>
<p>Conversion of the command <code>jsmin &lt; src/a.js &gt; dest/a.js</code> but for all files in
the <samp>src</samp> directory. Because the filename itself should not be passed to
the <code>jsmin</code> program, the <var>addsourcefile</var> is set to <q>false</q>.</p>

</body>
</html>

+ 68
- 75
manual/Tasks/attrib.html View File

@@ -28,20 +28,18 @@
<p><em>Since Apache Ant 1.6</em>.</p>
<h3>Description</h3>

<p>Changes the attributes of a file or all files inside specified
directories. Right now it has effect only under Windows. Each of the
4 possible permissions has its own attribute, matching the arguments
for the attrib command.</p>
<p>Changes the attributes of a file or all files inside specified directories. Right now it has
effect only under Windows. Each of the 4 possible permissions has its own attribute, matching the
arguments for the attrib command.</p>

<p><a href="../Types/fileset.html">FileSet</a>s,
<a href="../Types/dirset.html">DirSet</a>s or <a
href="../Types/filelist.html">FileList</a>s can be specified using
nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
<code>&lt;filelist&gt;</code> elements.</p>
<p><a href="../Types/fileset.html">FileSet</a>s, <a href="../Types/dirset.html">DirSet</a>s
or <a href="../Types/filelist.html">FileList</a>s can be specified using
nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and <code>&lt;filelist&gt;</code>
elements.</p>

<p><em>Since Ant 1.7</em>, this task supports arbitrary <a
href="../Types/resources.html#collection">Resource Collection</a>s
as nested elements.</p>
<p><em>Since Ant 1.7</em>, this task supports
arbitrary <a href="../Types/resources.html#collection">Resource Collection</a>s as nested
elements.</p>

<!--p>By default this task will use a single invocation of the underlying
attrib command. If you are working on a large number of files this
@@ -51,112 +49,107 @@ maxparallel attribute of this task to a non-zero value. The number to
use highly depends on the length of your file names (the depth of your
directory tree), so you'll have to experiment a little.</p-->

<p>By default this task won't do anything unless it detects it is
running on a Windows system. If you know for sure that you have a
"attrib" executable on your PATH that is command line compatible with
the Windows command, you can use the task's os attribute and set its
value to your current os.</p>
<p>By default this task won't do anything unless it detects it is running on a Windows system. If
you know for sure that you have a <code>attrib</code> executable on your <code>PATH</code> that is
command line compatible with the Windows command, you can use the task's <var>os</var> attribute and
set its value to your current OS.</p>

<p>See the <a href="setpermissions.html">setpermissions</a> task for a
platform independent alternative.</p>
<p>See the <a href="setpermissions.html">setpermissions</a> task for a platform independent
alternative.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file or directory of which the permissions must be
changed.</td>
<td valign="top" align="center">Yes, or nested
<code>&lt;fileset/list&gt;</code> elements</td>
<td>file</td>
<td>the file or directory of which the permissions must be changed.</td>
<td>Yes, or nested <code>&lt;fileset/list&gt;</code> elements</td>
</tr>
<tr>
<td valign="top">readonly</td>
<td valign="top">the readonly permission.</td>
<td valign="top" rowspan="4">At least one of the four</td>
<td>readonly</td>
<td>the readonly permission.</td>
<td rowspan="4">At least one of the four</td>
</tr>
<tr>
<td valign="top">archive</td>
<td valign="top">the archive permission.</td>
<td>archive</td>
<td class="left">the archive permission.</td>
</tr>
<tr>
<td valign="top">system</td>
<td valign="top">the system permission.</td>
<td>system</td>
<td class="left">the system permission.</td>
</tr>
<tr>
<td valign="top">hidden</td>
<td valign="top">the hidden permission.</td>
<td>hidden</td>
<td class="left">the hidden permission.</td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
<i>file</i>, only the permissions of plain files are going to be changed.
If set to <i>dir</i>, only the directories are considered.<br>
<td>type</td>
<td>One of <q>file</q>, <q>dir</q> or <q>both</q>. If set to <q>file</q>, only the permissions
of plain files are going to be changed. If set to <q>dir</q>, only the directories are
considered.<br/>
<strong>Note</strong>: The type attribute does not apply to
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
assume type to be <i>dir</i>.</td>
<td align="center" valign="top">No, default is <i>file</i></td>
nested <code>dirset</code>s&mdash;<code>dirset</code>s always implicitly assume type to
be <q>dir</q>.</td>
<td>No; default is <q>file</q></td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to print a summary after execution or not.
Defaults to <code>false</code>.</td>
<td align="center" valign="top">No</td>
<td>verbose</td>
<td>Whether to print a summary after execution or not.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<!--tr>
<td valign="top">parallel</td>
<td valign="top">process all specified files using a single
<code>chmod</code> command. Defaults to true.</td>
<td valign="top" align="center">No</td>
<td>parallel</td>
<td>process all specified files using a single
<code>chmod</code> command.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">maxparallel</td>
<td valign="top">Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to &lt;= 0 for
unlimited. Defaults to unlimited. <em>Since Ant 1.6</em>.</td>
<td align="center" valign="top">No</td>
<td>maxparallel</td>
<td>Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to negative integer for
unlimited. <em>Since Ant 1.6</em>.</td>
<td>No, defaults to unlimited</td>
</tr-->
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed.</td>
<td align="center" valign="top">No</td>
<td>os</td>
<td>list of Operating Systems on which the command may be executed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in
the <a href="../Tasks/conditions.html#os">&lt;os&gt;</a>
<td>osfamily</td>
<td>OS family as used in the <a href="../Tasks/conditions.html#os">&lt;os&gt;</a>
condition.</td>
<td align="center" valign="top">No - defaults to "windows"</td>
<td>No; defaults to <q>windows</q></td>
</tr>
</table>

<h3>Examples</h3>

<pre>&lt;attrib file=&quot;${dist}/run.bat&quot; readonly=&quot;true&quot; hidden=&quot;true&quot;/&gt;</pre>
<p>makes the &quot;run.bat&quot; file read-only and hidden.</p>

<p>makes the <code>run.bat</code> file read-only and hidden.</p>

<pre>&lt;attrib readonly=&quot;false&quot;&gt;
&lt;fileset dir=&quot;${meta.inf}&quot; includes=&quot;**/*.xml&quot;/&gt;
&lt;/attrib&gt;
</pre>
<p>makes all &quot;.xml&quot; files below <code>${meta.inf}</code> readable.</p>
&lt;/attrib&gt;</pre>

<p>makes all <samp>.xml</samp> files below <samp>${meta.inf}</samp> readable.</p>

<pre>
&lt;attrib readonly=&quot;true&quot; archive=&quot;true&quot;&gt;
&lt;fileset dir=&quot;shared/sources1&quot;&gt;
&lt;exclude name=&quot;**/trial/**&quot;/&gt;
&lt;/fileset&gt;
&lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
&lt;/attrib&gt;
</pre>
&lt;/attrib&gt;</pre>

<p>makes all files below <code>shared/sources1</code> (except those below any
directory named trial) read-only and archived. In addition all files belonging
to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
same attributes.</p>
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory
named <samp>trial</samp>) read-only and archived. In addition all files belonging to a FileSet
with <var>id</var> <samp>other.shared.sources</samp> get the same attributes.</p>

</body>
</html>

+ 24
- 33
manual/Tasks/augment.html View File

@@ -27,57 +27,48 @@
<h2>Augment</h2>

<h3>Description</h3>
<p>Modify an existing reference by adding nested elements or (re-)assigning properties
mapped as XML attributes. This is an unusual task that makes use of Ant's internal
processing mechanisms to reload a previously declared reference by means of the 'id'
attribute, then treats the declared <code>augment</code> element as though it were the
original element.
<em>Since Apache Ant 1.8.1</em></p>
<p>Modify an existing reference by adding nested elements or (re-)assigning properties mapped as XML
attributes. This is an unusual task that makes use of Ant's internal processing mechanisms to reload
a previously declared reference by means of the <var>id</var> attribute, then treats the
declared <code>augment</code> element as though it were the original element. <em>Since Apache Ant
1.8.1</em></p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">id</td>
<td valign="top">The id of the reference to augment. If no such reference has
been declared a <code>BuildException</code> is generated.</td>
<td valign="top" align="center">Yes</td>
<td>id</td>
<td>The <var>id</var> of the reference to augment. If no such reference has been declared
a <code>BuildException</code> is thrown.</td>
<td>Yes</td>
</tr>
</table>
<p>
Additional permissible attributes are dependent on the reference to be modified.
</p>
<p>Additional permissible attributes are dependent on the reference to be modified.</p>

<h3>Parameters specified as nested elements</h3>

<p>
Permissible nested elements are dependent on the reference to be modified.
</p>
<p>Permissible nested elements are dependent on the reference to be modified.</p>

<h3>Examples</h3>

Given
<pre>
&lt;fileset id="input-fs" dir="${basedir}" /&gt;
</pre>
<p>Given</p>

<pre>
&lt;augment id="input-fs" excludes="foo" /&gt;
</pre>
<pre>&lt;fileset id="input-fs" dir="${basedir}"/&gt;</pre>

<pre>&lt;augment id="input-fs" excludes="foo"/&gt;</pre>

<p>Modifies the <code>excludes</code> attribute of <code>input-fs</code>.</p>
<p>modifies the <var>excludes</var> attribute of <samp>input-fs</samp>.</p>

<pre>
&lt;augment id="input-fs"&gt;
&lt;filename name="bar" /&gt;
&lt;/augment&gt;
</pre>
&lt;augment id="input-fs"&gt;
&lt;filename name="bar"/&gt;
&lt;/augment&gt;</pre>

<p>Adds a <code>filename</code> selector to <code>input-fs</code>.</p>
<p>Adds a <code>filename</code> selector to <samp>input-fs</samp>.</p>

</body>
</html>

+ 71
- 80
manual/Tasks/available.html View File

@@ -26,132 +26,123 @@

<h2 id="available">Available</h2>
<h3>Description</h3>
<p>Sets a property if a resource is available at runtime. This resource can be a
file, a directory, a class in the classpath, or a JVM system resource.</p>
<p>If the resource is present, the property value is set to true by
default; otherwise, the property is not set. You can set the value to
something other than the default by specifying the <code>value</code> attribute.</p>
<p>Normally, this task is used to set properties that are useful to avoid target
execution depending on system parameters.</p>
<p>Sets a property if a resource is available at runtime. This resource can be a file, a directory,
a class in the classpath, or a JVM system resource.</p>
<p>If the resource is present, the property value is set to <q>true</q> by default; otherwise, the
property is not set. You can set the value to something other than the default by specifying
the <var>value</var> attribute.</p>
<p>Normally, this task is used to set properties that are useful to avoid target execution depending
on system parameters.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of the property to set.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>The name of the property to set.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">The value to set the property to. Defaults to &quot;true&quot;.</td>
<td valign="top" align="center">No</td>
<td>value</td>
<td>The value to set the property to.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">classname</td>
<td valign="top">The class to look for in the classpath.</td>
<td valign="middle" align="center" rowspan="3">Yes</td>
<td>classname</td>
<td>The class to look for in the classpath.</td>
<td rowspan="3">Exactly one of the three</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to look for.</td>
<td>file</td>
<td class="left">The file to look for.</td>
</tr>
<tr>
<td valign="top">resource</td>
<td valign="top">The resource to look for in the JVM.</td>
<td>resource</td>
<td class="left">The resource to look for in the JVM.</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">The classpath to use when looking up <code>classname</code> or <code>resource</code>.</td>
<td align="center" valign="top">No</td>
<td>classpath</td>
<td>The classpath to use when looking up <var>classname</var> or <var>resource</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">filepath</td>
<td valign="top">The path to use when looking up <code>file</code>.</td>
<td align="center" valign="top">No</td>
<td>filepath</td>
<td>The path to use when looking up <var>file</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">The classpath to use, given as a <a href="../using.html#references">reference</a> to a path defined elsewhere.</td>
<td align="center" valign="top">No</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>
<td>No</td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">The type of <code>file</code> to look for, either a directory (<code>type=&quot;dir&quot;</code>) or a file
(<code>type=&quot;file&quot;</code>). If not set, the property will be set if the name specified in the <code>file</code>
attribute exists as either a file or a directory.</td>
<td align="center" valign="top">No</td>
<td>type</td>
<td>The type of <var>file</var> to look for, either a directory (<var>type</var>=<q>dir</q>) or
a file (<var>type</var>=<q>file</q>). If not set, the property will be set if the name specified
in the <var>file</var> attribute exists as either a file or a directory.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">ignoresystemclasses</td>
<td valign="top">Ignore Ant's runtime classes, using only the specified
classpath. Only affects the "classname" attribute. Defaults to &quot;false&quot;</td>
<td align="center" valign="top">No</td>
<td>ignoresystemclasses</td>
<td>Ignore Ant's runtime classes, using only the specified classpath. Only affects
the <var>classname</var> attribute.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">searchparents</td>
<td valign="top">This contains the behaviour of the "file" type.
If true, the available task will, when
searching for a file, search not only the directories specified but
will also search the parent directories of those
specified.
If false, only the directories specified will be searched.
Defaults to "false".
<em>Since Ant 1.7</em>
</td>
<td align="center" valign="top">No</td>
<td>searchparents</td>
<td>This contains the behaviour of the <q>file</q> <var>type</var>. If <q>true</q>, the task
will, when searching for a file, search not only the directories specified but will also search
the parent directories of those specified. If <q>false</q>, only the directories specified will
be searched. <em>Since Ant 1.7</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>classpath</h4>
<p><code>Available</code>'s <code>classpath</code> attribute is a <a
href="../using.html#path">path-like structure</a> and can also be set via a nested
<p><code>Available</code>'s <code>classpath</code> attribute is
a <a href="../using.html#path">path-like structure</a> and can also be set via a nested
<code>&lt;classpath&gt;</code> element.</p>
<h4>filepath</h4>
<p><code>Available</code>'s <code>filepath</code> attribute is a <a
href="../using.html#path">path-like structure</a> and can also be set via a nested
<code>&lt;filepath&gt;</code> element.</p>
<p><code>Available</code>'s <code>filepath</code> attribute is
a <a href="../using.html#path">path-like structure</a> and can also be set via a
nested <code>&lt;filepath&gt;</code> element.</p>
<h3>Examples</h3>
<pre>
&lt;available classname=&quot;org.whatever.Myclass&quot; property=&quot;Myclass.present&quot;/&gt;
</pre>
<p>sets the <code>Myclass.present</code> property to the value &quot;true&quot;
if the class <code>org.whatever.Myclass</code> is found in Ant's classpath.</p>
<pre>&lt;available classname=&quot;org.whatever.Myclass&quot; property=&quot;Myclass.present&quot;/&gt;</pre>
<p>sets the <code>Myclass.present</code> property to the value <q>true</q> if the
class <code>org.whatever.Myclass</code> is found in Ant's classpath.</p>
<pre>
&lt;property name=&quot;jaxp.jar&quot; value=&quot;./lib/jaxp11/jaxp.jar&quot;/&gt;
&lt;available file=&quot;${jaxp.jar}&quot; property=&quot;jaxp.jar.present&quot;/&gt;
</pre>
<p>sets the <code>jaxp.jar.present</code> property to the value &quot;true&quot;
if the file <code>./lib/jaxp11/jaxp.jar</code> is found.</p>
&lt;available file=&quot;${jaxp.jar}&quot; property=&quot;jaxp.jar.present&quot;/&gt;</pre>
<p>sets the <code>jaxp.jar.present</code> property to the value <q>true</q> if the
file <samp>./lib/jaxp11/jaxp.jar</samp> is found.</p>
<pre>
&lt;available file=&quot;/usr/local/lib&quot; type=&quot;dir&quot;
property=&quot;local.lib.present&quot;/&gt;
</pre>
<p>sets the <code>local.lib.present</code> property to the value &quot;true&quot;
if the directory <code>/usr/local/lib</code> is found.</p>
property=&quot;local.lib.present&quot;/&gt;</pre>
<p>sets the <code>local.lib.present</code> property to the value <q>true</q> if the
directory <samp>/usr/local/lib</samp> is found.</p>
<pre>
...in project ...
&lt;property name=&quot;jaxp.jar&quot; value=&quot;./lib/jaxp11/jaxp.jar&quot;/&gt;
&lt;path id=&quot;jaxp&quot; location=&quot;${jaxp.jar}&quot;/&gt;
...in target ...
&lt;available classname=&quot;javax.xml.transform.Transformer&quot;
classpathref=&quot;jaxp&quot; property=&quot;jaxp11.present&quot;/&gt;
</pre>
<p>sets the <code>jaxp11.present</code> property to the value &quot;true&quot;
if the class <code>javax.xml.transform.Transformer</code> is found in the classpath referenced by <code>jaxp</code> (in this case, <code>./lib/jaxp11/jaxp.jar</code>).
classpathref=&quot;jaxp&quot; property=&quot;jaxp11.present&quot;/&gt;</pre>
<p>sets the <code>jaxp11.present</code> property to the value <q>true</q> if the
class <code>javax.xml.transform.Transformer</code> is found in the classpath referenced
by <samp>jaxp</samp> (in this case, <samp>./lib/jaxp11/jaxp.jar</samp>).
</p>
<pre>
&lt;available property=&quot;have.extras&quot; resource=&quot;extratasks.properties&quot;&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;/usr/local/ant/extra.jar&quot; /&gt;
&lt;pathelement location=&quot;/usr/local/ant/extra.jar&quot;/&gt;
&lt;/classpath&gt;
&lt;/available&gt;
</pre>
<p>sets the <code>have.extras</code> property to the value &quot;true&quot;
if the resource-file <code>extratasks.properties</code> is found.
&lt;/available&gt;</pre>
<p>sets the <code>have.extras</code> property to the value <q>true</q> if the resource
file <samp>extratasks.properties</samp> is found.
</p>

</body>


+ 29
- 39
manual/Tasks/basename.html View File

@@ -25,64 +25,54 @@
<body>

<h2 id="echo">Basename</h2>

<h3>Description</h3>
<p>
Task to determine the basename of a specified file, optionally minus a
specified suffix.
</p>
<p>
When this task executes, it will set the specified property to the
value of the last path element of the specified file. If <code>file</code> is a
directory, the basename will be the last directory element. If
<code>file</code> is a full-path, relative-path, or simple filename,
the basename will be the simple file name, without any directory elements.
</p>
<p>
<p>Task to determine the basename of a specified file, optionally minus a specified suffix.</p>
<p>When this task executes, it will set the specified property to the value of the last path element
of the specified file. If <var>file</var> is a directory, the basename will be the last directory
element. If <var>file</var> is a full-path, relative-path, or simple filename, the basename will be
the simple file name, without any directory elements.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The path to take the basename of.</td>
<td valign="top" align="center">Yes</td>
<td>file</td>
<td>The path to take the basename of.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of the property to set.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>The name of the property to set.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">suffix</td>
<td valign="top">The suffix to remove from the resulting basename
(specified either with or without the &quot;<code>.</code>&quot;).</td>
<td valign="top" align="center">No</td>
<td>suffix</td>
<td>The suffix to remove from the resulting basename (specified either with or without
the <q>.</q>).</td>
<td>No</td>
</tr>
</table>

<h3>Examples</h3>
<pre>
&lt;basename property=&quot;jar.filename&quot; file=&quot;${lib.jarfile}&quot;/&gt;
</pre>
will set <code>jar.filename</code> to
<code>myjar.jar</code>, if <code>lib.jarfile</code> is defined as either a
full-path filename (eg., <code>/usr/local/lib/myjar.jar</code>),
a relative-path filename (eg., <code>lib/myjar.jar</code>),
or a simple filename (eg., <code>myjar.jar</code>).
<pre>&lt;basename property=&quot;jar.filename&quot; file=&quot;${lib.jarfile}&quot;/&gt;</pre>
<p>will set <code>jar.filename</code> to <samp>myjar.jar</samp>, if <code>lib.jarfile</code> is
defined as either a full-path filename (eg., <samp>/usr/local/lib/myjar.jar</samp>), a relative-path
filename (eg., <samp>lib/myjar.jar</samp>), or a simple filename (eg., <samp>myjar.jar</samp>).</p>
<pre>
&lt;basename property=&quot;cmdname&quot; file=&quot;D:/usr/local/foo.exe&quot;
suffix=&quot;.exe&quot;/&gt;
</pre>
will set <code>cmdname</code> to <code>foo</code>.
suffix=&quot;.exe&quot;/&gt;</pre>
<p>will set <code>cmdname</code> to <samp>foo</samp>.</p>
<pre>
&lt;property environment=&quot;env&quot;/&gt;
&lt;basename property=&quot;temp.dirname&quot; file=&quot;${env.TEMP}&quot;/&gt;
</pre>
will set <code>temp.dirname</code> to the last directory element of
the path defined for the <code>TEMP</code> environment variable.
<p>will set <code>temp.dirname</code> to the last directory element of the path defined for
the <code>TEMP</code> environment variable.</p>

</body>
</html>

+ 33
- 40
manual/Tasks/bindtargets.html View File

@@ -27,64 +27,57 @@
<h2 id="ant">Bindtargets</h2>
<h3>Description</h3>

<p>Make some target the extension of some defined
<a href="../targets.html#extension-points">extension point</a>. It will make the
list of targets dependencies of the extension point.</p>
<p>Make some target the extension of some
defined <a href="../targets.html#extension-points">extension point</a>. It will make the list of
targets dependencies of the extension point.</p>

<p>This target is useful when you want to have a target participate to another
build workflow, build workflow which explicitly expose an extension point for
that kind of insertion. But the target to bind and the extension point to
bind to are both declared in some imported build files. Modifying directly the
target dependency graph of these external build files may have a side effect
on some other project which import them. This task helps then to modify the
target dependencies but only in your context.
</p>
<p>This target is useful when you want to have a target to participate in another build workflow
which explicitly exposes an extension point for that kind of insertion. Thus the target to bind and
the extension point to bind to are both declared in some imported build files. But directly
modifying the target dependency graph of these external build files may have a side effect on some
other project which imports them. This task helps to modify the target dependencies but only in your
context.</p>

<p><strong>Note</strong>: this task is quite equivalent to the definition of an intermediate
target which will be the bridge between the target to bind and the extension
point. For instance:
</p>
<pre>&lt;bindtargets targets="jar,javadoc" extensionPoint="dist" /&gt;</pre>
is quite equivalent to:
<pre>&lt;target name="bind-to-dist" depends="jar,javadoc" extensionOf="dist" /&gt;</pre>
<p>This task basically avoid the creation of a target.</p>
<p><strong>Note</strong>: this task is quite equivalent to the definition of an intermediate target
which will be the bridge between the target to bind and the extension point. For instance:</p>
<pre>&lt;bindtargets targets="jar,javadoc" extensionPoint="dist"/&gt;</pre>
<p>is quite equivalent to:</p>
<pre>&lt;target name="bind-to-dist" depends="jar,javadoc" extensionOf="dist"/&gt;</pre>
<p>This task basically avoids the creation of a target.</p>

<p>The bindtargets task may only be used as a top-level task. This means that
it may not be used in a target. This is making the target dependency graph static
and predictable as soon as every build file is loaded.</p>
<p>The <code>bindtargets</code> task may only be used as a top-level task. This means that it may
not be used in a target. This is making the target dependency graph static and predictable as soon
as every build file is loaded.</p>

<p><em>Since Apache Ant 1.8.2</em></p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">targets</td>
<td valign="top">a comma separated list of target names to bind.</td>
<td valign="top" align="center">Yes</td>
<td>targets</td>
<td>a comma separated list of target names to bind.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">extensionPoint</td>
<td valign="top">the name of the extension point to bind the targets to.</td>
<td valign="top" align="center">Yes</td>
<td>extensionPoint</td>
<td>the name of the extension point to bind the targets to.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">onMissingExtensionPoint</td>
<td valign="top">What to do if this target tries to extend a missing
<a href="../targets.html#extension-points">extension-point</a>. ("fail",
"warn", "ignore").</td>
<td valign="top" align="center">No. Defaults to <code>fail</code></td>
<td>onMissingExtensionPoint</td>
<td>What to do if this target tries to extend a
missing <a href="../targets.html#extension-points">extension-point</a>: <q>fail</q>, <q>warn</q>, <q>ignore</q>.</td>
<td>No; defaults to <q>fail</q></td>
</tr>
</table>

<h3>Examples</h3>
<pre>
&lt;bindtargets targets=&quot;build-jar,build-src-jar&quot; extensionPoint=&quot;dist&quot;/&gt;
</pre>
<pre>&lt;bindtargets targets=&quot;build-jar,build-src-jar&quot; extensionPoint=&quot;dist&quot;/&gt;</pre>

</body>
</html>

+ 16
- 27
manual/Tasks/buildnumber.html View File

@@ -27,45 +27,34 @@
<h2 id="buildnumber">BuildNumber</h2>
<h3>Description</h3>
<p>This is a basic task that can be used to track build numbers.</p>
<p>It will first attempt to read a build number from a file (by default,
<code>build.number</code> in the current directory), then
set the property <code>build.number</code> to the value that was read in
(or to <code>0</code>, if no such value). It will then increment the
number by one and write it back out to the file.
(See the
<a href="../Tasks/propertyfile.html">PropertyFile</a> task
if you need finer control over things such as the property name or
the number format.)
</p>
<p>It will first attempt to read a build number from a file (by default, <samp>build.number</samp>
in the current directory), then set the property <code>build.number</code> to the value that was
read in (or to <q>0</q>, if no such value). It will then increment the number by one and write it
back out to the file. (See the <a href="../Tasks/propertyfile.html">PropertyFile</a> task if you
need finer control over things such as the property name or the number format.)</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to read and write the build number from/to.</td>
<td align="center" valign="top">No; defaults to &quot;build.number&quot;</td>
<td>file</td>
<td>The file to read and write the build number from/to.</td>
<td>No; defaults to <q>build.number</q></td>
</tr>
</table>

<h3>Examples</h3>
<pre>
&lt;buildnumber/&gt;
</pre>
<pre>&lt;buildnumber/&gt;</pre>

<p>Read, increment, and write a build number to the default file,
<code>build.number</code>.</p>
<p>Read, increment, and write a build number to the default file, <samp>build.number</samp>.</p>

<pre>
&lt;buildnumber file=&quot;mybuild.number&quot;/&gt;
</pre>
<pre>&lt;buildnumber file=&quot;mybuild.number&quot;/&gt;</pre>

<p>Read, increment, and write a build number to the file
<code>mybuild.number</code>.</p>
<p>Read, increment, and write a build number to the file <samp>mybuild.number</samp>.</p>

</body>
</html>

+ 63
- 81
manual/Tasks/cab.html View File

@@ -26,124 +26,107 @@

<h2 id="cab">Cab</h2>
<h3>Description</h3>
<p>The cab task creates Microsoft cab archive files. It is invoked
similar to the <a href="../Tasks/jar.html">jar</a> or <a href="../Tasks/zip.html">zip</a> tasks.
This task will work on Windows using the external cabarc tool (provided by Microsoft)
which must be located in your executable path.</p>
<p>To use this task on other platforms you need to download and compile libcabinet from
<a href="http://trill.cis.fordham.edu/~barbacha/cabinet_library/">
http://trill.cis.fordham.edu/~barbacha/cabinet_library/</a>.</p>
<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>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>basedir</code>) as well as the nested
<code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.</p>
<p>The cab task creates Microsoft cabinet archive files. It is invoked similar to
the <a href="../Tasks/jar.html">jar</a> or <a href="../Tasks/zip.html">zip</a> tasks. This task
will work on Windows using the external <code>cabarc</code> tool (provided by Microsoft) which must
be located in your executable path.</p>
<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>
<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>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>basedir</var>) as well as
the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
and <code>&lt;patternset&gt;</code> elements.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">cabfile</td>
<td valign="top">the name of the cab file to create.</td>
<td valign="top" align="center">Yes</td>
<td>cabfile</td>
<td>the name of the cab file to create.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">basedir</td>
<td valign="top">the directory to start archiving files from.</td>
<td valign="top" align="center">No</td>
<td>basedir</td>
<td>the directory to start archiving files from.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">set to &quot;yes&quot; if you want to see the output from
the cabarc tool. defaults to &quot;no&quot;.</td>
<td valign="top" align="center">No</td>
<td>verbose</td>
<td>set to <q>yes</q> if you want to see the output from the <code>cabarc</code> tool.</td>
<td>No; defaults to <q>no</q></td>
</tr>
<tr>
<td valign="top">compress</td>
<td valign="top">set to &quot;no&quot; to store files without compressing.
defaults to &quot;yes&quot;.</td>
<td valign="top" align="center">No</td>
<td>compress</td>
<td>set to <q>no</q> to store files without compressing.</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">options</td>
<td valign="top">use to set additional command-line options for
the cabarc tool. should not normally be necessary.</td>
<td valign="top" align="center">No</td>
<td>options</td>
<td>use to set additional command-line options for the <code>cabarc</code> tool. Should not
normally be necessary.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that
must be included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td>name of a file. Each line of this file is taken to be an include pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that
must be excluded. No files (except default excludes) are excluded
when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td>name of a file. Each line of this file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used
or not (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>fileset</h4>

<p>The cab task supports one nested <a
href="../Types/fileset.html"><code>&lt;fileset&gt;</code></a>
element to specify the files to be included in the archive.
If this is specified, the "basedir" attribute cannot be used.
</p>
<p>The cab task supports one nested <a href="../Types/fileset.html"><code>&lt;fileset&gt;</code></a>
element to specify the files to be included in the archive. If this is specified,
the <var>basedir</var> attribute cannot be used.</p>

<h3>Examples</h3>
<pre>
&lt;cab cabfile=&quot;${dist}/manual.cab&quot;
basedir=&quot;htdocs/manual&quot;/&gt;
</pre>
<p>cabs all files in the htdocs/manual directory into a file called
manual.cab in the ${dist} directory.</p>
basedir=&quot;htdocs/manual&quot;/&gt;</pre>
<p>cabs all files in the <samp>htdocs/manual</samp> directory into a file
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory.</p>
<pre>
&lt;cab cabfile=&quot;${dist}/manual.cab&quot;
basedir=&quot;htdocs/manual&quot;
excludes=&quot;mydocs/**, **/todo.html&quot;/&gt;
</pre>
<p>cabs all files in the htdocs/manual directory into a file called
manual.cab in the ${dist} directory. Files in the directory mydocs,
or files with the name todo.html are excluded.</p>
excludes=&quot;mydocs/**, **/todo.html&quot;/&gt;</pre>
<p>cabs all files in the <samp>htdocs/manual</samp> directory into a file
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Files in the
directory <samp>mydocs</samp>, or files with the name <samp>todo.html</samp> are excluded.</p>
<pre>
&lt;cab cabfile=&quot;${dist}/manual.cab&quot;
basedir=&quot;htdocs/manual&quot;
includes=&quot;api/**/*.html&quot;
excludes=&quot;**/todo.html&quot;
verbose=&quot;yes&quot;/&gt;
</pre>
<p>Cab all files in the htdocs/manual directory into a file called
manual.cab in the ${dist} directory. Only html files under the
directory api are archived, and files with the name todo.html are
excluded. Output from the cabarc tool is displayed in the build
output.</p>
verbose=&quot;yes&quot;/&gt;</pre>
<p>Cab all files in the <samp>htdocs/manual</samp> directory into a file
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Only <samp>.html</samp> files
under the directory <samp>api</samp> are archived, and files with the name <samp>todo.html</samp>
are excluded. Output from the <code>cabarc</code> tool is displayed in the build output.</p>

<pre>
&lt;cab cabfile=&quot;${dist}/manual.cab&quot;
@@ -152,8 +135,7 @@ output.</p>
dir=&quot;htdocs/manual&quot;
includes=&quot;api/**/*.html&quot;
excludes=&quot;**/todo.html&quot;/&gt;
&lt;/cab&gt;
</pre>
&lt;/cab&gt;</pre>
<p>is equivalent to the example above.</p>

</body>


+ 71
- 56
manual/Tasks/ccm.html View File

@@ -34,13 +34,16 @@
</ul>

<p>These Apache Ant tasks are wrappers around Continuus Source Manager. They have been tested
against versions 5.1/6.2 on Windows 2000, but should work on other platforms with ccm installed.</p>
against versions 5.1/6.2 on Windows 2000, but should work on other platforms with <code>ccm</code>
installed.</p>

<hr/>

<h2 id="ccmcheckin">CCMCheckin</h2>
<h3>Description</h3>
Task to checkin a file
<p>Task to checkin a file</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Values</th>
@@ -53,35 +56,37 @@ Task to checkin a file
</tr>
<tr>
<td>comment</td>
<td>Specify a comment. Default is &quot;Checkin&quot; plus the date</td>
<td>No</td>
<td>Specify a comment.</td>
<td>No; default is <q>Checkin</q> plus the date</td>
</tr>
<tr>
<td>task</td>
<td>Specify the task number used to check in the file (may use 'default')</td>
<td>Specify the task number used to check in the file (may use <q>default</q>)</td>
<td>No</td>
</tr>
<tr>
<td>ccmdir</td>
<td>path to the ccm executable file, required if it is not on the PATH</td>
<td>path to the <code>ccm</code> executable file, required if it is not on
the <code>PATH</code></td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>

<pre>&lt;ccmcheckin file=&quot;c:/wa/com/foo/MyFile.java&quot;
comment=&quot;mycomment&quot;/&gt;
</pre>
<pre>
&lt;ccmcheckin file=&quot;c:/wa/com/foo/MyFile.java&quot;
comment=&quot;mycomment&quot;/&gt;</pre>

<p>Checks in the file <samp>c:/wa/com/foo/MyFile.java</samp>. Text <samp>mycomment</samp> is added
as a comment. The task used is the one set as the default.</p>

<p>Checks in the file <i>c:/wa/com/foo/MyFile.java</i>.
Comment attribute <i>mycomment</i> is added as a task comment. The task
used is the one set as the default.</p>
<hr/>

<h2 id="ccmcheckout">CCMCheckout</h2>
<h3>Description</h3>
Task to perform a Checkout command to Continuus
<p>Task to perform a checkout command to Continuus</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Values</th>
@@ -90,53 +95,57 @@ Task to perform a Checkout command to Continuus
<tr>
<td>file</td>
<td>Path to the file that the command will operate on</td>
<td rowspan="2">Yes (file|fileset)</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td>fileset</td>
<td>fileset containing the file to be checked out</td>
<td class="left">fileset containing the file to be checked out</td>
</tr>
<tr>
<td>comment</td>
<td>Specify a comment.</td>
<td>Specify a comment</td>
<td>No</td>
</tr>
<tr>
<td>task</td>
<td>Specify the task number used to checkin the file (may use
'default')</td>
<td>Specify the task number used to checkin the file (may use <q>default</q>)</td>
<td>No</td>
</tr>
<tr>
<td>ccmdir</td>
<td>path to the ccm executable file, required if it is not on the PATH</td>
<td>path to the <code>ccm</code> executable file, required if it is not on
the <code>PATH</code></td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>

<pre>&lt;ccmcheckout file=&quot;c:/wa/com/foo/MyFile.java&quot;
comment=&quot;mycomment&quot;/&gt;</pre>
<pre>
&lt;ccmcheckout file=&quot;c:/wa/com/foo/MyFile.java&quot;
comment=&quot;mycomment&quot;/&gt;</pre>

<p>Check out the file <i>c:/wa/com/foo/MyFile.java</i>.
Comment attribute <i>mycomment</i> is added as a task comment
The used task is the one set as the default.</p>
<p>Check out the file <samp>c:/wa/com/foo/MyFile.java</samp>. Comment
attribute <samp>mycomment</samp> is added as a task comment The used task is the one set as the
default.</p>

<pre>&lt;ccmcheckout comment=&quot;mycomment&quot;&gt;
<pre>
&lt;ccmcheckout comment=&quot;mycomment&quot;&gt;
&lt;fileset dir=&quot;lib&quot; &gt;
&lt;include name=&quot;**/*.jar&quot;/&gt;
&lt;/fileset&gt;
&lt;/ccmcheckout &gt;</pre>

<p>Check out all the files in the <i>lib</i> directory having the <i>.jar</i> extension.
Comment attribute <i>mycomment</i> is added as a task comment
The used task is the one set as the default.</p>
<p>Check out all the files in the <samp>lib</samp> directory having the <samp>.jar</samp> extension.
Comment attribute <samp>mycomment</samp> is added as a task comment The used task is the one set as
the default.</p>

<hr/>

<h2 id="ccmcheckintask">CCMCheckinTask</h2>
<h3>Description</h3>
Task to perform a check in default task command to Continuus
<p>Task to perform a checkin default task command to Continuus</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Values</th>
@@ -149,12 +158,13 @@ Task to perform a check in default task command to Continuus
</tr>
<tr>
<td>task</td>
<td>Specify the task number used to check in the file (may use 'default')</td>
<td>Specify the task number used to check in the file (may use <q>default</q>)</td>
<td>No</td>
</tr>
<tr>
<td>ccmdir</td>
<td >path to the ccm executable file, required if it is not on the PATH</td>
<td>path to the <code>ccm</code> executable file, required if it is not on
the <code>PATH</code></td>
<td>No</td>
</tr>
</table>
@@ -163,12 +173,14 @@ Task to perform a check in default task command to Continuus
<pre>&lt;ccmcheckintask comment=&quot;blahblah/&gt;</pre>

<p>Does a Checkin default task on all the checked out files in the current task.</p>

<hr/>

<h2 id="ccmreconfigure">CCMReconfigure</h2>
<h3>Description</h3>
Task to perform an reconfigure command to Continuus.
<p>Task to perform an reconfigure command to Continuus.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Values</th>
@@ -176,13 +188,13 @@ Task to perform an reconfigure command to Continuus.
</tr>
<tr>
<td>recurse</td>
<td>recurse on subproject (default false)</td>
<td>No</td>
<td>recurse on subproject</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td>verbose</td>
<td>do a verbose reconfigure operation (default false)</td>
<td>No</td>
<td>do a verbose reconfigure operation</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td>ccmproject</td>
@@ -191,24 +203,26 @@ Task to perform an reconfigure command to Continuus.
</tr>
<tr>
<td>ccmdir</td>
<td >path to the ccm executable file, required if it is not on the PATH</td>
<td>path to the <code>ccm</code> executable file, required if it is not on
the <code>PATH</code></td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>

<pre>&lt;ccmreconfigure ccmproject=&quot;ANTCCM_TEST#BMO_1&quot;
verbose=&quot;true&quot;/&gt;
</pre>
<pre>
&lt;ccmreconfigure ccmproject=&quot;ANTCCM_TEST#BMO_1&quot;
verbose=&quot;true&quot;/&gt;</pre>

<p>Does a Continuus <code>reconfigure</code> on the project <samp>ANTCCM_TEST#BMO_1</samp>.</p>

<p>Does a Continuus <i>reconfigure</i> on the project <i>ANTCCM_TEST#BMO_1</i>.
</p>
<hr/>

<h2 id="ccmcreatetask">CCMCreateTask</h2>
<h3>Description</h3>
Create a Continuus task.
<p>Create a Continuus task.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Values</th>
@@ -216,7 +230,7 @@ Create a Continuus task.
</tr>
<tr>
<td>comment</td>
<td>Specify a comment.</td>
<td>Specify a comment</td>
<td>No</td>
</tr>
<tr>
@@ -226,7 +240,8 @@ Create a Continuus task.
</tr>
<tr>
<td>ccmdir</td>
<td >path to the ccm executable file, required if it is not on the PATH</td>
<td>path to the <code>ccm</code> executable file, required if it is not on
the <code>PATH</code></td>
<td>No</td>
</tr>
<tr>
@@ -246,18 +261,18 @@ Create a Continuus task.
</tr>
<tr>
<td>task</td>
<td>Specify the task number used to checkin the file (may use 'default')</td>
<td>Specify the task number used to checkin the file (may use <q>default</q>)</td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>

<pre>&lt;ccmcreatetask resolver=&quot;${user.name}&quot;
release=&quot;ANTCCM_TEST&quot; comment=&quot;blahblah&quot;/&gt;
</pre>
<pre>
&lt;ccmcreatetask resolver=&quot;${user.name}&quot;
release=&quot;ANTCCM_TEST&quot; comment=&quot;blahblah&quot;/&gt;</pre>

<p>Creates a task for the release <i>ANTCCM_TEST</i> with the
current user as the resolver for this task.</p>
<p>Creates a task for the release <samp>ANTCCM_TEST</samp> with the current user as the resolver for
this task.</p>

</body>
</html>

+ 145
- 160
manual/Tasks/changelog.html View File

@@ -26,242 +26,228 @@

<h2 id="changelog">CvsChangeLog</h2>
<h3>Description</h3>
<p>Generates an XML-formatted report file of the change logs recorded in a
<a href="http://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p>
<p><b>Important:</b> This task needs &quot;<code>cvs</code>&quot; on the path. If it isn't, you will get
an error (such as error <code>2</code> on Windows). If <code>&lt;cvs&gt;</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>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>
<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>&lt;cvs&gt;</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&mdash;like CVSNT for example&mdash;and some
operation may fail when using such an incompatible client.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td colspan="3">Attributes from parent Cvs task which are meaningful here<br>
<em>Since Apache Ant 1.6.1</em></td>
<td colspan="3" class="left">Attributes from parent <code>&lt;cvs&gt;</code> task which are
meaningful here<br/><em>Since Apache Ant 1.6.1</em></td>
</tr>
<tr>
<td valign="top">cvsRoot</td>
<td valign="top">the <code>CVSROOT</code> variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRoot</td>
<td>the <code>CVSROOT</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">cvsRsh</td>
<td valign="top">the <code>CVS_RSH</code> variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRsh</td>
<td>the <code>CVS_RSH</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">package</td>
<td valign="top">the package/module to check out. <strong>Note</strong>:
multiple attributes can be split using spaces. Use a nested
&lt;module&gt; element if you want to specify a module with
spaces in its name.</td>
<td align="center" valign="top">No</td>
<td>package</td>
<td>the package/module to check out. <strong>Note</strong>: multiple attributes can be split
using spaces. Use a nested <code>&lt;module&gt;</code> element if you want to specify a
module with spaces in its name.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">port</td>
<td valign="top">Port used by CVS to communicate with the server.</td>
<td align="center" valign="top">No, default port 2401.</td>
<td>port</td>
<td>Port used by CVS to communicate with the server.</td>
<td>No; defaults to <q>2401</q></td>
</tr>
<tr>
<td valign="top">passfile</td>
<td valign="top">Password file to read passwords from.</td>
<td align="center" valign="top">No, default file <code>~/.cvspass</code>.</td>
<td>passfile</td>
<td>Password file to read passwords from.</td>
<td>No; defaults to <q>~/.cvspass</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the build process if the command exits with a
return code other than <code>0</code>. Defaults to false</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code other
than <code>0</code></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">tag</td>
<td valign="top">query the changelog for a specific branch.</td>
<td align="center" valign="top">No</td>
<td>tag</td>
<td>query the changelog for a specific branch.</td>
<td>No</td>
</tr>
<tr>
<td colspan="3">Specific attributes</td>
<td colspan="3" class="left">Specific attributes</td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">The directory from which to run the CVS <em>log</em>
command.</td>
<td align="center" valign="top">No; defaults to ${basedir}.</td>
<td>dir</td>
<td>The directory from which to run the CVS <em>log</em> command.</td>
<td>No; defaults to <q>${basedir}</q></td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">The file in which to write the change log report.</td>
<td align="center" valign="top">Yes</td>
<td>destfile</td>
<td>The file in which to write the change log report.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">usersfile</td>
<td valign="top">Property file that contains name-value pairs mapping
user IDs and names that should be used in the report in place of
the user ID.</td>
<td align="center" valign="top">No</td>
<td>usersfile</td>
<td>Property file that contains name-value pairs mapping user IDs and names that should be used
in the report in place of the user ID.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">daysinpast</td>
<td valign="top">Sets the number of days into the past for which the
change log information should be retrieved.</td>
<td align="center" valign="top">No</td>
<td>daysinpast</td>
<td>Sets the number of days into the past for which the change log information should be
retrieved.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">start</td>
<td valign="top">The earliest date from which change logs are to be
included in the report.</td>
<td align="center" valign="top">No</td>
<td>start</td>
<td>The earliest date from which change logs are to be included in the report.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">end</td>
<td valign="top">The latest date to which change logs are to be
included in the report.</td>
<td align="center" valign="top">No</td>
<td>end</td>
<td>The latest date to which change logs are to be included in the report.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">remote</td>
<td valign="top">If set to true, works against the repository
(using rlog) without a working copy. Default is
false. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No</td>
<td>remote</td>
<td>If set to true, works against the repository (using <code>rlog</code>) without a working
copy. <em>Since Ant 1.8.0</em></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">startTag</td>
<td valign="top">The start of a tag range. If endTag is also
specified, they must both be on the same branch. If endTag is not
specified, the end of the range will be the latest on the same
branch on which startTag lives. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No</td>
<td>startTag</td>
<td>The start of a tag range. If <var>endTag</var> is also specified, they must both be on the
same branch. If <var>endTag</var> is not specified, the end of the range will be the latest on
the same branch on which <var>startTag</var> lives. <em>Since Ant 1.8.0</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">endTag</td>
<td valign="top">The end of a tag range. If startTag is also
specified, they must both be on the same branch. If startTag is
not specified, the start of the range will be the top of the
branch on which endTag lives. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No</td>
<td>endTag</td>
<td>The end of a tag range. If <var>startTag</var> is also specified, they must both be on the
same branch. If <var>startTag</var> is not specified, the start of the range will be the top
of the branch on which <var>endTag</var> lives. <em>Since Ant 1.8.0</em></td>
<td>No</td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>
<h4 id="user">user</h4>
<p>The nested <code>&lt;user&gt;</code> element allows you to specify a
mapping between a user ID as it appears on the CVS server and a name to
include in the formatted report.
Anytime the specified user ID has made a change in the repository, the
<code>&lt;author&gt;</code> tag in the report file will include
the name specified in <code>displayname</code> rather than the user ID.
</p>
<p>The nested <code>&lt;user&gt;</code> element allows you to specify a mapping between a user ID as
it appears on the CVS server and a name to include in the formatted report. Anytime the specified
user ID has made a change in the repository, the <code>&lt;author&gt;</code> tag in the report file
will include the name specified in <var>displayname</var> rather than the user ID.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">displayname</td>
<td valign="top">The name to be used in the CVS change log report.</td>
<td valign="top" align="center">Yes</td>
<td>displayname</td>
<td>The name to be used in the CVS change log report.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">userid</td>
<td valign="top">The userid of the person as it exists on the CVS server.
<td>userid</td>
<td>The user ID of the person as it exists on the CVS server.
</td>
<td valign="top" align="center">Yes</td>
<td>Yes</td>
</tr>
</table>

<h4>module</h4>

<p>Specifies a package/module to work on, unlike the package attribute
modules specified using this attribute can contain spaces in their
name.</p>
<p>Specifies a package/module to work on, unlike the package attribute modules specified using this
attribute can contain spaces in their name.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The module's/package's name.</td>
<td align="center" valign="top">Yes.</td>
<td>name</td>
<td>The module's/package's name.</td>
<td>Yes</td>
</tr>
</table>

<h3>Examples</h3>
<pre> &lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;/&gt;</pre>
<pre>
&lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;/&gt;</pre>

<p>Generates a change log report for all the changes that have been made
under the <code>dve/network</code> directory.
It writes these changes into the file <code>changelog.xml</code>.</p>
<p>Generates a change log report for all the changes that have been made under
the <samp>dve/network</samp> directory. It writes these changes into the
file <samp>changelog.xml</samp>.</p>

<pre> &lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;
daysinpast=&quot;10&quot;/&gt;</pre>
<pre>
&lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;
daysinpast=&quot;10&quot;/&gt;</pre>

<p>Generates a change log report for any changes that were made
under the <code>dve/network</code> directory in the past 10 days.
It writes these changes into the file <code>changelog.xml</code>.</p>
<p>Generates a change log report for any changes that were made under the <samp>dve/network</samp>
directory in the past 10 days. It writes these changes into the
file <samp>changelog.xml</samp>.</p>

<pre> &lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;
start=&quot;20 Feb 2002&quot;
end=&quot;20 Mar 2002&quot;/&gt;</pre>
<pre>
&lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;
start=&quot;20 Feb 2002&quot;
end=&quot;20 Mar 2002&quot;/&gt;</pre>

<p>Generates a change log report for any changes that were made
between February 20, 2002 and March 20, 2002
under the <code>dve/network</code> directory.
It writes these changes into the file <code>changelog.xml</code>.</p>
<p>Generates a change log report for any changes that were made between February 20, 2002 and March
20, 2002 under the <samp>dve/network</samp> directory. It writes these changes into the
file <samp>changelog.xml</samp>.</p>

<pre> &lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;
start=&quot;20 Feb 2002&quot;/&gt;</pre>
<pre>
&lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;
start=&quot;20 Feb 2002&quot;/&gt;</pre>

<p>Generates a change log report for any changes that were made
after February 20, 2002 under the <code>dve/network</code> directory.
It writes these changes into the file <code>changelog.xml</code>.</p>
<p>Generates a change log report for any changes that were made after February 20, 2002 under
the <samp>dve/network</samp> directory. It writes these changes into the
file <samp>changelog.xml</samp>.</p>

<pre> &lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;&gt;
&lt;user displayname=&quot;Peter Donald&quot; userid=&quot;donaldp&quot;/&gt;
&lt;/cvschangelog&gt;</pre>
<pre>
&lt;cvschangelog dir=&quot;dve/network&quot;
destfile=&quot;changelog.xml&quot;&gt;
&lt;user displayname=&quot;Peter Donald&quot; userid=&quot;donaldp&quot;/&gt;
&lt;/cvschangelog&gt;</pre>

<p>Generates a change log report for all the changes that were made
under the <code>dve/network</code> directory, substituting the name
&quot;Peter Donald&quot; in the <code>&lt;author&gt;</code> tags
anytime it encounters a change made by the user ID &quot;donaldp&quot;.
It writes these changes into the file <code>changelog.xml</code>.</p>
<p>Generates a change log report for all the changes that were made under
the <code>dve/network</code> directory, substituting the name <samp>Peter Donald</samp> in
the <code>&lt;author&gt;</code> tags anytime it encounters a change made by the user
ID <samp>donaldp</samp>. It writes these changes into the file <samp>changelog.xml</samp>.</p>

<p>Generates a change log report on the <code>ANT_16_BRANCH</code>.</p>
<pre>
&lt;cvschangelog dir=&quot;c:/dev/asf/ant.head&quot; passfile=&quot;c:/home/myself/.cvspass&quot;
destfile=&quot;changelogant.xml&quot; tag=&quot;ANT_16_BRANCH&quot;/&gt;
</pre>
&lt;cvschangelog dir=&quot;c:/dev/asf/ant.head&quot; passfile=&quot;c:/home/myself/.cvspass&quot;
destfile=&quot;changelogant.xml&quot; tag=&quot;ANT_16_BRANCH&quot;/&gt;</pre>
<h4>Generate Report</h4>
<p>Ant includes a basic XSLT stylesheet that you can use to generate
a HTML report based on the xml output. The following example illustrates
how to generate a HTML report from the XML report.</p>
<p>Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the xml
output. The following example illustrates how to generate a HTML report from the XML report.</p>

<pre>
&lt;style in="changelog.xml"
out="changelog.html"
style="${ant.home}/etc/changelog.xsl"&gt;
&lt;param name="title" expression="Ant ChangeLog"/&gt;
&lt;param name="module" expression="ant"/&gt;
&lt;param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/&gt;
&lt;/style&gt;
</pre>
&lt;style in="changelog.xml"
out="changelog.html"
style="${ant.home}/etc/changelog.xsl"&gt;
&lt;param name="title" expression="Ant ChangeLog"/&gt;
&lt;param name="module" expression="ant"/&gt;
&lt;param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/&gt;
&lt;/style&gt;</pre>

<h4>Sample Output</h4>
<pre>
@@ -279,8 +265,7 @@ how to generate a HTML report from the XML report.</p>

This allows templates to be stored inside jar]]&gt;&lt;/msg&gt;
&lt;/entry&gt;
&lt;/changelog&gt;
</pre>
&lt;/changelog&gt;</pre>

</body>
</html>

+ 127
- 155
manual/Tasks/checksum.html View File

@@ -26,110 +26,92 @@

<h2 id="checksum">Checksum</h2>
<h3>Description</h3>
<p>
Generates checksum for files. This task can also be used to
perform checksum verifications.
</p>

<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 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="http://www.bouncycastle.org/">The Legion of the Bouncy
Castle</a>, the <a href="http://www.gnu.org/software/gnu-crypto/">GNU
project</a> or <a
href="http://jce.iaik.tugraz.at/products/01_jce/index.php">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 for "SHA1", you get a .SHA1 extension; if you ask for "sha1", you
get a file ending in .sha1. The Java Crypto Engines are case-insensitive
in matching algorithms, so choose a name to match your desired output extension,
or set the <tt>fileext</tt> attribute. The names of common hashing algorithms can be located on the
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest">Cryptography Architecture Standard Algorithm Name Documentation</a>
</p>
<p>Generates checksum for files. This task can also be used to perform checksum verifications.</p>

<p>Note that many popular message digest functions&mdash;including MD5 and SHA-1&mdash;have been
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
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>

<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
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>
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to generate checksum for.</td>
<td valign="top" align="center">Yes, unless
at least one nested (filesystem-only) resource collection is specified.</td>
<td>file</td>
<td>The file to generate checksum for.</td>
<td>Yes, unless at least one nested (filesystem-only) resource collection is specified.</td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">The root directory where checksums should be written.</td>
<td valign="top" align="center">No. If not specified, checksum files
will be written to the same directory as the files themselves.
<em>since Apache Ant 1.6</em>
<td>todir</td>
<td>The root directory where checksums should be written.</td>
<td>No. If not specified, checksum files will be written to the same directory as the files
themselves. <em>since Apache Ant 1.6</em>
</td>
</tr>
<tr>
<td valign="top">algorithm</td>
<td valign="top">Specifies the algorithm to be used to
compute the checksum. Defaults to &quot;MD5&quot;.
Other <a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest">popular algorithms</a> like &quot;SHA&quot; or &quot;SHA-512&quot; may be used
as well.
<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>
<td valign="top" align="center">No</td>
<td>No; defaults to <q>MD5</q></td>
</tr>
<tr>
<td valign="top">provider</td>
<td valign="top">Specifies the provider of the algorithm.</td>
<td valign="top" align="center">No</td>
<td>provider</td>
<td>Specifies the provider of the algorithm.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">fileext</td>
<td valign="top">The generated checksum file's name will be the
original filename with the fileext added to it.
Defaults to a "." and the algorithm name being used.
<td>fileext</td>
<td>The generated checksum file's name will be the original filename with the <var>fileext</var>
added to it.
</td>
<td valign="top" align="center">No</td>
<td>No; defaults to a <q>.</q> and the algorithm name being used</td>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">This attribute can mean two different things, it
depends on the presence of the verifyproperty attribute.<br>
<b>If you don't set the verifyproperty attribute</b>, property
specifies the name of the property to be set with the generated
checksum value.<br>
<b>If you set the verifyproperty attribute</b>, property specifies
the checksum you expect to be generated (the checksum itself, not
a name of a property containing the checksum).<br>
This cannot be specified when fileext is being used or when the
number of files for which checksums is to be generated is greater
than 1.
<td>property</td>
<td>This attribute can mean two different things, it depends on the presence of
the <var>verifyproperty</var> attribute.<br/><strong>If you don't set</strong>
the <var>verifyproperty</var> attribute, property specifies the name of the property to be set
with the generated checksum value.<br/><strong>If you set</strong>
the <var>verifyproperty</var> attribute, property specifies the checksum you expect to be
generated (the checksum itself, not a name of a property containing the checksum).<br> This
cannot be specified when <var>fileext</var> is being used or when the number of files for
which checksums are to be generated is greater than 1.
</td>
<td valign="top" align="center">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">pattern</td>
<td valign="top">Specifies the pattern to use as a pattern
suitable
for <a href="http://download.oracle.com/javase/6/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 basedir and <code>{4}</code> with the absolute
path of the file.</td>
<td valign="top" align="center">No - default is &quot;{0}&quot;.</td>
<td>pattern</td>
<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>
<td>No; default is <q>{0}</q></td>
</tr>
<tr>
<td valign="top">format</td>
<td valign="top">Specifies the pattern to use as one of a
well-known format. Supported values are
<td>format</td>
<td>Specifies the pattern to use as one of a well-known format. Supported values are
<table>
<tr>
<th>name</th>
@@ -138,111 +120,103 @@ or set the <tt>fileext</tt> attribute. The names of common hashing algorithms ca
</tr>
<tr>
<td>CHECKSUM</td>
<td><tt>{0}</tt></td>
<td><code>{0}</code></td>
<td>only the checksum itself</td>
</tr>
<tr>
<td>MD5SUM</td>
<td><tt>{0} *{1}</tt></td>
<td>the format of GNU textutils md5sum</td>
<td><code>{0} *{1}</code></td>
<td>the format of GNU textutils <code>md5sum</code></td>
</tr>
<tr>
<td>SVF</td>
<td><tt>MD5 ({1}) = {0}</tt></td>
<td>the format of BSDs md5 command</td>
<td><code>MD5 ({1}) = {0}</code></td>
<td>the format of BSD <code>md5</code> command</td>
</tr>
</table>
<em>Since Ant 1.7.0</em>
</td>
<td valign="top" align="center">No - default is &quot;CHECKSUM&quot;.</td>
<em>Since Ant 1.7.0</em></td>
<td>No; default is <q>CHECKSUM</q></td>
</tr>
<tr>
<td valign="top">totalproperty</td>
<td valign="top">If specified, this attribute specifies the name of
the property that will hold a checksum of all the checksums and
file paths. The individual checksums and the relative paths to the files
within the resource collections in which they are defined will be used to
compute this checksum. (The file separators in the paths will be
converted to '/' before computation to ensure platform portability).
<em>since Ant 1.6</em>
</td>
<td valign="top" align="center">No</td>
<td>totalproperty</td>
<td>If specified, this attribute specifies the name of the property that will hold a checksum of
all the checksums and file paths. The individual checksums and the relative paths to the files
within the resource collections in which they are defined will be used to compute this
checksum. (The file separators in the paths will be converted to <q>/</q> before computation
to ensure platform portability). <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">forceoverwrite</td>
<td valign="top">Overwrite existing files even if the destination
files are newer. Defaults to &quot;no&quot;.</td>
<td valign="top" align="center">No</td>
<td>forceoverwrite</td>
<td>Overwrite existing files even if the destination files are newer.</td>
<td>No; defaults to <q>no</q></td>
</tr>
<tr>
<td valign="top">verifyproperty</td>
<td valign="top">Specifies the name of the property to be set
with &quot;true&quot; or &quot;false&quot; depending upon whether
the generated checksum matches the existing checksum. When
this is set, the generated checksum is not written to a file or
property, but rather, the content of the file or property is used to
check against the generated checksum.
<td valign="top" align="center">No</td>
<td>verifyproperty</td>
<td>Specifies the name of the property to be set with <q>true</q> or <q>false</q> depending upon
whether the generated checksum matches the existing checksum. When this is set, the generated
checksum is not written to a file or property, but rather, the content of the file or property
is used to check against the generated checksum.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">readbuffersize</td>
<td valign="top">The size of the buffer (in bytes) to use when
reading a file. Defaults to &quot;8192&quot; - you may get a
better performance on big files if you increase this value.</td>
<td valign="top" align="center">No</td>
<td>readbuffersize</td>
<td>The size of the buffer (in bytes) to use when reading a file.</td>
<td>No; defaults to <q>8192</q>&mdash;you may get a better performance on big files if you
increase this value</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>

<h4>resource collection</h4>
<p>
<a href="../Types/resources.html#collection">Resource collections</a> are
used to select files for which checksums should be generated.
</p>
<p><a href="../Types/resources.html#collection">Resource collections</a> are used to select files
for which checksums should be generated.</p>

<h3>Examples</h3>
<p><b>Example 1</b></p>
<p><strong>Example 1</strong></p>
<pre>&lt;checksum file=&quot;foo.bar&quot;/&gt;</pre>
Generates a MD5 checksum for foo.bar and stores the checksum in the destination file
foo.bar.MD5. foo.bar.MD5 is overwritten only if foo.bar is newer than itself.
<p>Generates a MD5 checksum for <samp>foo.bar</samp> and stores the checksum in the destination
file <samp>foo.bar.MD5</samp>. <samp>foo.bar.MD5</samp> is overwritten only if <samp>foo.bar</samp>
is newer than itself.</p>

<p><b>Example 2</b></p>
<p><strong>Example 2</strong></p>
<pre>&lt;checksum file=&quot;foo.bar&quot; forceOverwrite=&quot;yes&quot;/&gt;</pre>
Generates a MD5 checksum for foo.bar and stores the checksum in foo.bar.MD5.
If foo.bar.MD5 already exists, it is overwritten.
<p>Generates a MD5 checksum for <samp>foo.bar</samp> and stores the checksum
in <samp>foo.bar.MD5</samp>. If <samp>foo.bar.MD5</samp> already exists, it is overwritten.</p>

<p><b>Example 3</b></p>
<p><strong>Example 3</strong></p>
<pre>&lt;checksum file=&quot;foo.bar&quot; property=&quot;foobarMD5&quot;/&gt;</pre>
Generates a MD5 checksum for foo.bar and stores it in the Project Property foobarMD5.
<p>Generates a MD5 checksum for <samp>foo.bar</samp> and stores it in the project
property <code>foobarMD5</code>.</p>

<p><b>Example 4</b></p>
<p><strong>Example 4</strong></p>
<pre>&lt;checksum file=&quot;foo.bar&quot; verifyProperty=&quot;isMD5ok&quot;/&gt;</pre>
Generates a MD5 checksum for foo.bar, compares it against foo.bar.MD5 and sets
isMD5ok to either true or false, depending upon the result.
<p>Generates a MD5 checksum for <samp>foo.bar</samp>, compares it against <samp>foo.bar.MD5</samp>
and sets <code>isMD5ok</code> to either <q>true</q> or <q>false</q>, depending upon the result.</p>

<p><b>Example 5</b></p>
<p><strong>Example 5</strong></p>
<pre>&lt;checksum file=&quot;foo.bar&quot; algorithm=&quot;SHA-512&quot; fileext=&quot;asc&quot;/&gt;</pre>
Generates a SHA-512 checksum for foo.bar and stores the checksum in the destination file
foo.bar.asc. foo.bar.asc is overwritten only if foo.bar is newer than itself.
<p>Generates a SHA-512 checksum for <samp>foo.bar</samp> and stores the checksum in the destination
file <samp>foo.bar.asc</samp>. <samp>foo.bar.asc</samp> is overwritten only if <samp>foo.bar</samp>
is newer than itself.</p>

<p><b>Example 6</b></p>
<pre>
&lt;checksum file=&quot;foo.bar&quot; property=&quot;${md5}&quot; verifyProperty=&quot;isEqual&quot;/&gt;
</pre>
Generates a MD5 checksum for foo.bar, compares it against the value of the property
md5, and sets isEqual to either true or false, depending upon the result.
<p><strong>Example 6</strong></p>
<pre>&lt;checksum file=&quot;foo.bar&quot; property=&quot;${md5}&quot; verifyProperty=&quot;isEqual&quot;/&gt;</pre>
<p>Generates a MD5 checksum for <samp>foo.bar</samp>, compares it against the value of the
property <code>md5</code>, and sets <code>isEqual</code> to either <q>true</q> or <q>false</q>,
depending upon the result.</p>

<p><b>Example 7</b></p>
<p><strong>Example 7</strong></p>
<pre>
&lt;checksum&gt;
&lt;fileset dir=&quot;.&quot;&gt;
&lt;include name=&quot;foo*&quot;/&gt;
&lt;/fileset&gt;
&lt;/checksum&gt;
</pre>
Works just like Example 1, but generates a .MD5 file for every file that begins with the name foo.
&lt;/checksum&gt;</pre>
<p>Works just like Example 1, but generates a <samp>.MD5</samp> file for every file that begins with
the name <samp>foo</samp>.</p>

<p><b>Example 8</b></p>
<p><strong>Example 8</strong></p>
<pre>
&lt;condition property=&quot;isChecksumEqual&quot;&gt;
&lt;checksum&gt;
@@ -250,16 +224,14 @@ Works just like Example 1, but generates a .MD5 file for every file that begins
&lt;include name=&quot;foo.bar&quot;/&gt;
&lt;/fileset&gt;
&lt;/checksum&gt;
&lt;/condition&gt;
</pre>
Works like Example 4, but only sets isChecksumEqual to true, if the
checksum matches - it will never be set to false. This example
demonstrates use with the Condition task.

<h3>Note:</h3>
When working with more than one file, if condition and/or verifyproperty is used,
the result will be true only if the checksums matched correctly for all files being
considered.
&lt;/condition&gt;</pre>
<p>Works like Example 4, but only sets <code>isChecksumEqual</code> to <q>true</q>, if the checksum
matches&mdash;it will never be set to <q>false</q>. This example demonstrates use with
the <code>condition</code> task.</p>

<h3>Note</h3>
<p>When working with more than one file, if condition and/or <var>verifyproperty</var> is used, the
result will be true only if the checksums matched correctly for all files being considered.</p>

</body>
</html>

+ 73
- 96
manual/Tasks/chgrp.html View File

@@ -28,120 +28,100 @@
<p><em>Since Apache Ant 1.6</em>.</p>
<h3>Description</h3>

<p>Changes the group of a file or all files inside specified
directories. Right now it has effect only under Unix. The group
attribute is equivalent to the corresponding argument for the chgrp
command.</p>

<p><a href="../Types/fileset.html">FileSet</a>s,
<a href="../Types/dirset.html">DirSet</a>s or <a
href="../Types/filelist.html">FileList</a>s can be specified using
nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
<code>&lt;filelist&gt;</code> elements.</p>

<p><em>Since Ant 1.7</em>, this task supports arbitrary <a
href="../Types/resources.html#collection">Resource Collection</a>s
as nested elements.</p>

<p>By default this task will use a single invocation of the underlying
chgrp command. If you are working on a large number of files this may
result in a command line that is too long for your operating system.
If you encounter such problems, you should set the maxparallel
attribute of this task to a non-zero value. The number to use highly
depends on the length of your file names (the depth of your directory
tree) and your operating system, so you'll have to experiment a
little. POSIX recommends command line length limits of at least 4096
characters, this may give you an approximation for the number you
could use as initial value for these experiments.</p>

<p>By default this task won't do anything unless it detects it is
running on a Unix system. If you know for sure that you have a
"chgrp" executable on your PATH that is command line compatible with
the Unix command, you can use the task's os attribute and set its
value to your current os.</p>
<p>Changes the group of a file or all files inside specified directories. Right now it has effect
only under Unix. The group attribute is equivalent to the corresponding argument for
the <code>chgrp</code> command.</p>

<p><a href="../Types/fileset.html">FileSet</a>s, <a href="../Types/dirset.html">DirSet</a>s
or <a href="../Types/filelist.html">FileList</a>s can be specified using
nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and <code>&lt;filelist&gt;</code>
elements.</p>

<p><em>Since Ant 1.7</em>, this task supports
arbitrary <a href="../Types/resources.html#collection">Resource Collection</a>s as nested
elements.</p>

<p>By default this task will use a single invocation of the underlying <code>chgrp</code> command.
If you are working on a large number of files this may result in a command line that is too long for
your operating system. If you encounter such problems, you should set the <var>maxparallel</var>
attribute of this task to a non-zero value. The number to use highly depends on the length of your
file names (the depth of your directory tree) and your operating system, so you'll have to
experiment a little. POSIX recommends command line length limits of at least 4096 characters, this
may give you an approximation for the number you could use as initial value for these
experiments.</p>

<p>By default this task won't do anything unless it detects it is running on a Unix system. If you
know for sure that you have a <code>chgrp</code> executable on your <code>PATH</code> that is
command line compatible with the Unix command, you can use the task's <var>os</var> attribute and
set its value to your current OS.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file or directory of which the group must be
changed.</td>
<td valign="top" align="center">Yes, unless nested
<code>&lt;fileset|filelist|dirset&gt;</code>
elements are specified</td>
<td>file</td>
<td>the file or directory of which the group must be changed.</td>
<td>Yes, unless nested <code>&lt;fileset|filelist|dirset&gt;</code> elements are specified</td>
</tr>
<tr>
<td valign="top">group</td>
<td valign="top">the new group.</td>
<td valign="top" align="center">Yes</td>
<td>group</td>
<td>the new group.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">parallel</td>
<td valign="top">process all specified files using a single
<code>chgrp</code> command. Defaults to true.</td>
<td valign="top" align="center">No</td>
<td>parallel</td>
<td>process all specified files using a single <code>chgrp</code> command.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of <i>file</i>, <i>dir</i> or
<i>both</i>. If set to <i>file</i>, only the group of
plain files are going to be changed. If set to <i>dir</i>, only
the directories are considered.<br>
<strong>Note</strong>: The type attribute does not apply to
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
assume type to be <i>dir</i>.</td>
<td align="center" valign="top">No, default is <i>file</i></td>
<td>type</td>
<td>One of <q>file</q>, <q>dir</q> or <q>both</q>. If set to <q>file</q>, only the group of
plain files are going to be changed. If set to <q>dir</q>, only the directories are
considered.<br/><strong>Note</strong>: The type attribute does not apply to
nested <code>dirset</code>s&mdash;<code>dirset</code>s always implicitly assume type to
be <q>dir</q>.</td>
<td>No; default is <q>file</q></td>
</tr>
<tr>
<td valign="top">maxparallel</td>
<td valign="top">Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to &lt;= 0 for
unlimited. Defaults to unlimited.</td>
<td align="center" valign="top">No</td>

<td>maxparallel</td>
<td>Limit the amount of parallelism by passing at most this many sourcefiles at once. Set it to
negative integer for unlimited.</td>
<td>No; defaults to unlimited</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to print a summary after execution or not.
Defaults to <code>false</code>.</td>
<td align="center" valign="top">No</td>
<td>verbose</td>
<td>Whether to print a summary after execution or not.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed.</td>
<td align="center" valign="top">No</td>
<td>os</td>
<td>list of Operating Systems on which the command may be executed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in
the <a href="../Tasks/conditions.html#os">&lt;os&gt;</a>
<td>osfamily</td>
<td>OS family as used in the <a href="../Tasks/conditions.html#os">&lt;os&gt;</a>
condition.</td>
<td align="center" valign="top">No - defaults to "unix"</td>
<td>No; defaults to <q>unix</q></td>
</tr>

</table>
<h3>Examples</h3>
<pre>
&lt;chgrp file=&quot;${dist}/start.sh&quot; group=&quot;coders&quot;/&gt;
</pre>
<pre>&lt;chgrp file=&quot;${dist}/start.sh&quot; group=&quot;coders&quot;/&gt;</pre>

<p>makes the &quot;start.sh&quot; file belong to the coders group on a
UNIX system.</p>
<p>makes the <samp>start.sh</samp> file belong to the <samp>coders</samp> group on a UNIX
system.</p>

<pre>
&lt;chgrp group=&quot;coders&quot;&gt;
&lt;fileset dir=&quot;${dist}/bin&quot; includes=&quot;**/*.sh&quot;/&gt;
&lt;/chgrp&gt;
</pre>
&lt;/chgrp&gt;</pre>

<p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
belong to the coders group on a UNIX system.</p>
<p>makes all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to the <samp>coders</samp>
group on a UNIX system.</p>

<pre>
&lt;chgrp group=&quot;coders&quot;&gt;
@@ -152,13 +132,11 @@ belong to the coders group on a UNIX system.</p>
&lt;/chgrp&gt;
</pre>

<p>makes all files below <code>shared/sources1</code> (except those
below any directory named trial) belong to the coders group on a UNIX
system. In addition all files belonging to a FileSet
with <code>id</code> <code>other.shared.sources</code> get the same
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory
named <samp>trial</samp>) belong to the <samp>coders</samp> group on a UNIX system. In addition all
files belonging to a FileSet with <var>id</var> <samp>other.shared.sources</samp> get the same
group.</p>


<pre>
&lt;chgrp group=&quot;webdev&quot; type=&quot;file&quot;&gt;
&lt;fileset dir=&quot;/web&quot;&gt;
@@ -168,13 +146,12 @@ group.</p>
&lt;dirset dir=&quot;/web&quot;&gt;
&lt;include name=&quot;**/test_*&quot;/&gt;
&lt;/dirset&gt;
&lt;/chmod&gt;
</pre>
&lt;/chmod&gt;</pre>

<p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to
group webdev. Directories beginning with <code>test_</code> also will belong
to webdev, but if there is a directory that ends in <code>.new</code> or a file
that begins with <code>test_</code> it will be unaffected.</p>
<p>makes all <samp>.test.jsp</samp>, and <samp>.new</samp> files belong to
group <samp>webdev</samp>. Directories with names beginning with <samp>test_</samp> also will belong
to <samp>webdev</samp>, but if there is a directory name that ends in <samp>.new</samp> or a file
name that begins with <samp>test_</samp> it will be unaffected.</p>

</body>
</html>

+ 107
- 140
manual/Tasks/chmod.html View File

@@ -26,151 +26,129 @@

<h2 id="chmod">Chmod</h2>
<h3>Description</h3>
<p>Changes the permissions of a file or all files inside specified
directories. Right now it has effect only under Unix or NonStop Kernel (Tandem).
The permissions are also UNIX style, like the argument for the chmod command.</p>
<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>

<p>This task holds an implicit <a
href="../Types/fileset.html">FileSet</a> and supports all of
FileSet's attributes and nested elements directly. More sets can be
specified using nested <code>&lt;fileset&gt;</code> or
<code>&lt;dirset&gt;</code> (<em>since Apache Ant 1.6</em>) elements.</p>

<p><em>Since Ant 1.6</em>, this task also supports nested <a
href="../Types/filelist.html">filelist</a>s.</p>

<p><em>Since Ant 1.7</em>, this task supports arbitrary <a
href="../Types/resources.html#collection">Resource Collection</a>s
as nested elements.</p>

<p>By default this task will use a single invocation of the underlying
chmod command. If you are working on a large number of files this may
result in a command line that is too long for your operating system.
If you encounter such problems, you should set the maxparallel
attribute of this task to a non-zero value. The number to use highly
depends on the length of your file names (the depth of your directory
tree) and your operating system, so you'll have to experiment a
little. POSIX recommends command line length limits of at least 4096
characters, this may give you an approximation for the number you
could use as initial value for these experiments.</p>

<p>By default this task won't do anything unless it detects it is
running on a Unix system. If you know for sure that you have a
"chmod" executable on your PATH that is command line compatible with
the Unix command, you can use the task's os attribute and set its
value to your current os.</p>

<p>See the <a href="setpermissions.html">setpermissions</a> task for a
platform independent alternative.</p>
<p>Changes the permissions of a file or all files inside specified directories. Right now it has
effect only under Unix or NonStop Kernel (Tandem). The permissions are also UNIX style, like the
argument for the <code>chmod</code> command.</p>
<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>

<p>This task holds an implicit <a href="../Types/fileset.html">FileSet</a> and supports all of
FileSet's attributes and nested elements directly. More sets can be specified using
nested <code>&lt;fileset&gt;</code> or <code>&lt;dirset&gt;</code> (<em>since Apache Ant 1.6</em>)
elements.</p>

<p><em>Since Ant 1.6</em>, this task also supports
nested <a href="../Types/filelist.html">filelist</a>s.</p>

<p><em>Since Ant 1.7</em>, this task supports
arbitrary <a href="../Types/resources.html#collection">Resource Collection</a>s as nested
elements.</p>

<p>By default this task will use a single invocation of the underlying <code>chmod</code> command.
If you are working on a large number of files this may result in a command line that is too long for
your operating system. If you encounter such problems, you should set the <var>maxparallel</var>
attribute of this task to a non-zero value. The number to use highly depends on the length of your
file names (the depth of your directory tree) and your operating system, so you'll have to
experiment a little. POSIX recommends command line length limits of at least 4096 characters, this
may give you an approximation for the number you could use as initial value for these
experiments.</p>

<p>By default this task won't do anything unless it detects it is running on a Unix system. If you
know for sure that you have a <code>chmod</code> executable on your <code>PATH</code> that is
command line compatible with the Unix command, you can use the task's <var>os</var> attribute and
set its value to your current OS.</p>

<p>See the <a href="setpermissions.html">setpermissions</a> task for a platform independent
alternative.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file or single directory of which the permissions
must be changed.</td>
<td valign="top" align="center" rowspan="2">Exactly one of the two, or nested <code>&lt;fileset/list&gt;</code>s</td>
<td>file</td>
<td>the file or single directory of which the permissions must be changed.</td>
<td rowspan="2">Exactly one of the two, or nested <code>&lt;fileset/list&gt;</code>s</td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">the directory which holds the files whose permissions
must be changed.<br/>
<strong>Note</strong>: for backwards compatibility
reasons <code>&lt;chmod&nbsp;dir="some-dir"/&gt;</code> will
only change the permissions on "some-dir" but not recurse into
it, unless you also specify any patterns.</td>
<td>dir</td>
<td class="left">the directory which holds the files whose permissions must be
changed.<br/><strong>Note</strong>: for backwards compatibility reasons <code>&lt;chmod
dir="some-dir"/&gt;</code> will only change the permissions on <samp>some-dir</samp> but not
recurse into it, unless you also specify any patterns.</td>
</tr>
<tr>
<td valign="top">perm</td>
<td valign="top">the new permissions.</td>
<td valign="top" align="center">Yes</td>
<td>perm</td>
<td>the new permissions.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">parallel</td>
<td valign="top">process all specified files using a single
<code>chmod</code> command. Defaults to true.</td>
<td valign="top" align="center">No</td>
<td>parallel</td>
<td>process all specified files using a single <code>chmod</code> command.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of <i>file</i>, <i>dir</i> or
<i>both</i>. If set to <i>file</i>, only the permissions of
plain files are going to be changed. If set to <i>dir</i>, only
the directories are considered.<br>
<strong>Note</strong>: The type attribute does not apply to
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
assume type to be <i>dir</i>.</td>
<td align="center" valign="top">No, default is <i>file</i></td>
<td>type</td>
<td>One of <q>file</q>, <q>dir</q> or <q>both</q>. If set to <q>file</q>, only the permissions
of plain files are going to be changed. If set to <q>dir</q>, only the directories are
considered.<br/><strong>Note</strong>: The type attribute does not apply to
nested <code>dirset</code>s&mdash;<code>dirset</code>s always implicitly assume type to
be <q>dir</q>.</td>
<td>No; default is <q>file</q></td>
</tr>
<tr>
<td valign="top">maxparallel</td>
<td valign="top">Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to &lt;= 0 for
unlimited. Defaults to unlimited. <em>Since Ant 1.6</em>.</td>
<td align="center" valign="top">No</td>
<td>maxparallel</td>
<td>Limit the amount of parallelism by passing at most this many sourcefiles at once. Set it to
negative integer for unlimited. <em>Since Ant 1.6</em>.</td>
<td>No; defaults to unlimited</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to print a summary after execution or not.
Defaults to <code>false</code>. <em>Since Ant 1.6</em>.</td>
<td align="center" valign="top">No</td>
<td>verbose</td>
<td>Whether to print a summary after execution or not. <em>Since Ant 1.6</em>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed.</td>
<td align="center" valign="top">No</td>
<td>os</td>
<td>list of Operating Systems on which the command may be executed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in
the <a href="conditions.html#os">&lt;os&gt;</a> condition.</td>
<td align="center" valign="top">No - defaults to "unix"</td>
<td>osfamily</td>
<td>OS family as used in the <a href="conditions.html#os">&lt;os&gt;</a> condition.</td>
<td>No; defaults to <q>unix</q></td>
</tr>
</table>
<h3>Examples</h3>
<pre>
&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;/&gt;
</pre>
<p>makes the &quot;start.sh&quot; file readable and executable for anyone on a
UNIX system.</p>
<pre>
&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;700&quot;/&gt;
</pre>
<p>makes the &quot;start.sh&quot; file readable, writable and executable only for the owner on a
<pre>&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;/&gt;</pre>
<p>makes the <samp>start.sh</samp> file readable and executable for anyone on a UNIX system.</p>

<pre>&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;700&quot;/&gt;</pre>
<p>makes the <samp>start.sh</samp> file readable, writable and executable only for the owner on a
UNIX system.</p>

<pre>
&lt;chmod dir=&quot;${dist}/bin&quot; perm=&quot;ugo+rx&quot;
includes=&quot;**/*.sh&quot;/&gt;
</pre>
<p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
readable and executable for anyone on a UNIX system.</p>
includes=&quot;**/*.sh&quot;/&gt;</pre>
<p>makes all <samp>.sh</samp> files below <samp>${dist}/bin</samp> readable and executable for
anyone on a UNIX system.</p>

<pre>
&lt;chmod perm=&quot;g+w&quot;&gt;
@@ -178,13 +156,11 @@ readable and executable for anyone on a UNIX system.</p>
&lt;exclude name=&quot;**/trial/**&quot;/&gt;
&lt;/fileset&gt;
&lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
&lt;/chmod&gt;
</pre>
<p>makes all files below <code>shared/sources1</code> (except those
below any directory named trial) writable for members of the same
group on a UNIX system. In addition all files belonging to a FileSet
with <code>id</code> <code>other.shared.sources</code> get the same
permissions.</p>
&lt;/chmod&gt;</pre>
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory named trial)
writable for members of the same group on a UNIX system. In addition all files belonging to a
FileSet with <var>id</var> <samp>other.shared.sources</samp> get the same permissions.</p>

<pre>
&lt;chmod perm=&quot;go-rwx&quot; type=&quot;file&quot;&gt;
&lt;fileset dir=&quot;/web&quot;&gt;
@@ -194,26 +170,17 @@ permissions.</p>
&lt;dirset dir=&quot;/web&quot;&gt;
&lt;include name=&quot;**/private_*&quot;/&gt;
&lt;/dirset&gt;
&lt;/chmod&gt;
</pre>
<p>keeps non-owners from touching cgi scripts, files with a <code>.old</code>
extension or directories beginning with <code>private_</code>. A directory
ending in <code>.old</code> or a file beginning with private_ would remain
unaffected.</p>

<h3>Note on maxparallel attribute</h3>
<p>
Some shells have a limit of the number of characters that
a command line may contain.
This maximum limit varies from shell to shell and from operating
system to operating system.
If one has a large number of files to change mode on, consider
using the <em>maxparallel</em> attribute. For example
when using AIX and the limit is reached, the system responds
with a warning: "Warning:
UNIXProcess.forkAndExec native error: The parameter or environment lists
are too long". A value of about 300 seems to result in a
command line that is acceptable.
</p>
&lt;/chmod&gt;</pre>
<p>keeps non-owners from touching cgi scripts, files with a <samp>.old</samp> extension or
directories beginning with <samp>private_</samp>. A directory ending in <samp>.old</samp> or a file
beginning with <samp>private_</samp> would remain unaffected.</p>

<h3>Note on <var>maxparallel</var> attribute</h3>
<p>Some shells have a limit of the number of characters that a command line may contain. This
maximum limit varies from shell to shell and from operating system to operating system. If one has
a large number of files to change mode on, consider using the <var>maxparallel</var> attribute. For
example when using AIX and the limit is reached, the system responds with a warning: <code>"Warning:
UNIXProcess.forkAndExec native error: The parameter or environment lists are too long"</code>. A
value of about 300 seems to result in a command line that is acceptable.</p>
</body>
</html>

+ 74
- 97
manual/Tasks/chown.html View File

@@ -28,117 +28,99 @@
<p><em>Since Apache Ant 1.6</em>.</p>
<h3>Description</h3>

<p>Changes the owner of a file or all files inside specified
directories. Right now it has effect only under Unix. The owner
attribute is equivalent to the corresponding argument for the chown
command.</p>

<p><a href="../Types/fileset.html">FileSet</a>s,
<a href="../Types/dirset.html">DirSet</a>s or <a
href="../Types/filelist.html">FileList</a>s can be specified using
nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
<code>&lt;filelist&gt;</code> elements.</p>

<p><em>Since Ant 1.7</em>, this task supports arbitrary <a
href="../Types/resources.html#collection">Resource Collection</a>s
as nested elements.</p>

<p>By default this task will use a single invocation of the underlying
chown command. If you are working on a large number of files this may
result in a command line that is too long for your operating system.
If you encounter such problems, you should set the maxparallel
attribute of this task to a non-zero value. The number to use highly
depends on the length of your file names (the depth of your directory
tree) and your operating system, so you'll have to experiment a
little. POSIX recommends command line length limits of at least 4096
characters, this may give you an approximation for the number you
could use as initial value for these experiments.</p>

<p>By default this task won't do anything unless it detects it is
running on a Unix system. If you know for sure that you have a
"chown" executable on your PATH that is command line compatible with
the Unix command, you can use the task's os attribute and set its
value to your current os.</p>
<p>Changes the owner of a file or all files inside specified directories. Right now it has effect
only under Unix. The owner attribute is equivalent to the corresponding argument for
the <code>chown</code> command.</p>

<p><a href="../Types/fileset.html">FileSet</a>s, <a href="../Types/dirset.html">DirSet</a>s
or <a href="../Types/filelist.html">FileList</a>s can be specified using
nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and <code>&lt;filelist&gt;</code>
elements.</p>

<p><em>Since Ant 1.7</em>, this task supports
arbitrary <a href="../Types/resources.html#collection">Resource Collection</a>s as nested
elements.</p>

<p>By default this task will use a single invocation of the underlying <code>chown</code> command.
If you are working on a large number of files this may result in a command line that is too long for
your operating system. If you encounter such problems, you should set the <var>maxparallel</var>
attribute of this task to a non-zero value. The number to use highly depends on the length of your
file names (the depth of your directory tree) and your operating system, so you'll have to
experiment a little. POSIX recommends command line length limits of at least 4096 characters, this
may give you an approximation for the number you could use as initial value for these
experiments.</p>

<p>By default this task won't do anything unless it detects it is running on a Unix system. If you
know for sure that you have a <code>chown</code> executable on your <code>PATH</code> that is
command line compatible with the Unix command, you can use the task's os attribute and set its value
to your current os.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file or directory of which the owner must be
<td>file</td>
<td>the file or directory of which the owner must be
changed.</td>
<td valign="top" align="center">Yes or nested
<td>Yes or nested
<code>&lt;fileset/list&gt;</code> elements.</td>
</tr>
<tr>
<td valign="top">owner</td>
<td valign="top">the new owner.</td>
<td valign="top" align="center">Yes</td>
<td>owner</td>
<td>the new owner.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">parallel</td>
<td valign="top">process all specified files using a single
<code>chown</code> command. Defaults to true.</td>
<td valign="top" align="center">No</td>
<td>parallel</td>
<td>process all specified files using a single <code>chown</code> command.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of <i>file</i>, <i>dir</i> or
<i>both</i>. If set to <i>file</i>, only the owner of
plain files are going to be changed. If set to <i>dir</i>, only
the directories are considered.<br>
<strong>Note</strong>: The type attribute does not apply to
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
assume type to be <i>dir</i>.</td>
<td align="center" valign="top">No, default is <i>file</i></td>
<td>type</td>
<td>One of <q>file</q>, <q>dir</q> or <q>both</q>. If set to <q>file</q>, only the owner of
plain files are going to be changed. If set to <q>dir</q>, only the directories are
considered.<br/><strong>Note</strong>: The <var>type</var> attribute does not apply to
nested <code>dirset</code>s&mdash;<code>dirset</code>s always implicitly assume type to
be <q>dir</q>.</td>
<td>No; default is <q>file</q></td>
</tr>
<tr>
<td valign="top">maxparallel</td>
<td valign="top">Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to &lt;= 0 for
unlimited. Defaults to unlimited.</td>
<td align="center" valign="top">No</td>

<td>maxparallel</td>
<td>Limit the amount of parallelism by passing at most this many sourcefiles at once. Set it to
negative integer for unlimited.</td>
<td>No; defaults to unlimited</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to print a summary after execution or not.
Defaults to <code>false</code>.</td>
<td align="center" valign="top">No</td>
<td>verbose</td>
<td>Whether to print a summary after execution or not.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed.</td>
<td align="center" valign="top">No</td>
<td>os</td>
<td>list of Operating Systems on which the command may be executed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in
the <a href="../Tasks/conditions.html#os">&lt;os&gt;</a>
<td>osfamily</td>
<td>OS family as used in the <a href="../Tasks/conditions.html#os">&lt;os&gt;</a>
condition.</td>
<td align="center" valign="top">No - defaults to "unix"</td>
<td>No; defaults to <q>unix</q></td>
</tr>

</table>
<h3>Examples</h3>
<pre>
&lt;chown file="${dist}/start.sh" owner="coderjoe"/&gt;
</pre>
<p>makes the "start.sh" file belong to coderjoe on a
UNIX system.</p>
<pre>&lt;chown file="${dist}/start.sh" owner="coderjoe"/&gt;</pre>
<p>makes the <samp>start.sh</samp> file belong to <samp>coderjoe</samp> on a UNIX system.</p>

<pre>
&lt;chown owner="coderjoe"&gt;
&lt;fileset dir="${dist}/bin" includes="**/*.sh"/&gt;
&lt;/chown&gt;
</pre>
<p>makes all ".sh" files below <code>${dist}/bin</code>
belong to coderjoe on a UNIX system.</p>
&lt;chown owner="coderjoe"&gt;
&lt;fileset dir="${dist}/bin" includes="**/*.sh"/&gt;
&lt;/chown&gt;</pre>
<p>makes all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to <samp>coderjoe</samp>
on a UNIX system.</p>

<pre>
&lt;chown owner="coderjoe"&gt;
@@ -146,13 +128,10 @@ belong to coderjoe on a UNIX system.</p>
&lt;exclude name="**/trial/**"/&gt;
&lt;/fileset&gt;
&lt;fileset refid="other.shared.sources"/&gt;
&lt;/chown&gt;
</pre>
<p>makes all files below <code>shared/sources1</code> (except those
below any directory named trial) belong to coderjoe on a UNIX
system. In addition all files belonging to a FileSet
with <code>id</code> <code>other.shared.sources</code> get the same
owner.</p>
&lt;/chown&gt;</pre>
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory
named <samp>trial</samp>) belong to <samp>coderjoe</samp> on a UNIX system. In addition all files
belonging to a FileSet with <var>id</var> <code>other.shared.sources</code> get the same owner.</p>

<pre>
&lt;chown owner="webadmin" type="file"&gt;
@@ -163,12 +142,10 @@ owner.</p>
&lt;dirset dir="/web"&gt;
&lt;include name="**/private_*"/&gt;
&lt;/dirset&gt;
&lt;/chmod&gt;
</pre>
<p>makes cgi scripts, files with a <code>.old</code> extension or
directories beginning with <code>private_</code> belong to the user named
webadmin. A directory ending in <code>.old</code> or a file beginning with
<code>private_</code> would remain unaffected.</p>
&lt;/chmod&gt;</pre>
<p>makes <samp>cgi</samp> scripts, files with a <samp>.old</samp> extension or directories beginning
with <samp>private_</samp> belong to the user named <samp>webadmin</samp>. A directory ending
in <samp>.old</samp> or a file beginning with <samp>private_</samp> would remain unaffected.</p>

</body>
</html>

+ 444
- 467
manual/Tasks/clearcase.html
File diff suppressed because it is too large
View File


+ 13
- 13
manual/Tasks/common.html View File

@@ -27,28 +27,28 @@
<h2 id="javac">Common Attributes of all Tasks</h2>
<p>All tasks share the following attributes:</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">id</td>
<td valign="top">Unique identifier for this task instance, can be
<td>id</td>
<td>Unique identifier for this task instance, can be
used to reference this task in scripts.</td>
<td valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">taskname</td>
<td valign="top">A different name for this task instance - will
<td>taskname</td>
<td>A different name for this task instance&mdash;will
show up in the logging output.</td>
<td valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">description</td>
<td valign="top">Room for your comments</td>
<td valign="top">No</td>
<td>description</td>
<td>Room for your comments</td>
<td>No</td>
</tr>
</table>



+ 18
- 29
manual/Tasks/componentdef.html View File

@@ -26,36 +26,25 @@

<h2 id="componentdef">componentdef</h2>
<h3>Description</h3>
<p>
Adds a component definition to the current project.
A component definition is the same as a
<a href="typedef.html">typedef</a> except:
</p>
<ol>
<li>
that it can only be used in other types or tasks that
accept components (by having an <i>add()</i> method).
</li>
<li>
multiple components may have the same name, provided they
implement different interfaces.
</li>
</ol>
<p>
The purpose of this is to allow internal Apache Ant definitions to be
made for tags like "and" or "or".
</p>
<p>Adds a component definition to the current project. A component definition is the same as
a <a href="typedef.html">typedef</a> except:</p>
<ol>
<li>that it can only be used in other types or tasks that accept components (by having
an <code>add()</code> method).</li>
<li>multiple components may have the same name, provided they implement different interfaces.</li>
</ol>
<p>The purpose of this is to allow internal Apache Ant definitions to be made for tags
like <samp>and</samp> or <samp>or</samp>.</p>

<h3>Examples</h3>
<h3>Examples</h3>

<pre> &lt;componentdef name="or" onerror="ignore"
classname="com.apache.tools.ant.taskdefs.conditions.Or"/&gt;
&lt;componentdef name="or" onerror="ignore"
classname="com.apache.tools.ant.types.resources.selectors.Or"/&gt;</pre>
<p>
defines two components with the same name "or"; one is a condition
(see <a href="conditions.html">conditions</a>) and one is
a selector (see <a href="../Types/selectors.html">selectors</a>).
</p>
<pre>
&lt;componentdef name="or" onerror="ignore"
classname="com.apache.tools.ant.taskdefs.conditions.Or"/&gt;
&lt;componentdef name="or" onerror="ignore"
classname="com.apache.tools.ant.types.resources.selectors.Or"/&gt;</pre>
<p>defines two components with the same name <samp>or</samp>; one is a condition
(see <a href="conditions.html">conditions</a>) and one is a selector
(see <a href="../Types/selectors.html">selectors</a>).</p>
</body>
</html>

+ 236
- 315
manual/Tasks/concat.html View File

@@ -16,319 +16,240 @@
-->
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>Concat</title>
</head>

<body>

<h2 id="concat">Concat</h2>

<h3>Description</h3>

<p>
Concatenates one or more
<a href="../Types/resources.html">resource</a>s
to a single file or to the console. The destination
file will be created if it does not exist unless the resource
list is empty and ignoreempty is true.
</p>

<p><em>Since Apache Ant 1.7.1</em>, this task can be used as a
<a href="../Types/resources.html#collection">Resource Collection</a>
that will return exactly one
<a href="../Types/resources.html">resource</a>.
</p>

<p>
<a href="../Types/resources.html#collection">
Resource Collection</a>s are used to
select which resources are to be concatenated. There is no
singular attribute to specify a single resource to cat.
</p>

<h3>Parameters</h3>

<table>

<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>

<tr>
<td valign="top">destfile</td>
<td valign="top">
The destination file for the concatenated stream.
If not specified the console will be used instead.
</td>
<td valign="top" align="center">
No
</td>
</tr>

<tr>
<td valign="top">append</td>
<td valign="top">
Specifies whether or not the file specified by 'destfile'
should be appended. Defaults to &quot;no&quot;.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">
Specifies whether or not the file specified by 'destfile'
should be written to even if it is newer than all source files.
<strong>deprecated, use the overwrite attribute instead</strong>
Defaults to &quot;yes&quot;.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">overwrite</td>
<td valign="top">
Specifies whether or not the file specified by 'destfile'
should be written to even if it is newer than all source files.
<em>Since Ant 1.8.2</em>.
Defaults to &quot;yes&quot;.
</td>
<td valign="top" align="center">No</td>
</tr>

<tr>
<td valign="top">forceReadOnly</td>
<td valign="top">Overwrite read-only destination
files. <em>Since Ant 1.8.2</em></td>
<td valign="top" align="center">No; defaults to false.</td>
</tr>

<tr>
<td valign="top">encoding</td>
<td valign="top">
Specifies the encoding for the input files. Please see <a
href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html">
Supported Encodings</a>
for a list of possible values. Defaults to the platform's
default character encoding.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">outputencoding</td>
<td valign="top">
The encoding to use when writing the output file.
<em>Since Ant 1.6</em>.
Defaults to the value of the encoding attribute
if given or the default JVM encoding otherwise.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">fixlastline</td>
<td valign="top">
Specifies whether or not to check if
each file concatenated is terminated by
a new line. If this attribute is &quot;yes&quot;
a new line will be appended to the stream if
the file did not end in a new line.
<em>Since Ant 1.6</em>.
Defaults to &quot;no&quot;.
This attribute does not apply to embedded text.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">eol</td>
<td valign="top">
Specifies what the end of line character are
for use by the fixlastline attribute.
<em>Since Ant 1.6</em>
Valid values for this property are:
<ul>
<li>cr: a single CR</li>
<li>lf: a single LF</li>
<li>crlf: the pair CRLF</li>
<li>mac: a single CR</li>
<li>unix: a single LF</li>
<li>dos: the pair CRLF</li>
</ul>
The default is platform dependent.
For Unix platforms, the default is &quot;lf&quot;.
For DOS based systems (including Windows),
the default is &quot;crlf&quot;.
For Mac OS, the default is &quot;cr&quot;.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">binary</td>
<td valign="top">
<em>Since Ant 1.6.2</em>
If this attribute is set to true, the task concatenates the files
in a byte by byte fashion. If this attribute is false, concat will
not normally work for binary files due to character encoding
issues.
If this option is set to true, the destfile attribute must be
set, and the task cannot used nested text.
Also the attributes encoding, outputencoding, filelastline
cannot be used.
The default is &quot;false&quot;.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">ignoreempty</td>
<td valign="top">
<em>Since Ant 1.8.0</em>
Specifies whether or not the file specified by 'destfile'
should be created if the source resource list is
empty. Defaults to &quot;true&quot;.
</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">resourcename</td>
<td valign="top">
<em>Since Ant 1.8.3</em>
Specifies the name reported if this task is exposed
as a <a href="../Types/resources.html">resource</a>.
</td>
<td valign="top" align="center">No</td>
</tr>

</table>

<h3>Parameters specified as nested elements</h3>
<h4>Resource Collection</h4>
<p><em>since Ant 1.7</em>.</p>

<p>
Any of the various <a href="../Types/resources.html#collection">
Resource Collection</a> types can specify the resources to be
concatenated.
</p>

<h4>filterchain</h4>
<p><em>since Ant 1.6</em>.</p>
<p>The concat task supports nested
<a href="../Types/filterchain.html"> FilterChain</a>s.</p>

<h4>header, footer</h4>
<p><em>since Ant 1.6</em>.</p>
<p>Used to prepend or postpend text into the concatenated stream.</p>
<p>The text may be in-line or be in a file.</p>
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">filtering</td>
<td valign="top">
Whether to filter the text provided by this sub element,
default is "yes".
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">A file to place at the head or tail of the
concatenated text.
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">trim</td>
<td valign="top">Whether to trim the value, default is "no"</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">trimleading</td>
<td valign="top">
Whether to trim leading white space on each line, default is "no"
</td>
<td valign="top" align="center">No</td>
</tr>
</table>

<h3>Examples</h3>

<p><b>Concatenate a string to a file:</b></p>

<pre>
&lt;concat destfile=&quot;README&quot;&gt;Hello, World!&lt;/concat&gt;
</pre>

<p><b>Concatenate a series of files to the console:</b></p>

<pre>
&lt;concat&gt;
&lt;fileset dir=&quot;messages&quot; includes=&quot;*important*&quot;/&gt;
&lt;/concat&gt;
</pre>

<p><b>Concatenate a single file, appending if the destination file exists:</b></p>

<pre>
&lt;concat destfile=&quot;NOTES&quot; append=&quot;true&quot;&gt;
&lt;filelist dir=&quot;notes&quot; files=&quot;note.txt&quot;/&gt;
&lt;/concat&gt;
</pre>

<p><b>Concatenate a series of files, update the destination
file only if is older that all the source files:</b></p>

<pre>
&lt;concat destfile=&quot;${docbook.dir}/all-sections.xml&quot;
force=&quot;no&quot;&gt;
&lt;filelist dir=&quot;${docbook.dir}/sections&quot;
files=&quot;introduction.xml,overview.xml&quot;/&gt;
&lt;fileset dir=&quot;${docbook.dir}&quot;
includes=&quot;sections/*.xml&quot;
excludes=&quot;introduction.xml,overview.xml&quot;/&gt;
&lt;/concat&gt;
</pre>

<p><b>Concatenate a series of files, expanding Ant properties</b></p>
<pre>
&lt;concat destfile="${build.dir}/subs"&gt;
&lt;path&gt;
&lt;fileset dir="${src.dir}" includes="*.xml"/&gt;
&lt;pathelement location="build.xml"/&gt;
&lt;/path&gt;
&lt;filterchain&gt;
&lt;expandproperties/&gt;
&lt;/filterchain&gt;
&lt;/concat&gt;
</pre>

<p><b>Filter the lines containing project from build.xml and output
them to report.output, prepending with a header</b></p>
<pre>
&lt;concat destfile="${build.dir}/report.output"&gt;
&lt;header filtering="no" trimleading="yes"&gt;
Lines that contain project
==========================
&lt;/header&gt;
&lt;path path="build.xml"/&gt;
&lt;filterchain&gt;
&lt;linecontains&gt;
&lt;contains value="project"/&gt;
&lt;/linecontains&gt;
&lt;/filterchain&gt;
&lt;/concat&gt;
</pre>

<p><b>Concatenate a number of binary files.</b></p>
<pre>
&lt;concat destfile="${build.dir}/dist.bin" binary="yes"&gt;
&lt;fileset file="${src.dir}/scripts/dist.sh" /&gt;
&lt;fileset file="${build.dir}/dist.tar.bz2" /&gt;
&lt;/concat&gt;
</pre>

</body>
<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>Concat</title>
</head>

<body>

<h2 id="concat">Concat</h2>

<h3>Description</h3>

<p>Concatenates one or more <a href="../Types/resources.html">resource</a>s to a single file or
to the console. The destination file will be created if it does not exist unless the resource
list is empty and <var>ignoreempty</var> is <q>true</q>.</p>

<p><em>Since Apache Ant 1.7.1</em>, this task can be used as
a <a href="../Types/resources.html#collection">Resource Collection</a> that will return
exactly one <a href="../Types/resources.html">resource</a>.</p>

<p><a href="../Types/resources.html#collection">Resource Collection</a>s are used to select
which resources are to be concatenated. There is no singular attribute to specify a single
resource to <code>cat</code>.</p>

<h3>Parameters</h3>

<table class="attr">
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td>destfile</td>
<td>The destination file for the concatenated stream. If not specified the console will be
used instead.</td>
<td>No</td>
</tr>
<tr>
<td>append</td>
<td>Specifies whether or not the file specified by <var>destfile</var> should be
appended.</td>
<td>No; defaults to <q>no</q></td>
</tr>
<tr>
<td>force</td>
<td>Specifies whether or not the file specified by <var>destfile</var> should be written to
even if it is newer than all source files. <em><u>Deprecated</u>, use
the <var>overwrite</var> attribute instead.</em></td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td>overwrite</td>
<td>Specifies whether or not the file specified by <var>destfile</var> should be written to
even if it is newer than all source files. <em>Since Ant 1.8.2</em>.</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td>forceReadOnly</td>
<td>Overwrite read-only destination files. <em>Since Ant 1.8.2</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>encoding</td>
<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>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td>outputencoding</td>
<td>The encoding to use when writing the output file. <em>Since Ant 1.6</em>.</td>
<td>No; defaults to <var>encoding</var> if set or default JVM character encoding
otherwise</td>
</tr>
<tr>
<td>fixlastline</td>
<td>Specifies whether or not to check if each file concatenated is terminated by a new
line. If this attribute is <q>yes</q> a new line will be appended to the stream if the
file did not end in a new line. <em>Since Ant 1.6</em>. This attribute does not apply to
embedded text.</td>
<td>No; defaults to <q>no</q></td>
</tr>
<tr>
<td>eol</td>
<td>Specifies what the end of line character are for use by the fixlastline
attribute. <em>Since Ant 1.6</em> Valid values for this property are:
<ul>
<li><q>cr</q>: a single CR</li>
<li><q>lf</q>: a single LF</li>
<li><q>crlf</q>: the pair CRLF</li>
<li><q>mac</q>: a single CR</li>
<li><q>unix</q>: a single LF</li>
<li><q>dos</q>: the pair CRLF</li>
</ul></td>
<td>No; default is platform dependent: <q>lf</q> for Unix, <q>crlf</q> for DOS family
(including Windows), <q>cr</q> for Mac OS 9 or earlier</td></tr>
<tr>
<td>binary</td>
<td><em>Since Ant 1.6.2</em> If this attribute is set to <q>true</q>, the task concatenates
the files in a byte by byte fashion. If this attribute is <q>false</q>, concat will not
normally work for binary files due to character encoding issues. If this option is set
to <q>true</q>, the <var>destfile</var> attribute must be set, and the task cannot used
nested text. Also the
attributes <var>encoding</var>, <var>outputencoding</var>, <var>filelastline</var> cannot
be used.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td>ignoreempty</td>
<td><em>Since Ant 1.8.0</em> Specifies whether or not the file specified
by <var>destfile</var> should be created if the source resource list is empty.
</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td>resourcename</td>
<td><em>Since Ant 1.8.3</em> Specifies the name reported if this task is exposed as
a <a href="../Types/resources.html">resource</a>.
</td>
<td>No</td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>
<h4>Resource Collection</h4>
<p><em>since Ant 1.7</em>.</p>

<p>Any of the various <a href="../Types/resources.html#collection">Resource Collection</a> types
can specify the resources to be concatenated.</p>

<h4>filterchain</h4>
<p><em>since Ant 1.6</em>.</p>
<p>The concat task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p>

<h4>header, footer</h4>
<p><em>since Ant 1.6</em>.</p>
<p>Used to prepend or postpend text into the concatenated stream.</p>
<p>The text may be in-line or be in a file.</p>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td>filtering</td>
<td>Whether to filter the text provided by this sub element.</td>
<td>No; default is <q>yes</q></td>
</tr>
<tr>
<td>file</td>
<td>A file to place at the head or tail of the concatenated text.</td>
<td>No</td>
</tr>
<tr>
<td>trim</td>
<td>Whether to trim the value.</td>
<td>No; default is <q>no</q></td>
</tr>
<tr>
<td>trimleading</td>
<td>Whether to trim leading white space on each line.</td>
<td>No; default is <q>no</q></td>
</tr>
</table>

<h3>Examples</h3>

<p><strong>Concatenate a string to a file:</strong></p>

<pre>&lt;concat destfile=&quot;README&quot;&gt;Hello, World!&lt;/concat&gt;</pre>

<p><strong>Concatenate a series of files to the console:</strong></p>

<pre>
&lt;concat&gt;
&lt;fileset dir=&quot;messages&quot; includes=&quot;*important*&quot;/&gt;
&lt;/concat&gt;</pre>

<p><strong>Concatenate a single file, appending if the destination file exists:</strong></p>

<pre>
&lt;concat destfile=&quot;NOTES&quot; append=&quot;true&quot;&gt;
&lt;filelist dir=&quot;notes&quot; files=&quot;note.txt&quot;/&gt;
&lt;/concat&gt;</pre>

<p><strong>Concatenate a series of files, update the destination file only if is older that all
the source files:</strong></p>

<pre>
&lt;concat destfile=&quot;${docbook.dir}/all-sections.xml&quot;
force=&quot;no&quot;&gt;
&lt;filelist dir=&quot;${docbook.dir}/sections&quot;
files=&quot;introduction.xml,overview.xml&quot;/&gt;
&lt;fileset dir=&quot;${docbook.dir}&quot;
includes=&quot;sections/*.xml&quot;
excludes=&quot;introduction.xml,overview.xml&quot;/&gt;
&lt;/concat&gt;</pre>

<p><strong>Concatenate a series of files, expanding Ant properties</strong></p>
<pre>
&lt;concat destfile="${build.dir}/subs"&gt;
&lt;path&gt;
&lt;fileset dir="${src.dir}" includes="*.xml"/&gt;
&lt;pathelement location="build.xml"/&gt;
&lt;/path&gt;
&lt;filterchain&gt;
&lt;expandproperties/&gt;
&lt;/filterchain&gt;
&lt;/concat&gt;</pre>

<p><strong>Filter the lines containing project from build.xml and output them to report.output,
prepending with a header</strong></p>
<pre>
&lt;concat destfile="${build.dir}/report.output"&gt;
&lt;header filtering="no" trimleading="yes"&gt;
Lines that contain project
==========================
&lt;/header&gt;
&lt;path path="build.xml"/&gt;
&lt;filterchain&gt;
&lt;linecontains&gt;
&lt;contains value="project"/&gt;
&lt;/linecontains&gt;
&lt;/filterchain&gt;
&lt;/concat&gt;</pre>

<p><strong>Concatenate a number of binary files.</strong></p>
<pre>
&lt;concat destfile="${build.dir}/dist.bin" binary="yes"&gt;
&lt;fileset file="${src.dir}/scripts/dist.sh"/&gt;
&lt;fileset file="${build.dir}/dist.tar.bz2"/&gt;
&lt;/concat&gt;</pre>

</body>
</html>

+ 46
- 55
manual/Tasks/condition.html View File

@@ -26,80 +26,71 @@

<h2 id="condition">Condition</h2>
<h3>Description</h3>
<p>Sets a property if a certain condition holds true - this is a
generalization of <a href="available.html">Available</a> and <a
href="uptodate.html">Uptodate</a>.</p>
<p>If the condition holds true, the property value is set to true by
default; otherwise, the property is not set. You can set the value to
something other than the default by specifying the <code>value</code>
attribute.</p>
<p>Conditions are specified as <a href="#nested">nested elements</a>,
you must specify exactly one condition.</p>
<p>Sets a property if a certain condition holds true&mdash;this is a generalization
of <a href="available.html">Available</a> and <a href="uptodate.html">Uptodate</a>.</p>
<p>If the condition holds true, the property value is set to <q>true</q> by default; otherwise, the
property is not set. You can set the value to something other than the default by specifying
the <var>value</var> attribute.</p>
<p>Conditions are specified as <a href="#nested">nested elements</a>, you must specify exactly one
condition.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of the property to set.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>The name of the property to set.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">The value to set the property to. Defaults to
&quot;true&quot;.</td>
<td valign="top" align="center">No</td>
<td>value</td>
<td>The value to set the property to.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">else</td>
<td valign="top">The value to set the property to if the condition
evaluates to <i>false</i>. By default the property will remain unset.
<em>Since Apache Ant 1.6.3</em>
<td>else</td>
<td>The value to set the property to if the condition evaluates to <q>false</q>. <em>Since
Apache Ant 1.6.3</em>
</td>
<td valign="top" align="center">No</td>
<td>No; by default the property will remain unset</td>
</tr>
</table>
<h3 id="nested">Parameters specified as nested elements</h3>
<p>All conditions to test are specified as nested elements, for a
complete list see <a href="conditions.html">here</a>.</p>
<p>All conditions to test are specified as nested elements, for a complete list
see <a href="conditions.html">here</a>.</p>

<h3>Examples</h3>
<pre>
&lt;condition property=&quot;javamail.complete&quot;&gt;
&lt;and&gt;
&lt;available classname=&quot;javax.activation.DataHandler&quot;/&gt;
&lt;available classname=&quot;javax.mail.Transport&quot;/&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>javamail.complete</code> if both the
JavaBeans Activation Framework and JavaMail are available in the
classpath.</p>
&lt;condition property=&quot;javamail.complete&quot;&gt;
&lt;and&gt;
&lt;available classname=&quot;javax.activation.DataHandler&quot;/&gt;
&lt;available classname=&quot;javax.mail.Transport&quot;/&gt;
&lt;/and&gt;
&lt;/condition&gt;</pre>
<p>sets the property <code>javamail.complete</code> if both the JavaBeans Activation Framework and
JavaMail are available in the classpath.</p>

<pre>
&lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
&lt;and&gt;
&lt;os family=&quot;mac&quot;/&gt;
&lt;not&gt;
&lt;os family=&quot;unix&quot;/&gt;
&lt;/not&gt;
&lt;/and&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>isMacOsButNotMacOsX</code> if the current
operating system is MacOS, but not MacOS X - which Ant considers to be
in the Unix family as well.</p>
&lt;condition property=&quot;isMacOsButNotMacOsX&quot;&gt;
&lt;and&gt;
&lt;os family=&quot;mac&quot;/&gt;
&lt;not&gt;
&lt;os family=&quot;unix&quot;/&gt;
&lt;/not&gt;
&lt;/and&gt;
&lt;/condition&gt;</pre>
<p>sets the property <code>isMacOsButNotMacOsX</code> if the current operating system is MacOS, but
not MacOS X/macOS&mdash;which Ant considers to be in the Unix family as well.</p>

<pre>
&lt;condition property=&quot;isSunOSonSparc&quot;&gt;
&lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot;/&gt;
&lt;/condition&gt;
</pre>
<p>sets the property <code>isSunOSonSparc</code> if the current
operating system is SunOS and if it is running on a sparc architecture.</p>
&lt;condition property=&quot;isSunOSonSparc&quot;&gt;
&lt;os name=&quot;SunOS&quot; arch=&quot;sparc&quot;/&gt;
&lt;/condition&gt;</pre>
<p>sets the property <code>isSunOSonSparc</code> if the current operating system is SunOS and if it
is running on a SPARC architecture.</p>

</body>
</html>

+ 535
- 708
manual/Tasks/conditions.html
File diff suppressed because it is too large
View File


+ 194
- 271
manual/Tasks/copy.html View File

@@ -26,349 +26,272 @@

<h2 id="copy">Copy</h2>
<h3>Description</h3>
<p>Copies a file or resource collection to a new file or directory. By default, files are
only copied if the source file is newer than the destination file,
or when the destination file does not exist. However, you can explicitly
overwrite files with the <code>overwrite</code> attribute.</p>
<p>Copies a file or resource collection to a new file or directory. By default, files are only
copied if the source file is newer than the destination file, or when the destination file does not
exist. However, you can explicitly overwrite files with the <var>overwrite</var> attribute.</p>

<p><a href="../Types/resources.html#collection">Resource
Collection</a>s are used to select a group of files to copy. To use a
resource collection, the <code>todir</code> attribute must be set.
<strong>Note</strong> that some resources (for example
the <a href="../Types/resources.html#file">file</a> resource)
return absolute paths as names and the result of using them without
using a nested mapper (or the flatten attribute) may not be what you
<p><a href="../Types/resources.html#collection">Resource Collection</a>s are used to select a group
of files to copy. To use a resource collection, the <var>todir</var> attribute must be
set. <strong>Note</strong> that some resources (for example
the <a href="../Types/resources.html#file">file</a> resource) return absolute paths as names and the
result of using them without using a nested mapper (or the flatten attribute) may not be what you
expect.</p>

<p>
<strong>Note</strong>: If you employ filters in your copy operation,
you should limit the copy to text files. Binary files will be corrupted
by the copy operation.
This applies whether the filters are implicitly defined by the
<a href="filter.html">filter</a> task or explicitly provided to the copy
operation as <a href="../Types/filterset.html">filtersets</a>.
<em>See <a href="#encoding">encoding note</a></em>.
</p>
<p><strong>Note</strong>: If you employ filters in your copy operation, you should limit the copy to
text files. Binary files will be corrupted by the copy operation. This applies whether the filters
are implicitly defined by the <a href="filter.html">filter</a> task or explicitly provided to the
copy operation
as <a href="../Types/filterset.html">filtersets</a>. <em>See <a href="#encoding">encoding
note</a></em>.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to copy.</td>
<td valign="top" align="center">Yes, unless a nested
resource collection element is used.</td>
<td>file</td>
<td>The file to copy.</td>
<td>Yes, unless a nested resource collection element is used</td>
</tr>
<tr>
<td valign="top">preservelastmodified</td>
<td valign="top">Give the copied files the same last modified
time as the original source files.</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>preservelastmodified</td>
<td>Give the copied files the same last modified time as the original source files.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">tofile</td>
<td valign="top">The file to copy to.</td>
<td valign="top" align="center" rowspan="2">With the <code>file</code>
attribute, either <code>tofile</code> or <code>todir</code> can be used.<br/>

With nested resource collection elements, if the number of
included resources
is greater than 1, or if only the <code>dir</code> attribute is
specified in the <code>&lt;fileset&gt;</code>, or if the
<code>file</code> attribute is also specified, then only
<code>todir</code> is allowed.<br/>
Prior to Apache Ant 1.8.2, the <code>tofile</code> attribute
only supported <a href="../Types/resources.html#file">file resources</a> to copy from.</td>
<td>tofile</td>
<td>The file to copy to. Prior to Apache Ant 1.8.2, the <var>tofile</var> attribute only
supported <a href="../Types/resources.html#file">file resources</a> to copy from.</td>
<td rowspan="2">With the <var>file</var> attribute, either <var>tofile</var> or <var>todir</var>
can be used.<br/> With nested resource collection elements, if the number of included
resources is greater than 1, or if only the <var>dir</var> attribute is specified in
the <code>&lt;fileset&gt;</code>, or if the <var>file</var> attribute is also specified, then
only <var>todir</var> is allowed.<br/></td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">The directory to copy to.</td>
<td>todir</td>
<td>The directory to copy to.</td>
</tr>
<tr>
<td valign="top">overwrite</td>
<td valign="top">Overwrite existing files even if the destination
files are newer.</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>overwrite</td>
<td>Overwrite existing files even if the destination files are newer.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">Overwrite read-only destination
files. <em>since Ant 1.8.2</em></td>
<td valign="top" align="center">No; defaults to false.</td>
<td>force</td>
<td>Overwrite read-only destination files. <em>since Ant 1.8.2</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">filtering</td>
<td valign="top">Indicates whether token filtering using the <a href="../using.html#filters">global
build-file filters</a> should take place during the copy.
<strong>Note</strong>: Nested <code>&lt;filterset&gt;</code> elements will
always be used, even if this attribute is not specified, or its value is
<code>false</code> (<code>no</code>, or <code>off</code>).</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>filtering</td>
<td>Indicates whether token filtering using the <a href="../using.html#filters">global
build-file filters</a> should take place during the copy. <strong>Note</strong>:
Nested <code>&lt;filterset&gt;</code> elements will always be used, even if this attribute is
not specified, or its value is <q>false</q>, <q>no</q>, or <q>off</q>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">flatten</td>
<td valign="top">Ignore the directory structure of the source files,
and copy all files into the directory specified by the <code>todir</code>
attribute. Note that you can achieve the same effect by using a
<a href="../Types/mapper.html#flatten-mapper">flatten mapper</a>.</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>flatten</td>
<td>Ignore the directory structure of the source files, and copy all files into the directory
specified by the <var>todir</var> attribute. Note that you can achieve the same effect by
using a <a href="../Types/mapper.html#flatten-mapper">flatten mapper</a>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">includeEmptyDirs</td>
<td valign="top">Copy any empty directories included in the FileSet(s).
</td>
<td valign="top" align="center">No; defaults to true.</td>
<td>includeEmptyDirs</td>
<td>Copy any empty directories included in the FileSet(s).</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">If false, log a warning message, but do not stop the
build, when the file to copy does not exist or one of the nested
filesets points to a directory that doesn't exist or an error occurs
while copying.
</td>
<td valign="top" align="center">No; defaults to true.</td>
<td>failonerror</td>
<td>If <q>false</q>, log a warning message, but do not stop the build, when the file to copy
does not exist or one of the nested filesets points to a directory that doesn't exist or an
error occurs while copying.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">If true and failonerror is false, then do not log a
warning message when the file to copy does not exist or one of the nested
filesets points to a directory that doesn't exist or an error occurs
while copying. <em>since Ant 1.8.3</em>.
</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>quiet</td>
<td>If <q>true</q> and <var>failonerror</var> is <q>false</q>, then do not log a warning message
when the file to copy does not exist or one of the nested filesets points to a directory that
doesn't exist or an error occurs while copying. <em>since Ant 1.8.3</em>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Log the files that are being copied.</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>verbose</td>
<td>Log the files that are being copied.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The encoding to assume when filter-copying the
files. <em>since Ant 1.5</em>.</td>
<td align="center">No - defaults to default JVM encoding</td>
<td>encoding</td>
<td>The encoding to assume when filter-copying the files. <em>since Ant 1.5</em>.</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td valign="top">outputencoding</td>
<td valign="top">The encoding to use when writing the files.
<td>outputencoding</td>
<td>The encoding to use when writing the files.
<em>since Ant 1.6</em>.</td>
<td align="center">No - defaults to the value of the encoding
attribute if given or the default JVM encoding otherwise.</td>
<td>No; defaults to <var>encoding</var> if set or default JVM character encoding otherwise</td>
</tr>
<tr>
<td valign="top">enablemultiplemappings</td>
<td valign="top">
If true the task will process to all the mappings for a
given source path. If false the task will only process
the first file or directory. This attribute is only relevant
if there is a mapper subelement.
<em>since Ant 1.6</em>.</td>
<td align="center">No - defaults to false.</td>
<td>enablemultiplemappings</td>
<td>If <q>true</q> the task will process to all the mappings for a given source
path. If <q>false</q> the task will only process the first file or directory. This attribute
is only relevant if there is a <code>mapper</code> subelement. <em>since Ant 1.6</em>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">granularity</td>
<td valign="top">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. Default is 1 second, or 2 seconds on DOS
systems. This can also be useful if source and target files live
on separate machines with clocks being out of sync. <em>since Ant
1.6.2</em>.</td>
<td align="center">No</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. This can also be useful if source and target files live on separate
machines with clocks being out of sync. <em>since Ant 1.6.2</em>.</td>
<td>No; default is 1 second, or 2 seconds on DOS systems</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>

<h4>fileset or any other resource collection</h4>
<p><a href="../Types/resources.html#collection">Resource
Collection</a>s are used to select groups of files to copy. To use a
resource collection, the <code>todir</code> attribute must be set.</p>
<p>Prior to Ant 1.7, only <code>&lt;fileset&gt;</code> has been
supported as a nested element.</p>
<p><a href="../Types/resources.html#collection">Resource Collection</a>s are used to select groups
of files to copy. To use a resource collection, the <var>todir</var> attribute must be set.</p>
<p>Prior to Ant 1.7, only <code>&lt;fileset&gt;</code> has been supported as a nested element.</p>

<h4>mapper</h4>
<p>You can define filename transformations by using a nested <a
href="../Types/mapper.html">mapper</a> element. The default mapper used by
<code>&lt;copy&gt;</code> is the <a
href="../Types/mapper.html#identity-mapper">identity mapper</a>.</p>
<p>
<em>Since Ant 1.6.3</em>,
one can use a filenamemapper type in place of the mapper element.
</p>
<p>You can define filename transformations by using a
nested <a href="../Types/mapper.html">mapper</a> element. The default mapper used
by <code>&lt;copy&gt;</code> is the <a href="../Types/mapper.html#identity-mapper">identity
mapper</a>.</p>
<p><em>Since Ant 1.6.3</em>, one can use a filenamemapper type in place of the mapper element.</p>

<p>Note that the source name handed to the mapper depends on the
resource collection you use. If you use <code>&lt;fileset&gt;</code>
or any other collection that provides a base directory, the name
passed to the mapper will be a relative filename, relative to the base
directory. In any other case the absolute filename of the source will
be used.</p>
<p>Note that the source name handed to the mapper depends on the resource collection you use. If
you use <code>&lt;fileset&gt;</code> or any other collection that provides a base directory, the
name passed to the mapper will be a relative filename, relative to the base directory. In any other
case the absolute filename of the source will be used.</p>

<h4>filterset</h4>
<p><a href="../Types/filterset.html">FilterSet</a>s are used to replace
tokens in files that are copied.
To use a FilterSet, use the nested <code>&lt;filterset&gt;</code> element.</p>
<p><a href="../Types/filterset.html">FilterSet</a>s are used to replace tokens in files that are
copied. To use a FilterSet, use the nested <code>&lt;filterset&gt;</code> element.</p>

<p>It is possible to use more than one filterset.</p>

<h4>filterchain</h4>
<p>The Copy task supports nested <a href="../Types/filterchain.html">
FilterChain</a>s.</p>
<p>The Copy task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p>

<p>
If <code>&lt;filterset&gt;</code> and <code>&lt;filterchain&gt;</code> elements are used inside the
same <code>&lt;copy&gt;</code> task, all <code>&lt;filterchain&gt;</code> elements are processed first
followed by <code>&lt;filterset&gt;</code> elements.
</p>
<p>If <code>&lt;filterset&gt;</code> and <code>&lt;filterchain&gt;</code> elements are used inside
the same <code>&lt;copy&gt;</code> task, all <code>&lt;filterchain&gt;</code> elements are processed
first followed by <code>&lt;filterset&gt;</code> elements.</p>

<h3>Examples</h3>
<p><b>Copy a single file</b></p>
<pre>
&lt;copy file=&quot;myfile.txt&quot; tofile=&quot;mycopy.txt&quot;/&gt;
</pre>
<p><b>Copy a single file to a directory</b></p>
<p><strong>Copy a single file</strong></p>
<pre>&lt;copy file=&quot;myfile.txt&quot; tofile=&quot;mycopy.txt&quot;/&gt;</pre>
<p><strong>Copy a single file to a directory</strong></p>
<pre>&lt;copy file=&quot;myfile.txt&quot; todir=&quot;../some/other/dir&quot;/&gt;</pre>
<p><strong>Copy a directory to another directory</strong></p>
<pre>
&lt;copy file=&quot;myfile.txt&quot; todir=&quot;../some/other/dir&quot;/&gt;
&lt;copy todir=&quot;../new/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;/&gt;
&lt;/copy&gt;
</pre>
<p><b>Copy a directory to another directory</b></p>
<p><strong>Copy a set of files to a directory</strong></p>
<pre>
&lt;copy todir=&quot;../new/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;/&gt;
&lt;/copy&gt;
</pre>
<p><b>Copy a set of files to a directory</b></p>
<pre>
&lt;copy todir=&quot;../dest/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;&gt;
&lt;exclude name=&quot;**/*.java&quot;/&gt;
&lt;/fileset&gt;
&lt;/copy&gt;
&lt;copy todir=&quot;../dest/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;&gt;
&lt;exclude name=&quot;**/*.java&quot;/&gt;
&lt;/fileset&gt;
&lt;/copy&gt;

&lt;copy todir=&quot;../dest/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot; excludes=&quot;**/*.java&quot;/&gt;
&lt;/copy&gt;
</pre>
<p><b>Copy a set of files to a directory, appending
<code>.bak</code> to the file name on the fly</b></p>
&lt;copy todir=&quot;../dest/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot; excludes=&quot;**/*.java&quot;/&gt;
&lt;/copy&gt;</pre>
<p><strong>Copy a set of files to a directory, appending <samp>.bak</samp> to the file name on the
fly</strong></p>
<pre>
&lt;copy todir=&quot;../backup/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;/&gt;
&lt;globmapper from=&quot;*&quot; to=&quot;*.bak&quot;/&gt;
&lt;/copy&gt;
</pre>
&lt;copy todir=&quot;../backup/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;/&gt;
&lt;globmapper from=&quot;*&quot; to=&quot;*.bak&quot;/&gt;
&lt;/copy&gt;</pre>

<p><b>Copy a set of files to a directory, replacing @TITLE@ with Foo Bar
in all files.</b></p>
<p><strong>Copy a set of files to a directory, replacing <code>@TITLE@</code> with <samp>Foo
Bar</samp> in all files.</strong></p>
<pre>
&lt;copy todir=&quot;../backup/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;/&gt;
&lt;filterset&gt;
&lt;filter token=&quot;TITLE&quot; value=&quot;Foo Bar&quot;/&gt;
&lt;/filterset&gt;
&lt;/copy&gt;
</pre>
&lt;copy todir=&quot;../backup/dir&quot;&gt;
&lt;fileset dir=&quot;src_dir&quot;/&gt;
&lt;filterset&gt;
&lt;filter token=&quot;TITLE&quot; value=&quot;Foo Bar&quot;/&gt;
&lt;/filterset&gt;
&lt;/copy&gt;</pre>

<p><b>Collect all items from the current CLASSPATH setting into a
destination directory, flattening the directory structure.</b></p>
<p><strong>Collect all items from the current <code>CLASSPATH</code> setting into a destination
directory, flattening the directory structure.</strong></p>
<pre>
&lt;copy todir=&quot;dest&quot; flatten=&quot;true&quot;&gt;
&lt;path&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/path&gt;
&lt;/copy&gt;
</pre>
&lt;copy todir=&quot;dest&quot; flatten=&quot;true&quot;&gt;
&lt;path&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/path&gt;
&lt;/copy&gt;</pre>

<p><b>Copies some resources to a given directory.</b></p>
<p><strong>Copies some resources to a given directory.</strong></p>
<pre>
&lt;copy todir=&quot;dest&quot; flatten=&quot;true&quot;&gt;
&lt;resources&gt;
&lt;file file=&quot;src_dir/file1.txt&quot;/&gt;
&lt;url url=&quot;http://ant.apache.org/index.html&quot;/&gt;
&lt;/resources&gt;
&lt;/copy&gt;
</pre>
&lt;copy todir=&quot;dest&quot; flatten=&quot;true&quot;&gt;
&lt;resources&gt;
&lt;file file=&quot;src_dir/file1.txt&quot;/&gt;
&lt;url url=&quot;http://ant.apache.org/index.html&quot;/&gt;
&lt;/resources&gt;
&lt;/copy&gt;</pre>

<p>If the example above didn't use the flatten attribute,
the <code>&lt;file&gt;</code> resource would have returned its full
path as source and target name and would not have been copied at
all. In general it is a good practice to use an explicit mapper
together with resources that use an absolute path as their
names.</p>
<p>If the example above didn't use the <var>flatten</var> attribute, the <code>&lt;file&gt;</code>
resource would have returned its full path as source and target name and would not have been copied
at all. In general it is a good practice to use an explicit mapper together with resources that use
an absolute path as their names.</p>

<p><b>Copies the two newest resources into a destination directory.</b></p>
<p><strong>Copies the two newest resources into a destination directory.</strong></p>
<pre>
&lt;copy todir=&quot;dest&quot; flatten=&quot;true&quot;&gt;
&lt;first count=&quot;2&quot;&gt;
&lt;sort&gt;
&lt;date xmlns=&quot;antlib:org.apache.tools.ant.types.resources.comparators&quot;/&gt;
&lt;resources&gt;
&lt;file file=&quot;src_dir/file1.txt&quot;/&gt;
&lt;file file=&quot;src_dir/file2.txt&quot;/&gt;
&lt;file file=&quot;src_dir/file3.txt&quot;/&gt;
&lt;url url=&quot;http://ant.apache.org/index.html&quot;/&gt;
&lt;/resources&gt;
&lt;/sort&gt;
&lt;/first&gt;
&lt;/copy&gt;
</pre>
&lt;copy todir=&quot;dest&quot; flatten=&quot;true&quot;&gt;
&lt;first count=&quot;2&quot;&gt;
&lt;sort&gt;
&lt;date xmlns=&quot;antlib:org.apache.tools.ant.types.resources.comparators&quot;/&gt;
&lt;resources&gt;
&lt;file file=&quot;src_dir/file1.txt&quot;/&gt;
&lt;file file=&quot;src_dir/file2.txt&quot;/&gt;
&lt;file file=&quot;src_dir/file3.txt&quot;/&gt;
&lt;url url=&quot;http://ant.apache.org/index.html&quot;/&gt;
&lt;/resources&gt;
&lt;/sort&gt;
&lt;/first&gt;
&lt;/copy&gt;</pre>

<p>The paragraph following the previous example applies to this
example as well.</p>
<p>The paragraph following the previous example applies to this example as well.</p>

<p><strong>Unix Note</strong>: File permissions are not retained when files
are copied; they end up with the default <code>UMASK</code> permissions
instead. This
is caused by the lack of any means to query or set file permissions in the
current Java runtimes. If you need a permission-preserving copy function,
use <code>&lt;exec executable="cp" ... &gt;</code> instead.
</p>
<p><strong>Unix Note</strong>: File permissions are not retained when files are copied; they end up
with the default <code>UMASK</code> permissions instead. This is caused by the lack of any means to
query or set file permissions in the current Java runtimes. If you need a permission-preserving copy
function, use <code>&lt;exec executable="cp" ... &gt;</code> instead.</p>

<p><strong>Windows Note</strong>: If you copy a file to a directory
where that file already exists, but with different casing,
the copied file takes on the case of the original. The workaround is to
<a href="delete.html">delete</a>
the file in the destination directory before you copy it.
</p>
<p id="encoding">
<strong>Important Encoding Note</strong>:
The reason that binary files when filtered get corrupted is that
filtering involves reading in the file using a Reader class. This
has an encoding specifying how files are encoded. There are a number
of different types of encoding - UTF-8, UTF-16, Cp1252, ISO-8859-1,
US-ASCII and (lots) others. On Windows the default character encoding
is Cp1252, on Unix it is usually UTF-8. For both of these encoding
there are illegal byte sequences (more in UTF-8 than for Cp1252).
</p>
<p>
How the Reader class deals with these illegal sequences is up to the
implementation
of the character decoder. The current Sun Java implementation is to
map them to legal characters. Previous Sun Java (1.3 and lower) threw
a MalformedInputException. IBM Java 1.4 also throws this exception.
It is the mapping of the characters that cause the corruption.
</p>
<p>
On Unix, where the default is normally UTF-8, this is a <em>big</em>
problem, as it is easy to edit a file to contain non US Ascii characters
from ISO-8859-1, for example the Danish oe character. When this is
copied (with filtering) by Ant, the character get converted to a
question mark (or some such thing).
</p>
<p>
There is not much that Ant can do. It cannot figure out which
files are binary - a UTF-8 version of Korean will have lots of
bytes with the top bit set. It is not informed about illegal
character sequences by current Sun Java implementations.
</p>
<p>
One trick for filtering containing only US-ASCII is to
use the ISO-8859-1 encoding. This does not seem to contain
illegal character sequences, and the lower 7 bits are US-ASCII.
Another trick is to change the LANG environment variable from
something like "us.utf8" to "us".
</p>
<p><strong>Windows Note</strong>: If you copy a file to a directory where that file already exists,
but with different case, the copied file takes on the case of the original. The workaround is
to <a href="delete.html">delete</a> the file in the destination directory before you copy it.</p>
<p id="encoding"><strong>Important Encoding Note</strong>: The reason that binary files when
filtered get corrupted is that filtering involves reading in the file using a Reader class. This has
an encoding specifying how files are encoded. There are a number of different types of
encoding&mdash;UTF-8, UTF-16, Cp1252, ISO-8859-1, US-ASCII and (lots of) others. On Windows the
default character encoding is Cp1252, on Unix it is usually UTF-8. For both of these encoding there
are illegal byte sequences (more in UTF-8 than for Cp1252).</p>
<p>How the Reader class deals with these illegal sequences is up to the implementation of the
character decoder. The current Sun Java implementation is to map them to legal characters. Previous
Sun Java (1.3 and lower) threw a MalformedInputException. IBM Java 1.4 also throws this exception.
It is the mapping of the characters that cause the corruption.</p>
<p>On Unix, where the default is normally UTF-8, this is a <em>big</em> problem, as it is easy to
edit a file to contain non US-ASCII characters from ISO-8859-1, for example the Danish &oelig;
character. When this is copied (with filtering) by Ant, the character get converted to a question
mark (or some such thing).</p>
<p>There is not much that Ant can do. It cannot figure out which files are binary&mdash;a UTF-8
version of Korean will have lots of bytes with the top bit set. It is not informed about illegal
character sequences by current Sun Java implementations.</p>
<p>One trick for filtering containing only US-ASCII is to use the ISO-8859-1 encoding. This does not
seem to contain illegal character sequences, and the lower 7 bits are US-ASCII. Another trick is to
change the <code>LANG</code> environment variable from something like <q>us.utf8</q>
to <q>us</q>.</p>

</body>
</html>

+ 69
- 74
manual/Tasks/copydir.html View File

@@ -25,108 +25,103 @@
<body>

<h2 id="copydir">Copydir</h2>
<h3><i>Deprecated</i></h3>
<p><i>This task has been deprecated. Use the Copy task instead.</i></p>
<h3><em><u>Deprecated</u></em></h3>
<p><em>This task has been <u>deprecated</u>. Use the <code>Copy</code> task instead.</em></p>
<h3>Description</h3>
<p>Copies a directory tree from the source to the destination.</p>
<p>It is possible to refine the set of files that are being copied. This can be
done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
the files you want to have excluded. This is also done with patterns. And
finally with the <i>defaultexcludes</i> attribute, you can specify whether you
want to use default exclusions or not. See the section on <a
href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
<p>It is possible to refine the set of files that are being copied. This can be done with
the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var>
and <var>defaultexcludes</var> attributes. With the <var>includes</var> or <var>includesfile</var>
attribute you specify the files you want to have included by using patterns. The <var>exclude</var>
or <var>excludesfile</var> attribute is used to specify the files you want to have excluded. This is
also done with patterns. And finally with the <var>defaultexcludes</var> attribute, you can specify
whether you want to use default exclusions or not. 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>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>src</code>) as well as the nested
<code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.</p>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>src</var>) as well as the
nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
and <code>&lt;patternset&gt;</code> elements.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">src</td>
<td valign="top">the directory to copy.</td>
<td valign="top" align="center">Yes</td>
<td>src</td>
<td>the directory to copy.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">the directory to copy to.</td>
<td valign="top" align="center">Yes</td>
<td>dest</td>
<td>the directory to copy to.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td>name of a file. Each line of this file is taken to be an include pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td>name of a file. Each line of this file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">filtering</td>
<td valign="top">indicates whether token filtering should take place during
the copy</td>
<td valign="top" align="center">No</td>
<td>filtering</td>
<td>indicates whether token filtering should take place during the copy</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">flatten</td>
<td valign="top">ignore directory structure of source directory,
copy all files into a single directory, specified by the <code>dest</code>
attribute (default is <code>false</code>).</td>
<td valign="top" align="center">No</td>
<td>flatten</td>
<td>ignore directory structure of source directory, copy all files into a single directory,
specified by the <code>dest</code> attribute.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">forceoverwrite</td>
<td valign="top">overwrite existing files even if the destination
files are newer (default is false).</td>
<td valign="top" align="center">No</td>
<td>forceoverwrite</td>
<td>overwrite existing files even if the destination files are newer.</td>
<td>No; default is <q>false</q></td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;copydir src=&quot;${src}/resources&quot;
dest=&quot;${dist}&quot;/&gt;</pre>
<p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>.</p>
<pre> &lt;copydir src=&quot;${src}/resources&quot;
dest=&quot;${dist}&quot;
includes=&quot;**/*.java&quot;
excludes=&quot;**/Test.java&quot;/&gt;</pre>
<p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
recursively. All java files are copied, except for files with the name <code>Test.java</code>.</p>
<pre> &lt;copydir src=&quot;${src}/resources&quot;
dest=&quot;${dist}&quot;
includes=&quot;**/*.java&quot;
excludes=&quot;mypackage/test/**&quot;/&gt;</pre>
<p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
recursively. All java files are copied, except for the files under the <code>mypackage/test</code>
directory.</p>
<pre>
&lt;copydir src=&quot;${src}/resources&quot;
dest=&quot;${dist}&quot;/&gt;</pre>
<p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>.</p>
<pre>
&lt;copydir src=&quot;${src}/resources&quot;
dest=&quot;${dist}&quot;
includes=&quot;**/*.java&quot;
excludes=&quot;**/Test.java&quot;/&gt;</pre>
<p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>
recursively. All <samp>.java</samp> files are copied, except for files with the
name <samp>Test.java</samp>.</p>
<pre>
&lt;copydir src=&quot;${src}/resources&quot;
dest=&quot;${dist}&quot;
includes=&quot;**/*.java&quot;
excludes=&quot;mypackage/test/**&quot;/&gt;</pre>
<p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>
recursively. All <samp>.java</samp> files are copied, except for the files under
the <samp>mypackage/test</samp> directory.</p>

</body>
</html>

+ 23
- 25
manual/Tasks/copyfile.html View File

@@ -25,45 +25,43 @@
<body>

<h2 id="copyfile">Copyfile</h2>
<h3><i>Deprecated</i></h3>
<p><i>This task has been deprecated. Use the Copy task instead.</i></p>
<h3><em><u>Deprecated</u></em></h3>
<p><em>This task has been <em>deprecated</em>. Use the <code>Copy</code> task instead.</em></p>
<h3>Description</h3>
<p>Copies a file from the source to the destination. The file is only copied if
the source file is newer than the destination file, or when the destination file
does not exist.</p>
<p>Copies a file from the source to the destination. The file is only copied if the source file is
newer than the destination file, or when the destination file does not exist.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">src</td>
<td valign="top">the filename of the file to copy.</td>
<td valign="top" align="center">Yes</td>
<td>src</td>
<td>the filename of the file to copy.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">the filename of the file where to copy to.</td>
<td valign="top" align="center">Yes</td>
<td>dest</td>
<td>the filename of the file where to copy to.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">filtering</td>
<td valign="top">indicates whether token filtering should take place during
the copy</td>
<td valign="top" align="center">No</td>
<td>filtering</td>
<td>indicates whether token filtering should take place during the copy</td>
<td>No</td>
</tr>
<tr>
<td valign="top">forceoverwrite</td>
<td valign="top">overwrite existing files even if the destination
files are newer (default is false).</td>
<td valign="top" align="center">No</td>
<td>forceoverwrite</td>
<td>overwrite existing files even if the destination files are newer.</td>
<td>No; default is <q>false</q></td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;copyfile src=&quot;test.java&quot; dest=&quot;subdir/test.java&quot;/&gt;
&lt;copyfile src=&quot;${src}/index.html&quot; dest=&quot;${dist}/help/index.html&quot;/&gt;</pre>
<pre>
&lt;copyfile src=&quot;test.java&quot; dest=&quot;subdir/test.java&quot;/&gt;
&lt;copyfile src=&quot;${src}/index.html&quot; dest=&quot;${dist}/help/index.html&quot;/&gt;</pre>

</body>
</html>

+ 119
- 126
manual/Tasks/cvs.html View File

@@ -26,132 +26,126 @@

<h2 id="cvs">Cvs</h2>
<h3>Description</h3>
<p>Handles packages/modules retrieved from a
<a href="http://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p>
<p><b>Important:</b> This task needs &quot;<code>cvs</code>&quot; on the path. If it isn't, you will get
an error (such as error <code>2</code> on Windows). If <code>&lt;cvs&gt;</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>CVSNT Note</strong>: CVSNT prefers users to store the passwords
inside the registry. If the <a href="cvspass.html">cvspass task</a>
and the passfile attribute don't seem to work for you, the most likely
reason is that CVSNT ignores your .cvspass file completely. See <a
href="http://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5">bugzilla
report 21657</a> for recommended workarounds.</p>
<p>Handles packages/modules retrieved from a <a href="https://www.nongnu.org/cvs/"
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
will get an error (such as error <code>2</code> on Windows). If <code>&lt;cvs&gt;</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&mdash;like CVSNT for
example&mdash;and some operation may fail when using such an incompatible client.</p>

<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
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">command</td>
<td valign="top">the CVS command to execute.</td>
<td align="center" valign="top">No, default &quot;checkout&quot;.</td>
<td>command</td>
<td>the CVS command to execute.</td>
<td>No; default is <q>checkout</q></td>
</tr>
<tr>
<td valign="top">compression</td>
<td valign="top"><code>true</code> or <code>false</code> - if set
to true, this is the same as <code>compressionlevel=&quot;3&quot;</code></td>
<td align="center" valign="top">No. Defaults to false.</td>
<td>compression</td>
<td><q>true</q> (equivalent to <var>compressionlevel</var>=<q>3</q>) or <q>false</q></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">compressionlevel</td>
<td valign="top">A number between 1 and 9 (corresponding to
possible values for CVS' <code>-z#</code> argument). Any
other value is treated as <code>compression=&quot;false&quot;</code></td>
<td align="center" valign="top">No. Defaults to no compression.</td>
<td>compressionlevel</td>
<td>A number between <q>1</q> and <q>9</q> (corresponding to possible values for
CVS <code>-z#</code> argument). Any other value is treated
as <var>compression</var>=<q>false</q></td>
<td>No; defaults to no compression</td>
</tr>

<tr>
<td valign="top">cvsRoot</td>
<td valign="top">the <code>CVSROOT</code> variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRoot</td>
<td>the <code>CVSROOT</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">cvsRsh</td>
<td valign="top">the <code>CVS_RSH</code> variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRsh</td>
<td>the <code>CVS_RSH</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">the directory where the checked out files should
be placed. Note that this is different from CVS's <code>-d</code> command line
switch as Apache Ant will never shorten pathnames to avoid empty
directories.</td>
<td align="center" valign="top">No, default is project's basedir.</td>
<td>dest</td>
<td>the directory where the checked out files should be placed. Note that this is different
from CVS's <code>-d</code> command line switch as Apache Ant will never shorten pathnames to
avoid empty directories.</td>
<td>No; default is project's <var>basedir</var></td>
</tr>
<tr>
<td valign="top">package</td>
<td valign="top">the package/module to check out. <strong>Note</strong>:
multiple attributes can be split using spaces. Use a nested
&lt;module&gt; element if you want to specify a module with
spaces in its name.</td>
<td align="center" valign="top">No</td>
<td>package</td>
<td>the package/module to check out. <strong>Note</strong>: multiple attributes can be split
using spaces. Use a nested <code>&lt;module&gt;</code> element if you want to specify a
module with spaces in its name.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">tag</td>
<td valign="top">the tag of the package/module to check out.</td>
<td align="center" valign="top">No</td>
<td>tag</td>
<td>the tag of the package/module to check out.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">date</td>
<td valign="top">Use the most recent revision no later than the given date</td>
<td align="center" valign="top">No</td>
<td>date</td>
<td>Use the most recent revision no later than the given date</td>
<td>No</td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">suppress informational messages. This is the same as <code>-q</code> on the command line.</td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>quiet</td>
<td>suppress informational messages. This is the same as <code>-q</code> on the command
line.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">reallyquiet</td>
<td valign="top">suppress all messages. This is the same as
<td>reallyquiet</td>
<td>suppress all messages. This is the same as
<code>-Q</code> on the command line. <em>since Ant 1.6</em>.</td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">noexec</td>
<td valign="top">report only, don't change any files.</td>
<td align="center" valign="top">No, default to &quot;false&quot;</td>
<td>noexec</td>
<td>report only, don't change any files.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">the file to direct standard output from the command.</td>
<td align="center" valign="top">No, default output to ANT Log as <code>MSG_INFO</code>.</td>
<td>output</td>
<td>the file to direct standard output from the command.</td>
<td>No; default is output to the log as <code>MSG_INFO</code></td>
</tr>
<tr>
<td valign="top">error</td>
<td valign="top">the file to direct standard error from the command.</td>
<td align="center" valign="top">No, default error to ANT Log as <code>MSG_WARN</code>.</td>
<td>error</td>
<td>the file to direct standard error from the command.</td>
<td>No; default is error to the log as <code>MSG_WARN</code></td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">whether to append output/error when redirecting to a file.</td>
<td align="center" valign="top">No, default to &quot;false&quot;.</td>
<td>append</td>
<td>whether to append output/error when redirecting to a file.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">port</td>
<td valign="top">Port used by CVS to communicate with the server.</td>
<td align="center" valign="top">No, default port <code>2401</code>.</td>
<td>port</td>
<td>Port used by CVS to communicate with the server.</td>
<td>No; default is <q>2401</q></td>
</tr>
<tr>
<td valign="top">passfile</td>
<td valign="top">Password file to read passwords from.</td>
<td align="center" valign="top">No, default file <code>~/.cvspass</code>.</td>
<td>passfile</td>
<td>Password file to read passwords from.</td>
<td>No; default is <q>~/.cvspass</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the build process if the command exits with a
return code other than <code>0</code>. Defaults to &quot;false&quot;</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code other
than <code>0</code>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>

@@ -159,38 +153,39 @@ report 21657</a> for recommended workarounds.</p>

<h4>module</h4>

<p>Specifies a package/module to work on, unlike the package attribute
modules specified using this attribute can contain spaces in their
name.</p>
<p>Specifies a package/module to work on, unlike the package attribute modules specified using this
attribute can contain spaces in their name.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The module's/package's name.</td>
<td align="center" valign="top">Yes.</td>
<td>name</td>
<td>The module's/package's name.</td>
<td>Yes</td>
</tr>
</table>

<h3>Examples</h3>
<pre> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
package=&quot;ant&quot;
dest=&quot;${ws.dir}&quot;/&gt;</pre>
<p>checks out the package/module &quot;ant&quot; from the CVS
repository pointed to by the <code>cvsRoot</code> attribute, and stores the files in &quot;<code>${ws.dir}</code>&quot;.</p>
<pre> &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
<p>updates the package/module that has previously been checked out into
&quot;<code>${ws.dir}</code>&quot;.</p>

<pre> &lt;cvs command=&quot;-q diff -u -N&quot; output=&quot;patch.txt&quot;/&gt;</pre>

<p>silently (<code>-q</code>) creates a file called <code>patch.txt</code> which contains a unified (<code>-u</code>) diff which includes new files added via &quot;cvs add&quot; (<code>-N</code>) and can be used as input to patch.
The equivalent, using <code>&lt;commandline&gt;</code> elements, is:
</p>
<pre>
&lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
package=&quot;ant&quot;
dest=&quot;${ws.dir}&quot;/&gt;</pre>
<p>checks out the package/module <samp>ant</samp> from the CVS repository pointed to by
the <var>cvsRoot</var> attribute, and stores the files in <samp>${ws.dir}</samp>.</p>

<pre>&lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
<p>updates the package/module that has previously been checked out into <samp>${ws.dir}</samp>.</p>

<pre>&lt;cvs command=&quot;-q diff -u -N&quot; output=&quot;patch.txt&quot;/&gt;</pre>

<p>silently (<code>-q</code>) creates a file called <samp>patch.txt</samp> which contains a unified
(<code>-u</code>) diff which includes new files added via <code>cvs add</code> (<code>-N</code>) and
can be used as input to <code>patch</code>. The equivalent, using <code>&lt;commandline&gt;</code>
elements, is:</p>
<pre>
&lt;cvs output=&quot;patch&quot;&gt;
&lt;commandline&gt;
@@ -199,29 +194,27 @@ The equivalent, using <code>&lt;commandline&gt;</code> elements, is:
&lt;argument value=&quot;-u&quot;/&gt;
&lt;argument value=&quot;-N&quot;/&gt;
&lt;/commandline&gt;
&lt;/cvs&gt;
</pre>
or:
&lt;/cvs&gt;</pre>
<p>or:</p>
<pre>
&lt;cvs output=&quot;patch&quot;&gt;
&lt;commandline&gt;
&lt;argument line=&quot;-q diff -u -N&quot;/&gt;
&lt;/commandline&gt;
&lt;/cvs&gt;
</pre>
<p>
You may include as many <code>&lt;commandline&gt;</code> elements as you like.
Each will inherit the <code>failonerror</code>, <code>compression</code>, and other &quot;global&quot; parameters
from the <code>&lt;cvs&gt;</code> element.
</p>

&lt;/cvs&gt;</pre>
<p>You may include as many <code>&lt;commandline&gt;</code> elements as you like. Each will inherit
the <var>failonerror</var>, <var>compression</var>, and other &quot;global&quot; parameters from
the <code>&lt;cvs&gt;</code> element.</p>

<pre> &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
<p>Updates from the head of repository ignoring sticky bits (<code>-A</code>) and creating any new directories as necessary (<code>-d</code>).</p>
<p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any cvs options should appear
before the command, and any command options should appear after the command as in the diff example
above. See <a href="http://ximbiot.com/cvs/wiki/index.php?title=Category:User_Documentation" target="_top">the cvs manual</a> for details,
specifically the <a href="http://ximbiot.com/cvs/wiki/index.php?title=CVS--Concurrent_Versions_System_v1.12.12.1:_Guide_to_CVS_commands#SEC116" target="_top">Guide to CVS commands</a></p>
<p>Updates from the head of repository ignoring sticky bits (<code>-A</code>) and creating any new
directories as necessary (<code>-d</code>).</p>
<p>Note: the text of the command is passed to <code>cvs</code> &quot;as-is&quot; so any cvs options
should appear before the command, and any command options should appear after the command as in the
diff example above. See <a href="http://cvsbook.red-bean.com/cvsbook.html" target="_top">the CVS
book</a> for details, specifically
the <a href="http://cvsbook.red-bean.com/cvsbook.html#Commands%20And%20Options" target="_top">Guide
to CVS commands</a></p>

</body>
</html>

+ 24
- 23
manual/Tasks/cvspass.html View File

@@ -26,42 +26,43 @@

<h2 id="cvs">cvspass</h2>
<h3>Description</h3>
<p>Adds entries to a .cvspass file. Adding entries to this file has the same affect as a cvs login command.</p>
<p>Adds entries to a <samp>.cvspass</samp> file. Adding entries to this file has the same affect as
a <code>cvs login</code> command.</p>

<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 your .cvspass file
completely. See <a
href="http://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5">bug
zilla report 21657</a> for recommended workarounds.</p>
<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
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">cvsroot</td>
<td valign="top">the CVS repository to add an entry for.</td>
<td align="center" valign="top">Yes</td>
<td>cvsroot</td>
<td>the CVS repository to add an entry for.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">password</td>
<td valign="top">Password to be added to the password file.</td>
<td align="center" valign="top">Yes</td>
<td>password</td>
<td>Password to be added to the password file.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">passfile</td>
<td valign="top">Password file to add the entry to.</td>
<td align="center" valign="top">No, default is <code>~/.cvspass</code>.</td>
<td>passfile</td>
<td>Password file to add the entry to.</td>
<td>No; default is <q>~/.cvspass</q></td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;cvspass cvsroot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
password=&quot;anoncvs&quot;/&gt;</pre>
<p>Adds an entry into the ~/.cvspass password file.</p>
<pre>
&lt;cvspass cvsroot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
password=&quot;anoncvs&quot;/&gt;</pre>
<p>Adds an entry into the <samp>~/.cvspass</samp> password file.</p>

</body>
</html>

+ 137
- 136
manual/Tasks/cvstagdiff.html View File

@@ -23,111 +23,106 @@
<body>
<h2 id="cvstagdiff">CvsTagDiff</h2>
<h3>Description</h3>
<p>Generates an XML-formatted report file of the changes between two tags or dates recorded in a
<a href="http://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p>
<p><b>Important:</b> This task needs &quot;<code>cvs</code>&quot; on the path. If it isn't, you will get
an error (such as error <code>2</code> on Windows). If <code>&lt;cvs&gt;</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>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>
<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>&lt;cvs&gt;</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&mdash;like CVSNT for
example&mdash;and some operation may fail when using such an incompatible client.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">startTag</td>
<td valign="top">The earliest tag from which diffs are to be
included in the report.</td>
<td align="center" valign="top" rowspan="2">Exactly one of the two</td>
<td>startTag</td>
<td>The earliest tag from which diffs are to be included in the report.</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">startDate</td>
<td valign="top">The earliest date from which diffs are to be
included in the report.<br>
accepts all formats accepted by the cvs command for -D date_spec arguments</td>
<td>startDate</td>
<td class="left">The earliest date from which diffs are to be included in the
report.<br/>Accepts all formats accepted by the <code>cvs</code> command for <code>-D
date_spec</code> arguments.</td>
</tr>
<tr>
<td valign="top">endTag</td>
<td valign="top">The latest tag from which diffs are to be
included in the report.</td>
<td align="center" valign="top" rowspan="2">Exactly one of the two</td>
<td>endTag</td>
<td>The latest tag from which diffs are to be included in the report.</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">endDate</td>
<td valign="top">The latest date from which diffs are to be
included in the report.<br>
accepts all formats accepted by the cvs command for -D date_spec arguments</td>
<td>endDate</td>
<td class="left">The latest date from which diffs are to be included in the report.<br/>Accepts
all formats accepted by the <code>cvs</code> command for <code>-D date_spec</code>
arguments.</td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">The file in which to write the diff report.</td>
<td align="center" valign="top">Yes</td>
<td>destfile</td>
<td>The file in which to write the diff report.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">ignoreRemoved</td>
<td valign="top">When set to true, the report will not include any
removed files. <em>Since Apache Ant 1.8.0</em></td>
<td align="center" valign="top">No, defaults to false.</td>
<td>ignoreRemoved</td>
<td>When set to <q>true</q>, the report will not include any removed files. <em>Since Apache
Ant 1.8.0</em></td>
<td>No; defaults to <q>false</q></td>
</table>

<h3>Parameters inherited from the <code>cvs</code> task</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">compression</td>
<td valign="top"><code>true</code>, <code>false</code>, or the number 1-9 (corresponding to possible values for CVS <code>-z#</code> argument). Any other value is treated as false</td>
<td align="center" valign="top">No. Defaults to no compression. if passed <code>true</code>, level 3 compression is assumed.</td>
<td>compression</td>
<td><q>true</q> (equivalent to <q>3</q>), <q>false</q>, or a number between <q>1</q>
and <q>9</q> (corresponding to possible values for CVS <code>-z#</code> argument). Any other
value is treated as <q>false</q></td>
<td>No; defaults to no compression</td>
</tr>
<tr>
<td valign="top">cvsRoot</td>
<td valign="top">the CVSROOT variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRoot</td>
<td>the <code>CVSROOT</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">cvsRsh</td>
<td valign="top">the CVS_RSH variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRsh</td>
<td>the <code>CVS_RSH</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">package</td>
<td valign="top">the package/module to analyze.<br>
<em>Since Ant 1.6</em>
multiple packages separated by spaces are possible.
aliases corresponding to different modules are also possible.
Use a nested &lt;module&gt; element if you want to specify a module with
spaces in its name.</td>
<td align="center" valign="top">No</td>
<td>package</td>
<td>the package/module to analyze.<br/><em>Since Ant 1.6</em> multiple packages separated by
spaces are possible. aliases corresponding to different modules are also possible. Use a
nested <code>&lt;module&gt;</code> element if you want to specify a module with spaces in its
name.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">suppress informational messages.</td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>quiet</td>
<td>suppress informational messages.</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">port</td>
<td valign="top">Port used by CVS to communicate with the server.</td>
<td align="center" valign="top">No, default port 2401.</td>
<td>port</td>
<td>Port used by CVS to communicate with the server.</td>
<td>No; default <q>2401</q></td>
</tr>
<tr>
<td valign="top">passfile</td>
<td valign="top">Password file to read passwords from.</td>
<td align="center" valign="top">No, default file <code>~/.cvspass</code>.</td>
<td>passfile</td>
<td>Password file to read passwords from.</td>
<td>No; default <q>~/.cvspass</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a
returncode other than 0. Defaults to false</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code other than 0.</td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>

@@ -135,90 +130,96 @@ operation may fail when using such an incompatible client.

<h4>module</h4>

<p>Specifies a package/module to work on, unlike the package attribute
modules specified using this attribute can contain spaces in their
name.</p>
<p>Specifies a package/module to work on, unlike the package attribute modules specified using this
attribute can contain spaces in their name.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The module's/package's name.</td>
<td align="center" valign="top">Yes.</td>
<td>name</td>
<td>Name of the module/package.</td>
<td>Yes</td>
</tr>
</table>

<h3>Examples</h3>
<pre> &lt;cvstagdiff cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
destfile=&quot;tagdiff.xml&quot;
package=&quot;ant&quot;
startTag=&quot;ANT_14&quot;
endTag=&quot;ANT_141&quot;/&gt;</pre>

<p>Generates a tagdiff report for all the changes that have been made
in the <code>ant</code> module between the tags <code>ANT_14</code> and <code>ANT_141</code>.
It writes these changes into the file <code>tagdiff.xml</code>.</p>

<pre> &lt;cvstagdiff
destfile=&quot;tagdiff.xml&quot;
package=&quot;ant&quot;
startDate=&quot;2002-01-01&quot;
endDate=&quot;2002-31-01&quot;/&gt;</pre>

<p>Generates a tagdiff report for all the changes that have been made
in the <code>ant</code> module in january 2002. In this example <code>cvsRoot</code>
has not been set. The current <code>cvsRoot</code> will be used (assuming the build is started
from a folder stored in <code>cvs</code>.
It writes these changes into the file <code>tagdiff.xml</code>.</p>

<pre> &lt;cvstagdiff
destfile=&quot;tagdiff.xml&quot;
package=&quot;ant jakarta-gump&quot;
startDate=&quot;2003-01-01&quot;
endDate=&quot;2003-31-01&quot;/&gt;</pre>

<p>Generates a tagdiff report for all the changes that have been made
in the <code>ant</code> and <code>jakarta-gump</code> modules in january 2003.
In this example <code>cvsRoot</code>
has not been set. The current <code>cvsRoot</code> will be used (assuming the build is started
from a folder stored in <code>cvs</code>.
It writes these changes into the file <code>tagdiff.xml</code>.</p>
<pre>
&lt;cvstagdiff cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
destfile=&quot;tagdiff.xml&quot;
package=&quot;ant&quot;
startTag=&quot;ANT_14&quot;
endTag=&quot;ANT_141&quot;/&gt;</pre>

<p>Generates a <code>tagdiff</code> report for all the changes that have been made in
the <code>ant</code> module between the tags <samp>ANT_14</samp> and <samp>ANT_141</samp>. It
writes these changes into the file <samp>tagdiff.xml</samp>.</p>

<pre>
&lt;cvstagdiff destfile=&quot;tagdiff.xml&quot;
package=&quot;ant&quot;
startDate=&quot;2002-01-01&quot;
endDate=&quot;2002-31-01&quot;/&gt;</pre>

<p>Generates a <code>tagdiff</code> report for all the changes that have been made in
the <samp>ant</samp> module in January 2002. In this example <var>cvsRoot</var> has not been
set. The current <var>cvsRoot</var> will be used (assuming the build is started from a folder stored
in <samp>cvs</samp>. It writes these changes into the file <samp>tagdiff.xml</samp>.</p>

<pre>
&lt;cvstagdiff destfile=&quot;tagdiff.xml&quot;
package=&quot;ant jakarta-gump&quot;
startDate=&quot;2003-01-01&quot;
endDate=&quot;2003-31-01&quot;/&gt;</pre>

<p>Generates a <code>tagdiff</code> report for all the changes that have been made in
the <samp>ant</samp> and <samp>jakarta-gump</samp> modules in January 2003. In this
example <var>cvsRoot</var> has not been set. The current <var>cvsRoot</var> will be used (assuming
the build is started from a folder stored in <samp>cvs</samp>. It writes these changes into the
file <samp>tagdiff.xml</samp>.</p>

<h4>Generate Report</h4>
<p>Ant includes a basic XSLT stylesheet that you can use to generate
a HTML report based on the xml output. The following example illustrates
how to generate a HTML report from the XML report.</p>
<p>Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the xml
output. The following example illustrates how to generate a HTML report from the XML report.</p>

<pre>
&lt;style in="tagdiff.xml"
out="tagdiff.html"
style="${ant.home}/etc/tagdiff.xsl"&gt;
&lt;param name="title" expression="Ant Diff"/&gt;
&lt;param name="module" expression="ant"/&gt;
&lt;param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/&gt;
&lt;/style&gt;
</pre>
&lt;style in="tagdiff.xml"
out="tagdiff.html"
style="${ant.home}/etc/tagdiff.xsl"&gt;
&lt;param name="title" expression="Ant Diff"/&gt;
&lt;param name="module" expression="ant"/&gt;
&lt;param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/&gt;
&lt;/style&gt;</pre>

<h4>Output</h4>
<p>
The cvsroot and package attributes of the tagdiff element are new in Ant 1.6.<br>
Notes on entry attributes:
</p>
<p>The <var>cvsroot</var> and <var>package</var> attributes of the <code>tagdiff</code> element are
new in Ant 1.6.<br> Notes on <code>entry</code> attributes:</p>
<table>
<tr><th>Attribute</th><th>Comment</th></tr>
<tr><td>name</td><td>when reporting on one package, the package name is removed from the output</td></tr>
<tr><td>revision</td><td>supplied for files which exist at the end of the reporting period</td></tr>
<tr><td>prevrevision</td><td>supplied for files which exist at the beginning of the reporting period.<br>
Old CVS servers do not supply it for deleted files. CVS 1.12.2 supplies it.</td></tr>
<tr>
<th>Attribute</th>
<th>Comment</th>
</tr>
<tr>
<td>name</td>
<td>when reporting on one package, the package name is removed from the output</td>
</tr>
<tr>
<td>revision</td>
<td>supplied for files which exist at the end of the reporting period</td>
</tr>
<tr>
<td>prevrevision</td>
<td>supplied for files which exist at the beginning of the reporting period.<br/>Old CVS servers
do not supply it for deleted files. CVS 1.12.2 supplies it.</td>
</tr>
</table>
<pre>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;tagdiff startTag=&quot;ANT_14&quot; endTag=&quot;ANT_141&quot;
cvsroot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot; package=&quot;ant&quot;&gt;
cvsroot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot; package=&quot;ant&quot;&gt;
&lt;entry&gt;
&lt;file&gt;
&lt;name&gt;src/main/org/apache/tools/ant/DirectoryScanner.java&lt;/name&gt;


+ 43
- 46
manual/Tasks/cvsversion.html View File

@@ -26,79 +26,76 @@

<h2 id="cvs">CvsVersion</h2>
<h3>Description</h3>
<p>
This task allows to retrieve a CVS client and server version.
<em>Since Apache Ant 1.6.1</em>.
</p>
<p>This task allows to retrieve a CVS client and server version. <em>Since Apache Ant
1.6.1</em>.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td colspan="3">Attributes from parent Cvs task which are meaningful here</td>
<td colspan="3" class="left">Attributes from parent <code>&lt;cvs&gt;</code> task which are
meaningful here</td>
</tr>
<tr>
<td valign="top">cvsRoot</td>
<td valign="top">the <code>CVSROOT</code> variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRoot</td>
<td>the <code>CVSROOT</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">cvsRsh</td>
<td valign="top">the <code>CVS_RSH</code> variable.</td>
<td align="center" valign="top">No</td>
<td>cvsRsh</td>
<td>the <code>CVS_RSH</code> variable.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">directory containing the checked out version of the project</td>
<td align="center" valign="top">No, default is project's basedir.</td>
<td>dest</td>
<td>directory containing the checked out version of the project</td>
<td>No; default is project's <var>basedir</var></td>
</tr>
<tr>
<td valign="top">package</td>
<td valign="top">the package/module to check out.</td>
<td align="center" valign="top">No</td>
<td>package</td>
<td>the package/module to check out.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">port</td>
<td valign="top">Port used by CVS to communicate with the server.</td>
<td align="center" valign="top">No, default port 2401.</td>
<td>port</td>
<td>Port used by CVS to communicate with the server.</td>
<td>No; default is <q>2401</q></td>
</tr>
<tr>
<td valign="top">passfile</td>
<td valign="top">Password file to read passwords from.</td>
<td align="center" valign="top">No, default file ~/.cvspass.</td>
<td>passfile</td>
<td>Password file to read passwords from.</td>
<td>No; default is <q>~/.cvspass</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the build process if the command exits with a
return code other than <code>0</code>. Defaults to false</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code other than <q>0</q>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td colspan="3">Specific attributes</td>
<td colspan="3" class="left">Specific attributes</td>
</tr>
<tr>
<td valign="top">clientversionproperty</td>
<td valign="top">Name of a property where the cvsclient version
should be stored</td>
<td align="center" valign="top">No</td>
<td>clientversionproperty</td>
<td>Name of a property where the CVS client version should be stored</td>
<td>No</td>
</tr>
<tr>
<td valign="top">serverversionproperty</td>
<td valign="top">Name of a property where the cvs server version
should be stored</td>
<td align="center" valign="top">No</td>
<td>serverversionproperty</td>
<td>Name of a property where the CVS server version should be stored</td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;cvsversion cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
passfile=&quot;/home/myself/.cvspass&quot;
serverversionproperty=&quot;apachecvsversion&quot;
clientversionproperty=&quot;localcvsversion&quot;/&gt;</pre>
<p>finds out the cvs client and server versions and stores the versions in the
properties called apachecvsversion and localcvsversion</p>
<pre>
&lt;cvsversion cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
passfile=&quot;/home/myself/.cvspass&quot;
serverversionproperty=&quot;apachecvsversion&quot;
clientversionproperty=&quot;localcvsversion&quot;/&gt;</pre>
<p>finds out the CVS client and server versions and stores the versions in the properties
called <code>apachecvsversion</code> and <code>localcvsversion</code></p>

</body>
</html>

+ 38
- 41
manual/Tasks/defaultexcludes.html View File

@@ -29,37 +29,35 @@
<p><em>since Apache Ant 1.6</em></p>

<h3>Description</h3>
<p>Alters the default excludes for all subsequent processing in the
build, and prints out the current default excludes if desired.
<p>Alters the default excludes for all subsequent processing in the build, and prints out the
current default excludes if desired.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">echo</td>
<td valign="top">whether or not to print out the default excludes.(defaults to false)</td>
<td valign="top" align="center">attribute "true" required if no
other attribute specified</td>
<td>echo</td>
<td>whether or not to print out the default excludes</td>
<td><q>true</q> required if no other attribute specified; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">default</td>
<td valign="top">go back to hard wired default excludes</td>
<td valign="top" align="center">attribute "true" required if no
if no other attribute is specified</td>
<td>default</td>
<td>go back to hard wired default excludes</td>
<td><q>true</q> required if no other attribute is specified</td>
</tr>
<tr>
<td valign="top">add</td>
<td valign="top">the pattern to add to the default excludes</td>
<td valign="top" align="center">if no other attribute is specified</td>
<td>add</td>
<td>the pattern to add to the default excludes</td>
<td>if no other attribute is specified</td>
</tr>
<tr>
<td valign="top">remove</td>
<td valign="top">remove the specified pattern from the default excludes</td>
<td valign="top" align="center">if no other attribute is specified</td>
<td>remove</td>
<td>remove the specified pattern from the default excludes</td>
<td>if no other attribute is specified</td>
</tr>
</table>

@@ -67,37 +65,36 @@ build, and prints out the current default excludes if desired.

<p>Print out the default excludes</p>

<pre> &lt;defaultexcludes echo=&quot;true&quot;/&gt;</pre>
<pre>&lt;defaultexcludes echo=&quot;true&quot;/&gt;</pre>

<p>Print out the default excludes and exclude all *.bak files in
<strong>all</strong> further processing</p>
<p>Print out the default excludes and exclude all <samp>*.bak</samp> files in <strong>all</strong>
further processing</p>

<pre> &lt;defaultexcludes echo=&quot;true&quot; add=&quot;**/*.bak&quot;/&gt;</pre>
<pre>&lt;defaultexcludes echo=&quot;true&quot; add=&quot;**/*.bak&quot;/&gt;</pre>

<p>Silently allow several fileset based tasks to operate on emacs
backup files and then restore normal behavior</p>
<p>Silently allow several fileset based tasks to operate on emacs backup files and then restore
normal behavior</p>

<pre>
&lt;defaultexcludes remove=&quot;**/*~&quot;/&gt;
&lt;defaultexcludes remove=&quot;**/*~&quot;/&gt;

(do several fileset based tasks here)
(do several fileset based tasks here)

&lt;defaultexcludes default=&quot;true&quot;/&gt;
</pre>
&lt;defaultexcludes default=&quot;true&quot;/&gt;</pre>

<h3>Notes</h3>
By default the pattern <tt>**/.svn</tt> and <tt>**/.svn/**</tt> are set as default
excludes. With version 1.3 Subversion supports the
<a target="_blank" href="http://subversion.apache.org/docs/release-notes/1.3.html#_svn-hack">&quot;_svn hack&quot;</a>.
That means, that the svn-libraries evaluate environment variables and use <i>.svn</i>
or <i>_svn</i> 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>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">&quot;_svn
hack&quot;</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>
&lt;defaultexcludes remove=&quot;**/.svn&quot;/&gt;
&lt;defaultexcludes remove=&quot;**/.svn/**&quot;/&gt;
&lt;defaultexcludes add=&quot;**/_svn&quot;/&gt;
&lt;defaultexcludes add=&quot;**/_svn/**&quot;/&gt;
&lt;defaultexcludes remove=&quot;**/.svn&quot;/&gt;
&lt;defaultexcludes remove=&quot;**/.svn/**&quot;/&gt;
&lt;defaultexcludes add=&quot;**/_svn&quot;/&gt;
&lt;defaultexcludes add=&quot;**/_svn/**&quot;/&gt;
</pre>

</body>


+ 122
- 151
manual/Tasks/delete.html View File

@@ -26,201 +26,172 @@

<h2 id="delete">Delete</h2>
<h3>Description</h3>
<p>Deletes a single file, a specified directory and all its files and
subdirectories, or a set of files specified by one or more
<a href="../Types/resources.html#collection">resource collection</a>s.
The literal implication of <code>&lt;fileset&gt;</code> is that
directories are not included; however the removal of empty directories can
be triggered when using nested filesets by setting the
<code>includeEmptyDirs</code> attribute to <i>true</i>. Note that this
attribute is meaningless in the context of any of the various resource
collection types that <i>do</i> include directories, but that no attempt
will be made to delete non-empty directories in any case. Whether a
directory is empty or not is decided by looking into the filesystem -
include or exclude patterns don't apply here.</p>
<p>
If you use this task to delete temporary files created by editors
and it doesn't seem to work, read up on the
<a href="../dirtasks.html#defaultexcludes">default exclusion set</a>
in <strong>Directory-based Tasks</strong>, and see the
<code>defaultexcludes</code> attribute below.
<p>Deletes a single file, a specified directory and all its files and subdirectories, or a set of
files specified by one or more <a href="../Types/resources.html#collection">resource
collection</a>s. The literal implication of <code>&lt;fileset&gt;</code> is that directories are
not included; however the removal of empty directories can be triggered when using nested filesets
by setting the <var>includeEmptyDirs</var> attribute to <q>true</q>. Note that this attribute is
meaningless in the context of any of the various resource collection types that <em>do</em> include
directories, but that no attempt will be made to delete non-empty directories in any case. Whether
a directory is empty or not is decided by looking into the filesystem&mdash;include or exclude
patterns don't apply here.</p>
<p>If you use this task to delete temporary files created by editors and it doesn't seem to work,
read up on the <a href="../dirtasks.html#defaultexcludes">default exclusion set</a>
in <strong>Directory-based Tasks</strong>, and see the <code>defaultexcludes</code> attribute
below.</p>

<p>For historical reasons <code>&lt;delete dir="x"/&gt;</code> is
different from <code>&lt;delete&gt;&lt;fileset
dir="x"/&gt;&lt;/delete&gt;</code>, it will try to remove everything
inside "x" including "x" itself, not taking default excludes into
account, blindly following all symbolic links. If you need more
control, use a nested <code>&lt;fileset&gt;</code>.</p>
<p>For historical reasons <code>&lt;delete dir="x"/&gt;</code> is different
from <code>&lt;delete&gt;&lt;fileset dir="x"/&gt;&lt;/delete&gt;</code>; it will try to remove
everything inside <q>x</q> including <q>x</q> itself, not taking default excludes into account,
blindly following all symbolic links. If you need more control, use a
nested <code>&lt;fileset&gt;</code>.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to delete, specified as either the simple
filename (if the file exists in the current base directory), a
relative-path filename, or a full-path filename.</td>
<td align="center" valign="middle" rowspan="2">At least one of the two,
unless nested resource collections are specified
<td>file</td>
<td>The file to delete, specified as either the simple filename (if the file exists in the
current base directory), a relative-path filename, or a full-path filename.</td>
<td rowspan="2">At least one of the two, unless nested resource collections are specified</td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">The directory to delete, including all its files and
subdirectories.<br>
<strong>Note</strong>: <code>dir</code> is <em>not</em> used
to specify a directory name for <code>file</code>; <code>file</code>
and <code>dir</code> are independent of each other.<br>
<strong>Warning</strong>: Do <b>not</b> set <code>dir</code> to
<code>&quot;.&quot;</code>, <code>&quot;${basedir}&quot;</code>,
or the full-pathname equivalent unless you truly <em>intend</em> to
recursively remove the entire contents of the current base directory
(and the base directory itself, if different from the current working
directory).</td>
<td>dir</td>
<td class="left">The directory to delete, including all its files and
subdirectories.<br/><strong>Note</strong>: <var>dir</var> is <em>not</em> used to specify a
directory name for <var>file</var>; <var>file</var> and <var>dir</var> are independent of each
other.<br/><strong>Warning</strong>: Do <strong>not</strong> set <var>dir</var>
to <q>.</q>, <q>${basedir}</q>, or the full-pathname equivalent unless you
truly <em>intend</em> to recursively remove the entire contents of the current base directory
(and the base directory itself, if different from the current working directory).</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to show the name of each deleted file.</td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>verbose</td>
<td>Whether to show the name of each deleted file.</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">If the specified file or directory does not exist,
do not display a diagnostic message (unless Apache Ant
has been invoked with the <code>-verbose</code> or
<code>-debug</code> switches) or modify the exit status to
reflect an error.
When set to &quot;true&quot;, if a file or directory cannot be deleted,
no error is reported. This setting emulates the
<code>-f</code> option to the Unix <em>rm</em> command.
Setting this to &quot;true&quot; implies setting
<code>failonerror</code> to &quot;false&quot;.
</td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>quiet</td>
<td>If the specified file or directory does not exist, do not display a diagnostic message
(unless Apache Ant has been invoked with the <code>-verbose</code> or <code>-debug</code>
switches) or modify the exit status to reflect an error. When set to <q>true</q>, if a file
or directory cannot be deleted, no error is reported. This setting emulates
the <code>-f</code> option to the Unix <em>rm</em> command. Setting this to <q>true</q>
implies setting <var>failonerror</var> to <q>false</q>.</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Controls whether an error (such as a failure to
delete a file) stops the build or is merely reported to the screen.
Only relevant if <code>quiet</code> is &quot;false&quot;.</td>
<td align="center" valign="top">No, default &quot;true&quot;</td>
<td>failonerror</td>
<td>Controls whether an error (such as a failure to delete a file) stops the build or is merely
reported to the screen. Only relevant if <code>quiet</code> is <q>false</q>.</td>
<td>No; default <q>true</q></td>
</tr>
<tr>
<td valign="top">includeemptydirs</td>
<td valign="top">Whether to delete empty directories
when using filesets.</td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>includeemptydirs</td>
<td>Whether to delete empty directories when using filesets.</td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top"><em>Deprecated</em>. Use resource collections.
Comma- or space-separated list of patterns of
files that must be deleted. All files are relative to the directory
specified in <code>dir</code>.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td><em><u>Deprecated</u></em>. Use resource collections. Comma- or space-separated list of
patterns of files that must be deleted. All files are relative to the directory specified
in <var>dir</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top"><em>Deprecated</em>. Use resource collections.
The name of a file. Each line of
this file is taken to be an include pattern.</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td><em><u>Deprecated</u></em>. Use resource collections. Name of a file; each line of this
file is taken to be an include pattern.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top"><em>Deprecated</em>. Use resource collections.
Comma- or space-separated list of patterns of
files that must be excluded from the deletion list.
All files are relative to the directory specified in <code>dir</code>.
No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td><em><u>Deprecated</u></em>. Use resource collections. Comma- or space-separated list of
patterns of files that must be excluded from the deletion list. All files are relative to the
directory specified in <var>dir</var>.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top"><em>Deprecated</em>. Use resource collections.
The name of a file. Each line of
this file is taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td><em><u>Deprecated</u></em>. Use resource collections. Name of a file; each line of this
file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top"><em>Deprecated</em>. Use resource collections.
Whether to use <a href="../dirtasks.html#defaultexcludes">
default excludes.</a></td>
<td align="center" valign="top">No, default &quot;true&quot;</td>
<td>defaultexcludes</td>
<td><em><u>Deprecated</u></em>. Use resource collections. Whether to
use <a href="../dirtasks.html#defaultexcludes"> default excludes.</a></td>
<td>No; default <q>true</q></td>
</tr>
<tr>
<td valign="top">deleteonexit</td>
<td valign="top">
Indicates whether to use File#deleteOnExit() if there is a
failure to delete a file, this causes the jvm to attempt
to delete the file when the jvm process is terminating.
<em>Since Ant 1.6.2</em></td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>deleteonexit</td>
<td>Indicates whether to use <code>File#deleteOnExit()</code> if there is a failure to delete a
file. This causes the JVM to attempt to delete the file when the JVM process is
terminating. <em>Since Ant 1.6.2</em></td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">removeNotFollowedSymlinks</td>
<td valign="top">
Whether symbolic links (not the files/directories they link to)
should be removed if they haven't been followed because
followSymlinks was false or the maximum number of symbolic links
was too big.
<em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No, default &quot;false&quot;</td>
<td>removeNotFollowedSymlinks</td>
<td>Whether symbolic links (not the files/directories they link to) should be removed if they
haven't been followed because <var>followSymlinks</var> was <q>false</q> or the maximum number
of symbolic links was too big. <em>Since Ant 1.8.0</em></td>
<td>No; default <q>false</q></td>
</tr>
<tr>
<td valign="top">performGCOnFailedDelete</td>
<td valign="top">
If Ant fails to delete a file or directory it will retry the
operation once. If this flag is set to true it will perform a
garbage collection before retrying the delete.<br/>
Setting this flag to true is known to resolve some problems on
Windows (where it defaults to true) but also for directory trees
residing on an NFS share.
<em>Since Ant 1.8.3</em></td>
<td align="center" valign="top">No, default &quot;true&quot; on
Windows and &quot;true&quot; on any other OS.</td>
<td>performGCOnFailedDelete</td>
<td>If Ant fails to delete a file or directory it will retry the operation once. If this flag
is set to <q>true</q> it will perform a garbage collection before retrying the
delete.<br/>Setting this flag to true is known to resolve some problems on Windows (where it
defaults to <q>true</q>) but also for directory trees residing on an NFS share. <em>Since Ant
1.8.3</em></td>
<td>No; default <q>true</q> on Windows and <q>true</q> on any other OS</td>
</tr>
</table>

<h3>Examples</h3>
<pre> &lt;delete file=&quot;/lib/ant.jar&quot;/&gt;</pre>
<p>deletes the file <code>/lib/ant.jar</code>.</p>
<pre> &lt;delete dir=&quot;lib&quot;/&gt;</pre>
<p>deletes the <code>lib</code> directory, including all files
and subdirectories of <code>lib</code>.</p>
<pre>&lt;delete file=&quot;/lib/ant.jar&quot;/&gt;</pre>
<p>deletes the file <samp>/lib/ant.jar</samp>.</p>

<pre> &lt;delete&gt;
&lt;fileset dir=&quot;.&quot; includes=&quot;**/*.bak&quot;/&gt;
&lt;/delete&gt;
<pre>&lt;delete dir=&quot;lib&quot;/&gt;</pre>
<p>deletes the <samp>lib</samp> directory, including all files and subdirectories
of <samp>lib</samp>.</p>

<pre>
&lt;delete&gt;
&lt;fileset dir=&quot;.&quot; includes=&quot;**/*.bak&quot;/&gt;
&lt;/delete&gt;
</pre>
<p>deletes all files with the extension <code>.bak</code> from the current directory
and any subdirectories.</p>
<p>deletes all files with the extension <samp>.bak</samp> from the current directory and any
subdirectories.</p>

<pre> &lt;delete includeEmptyDirs=&quot;true&quot;&gt;
&lt;fileset dir=&quot;build&quot;/&gt;
&lt;/delete&gt;
<pre>
&lt;delete includeEmptyDirs=&quot;true&quot;&gt;
&lt;fileset dir=&quot;build&quot;/&gt;
&lt;/delete&gt;
</pre>
<p>deletes all files and subdirectories of <code>build</code>, including
<code>build</code> itself.</p>
<p>deletes all files and subdirectories of <samp>build</samp>, including <samp>build</samp>
itself.</p>

<pre> &lt;delete includeemptydirs=&quot;true&quot;&gt;
&lt;fileset dir=&quot;build&quot; includes=&quot;**/*&quot;/&gt;
&lt;/delete&gt;
<pre>
&lt;delete includeemptydirs=&quot;true&quot;&gt;
&lt;fileset dir=&quot;build&quot; includes=&quot;**/*&quot;/&gt;
&lt;/delete&gt;
</pre>
<p>deletes all files and subdirectories of <code>build</code>, without
<code>build</code> itself.</p>
<p>deletes all files and subdirectories of <samp>build</samp>, without <samp>build</samp>
itself.</p>

<pre> &lt;delete includeemptydirs=&quot;true&quot;&gt;
&lt;fileset dir=&quot;src&quot; includes=&quot;**/.svn/&quot; defaultexcludes=&quot;false&quot;/&gt;
&lt;/delete&gt;
<pre>
&lt;delete includeemptydirs=&quot;true&quot;&gt;
&lt;fileset dir=&quot;src&quot; includes=&quot;**/.svn/&quot; defaultexcludes=&quot;false&quot;/&gt;
&lt;/delete&gt;
</pre>
<p>deletes the subversion metadata directories under <code>src</code>. Because <code>.svn</code>
is on of the <a href="../dirtasks.html#defaultexcludes">default excludes</a> you have to use the
<code>defaultexcludes</code> flag, otherwise Ant wont delete these directories and the files in it.</p>
<p>deletes the subversion metadata directories under <samp>src</samp>. Because <samp>.svn</samp> is
on of the <a href="../dirtasks.html#defaultexcludes">default excludes</a> you have to use the
<var>defaultexcludes</var> flag, otherwise Ant won't delete these directories and the files in it.</p>

</body>
</html>

+ 13
- 15
manual/Tasks/deltree.html View File

@@ -25,30 +25,28 @@
<body>

<h2 id="deltree">Deltree</h2>
<h3><i>Deprecated</i></h3>
<p><i>This task has been deprecated. Use the Delete task instead.</i></p>
<h3><em><u>Deprecated</u></em></h3>
<p><em>This task has been <u>deprecated</u>. Use the <code>Delete</code> task instead.</em></p>
<h3>Description</h3>
<p>Deletes a directory with all its files and subdirectories.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">the directory to delete.</td>
<td valign="top" align="center">Yes</td>
<td>dir</td>
<td>the directory to delete.</td>
<td>Yes</td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;deltree dir=&quot;dist&quot;/&gt;</pre>
<p>deletes the directory <code>dist</code>, including its files and
subdirectories.</p>
<pre> &lt;deltree dir=&quot;${dist}&quot;/&gt;</pre>
<p>deletes the directory <code>${dist}</code>, including its files and
subdirectories.</p>
<pre>&lt;deltree dir=&quot;dist&quot;/&gt;</pre>
<p>deletes the directory <samp>dist</samp>, including its files and subdirectories.</p>
<pre>&lt;deltree dir=&quot;${dist}&quot;/&gt;</pre>
<p>deletes the directory <samp>${dist}</samp>, including its files and subdirectories.</p>

</body>
</html>

+ 115
- 144
manual/Tasks/depend.html View File

@@ -26,199 +26,170 @@

<h2>Depend</h2>

A task to manage Java class file dependencies.
<p>A task to manage Java class file dependencies.</p>

<h3>Description</h3>

<p>
The depend task works by determining which classes are out of date with
respect to their source and then removing the class files of any other
classes which depend on the out-of-date classes.
</p>

<p>
To determine the class dependencies, the depend task analyzes the class
files of all class files passed to it. Depend does not parse your source code in
any way but relies upon the class references encoded into the class files by the
compiler. This is generally faster than parsing the Java source.</p>

<p>
To learn more about how this information is obtained from the class files,
please refer to <a href="http://docs.oracle.com/javase/specs/">the Java
Virtual Machine Specification</a>
</p>

<p>
Since a class' dependencies only change when the class itself changes, the
depend task is able to cache dependency information. Only those class files
which have changed will have their dependency information re-analysed. Note that
if you change a class' dependencies by changing the source, it will be
recompiled anyway. You can examine the dependency files created to understand
the dependencies of your classes. Please do not rely, however, on the format of
the information, as it may change in a later release.
</p>

<p>
Once depend discovers all of the class dependencies, it &quot;inverts&quot;
this relation to determine, for each class, which other classes are dependent
upon it. This &quot;affects&quot; list is used to discover which classes are
invalidated by the out of date class. The class files of the invalidated
classes are removed, triggering the compilation of the affected classes.
</p>

<p>
The depend task supports an attribute, &quot;closure&quot; which controls
whether depend will only consider direct class-class relationships or whether it
will also consider transitive, indirect relationships. For example, say there
are three classes, A, which depends on B, which in-turn depend on C. Now say
that class C is out of date. Without closure, only class B would be removed by
depend. With closure set, class A would also be removed. Normally direct
relationships are sufficient - it is unusual for a class to depend on another
without having a direct relationship. With closure set, you will notice that
depend typically removes far more class files.
</p>

<p>The classpath attribute for <code>&lt;depend&gt;</code> is optional. If it is present,
depend will check class dependencies against classes and jars on this classpath.
Any classes which depend on an element from this classpath and which are older
than that element will be deleted. A typical example where you would use this
facility would be where you are building a utility jar and want to make sure
classes which are out of date with respect to this jar are rebuilt. You should
<b>not</b> include jars in this classpath which you do not expect to change,
such as the JDK runtime jar or third party jars, since doing so will just slow
down the dependency check. This means that if you do use a classpath for the
depend task it may be different from the classpath necessary to actually
compile your code.</p>
<p>The <code>depend</code> task works by determining which classes are out of date with respect to
their source and then removing the class files of any other classes which depend on the out-of-date
classes.</p>

<p>To determine the class dependencies, the <code>depend</code> task analyzes the class files of all
class files passed to it. The task does not parse your source code in any way but relies upon the
class references encoded into the class files by the compiler. This is generally faster than parsing
the Java source files.</p>

<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>

<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
changed will have their dependency information re-analysed. Note that if you change a class'
dependencies by changing the source, it will be recompiled anyway. You can examine the dependency
files created to understand the dependencies of your classes. Please do not rely, however, on the
format of the information, as it may change in a later release.</p>

<p>Once <code>depend</code> discovers all of the class dependencies, it &quot;inverts&quot; this
relation to determine, for each class, which other classes are dependent upon it. This
&quot;affects&quot; list is used to discover which classes are invalidated by the out of date
class. The class files of the invalidated classes are removed, triggering the compilation of the
affected classes.</p>

<p>The <code>depend</code> task supports an attribute, <var>closure</var> which controls
whether <code>depend</code> will only consider direct class-class relationships or whether it will
also consider transitive, indirect relationships. For example, say there are three classes, A, which
depends on B, which in-turn depend on C. Now say that class C is out of
date. Without <var>closure</var>, only class B would be removed
by <code>depend</code>. With <var>closure</var> set, class A would also be removed. Normally direct
relationships are sufficient&mdash;it is unusual for a class to depend on another without having a
direct relationship. With <var>closure</var> set, you will notice that <code>depend</code> typically
removes far more class files.</p>

<p>The <var>classpath</var> attribute for <code>&lt;depend&gt;</code> is optional. If it is
present, <code>depend</code> will check class dependencies against classes and jars on this
classpath. Any classes which depend on an element from this classpath and which are older than that
element will be deleted. A typical example where you would use this facility would be where you are
building a utility jar and want to make sure classes which are out of date with respect to this jar
are rebuilt. You should <strong>not</strong> include jars in this classpath which you do not expect
to change, such as the JDK runtime jar or third party jars, since doing so will just slow down the
dependency check. This means that if you do use a classpath for the <code>depend</code> task it may
be different from the classpath necessary to actually compile your code.</p>

<h3>Performance</h3>

<p>
The performance of the depend task is dependent on a
number of factors such as class relationship complexity and how many class files
are out of date. The decision about whether it is cheaper to just recompile all
classes or to use the depend task will depend on the size of your project and
how interrelated your classes are.
</p>
<p>The performance of the <code>depend</code> task is dependent on a number of factors such as class
relationship complexity and how many class files are out of date. The decision about whether it is
cheaper to just recompile all classes or to use the <code>depend</code> task will depend on the size
of your project and how interrelated your classes are.</p>


<h3>Limitations</h3>

<p>
There are some source dependencies which depend will not detect.
</p>
<p>There are some source dependencies which <code>depend</code> will not detect.</p>

<ul>
<li>If the Java compiler optimizes away a class relationship,
there can be a source dependency without a class dependency.</li>

<li>Non public classes cause two problems. Firstly depend cannot relate
the class file to a source file. In the future this may be addressed
using the source file attribute in the classfile. Secondly, neither
depend nor the compiler tasks can detect when a non public class is
missing. Inner classes are handled by the depend task.</li>
<li>If the Java compiler optimizes away a class relationship, there can be a source dependency
without a class dependency.</li>

<li>Non public classes cause two problems. Firstly depend cannot relate the class file to a source
file. In the future this may be addressed using the source file attribute in the
classfile. Secondly, neither <code>depend</code> nor the compiler tasks can detect when a non public
class is missing. Inner classes are handled by the <code>depend</code> task.</li>
</ul>

The most obvious example of these limitations is that the task can't tell
which classes to recompile when a constant primitive data type exported
by other classes is changed. For example, a change in the definition of
something like
<p>The most obvious example of these limitations is that the task can't tell which classes to
recompile when a constant primitive data type exported by other classes is changed. For example, a
change in the definition of something like</p>
<pre>
public final class Constants {
public final static boolean DEBUG=false;
}
</pre> will not be picked up by other classes.
public final static boolean DEBUG=false;
}</pre>
<p>will not be picked up by other classes.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">srcDir</td>
<td valign="top">This is the directory where the source exists. depend
will examine this to determine which classes are out of date. If you use multiple
source directories you can pass this attribute a path of source directories.</td>
<td valign="top" align="center">Yes</td>
<td>srcDir</td>
<td>This is the directory where the source exists. <code>depend</code> will examine this to
determine which classes are out of date. If you use multiple source directories you can pass
this attribute a path of source directories.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">destDir</td>
<td valign="top">This is the root directory of the class files which
will be analysed. If this is not present, the srcdir is used.</td>
<td valign="top" align="center">No</td>
<td>destDir</td>
<td>This is the root directory of the class files which will be analysed.</td>
<td>No; defaults to <var>srcdir</var></td>
</tr>
<tr>
<td valign="top">cache</td>
<td valign="top">This is a directory in which depend can store and
retrieve dependency information. If this is not present, depend will not
use a cache</td>
<td valign="top" align="center">No</td>
<td>cache</td>
<td>This is a directory in which <code>depend</code> can store and retrieve dependency
information.</td>
<td>No; defaults to no cache</td>
</tr>
<tr>
<td valign="top">closure</td>
<td valign="top">This attribute controls whether depend only removes
classes which directly depend on out of date classes. If this is set to true,
depend will traverse the class dependency graph deleting all affected
classes. Defaults to false</td>
<td valign="top" align="center">No</td>
<td>closure</td>
<td>This attribute controls whether <code>depend</code> only removes classes which directly
depend on out of date classes. If this is set to <q>true</q>, <code>depend</code> will
traverse the class dependency graph deleting all affected classes.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">dump</td>
<td valign="top">If true the dependency information will be written to the debug level log</td>
<td valign="top" align="center">No</td>
<td>dump</td>
<td>If true the dependency information will be written to the debug level log</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">The classpath containing jars and classes for which <code>&lt;depend&gt;</code> should also
check dependencies</td>
<td valign="top" align="center">No</td>
<td>classpath</td>
<td>The classpath containing jars and classes for which <code>&lt;depend&gt;</code> should also
check dependencies</td>
<td>No</td>
</tr>
<tr>
<td valign="top">warnOnRmiStubs</td>
<td valign="top">Flag to disable warnings about files that look like rmic generated stub/skeleton
classes and have no .java source. Useful when doing RMI development.</td>
<td valign="top" align="center">No, default=true</td>
<td>warnOnRmiStubs</td>
<td>Flag to disable warnings about files that look like <code>rmic</code> generated
stub/skeleton classes and have no <samp>.java</samp> source. Useful when doing RMI
development.</td>
<td>No; default <q>true</q></td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>
<p>The <code>depend</code> task's <code>classpath</code> attribute is a
<a href="../using.html#path">PATH-like structure</a> and can also be set
via a nested <code>&lt;classpath&gt;</code> element.</p>

<p>Additionally,
this task forms an implicit
<a href="../Types/fileset.html">FileSet</a>
and supports most attributes of
<code>&lt;fileset&gt;</code> (<code>dir</code> becomes <code>srcdir</code>),
as well as the nested <code>&lt;include&gt;</code>,
<code>&lt;exclude&gt;</code>, and <code>&lt;patternset&gt;</code> elements.
<p>The <code>depend</code> task's <var>classpath</var> attribute is
a <a href="../using.html#path">path-like structure</a> and can also be set via a
nested <code>&lt;classpath&gt;</code> element.</p>

<p>Additionally, this task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>srcdir</var>),
as well as the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>,
and <code>&lt;patternset&gt;</code> elements.</p>

<h3>Examples</h3>
<pre>&lt;depend srcdir=&quot;${java.dir}&quot;
<pre>
&lt;depend srcdir=&quot;${java.dir}&quot;
destdir=&quot;${build.classes}&quot;
cache=&quot;depcache&quot;
closure=&quot;yes&quot;/&gt;</pre>

<p>removes any classes in the <code>${build.classes}</code> directory
that depend on out-of-date classes. Classes are considered out-of-date with
respect to the source in the <code>${java.dir}</code> directory, using the same
mechanism as the <code>&lt;javac&gt;</code> task. In this example, the
<code>&lt;depend&gt;</code> task caches its dependency
information in the <code>depcache</code> directory.
</p>
<p>removes any classes in the <samp>${build.classes}</samp> directory that depend on out-of-date
classes. Classes are considered out-of-date with respect to the source in
the <samp>${java.dir}</samp> directory, using the same mechanism as the <code>&lt;javac&gt;</code>
task. In this example, the <code>&lt;depend&gt;</code> task caches its dependency information in
the <samp>depcache</samp> directory.</p>

<pre>
&lt;depend srcdir=&quot;${java.dir}&quot; destdir=&quot;${build.classes}&quot;
cache=&quot;depcache&quot; closure=&quot;yes&quot;&gt;
&lt;include name=&quot;**/*.java&quot;/&gt;
&lt;excludesfile name=&quot;${java.dir}/build_excludes&quot;/&gt;
&lt;/depend&gt;
</pre>
<p>does the same as the previous example, but explicitly includes all
<code>.java</code> files, except those that match the list given
in <code>${java.dir}/build_excludes</code>.</p>
&lt;/depend&gt;</pre>

<p>does the same as the previous example, but explicitly includes all <samp>.java</samp> files,
except those that match the list given in <samp>${java.dir}/build_excludes</samp>.</p>

</body>
</html>

+ 70
- 98
manual/Tasks/dependset.html View File

@@ -30,46 +30,35 @@ A task to manage arbitrary dependencies between resources.

<h3>Description</h3>

<p>
The dependset task compares a set of sources with a set of target
files. If any of the sources has been modified more recently than
any of the target files, all of the target files are removed.
</p>
<p>
Sources and target files are specified via nested
<a href="../Types/resources.html#collection">Resource Collection</a>s;
sources can be resources of any type, while targets are restricted to files
only. At least one set of sources and one set of targets is required.
</p>
<p>
Use a FileSet when you want to use wildcard include or exclude
patterns and don't care about missing files. Use a FileList when you
want to consider the non-existence of a file as if it were out of
date. If there are any non-existing files in any source or target
FileList, all target files will be removed.
</p>
<p>
DependSet is useful to capture dependencies that are not or cannot be
determined algorithmically. For example, the <code>&lt;style&gt;</code> task only
compares the source XML file and XSLT stylesheet against the target
file to determined whether to restyle the source. Using dependset you
can extend this dependency checking to include a DTD or XSD file as
well as other stylesheets imported by the main stylesheet.
</p>
<p>The <code>dependset</code> task compares a set of sources with a set of target files. If any of
the sources has been modified more recently than any of the target files, all of the target files
are removed.</p>
<p>Sources and target files are specified via
nested <a href="../Types/resources.html#collection">Resource Collection</a>s; sources can be
resources of any type, while targets are restricted to files only. At least one set of sources and
one set of targets is required.</p>
<p>Use a FileSet when you want to use wildcard include or exclude patterns and don't care about
missing files. Use a FileList when you want to consider the non-existence of a file as if it were
out of date. If there are any non-existing files in any source or target FileList, all target files
will be removed.</p>
<p>DependSet is useful to capture dependencies that are not or cannot be determined algorithmically.
For example, the <code>&lt;style&gt;</code> task only compares the source XML file and XSLT
stylesheet against the target file to determined whether to restyle the source.
Using <code>dependset</code> you can extend this dependency checking to include a DTD or XSD file as
well as other stylesheets imported by the main stylesheet.</p>

<h3>Parameters</h3>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Makes the task list all deleted targets files
and the reason why they get deleted.</td>
<td align="center" valign="top">No</td>
<td>verbose</td>
<td>Makes the task list all deleted targets files and the reason why they get deleted.</td>
<td>No</td>
</tr>
</table>

@@ -77,92 +66,75 @@ well as other stylesheets imported by the main stylesheet.

<h4>sources</h4>

<p>The <code>&lt;sources&gt;</code> element is a
<a href="../Types/resources.html#union">Union</a> into which
arbitrary resource collections can be nested. <em>Since Apache Ant 1.7</em>
<p>The <code>&lt;sources&gt;</code> element is a <a href="../Types/resources.html#union">Union</a>
into which arbitrary resource collections can be nested. <em>Since Apache Ant 1.7</em>
</p>

<h4>srcfileset</h4>

<p>
The nested <code>&lt;srcfileset&gt;</code> element specifies a <a
href="../Types/fileset.html">FileSet</a>. All files included in
this fileset will be compared against all files included in all of the
<code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
filelists. Multiple <code>&lt;srcfileset&gt;</code> filesets may be specified.
</p>
<p>The nested <code>&lt;srcfileset&gt;</code> element specifies
a <a href="../Types/fileset.html">FileSet</a>. All files included in this fileset will be compared
against all files included in all of the <code>&lt;targetfileset&gt;</code> filesets
and <code>&lt;targetfilelist&gt;</code> filelists. Multiple <code>&lt;srcfileset&gt;</code>
filesets may be specified.</p>

<h4>srcfilelist</h4>

<p>
The nested <code>&lt;srcfilelist&gt;</code> element specifies a <a
href="../Types/filelist.html">FileList</a>. All files included in
this filelist will be compared against all files included in all of the
<code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
filelists. Multiple <code>&lt;srcfilelist&gt;</code> filelists may be specified.
</p>
<p>The nested <code>&lt;srcfilelist&gt;</code> element specifies
a <a href="../Types/filelist.html">FileList</a>. All files included in this filelist will be
compared against all files included in all of the <code>&lt;targetfileset&gt;</code> filesets
and <code>&lt;targetfilelist&gt;</code> filelists. Multiple <code>&lt;srcfilelist&gt;</code>
filelists may be specified.</p>

<h4>targets</h4>

<p>The <code>&lt;targets&gt;</code> element is a
<a href="../using.html#path">Path</a> and thus can
include any filesystem-based resource. <em>Since Ant 1.7</em>
</p>
<p>The <code>&lt;targets&gt;</code> element is a <a href="../using.html#path">Path</a> and thus can
include any filesystem-based resource. <em>Since Ant 1.7</em></p>

<h4>targetfileset</h4>

<p>
The nested <code>&lt;targetfileset&gt;</code> element specifies a <a
href="../Types/fileset.html">FileSet</a>. All files included in
this fileset will be compared against all files included in all of the
<code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
filelists, and if any are older, they are all deleted.
Multiple <code>&lt;targetfileset&gt;</code> filesets may be specified.
</p>
<p>The nested <code>&lt;targetfileset&gt;</code> element specifies
a <a href="../Types/fileset.html">FileSet</a>. All files included in this fileset will be compared
against all files included in all of the <code>&lt;srcfileset&gt;</code> filesets
and <code>&lt;sourcefilelist&gt;</code> filelists, and if any are older, they are all deleted.
Multiple <code>&lt;targetfileset&gt;</code> filesets may be specified.</p>

<h4>targetfilelist</h4>

<p>
The nested <code>&lt;targetfilelist&gt;</code> element specifies a <a
href="../Types/filelist.html">FileList</a>. All files included in
this filelist will be compared against all files included in all of the
<code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
filelists, and if any are older, they are all deleted.
Multiple <code>&lt;targetfilelist&gt;</code> filelists may be specified.
</p>
<p>The nested <code>&lt;targetfilelist&gt;</code> element specifies
a <a href="../Types/filelist.html">FileList</a>. All files included in this filelist will be
compared against all files included in all of the <code>&lt;srcfileset&gt;</code> filesets
and <code>&lt;sourcefilelist&gt;</code> filelists, and if any are older, they are all deleted.
Multiple <code>&lt;targetfilelist&gt;</code> filelists may be specified.</p>

<h3>Examples</h3>
<pre>
&lt;dependset&gt;
&lt;srcfilelist
dir = &quot;${dtd.dir}&quot;
files = &quot;paper.dtd,common.dtd&quot;/&gt;
&lt;srcfilelist
dir = &quot;${xsl.dir}&quot;
files = &quot;common.xsl&quot;/&gt;
&lt;srcfilelist
dir = &quot;${basedir}&quot;
files = &quot;build.xml&quot;/&gt;
&lt;targetfileset
dir = &quot;${output.dir}&quot;
includes = &quot;**/*.html&quot;/&gt;
&lt;/dependset&gt;</pre>

<p>
In this example derived HTML files in the ${output.dir} directory
will be removed if any are out-of-date with respect to:</p>
&lt;dependset&gt;
&lt;srcfilelist
dir = &quot;${dtd.dir}&quot;
files = &quot;paper.dtd,common.dtd&quot;/&gt;
&lt;srcfilelist
dir = &quot;${xsl.dir}&quot;
files = &quot;common.xsl&quot;/&gt;
&lt;srcfilelist
dir = &quot;${basedir}&quot;
files = &quot;build.xml&quot;/&gt;
&lt;targetfileset
dir = &quot;${output.dir}&quot;
includes = &quot;**/*.html&quot;/&gt;
&lt;/dependset&gt;</pre>

<p>In this example derived HTML files in the ${output.dir} directory will be removed if any are
out-of-date with respect to:</p>
<ol>
<li>the DTD of their source XML files</li>
<li>a common DTD (imported by the main DTD)</li>
<li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
<li>the buildfile</li>
<li>the DTD of their source XML files</li>
<li>a common DTD (imported by the main DTD)</li>
<li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
<li>the buildfile</li>
</ol>

<p>
If any of the sources in the above example does not exist, all
target files will also be removed. To ignore missing sources instead,
use filesets instead of filelists for the sources.
</p>
<p>If any of the sources in the above example does not exist, all target files will also be removed.
To ignore missing sources instead, use filesets instead of filelists for the sources.</p>

</body>
</html>

+ 6
- 12
manual/Tasks/diagnostics.html View File

@@ -26,22 +26,16 @@

<h2 id="diagnostics">Diagnostics</h2>
<h3>Description</h3>
<p>
Runs Apache Ant's <code>-diagnostics</code> code inside Ant itself. This is good for
debugging Ant's configuration under an IDE.
<em>Since Ant 1.7.0</em>
</p>
<p>Runs Apache Ant's <code>-diagnostics</code> code inside Ant itself. This is good for debugging
Ant's configuration under an IDE. <em>Since Ant 1.7.0</em></p>

<h3>Examples</h3>

<pre>
&lt;target name="diagnostics" description="diagnostics"&gt;
&lt;diagnostics/&gt;
&lt;/target&gt;
</pre>
<p>
Prints out the current diagnostics dump.
</p>
&lt;target name="diagnostics" description="diagnostics"&gt;
&lt;diagnostics/&gt;
&lt;/target&gt;</pre>
<p>Prints out the current diagnostics dump.</p>

</body>
</html>

+ 23
- 30
manual/Tasks/dirname.html View File

@@ -26,46 +26,39 @@

<h2 id="echo">Dirname</h2>
<h3>Description</h3>
<p>
Task to determine the directory path of a specified file.
</p>
<p>
When this task executes, it will set the specified property to the
value of the specified file (or directory) up to, but not including,
the last path element. If the specified file is a path that ends in a
filename, the filename will be dropped. If the specified file is just
a filename, the directory will be the current directory.
</p>
<p>
<strong>Note</strong>: This is not the same as the UNIX dirname command, which is
defined as "strip non-directory suffix from filename". &lt;dirname&gt;
determines the full directory path of the specified file.
</p>
<p>Task to determine the directory path of a specified file.</p>
<p>When this task executes, it will set the specified property to the value of the specified file
(or directory) up to, but not including, the last path element. If the specified file is a path that
ends in a filename, the filename will be dropped. If the specified file is just a filename, the
directory will be the current directory.</p>
<p><strong>Note</strong>: This is not the same as the UNIX <code>dirname</code> command, which is
defined as "strip non-directory suffix from filename". <code>&lt;dirname&gt;</code> determines the
full directory path of the specified file.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The path to take the dirname of.</td>
<td valign="top" align="center">Yes</td>
<td>file</td>
<td>The path to take the dirname of.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of the property to set.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>The name of the property to set.</td>
<td>Yes</td>
</tr>
</table>

<h3>Examples</h3>
<pre> &lt;dirname property=&quot;antfile.dir&quot; file=&quot;${ant.file}&quot;/&gt;</pre>
will set <code>antfile.dir</code> to the directory path for
<code>${ant.file}</code>.
<pre> &lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;/&gt;</pre>
will set <code>foo.dirname</code> to the project's basedir.
<pre>&lt;dirname property=&quot;antfile.dir&quot; file=&quot;${ant.file}&quot;/&gt;</pre>
<p>will set <code>antfile.dir</code> to the directory path for <samp>${ant.file}</samp>.</p>
<pre>&lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;/&gt;</pre>
<p>will set <code>foo.dirname</code> to the project's <var>basedir</var>.</p>

</body>
</html>

+ 160
- 193
manual/Tasks/ear.html View File

@@ -26,273 +26,240 @@

<h2 id="ear">Ear</h2>
<h3>Description</h3>
<p>An extension of the <a href="jar.html">Jar</a> task with special
treatment for files that should end up in an Enterprise Application archive.</p>
<p>(The Ear task is a shortcut for specifying the particular layout of a EAR file.
The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i>
attributes of zipfilesets in a Zip or Jar task.)</p>
<p>The extended zipfileset element from the zip task (with attributes <i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the Ear task.</p>
<p>An extension of the <a href="jar.html">Jar</a> task with special treatment for files that should
end up in an Enterprise Application archive.</p>
<p>(The <code>Ear</code> task is a shortcut for specifying the particular layout of a EAR file. The
same thing can be accomplished by using the <var>prefix</var> and <var>fullpath</var> attributes of
zipfilesets in a <code>Zip</code> or <code>Jar</code> task.)</p>
<p>The extended zipfileset element from the <code>Zip</code> task (with
attributes <var>prefix</var>, <var>fullpath</var>, and <var>src</var>) is available in
the <code>Ear</code> task.</p>

<p><b>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 users. If you wish
to avoid this behavior you must set the <code>duplicate</code> attribute
to a value other than its default, <code>&quot;add&quot;</code>.</b></p>
<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 users. If you wish to avoid this behavior you must set the <var>duplicate</var>
attribute to a value other than its default, <q>add</q>.</strong></p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">the EAR file to create.</td>
<td valign="top" align="center">Yes</td>
<td>destfile</td>
<td>the EAR file to create.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">appxml</td>
<td valign="top">The deployment descriptor to use (META-INF/application.xml).</td>
<td valign="top" align="center">Yes, unless update is set to true</td>
<td>appxml</td>
<td>The deployment descriptor to use (<samp>META-INF/application.xml</samp>).</td>
<td>Yes, unless <var>update</var> is set to <q>true</q></td>
</tr>
<tr>
<td valign="top">basedir</td>
<td valign="top">the directory from which to jar the files.</td>
<td valign="top" align="center">No</td>
<td>basedir</td>
<td>the directory from which to jar the files.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">compress</td>
<td valign="top">Not only store data but also compress them,
defaults to true. Unless you set the <em>keepcompression</em>
attribute to false, this will apply to the entire archive, not
only the files you've added while updating.</td>
<td align="center" valign="top">No</td>
<td>compress</td>
<td>Not only store data but also compress them. Unless you set the <var>keepcompression</var>
attribute to <q>false</q>, this will apply to the entire archive, not only the files you've
added while updating.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">keepcompression</td>
<td valign="top">For entries coming from existing archives (like
nested <em>zipfileset</em>s or while updating the archive), keep
the compression as it has been originally instead of using the
<em>compress</em> attribute. Defaults to false. <em>Since Apache Ant
1.6</em></td>
<td align="center" valign="top">No</td>
<td>keepcompression</td>
<td>For entries coming from existing archives (like nested <code>zipfileset</code>s or while
updating the archive), keep the compression as it has been originally instead of using the
<var>compress</var> attribute. <em>Since Apache Ant 1.6</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The character encoding to use for filenames
inside the archive. Defaults to UTF8. <strong>It is not
recommended to change this value as the created archive will most
likely be unreadable for Java otherwise.</strong>
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td align="center" valign="top">No</td>
<td>encoding</td>
<td>The character encoding to use for filenames inside the archive. <strong>It is not
recommended to change this value as the created archive will most likely be unreadable for
Java otherwise.</strong> <br/>See also the <a href="zip.html#encoding">discussion in the zip
task page</a></td>
<td>No; defaults to <q>UTF8</q></td>
</tr>
<tr>
<td valign="top">filesonly</td>
<td valign="top">Store only file entries, defaults to false</td>
<td align="center" valign="top">No</td>
<td>filesonly</td>
<td>Store only file entries.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td>name of a file. Each line of this file is taken to be an include pattern.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td>name of a file. Each line of this file is taken to be an exclude pattern.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">manifest</td>
<td valign="top">the manifest file to use.</td>
<td valign="top" align="center">No</td>
<td>manifest</td>
<td>the manifest file to use.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">filesetmanifest</td>
<td valign="top">behavior when a Manifest is found in a zipfileset or zipgroupfileset file is found. Valid values are &quot;skip&quot;, &quot;merge&quot;, and &quot;mergewithoutmain&quot;. &quot;merge&quot; will merge all of the manifests together, and merge this into any other specified manifests. &quot;mergewithoutmain&quot; merges everything but the Main section of the manifests. Default value is &quot;skip&quot;.
</td>
<td valign="top" align="center">No</td>
<td>filesetmanifest</td>
<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>
<td>No; defaults to <q>skip</q></td>
</tr>
<tr>
<td valign="top">whenmanifestonly</td>
<td valign="top">behavior when no files match. Valid values are &quot;fail&quot;, &quot;skip&quot;, and &quot;create&quot;. Default is &quot;create&quot;.</td>
<td valign="top" align="center">No</td>
<td>whenmanifestonly</td>
<td>behavior when no files match. Valid values are <q>fail</q>, <q>skip</q>,
and <q>create</q>.</td>
<td>No; defaults to <q>create</q></td>
</tr>
<tr>
<td valign="top">manifestencoding</td>
<td valign="top">The encoding used to read the JAR manifest, when a manifest file is specified.</td>
<td valign="top" align="center">No, defaults to the platform encoding.</td>
<td>manifestencoding</td>
<td>The encoding used to read the JAR manifest, when a manifest file is specified.</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td valign="top">index</td>
<td valign="top">whether to create an <a
href="http://docs.oracle.com/javase/7/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. Defaults to
false.</td>
<td valign="top" align="center">No</td>
<td>index</td>
<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>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">indexMetaInf</td>
<td valign="top">whether to include META-INF and its children in
the index. Doesn't have any effect if <em>index</em> is
false.<br/>
Oracle's jar implementation used to skip the META-INF 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 META-INF unless
explicitly asked to. Defaults to false<br/>
<em>Since Ant 1.8.0</em>.</td>
<td valign="top" align="center">No</td>
<td>indexMetaInf</td>
<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
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>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">update</td>
<td valign="top">indicates whether to update or overwrite
the destination file if it already exists. Default is &quot;false&quot;.</td>
<td valign="top" align="center">No</td>
<td>update</td>
<td>indicates whether to update or overwrite the destination file if it already exists.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">duplicate</td>
<td valign="top">behavior when a duplicate file is found. Valid values are &quot;add&quot;, &quot;preserve&quot;, and &quot;fail&quot;. The default value is &quot;add&quot;. </td>
<td valign="top" align="center">No</td>
<td>duplicate</td>
<td>behavior when a duplicate file is found. Valid values are <q>add</q>, <q>preserve</q>,
and <q>fail</q>.</td>
<td>No; default is <q>add</q></td>
</tr>
<tr>
<td valign="top">roundup</td>
<td valign="top">Whether the file modification times will be
rounded up to the next even number of seconds.<br>
Zip archives store file modification times with a granularity of
two seconds, so the times will either be rounded up or down. If
you round down, the archive will always seem out-of-date when you
rerun the task, so the default is to round up. Rounding up may
lead to a different type of problems like JSPs inside a web
archive that seem to be slightly more recent than precompiled
pages, rendering precompilation useless.<br>
Defaults to true. <em>Since Ant 1.6.2</em></td>
<td align="center" valign="top">No</td>
<td>roundup</td>
<td>Whether the file modification times will be rounded up to the next even number of
seconds.<br/>Zip archives store file modification times with a granularity of 2 seconds, so
the times will either be rounded up or down. If you round down, the archive will always seem
out-of-date when you rerun the task, so the default is to round up. Rounding up may lead to a
different type of problems like JSPs inside a web archive that seem to be slightly more recent
than precompiled pages, rendering precompilation useless.<br/><em>Since Ant 1.6.2</em></td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">level</td>
<td valign="top">Non-default level at which file compression should be
performed. Valid values range from 0 (no compression/fastest) to 9
(maximum compression/slowest). <em>Since Ant 1.7</em></td>
<td valign="top" align="center">No</td>
<td>level</td>
<td>Non-default level at which file compression should be performed. Valid values range
from <q>0</q> (no compression/fastest) to <q>9</q> (maximum compression/slowest). <em>Since Ant
1.7</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">preserve0permissions</td>
<td valign="top">when updating an archive or adding entries from a
different archive Ant will assume that a Unix permissions value of
0 (nobody is allowed to do anything to the file/directory) means
that the permissions haven't been stored at all rather than real
permissions and will instead apply its own default values.<br/>
Set this attribute to true if you really want to preserve the
original permission field. <em>Since Ant 1.8.0</em>
<td>preserve0permissions</td>
<td>when updating an archive or adding entries from a different archive Ant will assume that a
Unix permissions value of 0 (nobody is allowed to do anything to the file/directory) means
that the permissions haven't been stored at all rather than real permissions and will instead
apply its own default values.<br/> Set this attribute to <q>true</q> if you really want to
preserve the original permission field. <em>Since Ant 1.8.0</em>
</td>
<td valign="top" align="center">No, default is false</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">useLanguageEncodingFlag</td>
<td valign="top">Whether to set the language encoding flag if the
encoding is UTF-8. This setting doesn't have any effect if the
encoding is not UTF-8.
<em>Since Ant 1.8.0</em>.
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td valign="top" align="center">No, default is true</td>
<td>useLanguageEncodingFlag</td>
<td>Whether to set the language encoding flag if the encoding is UTF-8. This setting doesn't
have any effect if the encoding is not UTF-8. <em>Since Ant 1.8.0</em>.<br/>See also
the <a href="zip.html#encoding">discussion in the zip task page</a></td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">createUnicodeExtraFields</td>
<td valign="top">Whether to create unicode extra fields to store
the file names a second time inside the entry's metadata.
<br>Possible values are "never", "always" and "not-encodeable"
which will only add Unicode extra fields if the file name cannot
be encoded using the specified encoding.
<em>Since Ant 1.8.0</em>.
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td align="center" valign="top">No, default is "never"</td>
<td>createUnicodeExtraFields</td>
<td>Whether to create Unicode extra fields to store the file names a second time inside the
entry's metadata.<br/>Possible values are <q>never</q>, <q>always</q>
and <q>not-encodeable</q> which will only add Unicode extra fields if the file name cannot be
encoded using the specified encoding. <em>Since Ant 1.8.0</em>. <br/>See also
the <a href="zip.html#encoding">discussion in the zip task page</a></td>
<td>No; default is <q>never</q></td>
</tr>
<tr>
<td valign="top">fallbacktoUTF8</td>
<td valign="top">Whether to use UTF-8 and the language encoding
flag instead of the specified encoding if a file name cannot be
encoded using the specified encoding.
<em>Since Ant 1.8.0</em>.
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td align="center" valign="top">No, default is false</td>
<td>fallbacktoUTF8</td>
<td>Whether to use UTF-8 and the language encoding flag instead of the specified encoding if a
file name cannot be encoded using the specified encoding. <em>Since Ant 1.8.0</em>.<br/>See
also the <a href="zip.html#encoding">discussion in the zip task page</a></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">mergeClassPathAttributes</td>
<td valign="top">Whether to merge the Class-Path attributes found
in different manifests (if merging manifests). If false, only
the attribute of the last merged manifest will be preserved.
<em>Since Ant 1.8.0</em>.
<br/>unless you also set flattenAttributes to true this may
result in manifests containing multiple Class-Path attributes
which violates the manifest specification.</td>
<td align="center" valign="top">No, default is false</td>
<td>mergeClassPathAttributes</td>
<td>Whether to merge the <code>Class-Path</code> attributes found in different manifests (if
merging manifests). If <q>false</q>, only the attribute of the last merged manifest will be
preserved. <em>Since Ant 1.8.0</em>.<br/>unless you also set <var>flattenAttributes</var>
to <q>true</q> this may result in manifests containing multiple <code>Class-Path</code>
attributes which violates the manifest specification.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">flattenAttributes</td>
<td valign="top">Whether to merge attributes occurring more than
once in a section (this can only happen for the Class-Path
attribute) into a single attribute.
<em>Since Ant 1.8.0</em>.</td>
<td align="center" valign="top">No, default is false</td>
<td>flattenAttributes</td>
<td>Whether to merge attributes occurring more than once in a section (this can only happen for
the <code>Class-Path</code> attribute) into a single attribute. <em>Since Ant
1.8.0</em>.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">zip64Mode</td>
<td valign="top">When to use Zip64 extensions for entries. The
possible values are "never", "always" and "as-needed".
<em>Since Ant 1.9.1</em>.
<br/>See also the <a href="zip.html#zip64">discussion in the
zip task page</a></td>
<td align="center" valign="top">No, default is "never"</td>
<td>zip64Mode</td>
<td>When to use Zip64 extensions for entries. The possible values
are <q>never</q>, <q>always</q> and <q>as-needed</q>. <em>Since Ant 1.9.1</em>.<br/>See also
the <a href="zip.html#zip64">discussion in the zip task page</a></td>
<td>No; default is <q>never</q></td>
</tr>
</table>

<h3>Nested elements</h3>

<h4>metainf</h4>
<p>The nested <code>metainf</code> element specifies a <a
href="../Types/fileset.html">FileSet</a>. All files included in this fileset will
end up in the <code>META-INF</code> directory of the ear file. If this
fileset includes a file named <code>MANIFEST.MF</code>, the file is
ignored and you will get a warning.</p>
<p>The nested <code>metainf</code> element specifies
a <a href="../Types/fileset.html">FileSet</a>. All files included in this fileset will end up in
the <samp>META-INF</samp> directory of the ear file. If this fileset includes a file
named <samp>MANIFEST.MF</samp>, the file is ignored and you will get a warning.</p>

<h4>manifest, indexjars, service</h4>
These are inherited from <a href="jar.html">&lt;jar&gt;</a>
<p>These are inherited from <a href="jar.html">&lt;jar&gt;</a></p>

<h2>Example</h2>
<pre>
&lt;ear destfile=&quot;${build.dir}/myapp.ear&quot; appxml=&quot;${src.dir}/metadata/application.xml&quot;&gt;
&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;*.jar,*.war&quot;/&gt;
&lt;/ear&gt;
</pre>
&lt;ear destfile=&quot;${build.dir}/myapp.ear&quot; appxml=&quot;${src.dir}/metadata/application.xml&quot;&gt;
&lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;*.jar,*.war&quot;/&gt;
&lt;/ear&gt;</pre>

</body>
</html>

+ 87
- 105
manual/Tasks/echo.html View File

@@ -26,161 +26,143 @@

<h2 id="echo">Echo</h2>
<h3>Description</h3>
<p>Echoes a message to the current loggers and listeners which
means <tt>System.out</tt> unless overridden. A <tt>level</tt>
can be specified, which controls at what logging level the message is
filtered at.
<p>
The task can also echo to a file, in which case the option to append rather
than overwrite the file is available, and the <tt>level</tt> option is
ignored</p>
<p>Echoes a message to the current loggers and listeners which means <code>System.out</code> unless
overridden. A <var>level</var> can be specified, which controls at what logging level the message is
filtered at.</p>
<p>The task can also echo to a file, in which case the option to append rather than overwrite the
file is available, and the <var>level</var> option is ignored</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">message</td>
<td valign="top">the message to echo.</td>
<td valign="top" align="center">No. Text may also be included in a
character section within this element. If neither is included a
blank line will be emitted in the output.</td>
<td>message</td>
<td>the message to echo.</td>
<td>No; defaults to a blank line unless text is included in a character section within this
element</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file to write the message to.</td>
<td valign="top" align="center" rowspan="2">No; only one of these may be used.</td>
<td>file</td>
<td>the file to write the message to.</td>
<td rowspan="2">No; only one of these may be used</td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">the <a href="../Types/resources.html">Resource</a>
<td>output</td>
<td class="left">the <a href="../Types/resources.html">Resource</a>
to write the message to (see <a href="../develop.html#set-magic">note</a>).
<em>Since Apache Ant 1.8</em></td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">Append to an existing file (or
<a href="http://docs.oracle.com/javase/7/docs/api//java/io/FileWriter.html#FileWriter%28java.lang.String,%20boolean%29" target="_blank">
open a new file / overwrite an existing file</a>)? Default <i>false</i>.
<td>append</td>
<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-"
target="_blank"> open a new file / overwrite an existing file</a>)?
</td>
<td valign="top" align="center">No; ignored unless <i>output</i> indicates a
filesystem destination.</td>
<td>No; ignored unless <var>output</var> indicates a filesystem destination, default
is <q>false</q></td>
</tr>
<tr>
<td valign="top">level</td>
<td valign="top">Control the level at which this message is reported.
One of "error", "warning", "info", "verbose", "debug" (decreasing order)</td>
<td valign="top" align="center">No - default is "warning".</td>
<td>level</td>
<td>Control the level at which this message is reported. One
of <q>error</q>, <q>warning</q>, <q>info</q>, <q>verbose</q>, <q>debug</q> (decreasing
order)</td>
<td>No; default is <q>warning</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">encoding to use, default is ""; the local system encoding. <em>since Ant 1.7</em></td>
<td valign="top" align="center">No</td>
<td>encoding</td>
<td>encoding to use. <em>since Ant 1.7</em></td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">Overwrite read-only destination
files. <em>since Ant 1.8.2</em></td>
<td valign="top" align="center">No; defaults to false.</td>
<td>force</td>
<td>Overwrite read-only destination files. <em>since Ant 1.8.2</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>

<h3>Examples</h3>
<pre>
&lt;echo message=&quot;Hello, world&quot;/&gt;
</pre>
<pre>
&lt;echo message=&quot;Embed a line break:${line.separator}&quot;/&gt;
</pre>
<pre>
&lt;echo&gt;Embed another:${line.separator}&lt;/echo&gt;
</pre>
<pre>
&lt;echo&gt;This is a longer message stretching over
<pre>&lt;echo message=&quot;Hello, world&quot;/&gt;</pre>
<pre>&lt;echo message=&quot;Embed a line break:${line.separator}&quot;/&gt;</pre>
<pre>&lt;echo&gt;Embed another:${line.separator}&lt;/echo&gt;</pre>
<pre>&lt;echo&gt;This is a longer message stretching over
two lines.
&lt;/echo&gt;
</pre>
<pre>
&lt;echo&gt;
&lt;/echo&gt;</pre>
<pre>&lt;echo&gt;
This is a longer message stretching over
three lines; the first line is a blank
&lt;/echo&gt;
</pre>
The newline immediately following the &lt;echo&gt; tag will be part of the output.<br>
Newlines in character data within the content of an element are not discarded by XML parsers.<br>
See <a href="http://www.w3.org/TR/2004/REC-xml-20040204/#sec-line-ends">
W3C Recommendation 04 February 2004 / End of Line handling
</a> for more details.
&lt;/echo&gt;</pre>
<p>The newline immediately following the <code>&lt;echo&gt;</code> tag will be part of the
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>

<pre>&lt;echo message=&quot;Deleting drive C:&quot; level=&quot;debug&quot;/&gt;</pre>
A message which only appears in <tt>-debug</tt> mode.
<p>A message which only appears in <code>-debug</code> mode.</p>
<pre>&lt;echo level=&quot;error&quot;&gt;
Imminent failure in the antimatter containment facility.
Please withdraw to safe location at least 50km away.
&lt;/echo&gt;
</pre>
A message which appears even in <tt>-quiet</tt> mode.
&lt;/echo&gt;</pre>
<p>A message which appears even in <code>-quiet</code> mode.</p>

<pre>&lt;echo file="runner.csh" append="false"&gt;#\!/bin/tcsh
java-1.3.1 -mx1024m ${project.entrypoint} $$*
&lt;/echo&gt;</pre>
Generate a shell script by echoing to a file.
Note the use of a double $ symbol to stop Ant
filtering out the single $ during variable expansion
<p>Generate a shell script by echoing to a file. Note the use of a double <q>$</q> symbol to stop
Ant filtering out the single <q>$</q> during variable expansion.</p>

<p>Depending on the loglevel Ant runs, messages are print out or silently
ignored:
<p>Depending on the log level Ant runs at, messages are print out or silently ignored:</p>
<table>
<tr>
<th>Ant-Statement</th>
<th>-quiet, -q</th>
<th><i>no statement</i></th>
<th>-verbose, -v</th>
<th>-debug, -d</th>
<th>Ant command line</th>
<th><code>-quiet</code>, <code>-q</code></th>
<th><em>no switch</em></th>
<th><code>-verbose</code>, <code>-v</code></th>
<th><code>-debug</code>, <code>-d</code></th>
</tr>
<tr>
<td><pre>&lt;echo message="This is error message." level="error" /&gt;</pre></td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td><pre>&lt;echo message="This is error message." level="error"/&gt;</pre></td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is warning message." /&gt;</pre></td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td><pre>&lt;echo message="This is warning message."/&gt;</pre></td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is warning message." level="warning" /&gt;</pre></td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td><pre>&lt;echo message="This is warning message." level="warning"/&gt;</pre></td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is info message." level="info" /&gt;</pre></td>
<td align="center">not logged</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td><pre>&lt;echo message="This is info message." level="info"/&gt;</pre></td>
<td>not logged</td>
<td>ok</td>
<td>ok</td>
<td>ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is verbose message." level="verbose" /&gt;</pre></td>
<td align="center">not logged</td>
<td align="center">not logged</td>
<td align="center">ok</td>
<td align="center">ok</td>
<td><pre>&lt;echo message="This is verbose message." level="verbose"/&gt;</pre></td>
<td>not logged</td>
<td>not logged</td>
<td>ok</td>
<td>ok</td>
</tr>
<tr>
<td><pre>&lt;echo message="This is debug message." level="debug" /&gt;</pre></td>
<td align="center">not logged</td>
<td align="center">not logged</td>
<td align="center">not logged</td>
<td align="center">ok</td>
<td><pre>&lt;echo message="This is debug message." level="debug"/&gt;</pre></td>
<td>not logged</td>
<td>not logged</td>
<td>not logged</td>
<td>ok</td>
</tr>
</table>



+ 53
- 67
manual/Tasks/echoproperties.html View File

@@ -27,59 +27,50 @@
<h2 id="echoproperties">echoproperties</h2>
<h3>Description</h3>

<p>Displays all the current properties (or a subset of them specified
by a nested <code>&lt;propertyset&gt;</code>) in the project. The
output can be sent to a file if desired. This task can be used as a
somewhat contrived means of returning data from an
<tt>&lt;ant&gt;</tt> invocation, but is really for debugging build
<p>Displays all the current properties (or a subset of them specified by a
nested <code>&lt;propertyset&gt;</code>) in the project. The output can be sent to a file if
desired. This task can be used as a somewhat contrived means of returning data from an
<code>ant</code> invocation, but is really for debugging build
files.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">If specified, the value indicates the name of the
file to send the output of the statement to. The generated output file
is compatible for loading by any Java application as a property file.
If not specified, then the output will go to the Apache Ant log.</td>
<td valign="top" align="center">No</td>
<td>destfile</td>
<td>If specified, the value indicates the name of the file to send the output of the statement
to. The generated output file is compatible for loading by any Java application as a property
file.</td>
<td>No; by default, output to the log</td>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">
a prefix which is used to filter the properties:
only properties whose names start with this prefix will be echoed.
</td>
<td valign="top" align="center">No</td>
<td>prefix</td>
<td>a prefix which is used to filter the properties: only properties whose names start with this
prefix will be echoed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">regex</td>
<td valign="top">
a regular expression which is used to filter the
properties:
only those properties whose names match it will be echoed.
</td>
<td valign="top" align="center">No</td>
<td>regex</td>
<td>a regular expression which is used to filter the properties: only those properties whose
names match it will be echoed.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">By default, the "failonerror" attribute is enabled.
If an error occurs while writing the properties to a file, and this
attribute is enabled, then a BuildException will be thrown, causing the
build to fail. If disabled, then IO errors will be reported as a log
statement, and the build will continue without failure from this task.</td>
<td valign="top" align="center">No</td>
<td>failonerror</td>
<td>If an error occurs while writing the properties to a file, and this attribute is enabled,
then a BuildException will be thrown, causing the build to fail. If disabled, then IO errors
will be reported as a log statement, and the build will continue without failure from this
task.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">format</td>
<td valign="top">One of <code>text</code> or <code>xml</code>.
Determines the output format. Defaults to <code>text</code>.</td>
<td valign="top" align="center">No</td>
<td>format</td>
<td>One of <q>text</q> or <q>xml</q>. Determines the output format.</td>
<td>No; defaults to <q>text</q></td>
</tr>
</table>

@@ -87,12 +78,10 @@ files.</p>

<h4>propertyset</h4>

<p>You can specify subsets of properties to be echoed with <a
href="../Types/propertyset.html">propertyset</a>s. Using
<tt>propertyset</tt>s gives more control on which properties will be
picked up. The attributes <tt>prefix</tt> and <tt>regex</tt> are just
shortcuts that use <tt>propertyset</tt>s internally.
</p>
<p>You can specify subsets of properties to be echoed
with <a href="../Types/propertyset.html">propertyset</a>s. Using <code>propertyset</code>s gives
more control on which properties will be picked up. The attributes <var>prefix</var>
and <var>regex</var> are just shortcuts that use <code>propertyset</code>s internally.</p>

<p><em>since Ant 1.6</em>.</p>

@@ -100,33 +89,30 @@ shortcuts that use <tt>propertyset</tt>s internally.
<pre>&lt;echoproperties/&gt;</pre>
<p>Report the current properties to the log.</p>
<pre>&lt;echoproperties destfile="my.properties"/&gt;</pre>
<p>Report the current properties to the file "my.properties", and will
fail the build if the file could not be created or written to.</p>
<p>Report the current properties to the file <samp>my.properties</samp>, and will fail the build if
the file could not be created or written to.</p>
<pre>&lt;echoproperties destfile="my.properties" failonerror="false"/&gt;</pre>
<p>Report the current properties to the file "my.properties", and will
log a message if the file could not be created or written to, but will still
allow the build to continue.</p>
<p>Report the current properties to the file <samp>my.properties</samp>, and will log a message if
the file could not be created or written to, but will still allow the build to continue.</p>
<pre>&lt;echoproperties prefix="java."/&gt;</pre>
<p>List all properties beginning with "java."</p>
<p>List all properties beginning with <samp>java.</samp></p>
<pre>
&lt;echoproperties&gt;
&lt;propertyset&gt;
&lt;propertyref prefix="java."/&gt;
&lt;/propertyset&gt;
&lt;/echoproperties&gt;
</pre>
<p>This again lists all properties beginning with "java." using a nested
<tt>&lt;/propertyset&gt;</tt> which is an equivalent but longer way.</p>
&lt;echoproperties&gt;
&lt;propertyset&gt;
&lt;propertyref prefix="java."/&gt;
&lt;/propertyset&gt;
&lt;/echoproperties&gt;</pre>
<p>This again lists all properties beginning with <samp>java.</samp> using a
nested <code>&lt;propertyset/&gt;</code> which is an equivalent but longer way.</p>
<pre>&lt;echoproperties regex=".*ant.*"/&gt;</pre>
<p>Lists all properties that contain "ant" in their names.
The equivalent snippet with <tt>&lt;/propertyset&gt;</tt> is:</p>
<p>Lists all properties that contain <samp>ant</samp> in their names. The equivalent snippet
with <code>&lt;propertyset/&gt;</code> is:</p>
<pre>
&lt;echoproperties&gt;
&lt;propertyset&gt;
&lt;propertyref regex=".*ant.*"/&gt;
&lt;/propertyset&gt;
&lt;/echoproperties&gt;
</pre>
&lt;echoproperties&gt;
&lt;propertyset&gt;
&lt;propertyref regex=".*ant.*"/&gt;
&lt;/propertyset&gt;
&lt;/echoproperties&gt;</pre>

</body>
</html>

+ 18
- 22
manual/Tasks/echoxml.html View File

@@ -28,35 +28,32 @@
<h3>Description</h3>
<p>Echo nested XML to the console or a file. <em>Since Apache Ant 1.7</em></p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to receive the XML. If omitted nested
XML will be echoed to the log.</td>
<td valign="top" align="center">No</td>
<td>file</td>
<td>The file to receive the XML.</td>
<td>No; by default nested XML is echoed to the log</td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">Whether to append <code>file</code>, if specified.</td>
<td valign="top" align="center">No</td>
<td>append</td>
<td>Whether to append <var>file</var>, if specified.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">namespacePolicy</td>
<td valign="top">Sets the namespace policy as defined
by <code>org.apache.tools.ant.util.DOMElementWriter.XmlNamespacePolicy</code>.
Valid values are <code>ignore</code>, <code>elementsOnly</code>, or <code>all</code>.
<em>Since Apache Ant 1.8</em>
</td>
<td valign="top" align="center">No, default <code>ignore</code></td>
<td>namespacePolicy</td>
<td>Sets the namespace policy as defined
by <code>org.apache.tools.ant.util.DOMElementWriter.XmlNamespacePolicy</code>. Valid values
are <q>ignore</q>, <q>elementsOnly</q>, or <q>all</q>. <em>Since Apache Ant 1.8</em></td>
<td>No; default <q>ignore</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
Nested XML content is required.
<p>Nested XML content is required.</p>

<h3>Examples</h3>
<pre>&lt;echoxml file=&quot;subbuild.xml&quot;&gt;
@@ -65,9 +62,8 @@ Nested XML content is required.
&lt;echo&gt;foo&lt;/echo&gt;
&lt;/target&gt;
&lt;/project&gt;
&lt;/echoxml&gt;
</pre>
<p>Creates an Ant buildfile, <code>subbuild.xml</code>.</p>
&lt;/echoxml&gt;</pre>
<p>Creates an Ant buildfile, <samp>subbuild.xml</samp>.</p>

</body>
</html>

+ 1147
- 1355
manual/Tasks/ejb.html
File diff suppressed because it is too large
View File


+ 211
- 273
manual/Tasks/exec.html View File

@@ -26,40 +26,33 @@

<h2 id="exec">Exec</h2>
<h3>Description</h3>
<p>Executes a system command. When the <i>os</i> attribute is specified, then
the command is only executed when Apache Ant is run on one of the specified operating
systems.</p>
<p>Executes a system command. When the <var>os</var> attribute is specified, then the command is
only executed when Apache Ant is run on one of the specified operating systems.</p>

<p>Note that you cannot interact with the forked program, the only way
to send input to it is via the input and inputstring attributes. Also note that
<em>since Ant 1.6</em>, any attempt to read input in the forked program will receive an
EOF (-1). This is a change from Ant 1.5, where such an attempt would block.</p>
<p>Note that you cannot interact with the forked program, the only way to send input to it is via
the input and inputstring attributes. Also note that <em>since Ant 1.6</em>, any attempt to read
input in the forked program will receive an EOF (<q>-1</q>). This is a change from Ant 1.5, where
such an attempt would block.</p>

<p>If you want to execute an executable using a path relative to the
project's basedir, you may need to
use <code>vmlauncher="false"</code> on some operating systems - but
even this may fail (Solaris 8/9 has been reported as problematic).
The <code>resolveexecutable</code> attribute should be more
reliable, as would be something like</p>
<p>If you want to execute an executable using a path relative to the project's <var>basedir</var>,
you may need to use <var>vmlauncher</var>=<q>false</q> on some operating systems&mdash;but even this
may fail (Solaris 8/9 has been reported as problematic). The <var>resolveexecutable</var> attribute
should be more reliable, as would be something like</p>
<pre>
&lt;property name="executable-full-path"
location="../relative/path/to/executable"/&gt;
&lt;exec executable="${executable-full-path}" ...
</pre>
&lt;property name="executable-full-path"
location="../relative/path/to/executable"/&gt;
&lt;exec executable="${executable-full-path}" ...</pre>

<h4>Windows Users</h4>
<p>The <code>&lt;exec&gt;</code> task delegates to <code>Runtime.exec</code> which in turn
apparently calls <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp">
<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 ".EXE" files are looked for, not ".COM", ".CMD" or other file
types listed in the environment variable PATHEXT. That is only used by the shell.
</p>
<p>
Note that <em>.bat</em> 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>
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>
<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>
<pre>
&lt;target name="help"&gt;
&lt;exec executable="cmd"&gt;
@@ -67,245 +60,207 @@ types listed in the environment variable PATHEXT. That is only used by the shell
&lt;arg value="ant.bat"/&gt;
&lt;arg value="-p"/&gt;
&lt;/exec&gt;
&lt;/target&gt;
</pre>
&lt;/target&gt;</pre>

<p>A common problem is not having the executable on the PATH. In case you get an error
message <tt>Cannot run program "...":CreateProcess error=2. The system cannot find
the path specified.</tt> have a look at your PATH variable. Just type the command directly on
the command line and if Windows finds it, Ant should do it too. (Otherwise ask on the user mailinglist for help.) If Windows can not execute the program add the directory of the program
to the PATH (<tt>set PATH=%PATH%;dirOfProgram</tt>) or specify the absolute path in the
<tt>executable</tt> attribute in your buildfile.
</p>
message <code>Cannot run program "...":CreateProcess error=2. The system cannot find the path
specified.</code> have a look at your <code>PATH</code> variable. Just type the command directly on
the command line and if Windows finds it, Ant should do it too. (Otherwise ask on the user
mailinglist for help.) If Windows can not execute the program add the directory of the program to
the <code>PATH</code> (<code>set PATH=%PATH%;dirOfProgram</code>) or specify the absolute path in
the <var>executable</var> attribute in your buildfile.</p>

<h4>Cygwin Users</h4>
<p>The <code>&lt;exec&gt;</code> task will not understand paths such as /bin/sh
for the executable parameter. This is because the Java VM in which Ant is
running is a standard Windows executable and is not aware of the Cygwin
environment (i.e., doesn't load <code>cygwin1.dll</code>). The only
work-around for this is to compile a JVM under Cygwin (at your own risk).
See for instance
<a href="http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html#cygwin">
OpenJDK build instructions for cygwin</a>.
</p>
<p>The <code>&lt;exec&gt;</code> task will not understand paths such as <code>/bin/sh</code> for the
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
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>

<h4>OpenVMS Users</h4>
<p>The command specified using <code>executable</code> and
<code>&lt;arg&gt;</code> elements is executed exactly as specified
inside a temporary DCL script. This has some implications:</p>
<p>The command specified using <code>executable</code> and <code>&lt;arg&gt;</code> elements is
executed exactly as specified inside a temporary DCL script. This has some implications:</p>
<ul>
<li>paths have to be written in VMS style</li>
<li>if your <code>executable</code> points to a DCL script remember to
prefix it with an <code>@</code>-sign
(e.g. <code>executable="@[FOO]BAR.COM"</code>), just as you would in a
DCL script</li>
<li>paths have to be written in VMS style</li>
<li>if your <var>executable</var> points to a DCL script remember to prefix it with
an <q>@</q>-sign (e.g. <var>executable</var>=<q>@[FOO]BAR.COM</q>), just as you would in a DCL
script</li>
</ul>
<p>For <code>&lt;exec&gt;</code> to work in an environment with a Java VM
older than version 1.4.1-2 it is also <i>required</i> that the logical
<code>JAVA$FORK_SUPPORT_CHDIR</code> is set to <code>TRUE</code> in
the job table (see the <i>JDK Release Notes</i>).</p>
<p>For <code>&lt;exec&gt;</code> to work in an environment with a JVM older than version 1.4.1-2 it
is also <em>required</em> that the logical <code>JAVA$FORK_SUPPORT_CHDIR</code> is set
to <code>TRUE</code> in the job table (see the <em>JDK Release Notes</em>).</p>

<p>Please note that the Java VM provided by HP doesn't follow OpenVMS'
conventions of exit codes. If you run a Java VM with this task, the
task may falsely claim that an error occurred (or silently ignore an
error). Don't use this task to run <code>JAVA.EXE</code>, use a
<code>&lt;java&gt;</code> task with the <code>fork</code> attribute
set to <code>true</code> instead as this task will follow the VM's
<p>Please note that JVM provided by HP doesn't follow OpenVMS' conventions of exit codes. If you
run a JVM with this task, the task may falsely claim that an error occurred (or silently ignore an
error). Don't use this task to run <code>JAVA.EXE</code>, use a <code>&lt;java&gt;</code> task with
the <var>fork</var> attribute set to <q>true</q> instead as this task will follow the JVM's
interpretation of exit codes.</p>

<h4>RedHat S/390 Users</h4>
<p>It has been <a
href="http://listserv.uark.edu/scripts/wa.exe?A1=ind0404&L=vmesa-l#33">reported
on the VMESA-LISTSERV</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">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>
<pre>
[exec] Warning: UNIXProcess.forkAndExec native error: Exec format error
[exec] Result: 255
</pre>
[exec] Result: 255</pre>

<h4 id="background">Running Ant as a background process on Unix(-like) systems</h4>

<p>If you run Ant as a background process (like <code>ant &</code>)
and use the <code>&lt;exec&gt;</code> task with <code>spawn</code>
set to <code>false</code>, you must provide explicit input to the
forked process or Ant will be suspended because it tries to read
from the standard input.</p>
<p>If you run Ant as a background process (like <code>ant &</code>) and use
the <code>&lt;exec&gt;</code> task with <var>spawn</var> set to <q>false</q>, you must provide
explicit input to the forked process or Ant will be suspended because it tries to read from the
standard input.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">command</td>
<td valign="top">the command to execute with all command line
arguments. <b>deprecated, use executable and nested
<code>&lt;arg&gt;</code> elements instead</b>.</td>
<td align="center" rowspan="2">Exactly one of the two</td>
<td>command</td>
<td>the command to execute with all command line arguments. <em><u>Deprecated</u>,
use <var>executable</var> and nested <code>&lt;arg&gt;</code> elements instead</em>.</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">executable</td>
<td valign="top">the command to execute without any command line
arguments.</td>
<td>executable</td>
<td class="left">the command to execute without any command line arguments.</td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">the directory in which the command should be executed.</td>
<td align="center" valign="top">No<br/>
<strong>Note</strong>: the default used when dir has not been
specified depends on the <code>vmlauncher</code> attribute. If
<code>vmlauncher</code> is <code>true</code> the task will use
the current working directory, otherwise it uses the project's basedir.
</td>
<td>dir</td>
<td>the directory in which the command should be executed.</td>
<td>No; if <var>vmlauncher</var> is <q>true</q>, defaults to the current working directory,
otherwise the project's <var>basedir</var></td>
</tr>
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed. If the current OS's name is contained in this list, the command will
be executed. The OS's name is determined by the Java Virtual machine and is set
in the &quot;os.name&quot; system property.
<td>os</td>
<td>list of Operating Systems on which the command may be executed. If the current OS's name is
contained in this list, the command will be executed. The OS's name is determined by JVM and
is set in the <code>os.name</code> system property.
</td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in the &lt;os&gt; condition.
<em>since Ant 1.7</em></td>
<td align="center" valign="top">No</td>
<td>osfamily</td>
<td>OS family as used in the <code>&lt;os&gt;</code> condition. <em>since Ant 1.7</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">spawn</td>
<td valign="top">whether or not you want the command to be spawned<br>
Default is false.<br>
If you spawn a command, its output will not be logged by Ant.<br>
The input, output, error, and result property settings are not active when spawning a process.<br>
<em>since Ant 1.6</em>
<td>spawn</td>
<td>whether or not you want the command to be spawned<br/>If you spawn a command, its output
will not be logged by Ant.<br/>The <var>input</var>, <var>output</var>, <var>error</var>,
and <var>result</var> property settings are not active when spawning a process.<br/><em>since
Ant 1.6</em>
</td>
<td align="center" valign="top">No</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">Name of a file to which to write the output. If the error stream
is not also redirected to a file or property, it will appear in this output.</td>
<td align="center" valign="top">No</td>
<td>output</td>
<td>Name of a file to which to write the output. If the error stream is not also redirected to a
file or property, it will appear in this output.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">error</td>
<td valign="top">The file to which the standard error of the
command should be redirected. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>error</td>
<td>The file to which the standard error of the command should be redirected. <em>since Ant
1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">logError</td>
<td valign="top">This attribute is used when you wish to see error output in Ant's
log and you are redirecting output to a file/property. The error
output will not be included in the output file/property. If you
redirect error with the &quot;error&quot; or &quot;errorProperty&quot;
attributes, this will have no effect. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>logError</td>
<td>This attribute is used when you wish to see error output in Ant's log and you are
redirecting output to a file/property. The error output will not be included in the output
file/property. If you redirect error with the <var>error</var> or <var>errorProperty</var>
attributes, this will have no effect. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">Whether output and error files should be appended to or overwritten.
Defaults to false.</td>
<td align="center" valign="top">No</td>
<td>append</td>
<td>Whether output and error files should be appended to or overwritten.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">outputproperty</td>
<td valign="top">The name of a property in which the output of the
command should be stored. Unless the error stream is redirected to a separate
file or stream, this property will include the error output.</td>
<td align="center" valign="top">No</td>
<td>outputproperty</td>
<td>The name of a property in which the output of the command should be stored. Unless the error
stream is redirected to a separate file or stream, this property will include the error
output.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">errorproperty</td>
<td valign="top">The name of a property in which the standard error of the
command should be stored. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>errorproperty</td>
<td>The name of a property in which the standard error of the command should be
stored. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">input</td>
<td valign="top">A file from which the executed command's standard input
is taken. This attribute is mutually exclusive with the
inputstring attribute. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>input</td>
<td>A file from which the executed command's standard input is taken. This attribute is mutually
exclusive with the <var>inputstring</var> attribute. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">inputstring</td>
<td valign="top">A string which serves as the input stream for the
executed command. This attribute is mutually exclusive with the
input attribute. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td>
<td>inputstring</td>
<td>A string which serves as the input stream for the executed command. This attribute is
mutually exclusive with the <var>input</var> attribute. <em>since Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">resultproperty</td>
<td valign="top">the name of a property in which the return code of the
command should be stored. Only of interest if failonerror=false.</td>
<td align="center" valign="top">No</td>
<td>resultproperty</td>
<td>the name of a property in which the return code of the command should be stored. Only of
interest if <var>failonerror</var>=<q>false</q>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">timeout</td>
<td valign="top">Stop the command if it doesn't finish within the
specified time (given in milliseconds).</td>
<td align="center" valign="top">No</td>
<td>timeout</td>
<td>Stop the command if it doesn't finish within the specified time (given in
milliseconds).</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a
return code signaling failure. Defaults to false.</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code signaling failure.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">failifexecutionfails</td>
<td valign="top">Stop the build if we can't start the program.
Defaults to true.</td>
<td align="center" valign="top">No</td>
<td>failifexecutionfails</td>
<td>Stop the build if we can't start the program.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">newenvironment</td>
<td valign="top">Do not propagate old environment when new environment
variables are specified.</td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>newenvironment</td>
<td>Do not propagate old environment when new environment variables are specified.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">vmlauncher</td>
<td valign="top">Run command using the Java VM's execution facilities
where available. If set to false the underlying OS's shell,
either directly or through the antRun scripts, will be used.
Under some operating systems, this gives access to facilities
not normally available through the VM including, under Windows,
being able to execute scripts, rather than their associated
interpreter. If you want to specify the name of the
executable as a relative path to the directory given by the
dir attribute, it may become necessary to set vmlauncher to
false as well.</td>
<td align="center" valign="top">No, default is <i>true</i></td>
<td>vmlauncher</td>
<td>Run command using the JVM's execution facilities where available. If set to <q>false</q> the
underlying OS's shell, either directly or through the <code>antRun</code> scripts, will be
used. Under some operating systems, this gives access to facilities not normally available
through JVM including, under Windows, being able to execute scripts, rather than their
associated interpreter. If you want to specify the name of the executable as a relative path
to the directory given by the <var>dir</var> attribute, it may become necessary to
set <var>vmlauncher</var> to <q>false</q> as well.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">resolveexecutable</td>
<td valign="top">When this attribute is true, the name of the executable
is resolved firstly against the project basedir and
if that does not exist, against the execution
directory if specified. On Unix systems, if you only
want to allow execution of commands in the user's path,
set this to false. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>resolveexecutable</td>
<td>When this attribute is <q>true</q>, the name of the executable is resolved firstly against
the project <var>basedir</var> and if that does not exist, against the execution directory if
specified. On Unix systems, if you only want to allow execution of commands in the user's
path, set this to <q>false</q>. <em>since Ant 1.6</em></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">searchpath</td>
<td valign="top">When this attribute is true, then
system path environment variables will
be searched when resolving the location
of the executable. <em>since Ant 1.6.3</em></td>
<td align="center" valign="top">No, default is <i>false</i></td>
<td>searchpath</td>
<td>When this attribute is <q>true</q>, then system path environment variables will be searched
when resolving the location of the executable. <em>since Ant 1.6.3</em></td>
<td>No; default is <q>false</q></td>
</tr>
</table>
<h3>Examples</h3>
@@ -316,76 +271,62 @@ start with something like:</p>

<h3>Parameters specified as nested elements</h3>
<h4>arg</h4>
<p>Command line arguments should be specified as nested
<code>&lt;arg&gt;</code> elements. See <a
href="../using.html#arg">Command line arguments</a>.</p>
<p>Command line arguments should be specified as nested <code>&lt;arg&gt;</code>
elements. See <a href="../using.html#arg">Command line arguments</a>.</p>
<h4 id="env">env</h4>
<p>It is possible to specify environment variables to pass to the
system command via nested <code>&lt;env&gt;</code> elements.</p>
<table>
<p>It is possible to specify environment variables to pass to the system command via
nested <code>&lt;env&gt;</code> elements.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">key</td>
<td valign="top">
The name of the environment variable.
<br/>
<strong>Note</strong>: <em>since Ant 1.7</em>,
for Windows, the name is case-insensitive.
</td>
<td align="center" valign="top">Yes</td>
<td>key</td>
<td>The name of the environment variable.<br/><strong>Note</strong>: <em>since Ant 1.7</em>, for
Windows, the name is case-insensitive.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">The literal value for the environment variable.</td>
<td align="center" rowspan="3">Exactly one of these</td>
<td>value</td>
<td>The literal value for the environment variable.</td>
<td rowspan="3">Exactly one of these</td>
</tr>
<tr>
<td valign="top">path</td>
<td valign="top">The value for a PATH like environment
variable. You can use ; or : as path separators and Ant will
convert it to the platform's local conventions.</td>
<td>path</td>
<td class="left">The value for a <code>PATH</code>-like environment variable. 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>
<td valign="top">file</td>
<td valign="top">The value for the environment variable. Will be
replaced by the absolute filename of the file by Ant.</td>
<td>file</td>
<td class="left">The value for the environment variable. Will be replaced by the absolute
filename of the file by Ant.</td>
</tr>
</table>
<h4 id="redirector">redirector</h4>
<em>Since Ant 1.6.2</em>
<p>A nested <a href="../Types/redirector.html">I/O Redirector</a>
can be specified. In general, the attributes of the redirector behave
as the corresponding attributes available at the task level. The most
notable peculiarity stems from the retention of the &lt;exec&gt;
attributes for backwards compatibility. Any file mapping is done
using a <code>null</code> sourcefile; therefore not all
<a href="../Types/mapper.html">Mapper</a> types will return
results. When no results are returned, redirection specifications
will fall back to the task level attributes. In practice this means that
defaults can be specified for input, output, and error output files.
</p>
<p>A nested <a href="../Types/redirector.html">I/O Redirector</a> can be specified. In general, the
attributes of the redirector behave as the corresponding attributes available at the task level.
The most notable peculiarity stems from the retention of the <code>&lt;exec&gt;</code> attributes
for backwards compatibility. Any file mapping is done using a <code>null</code> sourcefile;
therefore not all<a href="../Types/mapper.html">Mapper</a> types will return results. When no
results are returned, redirection specifications will fall back to the task level attributes. In
practice this means that defaults can be specified for input, output, and error output files.</p>
<h3>Errors and return codes</h3>
By default the return code of a <code>&lt;exec&gt;</code> is ignored; when you set
<code>failonerror="true"</code> then any return code signaling failure
(OS specific) causes the build to fail. Alternatively, you can set
<code>resultproperty</code> to the name of a property and have it assigned to
the result code (barring immutability, of course).
<p>
If the attempt to start the program fails with an OS dependent error code,
then <code>&lt;exec&gt;</code> halts the build unless <code>failifexecutionfails</code>
is set to <code>false</code>. You can use that to run a program if it exists, but
otherwise do nothing.
<p>
What do those error codes mean? Well, they are OS dependent. On Windows
boxes you have to look at
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes__0-499_.asp">
the documentation</a>; error code 2 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>By default the return code of a <code>&lt;exec&gt;</code> is ignored; when you
set <var>failonerror</var> to <q>true</q> then any return code signaling failure (OS specific)
causes the build to fail. Alternatively, you can set <var>resultproperty</var> to the name of a
property and have it assigned to the result code (barring immutability, of course).</p>
<p>If the attempt to start the program fails with an OS dependent error code,
then <code>&lt;exec&gt;</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>
<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>

<h3>Examples</h3>
<pre>
@@ -394,14 +335,15 @@ usually not an Ant bug, but some configuration problem on your machine.
&lt;/exec&gt;
</pre>
<p>starts <code>emacs</code> on display 1 of the X Window System.</p>

<pre>
&lt;property environment=&quot;env&quot;/&gt;
&lt;exec ... &gt;
&lt;env key=&quot;PATH&quot; path=&quot;${env.PATH}:${basedir}/bin&quot;/&gt;
&lt;/exec&gt;
</pre>
<p>adds <code>${basedir}/bin</code> to the <code>PATH</code> of the
system command.</p>
<p>adds <samp>${basedir}/bin</samp> to the <code>PATH</code> of the system command.</p>
<pre>
&lt;property name="browser" location="C:/Program Files/Internet Explorer/iexplore.exe"/&gt;
&lt;property name="file" location="ant/docs/manual/index.html"/&gt;
@@ -410,8 +352,9 @@ system command.</p>
&lt;arg value="${file}"/&gt;
&lt;/exec&gt;
</pre>
<p>Starts the <i>${browser}</i> with the specified <i>${file}</i> and end the
Ant process. The browser will remain.</p>
<p>Starts the <samp>${browser}</samp> with the specified <samp>${file}</samp> and end the Ant
process. The browser will remain.</p>

<pre>
&lt;exec executable=&quot;cat&quot;&gt;
&lt;redirector outputproperty=&quot;redirector.out&quot;
@@ -426,21 +369,16 @@ Ant process. The browser will remain.</p>
&lt;/exec&gt;
</pre>

Sends the string &quot;blah before blah&quot; to the &quot;cat&quot; executable,
using an <a href="../Types/filterchain.html">&lt;inputfilterchain&gt;</a>
to replace &quot;before&quot; with &quot;after&quot; on the way in.
Output is sent to the file &quot;redirector.out&quot; and stored
in a property of the same name. Similarly, error output is sent to
a file and a property, both named &quot;redirector.err&quot;.
<p>Sends the string <q>blah before blah</q> to the <code>cat</code> executable, using
an <a href="../Types/filterchain.html">&lt;inputfilterchain&gt;</a> to replace <q>before</q>
with <q>after</q> on the way in. Output is sent to the file <samp>redirector.out</samp> and stored
in a property of the same name. Similarly, error output is sent to a file and a property, both
named <samp>redirector.err</samp>.</p>

<p><strong>Note</strong>: do not try to specify arguments using
a simple arg-element and separate them by spaces. This results in
only a single argument containing the entire string.</p>
<p>
<b>Timeouts:</b> If a timeout is specified, when it is reached the
sub process is killed and a message printed to the log. The return
value of the execution will be "-1", which will halt the build if
<tt>failonerror=true</tt>, but be ignored otherwise.
</p>
<p><strong>Note</strong>: do not try to specify arguments using a simple arg-element and separate
them by spaces. This results in only a single argument containing the entire string.</p>
<p><strong>Timeouts</strong>: If a timeout is specified, when it is reached the sub process is
killed and a message printed to the log. The return value of the execution will be <q>-1</q>, which
will halt the build if <var>failonerror</var>=<q>true</q>, but be ignored otherwise.</p>
</body>
</html>

+ 46
- 55
manual/Tasks/fail.html View File

@@ -26,103 +26,95 @@

<h2 id="fail">Fail</h2>
<h3>Description</h3>
<p>Exits the current build (just throwing a BuildException), optionally printing additional information.</p>
<p>The message of the Exception can be set via the message attribute
or character data nested into the element.</p>
<p>Exits the current build (just throwing a BuildException), optionally printing additional
information.</p>
<p>The message of the Exception can be set via the message attribute or character data nested into
the element.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">message</td>
<td valign="top">A message giving further information on why the build exited</td>
<td align="center" valign="top">No</td>
<td>message</td>
<td>A message giving further information on why the build exited</td>
<td>No</td>
</tr>
<tr>
<td valign="top">if</td>
<td valign="top">Only fail <a href="../properties.html#if+unless">if a property of the given name exists</a>
<td>if</td>
<td>Only fail <a href="../properties.html#if+unless">if a property of the given name exists</a>
in the current project</td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">unless</td>
<td valign="top">Only fail <a href="../properties.html#if+unless">if a property of the given name doesn't
<td>unless</td>
<td>Only fail <a href="../properties.html#if+unless">if a property of the given name doesn't
exist</a> in the current project</td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">status</td>
<td valign="top">Exit using the specified status code;
assuming the generated Exception is not caught, the
<td>status</td>
<td>Exit using the specified status code; assuming the generated Exception is not caught, the
JVM will exit with this status. <em>Since Apache Ant 1.6.2</em></td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>

<p>As an alternative to the <i>if</i>/<i>unless</i> attributes,
conditional failure can be achieved using a single nested
<code>&lt;condition&gt;</code> element, which should contain exactly one
core or custom condition. For information about conditions, see
<a href="conditions.html">here</a>.<br><em>Since Ant 1.6.2</em>
<p>As an alternative to the <var>if</var>/<var>unless</var> attributes, conditional failure can be
achieved using a single nested <code>&lt;condition&gt;</code> element, which should contain exactly
one core or custom condition. For information about conditions,
see <a href="conditions.html">here</a>.<br><em>Since Ant 1.6.2</em>
</p>

<h3>Examples</h3>

<pre> &lt;fail/&gt;</pre>
<pre>&lt;fail/&gt;</pre>
<p>will exit the current build with no further information given.</p>
<pre>
BUILD FAILED

build.xml:4: No message
</pre>
build.xml:4: No message</pre>

<pre> &lt;fail message=&quot;Something wrong here.&quot;/&gt;</pre>
<p>will exit the current build and print something
like the following to wherever your output goes:
</p>
<pre>&lt;fail message=&quot;Something wrong here.&quot;/&gt;</pre>
<p>will exit the current build and print something like the following to wherever your output
goes:</p>
<pre>
BUILD FAILED

build.xml:4: Something wrong here.
</pre>
build.xml:4: Something wrong here.</pre>

<pre> &lt;fail&gt;Something wrong here.&lt;/fail&gt;</pre>
<pre>&lt;fail&gt;Something wrong here.&lt;/fail&gt;</pre>
<p>will give the same result as above.</p>

<pre> &lt;fail unless=&quot;thisdoesnotexist&quot;/&gt;</pre>
<p>will exit the current build and print something
like the following to wherever your output goes:
</p>
<pre>&lt;fail unless=&quot;thisdoesnotexist&quot;/&gt;</pre>
<p>will exit the current build and print something like the following to wherever your output
goes:</p>
<pre>
BUILD FAILED

build.xml:2: unless=thisdoesnotexist
</pre>
build.xml:2: unless=thisdoesnotexist</pre>

Using a condition to achieve the same effect:

<pre>
&lt;fail&gt;
&lt;condition&gt;
&lt;not&gt;
&lt;isset property=&quot;thisdoesnotexist&quot;/&gt;
&lt;/not&gt;
&lt;/condition&gt;
&lt;/fail&gt;
</pre>
&lt;fail&gt;
&lt;condition&gt;
&lt;not&gt;
&lt;isset property=&quot;thisdoesnotexist&quot;/&gt;
&lt;/not&gt;
&lt;/condition&gt;
&lt;/fail&gt;</pre>

<p>Output:</p>
<pre>
BUILD FAILED

build.xml:2: condition satisfied
</pre>
build.xml:2: condition satisfied</pre>

<pre>
&lt;fail message=&quot;Files are missing.&quot;&gt;
@@ -133,10 +125,9 @@ build.xml:2: condition satisfied
&lt;/resourcecount&gt;
&lt;/not&gt;
&lt;/condition&gt;
&lt;/fail&gt;
</pre>
<p>Will check that both files <i>one.txt</i> and <i>two.txt</i> are present otherwise the build
will fail.</p>
&lt;/fail&gt;</pre>
<p>Will check that both files <samp>one.txt</samp> and <samp>two.txt</samp> are present otherwise
the build will fail.</p>

</body>
</html>

+ 33
- 33
manual/Tasks/filter.html View File

@@ -26,51 +26,51 @@

<h2 id="filter">Filter</h2>
<h3>Description</h3>
<p>Sets a token filter for this project or read multiple token filter from
an input file and sets these as filters.
Token filters are used by all tasks that perform file copying operations
through the Project commodity methods. See the warning
<a href="../using.html#filters"><em>here</em></a> before using.</p>
<p>Note 1: the token string must not contain the separators chars (@).<br>
Note 2: Either token and value attributes must be provided, or only the
filtersfile attribute.</p>
<p>Sets a token filter for this project or read multiple token filter from an input file and sets
these as filters. Token filters are used by all tasks that perform file copying operations through
the Project commodity methods. See the warning <a href="../using.html#filters"><em>here</em></a>
before using.</p>
<p>Note 1: the token string must not contain the separators chars (<q>@</q>).<br/>Note 2:
Either <var>token</var> and <var>value</var> attributes must be provided, or only
the <var>filtersfile</var> attribute.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">token</td>
<td valign="top">the token string without @</td>
<td align="center" valign="top">Yes*</td>
<td>token</td>
<td>the token string without <q>@</q></td>
<td>Yes<sup>*</sup></td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">the string that should be put to replace the token when the
file is copied</td>
<td align="center" valign="top">Yes*</td>
<td>value</td>
<td>the string that should be put to replace the token when the file is copied</td>
<td>Yes<sup>*</sup></td>
</tr>
<tr>
<td valign="top">filtersfile</td>
<td valign="top">The file from which the filters must be read. This file must be a formatted as a property file.</td>
<td align="center" valign="top">Yes*</td>
<td>filtersfile</td>
<td>The file from which the filters must be read. This file must be a formatted as a property
file.</td>
<td>Yes<sup>*</sup></td>
</tr>
</table>
<p>* see notes 1 and 2 above parameters table.</p>
<p>* see Note 1 and 2 above parameters table.</p>
<h3>Examples</h3>
<pre> &lt;filter token=&quot;year&quot; value=&quot;2000&quot;/&gt;
&lt;copy todir=&quot;${dest.dir}&quot; filtering=&quot;true&quot;&gt;
&lt;fileset dir=&quot;${src.dir}&quot;/&gt;
&lt;/copy&gt;</pre>
<p>will copy recursively all the files from the <i>src.dir</i> directory into
the <i>dest.dir</i> directory replacing all the occurrences of the string <i>@year@</i>
with <i>2000.</i></p>
<pre> &lt;filter filtersfile=&quot;deploy_env.properties&quot;/&gt;</pre>
will read all property entries from the <i>deploy_env.properties</i> file
and set these as filters.
<pre>
&lt;filter token=&quot;year&quot; value=&quot;2000&quot;/&gt;
&lt;copy todir=&quot;${dest.dir}&quot; filtering=&quot;true&quot;&gt;
&lt;fileset dir=&quot;${src.dir}&quot;/&gt;
&lt;/copy&gt;</pre>
<p>will copy recursively all the files from the <samp>src.dir</samp> directory into
the <samp>dest.dir</samp> directory replacing all the occurrences of the string <code>@year@</code>
with <q>2000</q>.</p>
<pre>&lt;filter filtersfile=&quot;deploy_env.properties&quot;/&gt;</pre>
<p>will read all property entries from the <samp>deploy_env.properties</samp> file and set these as
filters.</p>

</body>
</html>

+ 153
- 234
manual/Tasks/fixcrlf.html View File

@@ -26,301 +26,220 @@

<h2 id="fixcrlf">FixCRLF</h2>
<h3>Description</h3>
<p>
Adjusts a text file to local conventions.
</p>
<p>Adjusts a text file to local conventions.</p>

<p>
The set of files to be adjusted can be refined with the
<i>includes</i>, <i>includesfile</i>, <i>excludes</i>,
<i>excludesfile</i> and <i>defaultexcludes</i>
attributes. Patterns provided through the <i>includes</i> or
<i>includesfile</i> attributes specify files to be
included. Patterns provided through the <i>exclude</i> or
<i>excludesfile</i> attribute specify files to be
excluded. Additionally, default exclusions can be specified with
the <i>defaultexcludes</i> attribute. See the section on <a
href="../dirtasks.html#directorybasedtasks">directory-based
tasks</a>, for details of file inclusion/exclusion patterns
and their usage.
</p>
<p>The set of files to be adjusted can be refined with
the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var>
and <var>defaultexcludes</var> attributes. Patterns provided through the <var>includes</var>
or <var>includesfile</var> attributes specify files to be included. Patterns provided through
the <var>exclude</var> or <var>excludesfile</var> attribute specify files to be
excluded. Additionally, default exclusions can be specified with the <var>defaultexcludes</var>
attribute. See the section on <a href="../dirtasks.html#directorybasedtasks">directory-based
tasks</a>, for details of file inclusion/exclusion patterns and their usage.</p>

<p>
This task forms an implicit
<a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>srcdir</code>) as well as the nested
<code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.
</p>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>srcdir</var>) as well as
the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
and <code>&lt;patternset&gt;</code> elements.</p>

<p>
The output file is only written if it is a new file, or if it
differs from the existing file. This prevents spurious
rebuilds based on unchanged files which have been regenerated
by this task.
</p>
<p>The output file is only written if it is a new file, or if it differs from the existing file.
This prevents spurious rebuilds based on unchanged files which have been regenerated by this
task.</p>

<p>
<em>Since Apache Ant 1.7</em>, this task can be used in a
<a href="../Types/filterchain.html">filterchain</a>.
</p>
<p><em>Since Apache Ant 1.7</em>, this task can be used in
a <a href="../Types/filterchain.html">filterchain</a>.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="center" rowspan="2"><b>Attribute</b></td>
<td valign="center" rowspan="2"><b>Description</b></td>
<td align="center" valign="top" colspan="2"><b>Required</b></td>
<th rowspan="2">Attribute</th>
<th rowspan="2">Description</th>
<th colspan="2">Required</th>
</tr>
<tr>
<td valign="center"><b>As Task</b></td>
<td valign="center"><b>As Filter</b></td>
<th>As Task</th>
<th>As Filter</th>
</tr>
<tr>
<td valign="top">srcDir</td>
<td valign="top">Where to find the files to be fixed up.</td>
<td valign="top" align="center" rowspan="2">One of these</td>
<td>&nbsp;</td>
<td>srcDir</td>
<td>Where to find the files to be fixed up.</td>
<td rowspan="2" class="center">One of these</td>
<td rowspan="11">N/A</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">Name of a single file to fix. <em>Since Ant 1.7</em></td>
<td>&nbsp;</td>
<td>file</td>
<td class="left">Name of a single file to fix. <em>Since Ant 1.7</em></td>
</tr>
<tr>
<td valign="top">destDir</td>
<td valign="top">Where to place the corrected files. Defaults to
srcDir (replacing the original file).</td>
<td valign="top" align="center">No</td>
<td>&nbsp;</td>
<td>destDir</td>
<td>Where to place the corrected files.</td>
<td class="center">No; defaults to <var>srcDir</var> (replace the original files)</td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>&nbsp;</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included.</td>
<td class="center">No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern.</td>
<td valign="top" align="center">No</td>
<td>&nbsp;</td>
<td>includesfile</td>
<td>name of a file. Each line of this file is taken to be an include pattern.</td>
<td class="center">No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>&nbsp;</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.</td>
<td class="center">No; defaults to default excludes or none if <var>defaultexcludes</var>
is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern.</td>
<td valign="top" align="center">No</td>
<td>&nbsp;</td>
<td>excludesfile</td>
<td>name of a file. Each line of this file is taken to be an exclude pattern.</td>
<td class="center">No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.
</td>
<td valign="top" align="center">No</td>
<td>&nbsp;</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td class="center">No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The encoding of the files.</td>
<td align="center">No; defaults to default JVM encoding.</td>
<td>&nbsp;</td>
<td>encoding</td>
<td>The encoding of the files.</td>
<td class="center">No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td valign="top">outputencoding</td>
<td valign="top">The encoding to use when writing the files.
<em>Since Ant 1.7</em></td>
<td align="center">No; defaults to the value of the encoding attribute.</td>
<td>&nbsp;</td>
<td>outputencoding</td>
<td>The encoding to use when writing the files. <em>Since Ant 1.7</em></td>
<td class="center">No; defaults to <var>encoding</var> if set or default JVM character encoding
otherwise</td>
</tr>
<tr>
<td valign="top">preservelastmodified</td>
<td valign="top">Whether to preserve the last modified
date of source files. <em>Since Ant 1.6.3</em></td>
<td align="center">No; default is <i>false</i></td>
<td>&nbsp;</td>
<td>preservelastmodified</td>
<td>Whether to preserve the last modified date of source files. <em>Since Ant 1.6.3</em></td>
<td class="center">No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">eol</td>
<td valign="top">
Specifies how end-of-line (EOL) characters are to be
handled. The EOL characters are CR, LF and the pair CRLF.
Valid values for this property are:
<td>eol</td>
<td>Specifies how end-of-line (EOL) characters are to be handled. The EOL characters are CR, LF
and the pair CRLF. Valid values for this property are:
<ul>
<li>asis: leave EOL characters alone</li>
<li>cr: convert all EOLs to a single CR</li>
<li>lf: convert all EOLs to a single LF</li>
<li>crlf: convert all EOLs to the pair CRLF</li>
<li>mac: convert all EOLs to a single CR</li>
<li>unix: convert all EOLs to a single LF</li>
<li>dos: convert all EOLs to the pair CRLF</li>
<li><q>asis</q>: leave EOL characters alone</li>
<li><q>cr</q>: convert all EOLs to a single CR</li>
<li><q>lf</q>: convert all EOLs to a single LF</li>
<li><q>crlf</q>: convert all EOLs to the pair CRLF</li>
<li><q>mac</q>: convert all EOLs to a single CR</li>
<li><q>unix</q>: convert all EOLs to a single LF</li>
<li><q>dos</q>: convert all EOLs to the pair CRLF</li>
</ul>
Default is based on the platform on which you are running this task.
For Unix platforms (including Mac OS X), the default is &quot;lf&quot;.
For DOS-based systems (including Windows), the default is
&quot;crlf&quot;.
For Mac environments other than OS X, the default is &quot;cr&quot;.
<p>
This is the preferred method for specifying EOL. The
&quot;<i><b>cr</b></i>&quot; attribute (see below) is
now deprecated.
</p>
<p>
<i>N.B.</i>: One special case is recognized. The three
characters CR-CR-LF are regarded as a single EOL.
Unless this property is specified as &quot;asis&quot;,
this sequence will be converted into the specified EOL
type.
</p>
<p>This is the preferred method for specifying EOL. The <var>cr</var> attribute (see below)
is now deprecated.</p>
<p><strong>Note</strong>: One special case is recognized. The three characters CR-CR-LF are
regarded as a single EOL. Unless this property is specified as <q>asis</q>, this sequence
will be converted into the specified EOL type.</p>
</td>
<td valign="top" align="center" colspan="2">No</td>
<td colspan="2">No; default is platform-specific: <q>lf</q> for Unix platforms (including Mac OS
X/macOS), <q>crlf</q> for DOS-based systems (including Windows), <q>cr</q> for Mac environments
other than OS X</td>
</tr>
<tr>
<td valign="top">cr</td>
<td valign="top">
<i><b>Deprecated.</b></i> Specifies how CR characters are
to be handled at end-of-line (EOL). Valid values for this
property are:
<td>cr</td>
<td><em><u>Deprecated</u></em>. Specifies how CR characters are to be handled at end-of-line
(EOL). Valid values for this property are:
<ul>
<li>asis: leave EOL characters alone.</li>
<li>
add: add a CR before any single LF characters. The
intent is to convert all EOLs to the pair CRLF.
</li>
<li>
remove: remove all CRs from the file. The intent is
to convert all EOLs to a single LF.
</li>
<li><q>asis</q>: leave EOL characters alone.</li>
<li><q>add</q>: add a CR before any single LF characters. The intent is to convert all EOLs
to the pair CRLF.</li>
<li><q>remove</q>: remove all CRs from the file. The intent is to convert all EOLs to a
single LF.</li>
</ul>
Default is based on the platform on which you are running
this task. For Unix platforms, the default is &quot;remove&quot;.
For DOS based systems (including Windows), the default is
&quot;add&quot;.
<p>
<i>N.B.</i>: One special case is recognized. The three
characters CR-CR-LF are regarded as a single EOL.
Unless this property is specified as &quot;asis&quot;,
this sequence will be converted into the specified EOL
type.
</p>
<p><strong>Note</strong>: One special case is recognized. The three characters CR-CR-LF are
regarded as a single EOL. Unless this property is specified as <q>asis</q>, this sequence
will be converted into the specified EOL type.</p>
</td>
<td valign="top" align="center" colspan="2">No</td>
<td colspan="2">No; default is platform-specific: <q>remove</q> for Unix platforms, <q>add</q>
for DOS based systems (including Windows)</td>
</tr>
<tr>
<td valign="top">javafiles</td>
<td valign="top">
Used only in association with the
&quot;<i><b>tab</b></i>&quot; attribute (see below), this
boolean attribute indicates whether the fileset is a set
of java source files
(&quot;yes&quot;/&quot;no&quot;). Defaults to
&quot;no&quot;. See notes in section on &quot;tab&quot;.
</td>
<td valign="top" align="center" colspan="2">No</td>
<td>javafiles</td>
<td>Used only in association with the <var>tab</var> attribute (see below), this boolean
attribute indicates whether the fileset is a set of Java source files (<q>yes|no</q>). See
notes in section on <var>tab</var>.</td>
<td colspan="2">No; defaults to <q>no</q></td>
</tr>
<tr>
<td valign="top">tab</td>
<td valign="top">Specifies how tab characters are to be handled. Valid
values for this property are:
<td>tab</td>
<td>Specifies how tab characters are to be handled. Valid values for this property are:
<ul>
<li>add: convert sequences of spaces which span a tab stop to tabs</li>
<li>asis: leave tab and space characters alone</li>
<li>remove: convert tabs to spaces</li>
<li><q>add</q>: convert sequences of spaces which span a tab stop to tabs</li>
<li><q>asis</q>: leave tab and space characters alone</li>
<li><q>remove</q>: convert tabs to spaces</li>
</ul>
Default for this parameter is &quot;asis&quot;.
<p>
<i>N.B.</i>: When the attribute
&quot;<i><b>javafiles</b></i>&quot; (see above) is
&quot;true&quot;, literal TAB characters occurring
within Java string or character constants are never
modified. This functionality also requires the
recognition of Java-style comments.
</p>
<p>
<i>N.B.</i>: There is an incompatibility between this
and the previous version in the handling of white
space at the end of lines. This version does
<i><b>not</b></i> remove trailing whitespace on lines.
</p>
<p><strong>Note</strong>: When the attribute <var>javafiles</var> (see above) is <q>true</q>,
literal TAB characters occurring within Java string or character constants are never
modified. This functionality also requires the recognition of Java-style comments.</p>
<p><strong>Note</strong>: There is an incompatibility between this and the previous version in
the handling of white space at the end of lines. This version
does <em><strong>not</strong></em> remove trailing whitespace on lines.</p>
</td>
<td valign="top" align="center" colspan="2">No</td>
<td colspan="2">No; default is <q>asis</q></td>
</tr>
<tr>
<td valign="top">tablength</td>
<td valign="top">TAB character interval. Valid values are between
2 and 80 inclusive. The default for this parameter is 8.</td>
<td valign="top" align="center" colspan="2">No</td>
<td>tablength</td>
<td>TAB character interval. Valid values are between <q>2</q> and <q>80</q> inclusive.</td>
<td colspan="2">No; default is <q>8</q></td>
</tr>
<tr>
<td valign="top">eof</td>
<td valign="top">Specifies how DOS end of file (control-Z) characters are
to be handled. Valid values for this property are:
<td>eof</td>
<td>Specifies how DOS end of file (control-Z) characters are to be handled. Valid values for
this property are:
<ul>
<li>add: ensure that there is an EOF character at the end of the file</li>
<li>asis: leave EOF characters alone</li>
<li>remove: remove any EOF character found at the end</li>
<li><q>add</q>: ensure that there is an EOF character at the end of the file</li>
<li><q>asis</q>: leave EOF characters alone</li>
<li><q>remove</q>: remove any EOF character found at the end</li>
</ul>
Default is based on the platform on which you are running this task.
For Unix platforms, the default is remove. For DOS based systems
(including Windows), the default is asis.
</td>
<td valign="top" align="center" colspan="2">No</td>
</td>
<td colspan="2">No; default is platform-specific: <q>remove</q> for Unix platforms, <q>asis</q>
for DOS based systems (including Windows)</td>
</tr>
<tr>
<td valign="top">fixlast</td>
<td valign="top">Whether to add a missing EOL to the last line
of a processed file.<br/>Ignored if EOL is asis.<br/><em>Since Ant 1.6.1</em></td>
<td align="center" colspan="2">No; default is <i>true</i></td>
<td>fixlast</td>
<td>Whether to add a missing EOL to the last line of a processed file.<br/>Ignored
if <var>eof</var> is <q>asis</q>.<br/><em>Since Ant 1.6.1</em></td>
<td colspan="2">No; default is <q>true</q></td>
</tr>
</table>
<h3>Examples</h3>
<pre>&lt;fixcrlf srcdir=&quot;${src}&quot; includes=&quot;**/*.sh&quot;
eol=&quot;lf&quot; eof=&quot;remove&quot; /&gt;</pre>
<p>Replaces EOLs with LF characters and removes eof characters from
the shell scripts. Tabs and spaces are left as is.</p>
<pre>&lt;fixcrlf srcdir=&quot;${src}&quot;
includes=&quot;**/*.bat&quot; eol=&quot;crlf&quot; /&gt;</pre>
<p>Replaces all EOLs with cr-lf pairs in the batch files.
Tabs and spaces are left as is.
EOF characters are left alone if run on
DOS systems, and are removed if run on Unix systems.</p>
<pre>&lt;fixcrlf srcdir=&quot;${src}&quot;
includes=&quot;**/Makefile&quot; tab=&quot;add&quot; /&gt;</pre>
<p>Sets EOLs according to local OS conventions, and
converts sequences of spaces and tabs to the minimal set of spaces and
tabs which will maintain spacing within the line. Tabs are
set at 8 character intervals. EOF characters are left alone if
run on DOS systems, and are removed if run on Unix systems.
Many versions of make require tabs prior to commands.</p>
<pre>&lt;fixcrlf srcdir=&quot;${src}&quot; includes=&quot;**/*.java&quot;
<pre>
&lt;fixcrlf srcdir=&quot;${src}&quot; includes=&quot;**/*.sh&quot;
eol=&quot;lf&quot; eof=&quot;remove&quot;/&gt;</pre>
<p>Replaces EOLs with LF characters and removes eof characters from the shell scripts. Tabs and
spaces are left as is.</p>
<pre>
&lt;fixcrlf srcdir=&quot;${src}&quot;
includes=&quot;**/*.bat&quot; eol=&quot;crlf&quot;/&gt;</pre>
<p>Replaces all EOLs with cr-lf pairs in the batch files. Tabs and spaces are left as is. EOF
characters are left alone if run on DOS systems, and are removed if run on Unix systems.</p>
<pre>
&lt;fixcrlf srcdir=&quot;${src}&quot;
includes=&quot;**/Makefile&quot; tab=&quot;add&quot;/&gt;</pre>
<p>Sets EOLs according to local OS conventions, and converts sequences of spaces and tabs to the
minimal set of spaces and tabs which will maintain spacing within the line. Tabs are set at 8
character intervals. EOF characters are left alone if run on DOS systems, and are removed if run on
Unix systems. Many versions of make require tabs prior to commands.</p>
<pre>
&lt;fixcrlf srcdir=&quot;${src}&quot; includes=&quot;**/*.java&quot;
tab=&quot;remove&quot; tablength=&quot;3&quot;
eol=&quot;lf&quot; javafiles=&quot;yes&quot; /&gt;</pre>
<p>
Converts all EOLs in the included java source files to a
single LF. Replace all TAB characters except those in string
or character constants with spaces, assuming a tab width of 3.
If run on a unix system, any CTRL-Z EOF characters at the end
of the file are removed. On DOS/Windows, any such EOF
characters will be left untouched.
eol=&quot;lf&quot; javafiles=&quot;yes&quot;/&gt;</pre>
<p>Converts all EOLs in the included Java source files to a single LF. Replace all TAB characters
except those in string or character constants with spaces, assuming a tab width of 3. If run on a
Unix system, any CTRL-Z EOF characters at the end of the file are removed. On DOS/Windows, any such
EOF characters will be left untouched.
</p>
<pre>&lt;fixcrlf srcdir=&quot;${src}&quot;
includes=&quot;**/README*&quot; tab=&quot;remove&quot; /&gt;</pre>
<p>Sets EOLs according to local OS conventions, and
converts all tabs to spaces, assuming a tab width of 8.
EOF characters are left alone if run on
DOS systems, and are removed if run on Unix systems.
You never know what editor a user will use to browse READMEs.</p>
<pre>
&lt;fixcrlf srcdir=&quot;${src}&quot;
includes=&quot;**/README*&quot; tab=&quot;remove&quot;/&gt;</pre>
<p>Sets EOLs according to local OS conventions, and converts all tabs to spaces, assuming a tab
width of 8. EOF characters are left alone if run on DOS systems, and are removed if run on Unix
systems. You never know what editor a user will use to browse READMEs.</p>

</body>
</html>

+ 438
- 526
manual/Tasks/ftp.html
File diff suppressed because it is too large
View File


+ 43
- 46
manual/Tasks/genkey.html View File

@@ -29,86 +29,83 @@
<p>Generates a key in a keystore.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">alias</td>
<td valign="top">the alias to add under</td>
<td valign="top" align="center">Yes.</td>
<td>alias</td>
<td>the alias to add under</td>
<td>Yes.</td>
</tr>
<tr>
<td valign="top">storepass</td>
<td valign="top">password for keystore integrity. Must
be at least 6 characters long</td>
<td valign="top" align="center">Yes.</td>
<td>storepass</td>
<td>password for keystore integrity. Must be at least 6 characters long</td>
<td>Yes.</td>
</tr>
<tr>
<td valign="top">keystore</td>
<td valign="top">keystore location</td>
<td valign="top" align="center">No</td>
<td>keystore</td>
<td>keystore location</td>
<td>No</td>
</tr>
<tr>
<td valign="top">storetype</td>
<td valign="top">keystore type</td>
<td valign="top" align="center">No</td>
<td>storetype</td>
<td>keystore type</td>
<td>No</td>
</tr>
<tr>
<td valign="top">keypass</td>
<td valign="top">password for private key (if different)</td>
<td valign="top" align="center">No</td>
<td>keypass</td>
<td>password for private key (if different)</td>
<td>No</td>
</tr>
<tr>
<td valign="top">sigalg</td>
<td valign="top">the algorithm to use in signing</td>
<td valign="top" align="center">No</td>
<td>sigalg</td>
<td>the algorithm to use in signing</td>
<td>No</td>
</tr>
<tr>
<td valign="top">keyalg</td>
<td valign="top">the method to use when generating name-value pair</td>
<td valign="top" align="center">No</td>
<td>keyalg</td>
<td>the method to use when generating name-value pair</td>
<td>No</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">(true | false) verbose output when signing</td>
<td valign="top" align="center">No</td>
<td>verbose</td>
<td>(<q>true|false</q>) verbose output when signing</td>
<td>No</td>
</tr>
<tr>
<td valign="top">dname</td>
<td valign="top">The distinguished name for entity</td>
<td valign="top" align="center">Yes if dname element unspecified</td>
<td>dname</td>
<td>The distinguished name for entity</td>
<td>Yes unless <code>&lt;dname&gt;</code> element is specified</td>
</tr>
<tr>
<td valign="top">validity</td>
<td valign="top">(integer) indicates how many days certificate is valid</td>
<td valign="top" align="center">No</td>
<td>validity</td>
<td>(integer) indicates how many days certificate is valid</td>
<td>No</td>
</tr>
<tr>
<td valign="top">keysize</td>
<td valign="top">(integer) indicates the size of key generated</td>
<td valign="top" align="center">No</td>
<td>keysize</td>
<td>(integer) indicates the size of key generated</td>
<td>No</td>
</tr>
</table>

<p>Alternatively you can specify the distinguished name by creating a
sub-element named dname and populating it with param elements that
have a name and a value. When using the subelement it is automatically
encoded properly and commas (&quot;<code>,</code>&quot;) are replaced
with &quot;<code>\,</code>&quot;.</p>
<p>Alternatively you can specify the distinguished name by creating a <code>&lt;dname&gt;</code>
sub-element and populating it with <code>&lt;param&gt;</code> elements that have a <var>name</var>
and a <var>value</var>. When using the subelement, it is automatically encoded properly and commas
(<q>,</q>) are replaced with <q>\,</q>.</p>

<p>The following two examples are identical:</p>

<h3>Examples</h3>
<pre>
&lt;genkey alias=&quot;apache-group&quot; storepass=&quot;secret&quot;
dname=&quot;CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US&quot;/&gt;
</pre>
dname=&quot;CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US&quot;/&gt;</pre>

<pre>
&lt;genkey alias=&quot;apache-group&quot; storepass=&quot;secret&quot; &gt;
&lt;genkey alias=&quot;apache-group&quot; storepass=&quot;secret&quot;&gt;
&lt;dname&gt;
&lt;param name=&quot;CN&quot; value=&quot;Ant Group&quot;/&gt;
&lt;param name=&quot;OU&quot; value=&quot;Jakarta Division&quot;/&gt;


+ 149
- 173
manual/Tasks/get.html View File

@@ -26,247 +26,223 @@

<h2 id="get">Get</h2>
<h3>Description</h3>
<p>Gets files from URLs. When the verbose option is &quot;on&quot;, this task
displays a '.' for every 100 Kb retrieved. Any URL schema supported by
the runtime is valid here, including http:, ftp: and jar:;
</p>
The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
<p>Gets files from URLs. When the <var>verbose</var> option is <q>on</q>, this task displays
a <q>.</q> for every 100 Kb retrieved. Any URL schema supported by the runtime is valid here,
including <q>http:</q>, <q>ftp:</q> and <q>jar:</q>.</p>
<p>The <var>usetimestamp</var> option enables you to control downloads so that the remote file is
only fetched if newer than the local copy. If there is no local copy, the download always takes
place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp.
<strong>Note</strong>: This timestamp facility only works on downloads using the HTTP protocol.
<p>
A username and password can be specified, in which case basic 'slightly encoded
plain text' authentication is used. This is only secure over an HTTPS link.
</p>

<p><b>Proxies</b>. <em>Since Apache Ant 1.7.0</em>, Ant running on Java 5 or later can
<a href="../proxy.html">use the proxy settings of the operating
system</a> if enabled with the
<code>-autoproxy</code> option. There is also the
<a href="../Tasks/setproxy.html">&lt;setproxy&gt;</a> task
for earlier Java versions. With proxies turned
on, <code>&lt;get&gt;</code> requests against localhost may not work
as expected, if the request is relayed to the proxy.</p>
place. When a file is downloaded, the timestamp of the downloaded file is set to the remote
timestamp. <strong>Note</strong>: This timestamp facility only works on downloads using the HTTP
protocol.</p>
<p>A username and password can be specified, in which case basic ('slightly encoded plain text')
authentication is used. This is only secure over an HTTPS link.</p>

<p><strong>Proxies</strong>. <em>Since Apache Ant 1.7.0</em>, Ant running on Java 5 or later
can <a href="../proxy.html">use the proxy settings of the operating system</a> if enabled with
the <code>-autoproxy</code> command line option. There is also
the <a href="../Tasks/setproxy.html">&lt;setproxy&gt;</a> task for earlier Java versions. With
proxies turned on, <code>&lt;get&gt;</code> requests against localhost may not work as expected, if
the request is relayed to the proxy.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">src</td>
<td valign="top">the URL from which to retrieve a file.</td>
<td align="center" valign="top">Yes or a nested resource collection</td>
<td>src</td>
<td>the URL from which to retrieve a file.</td>
<td>Yes, or a nested resource collection</td>
</tr>
<tr>
<td valign="top">dest</td>
<td valign="top">the file or directory where to store the
retrieved file(s).</td>
<td align="center" valign="top">Yes</td>
<td>dest</td>
<td>the file or directory where to store the retrieved file(s).</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
<td align="center" valign="top">No; default "false"</td>
<td>verbose</td>
<td>show verbose progress information (<q>on|off</q>).</td>
<td>No; default is <q>off</q></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">Log errors only.(&quot;true&quot;/&quot;false&quot;).</td>
<td align="center" valign="top">No; default "false"</td>
<td>quiet</td>
<td>Log errors only.(<q>true|false</q>).</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">ignoreerrors</td>
<td valign="top">Log errors but don't treat as fatal.</td>
<td align="center" valign="top">No; default "false"</td>
<td>ignoreerrors</td>
<td>Log errors but don't treat as fatal.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">usetimestamp</td>
<td valign="top">conditionally download a file based on the timestamp of the
local copy. HTTP only</td>
<td align="center" valign="top">No; default "false"</td>
<td>usetimestamp</td>
<td>conditionally download a file based on the timestamp of the local copy. HTTP only</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">username</td>
<td valign="top">username for 'BASIC' http authentication</td>
<td align="center" valign="top">if password is set</td>
<td>username</td>
<td>username for basic HTTP authentication</td>
<td>Yes, if <var>password</var> is set</td>
</tr>
<tr>
<td valign="top">password</td>
<td valign="top">password: required</td>
<td align="center" valign="top">if username is set</td>
<td>password</td>
<td>password for basic HTTP authentication</td>
<td>Yes if <var>username</var> is set</td>
</tr>
<tr>
<td valign="top">maxtime</td>
<td valign="top">Maximum time in seconds a single download may take,
otherwise it will be interrupted and treated like a download
error. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No: default 0 which means no
maximum time</td>
<td>maxtime</td>
<td>Maximum time in seconds a single download may take, otherwise it will be interrupted and
treated like a download error. <em>Since Ant 1.8.0</em></td>
<td>No; default is <q>0</q> which means
unlimited</td>
</tr>
<tr>
<td valign="top">retries</td>
<td valign="top">The number of attempts to make for opening the URI.<br/>
The name of the attribute is misleading as a value of 1 means
"don't retry on error" and a value of 0 meant don't even try to
reach the URI at all.<br/>
<em>since Ant 1.8.0</em></td>
<td align="center" valign="top">No; default "3"</td>
<td>retries</td>
<td>The number of attempts to make for opening the URI.<br/>The name of the attribute is
misleading as a value of <q>1</q> means "don't retry on error" and a value of <q>0</q> meant
don't even try to reach the URI at all.<br/><em>since Ant 1.8.0</em></td>
<td>No; default is <q>3</q></td>
</tr>
<tr>
<td valign="top">skipexisting</td>
<td valign="top">skip files that already exist on the local filesystem<br/>
<em>since Ant 1.8.0</em></td>
<td align="center" valign="top">No; default "false"</td>
<td>skipexisting</td>
<td>skip files that already exist on the local filesystem<br/><em>since Ant 1.8.0</em></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">httpusecaches</td>
<td valign="top">HTTP only - if true, allow caching at the
HttpUrlConnection level. if false, turn caching off.<br/>
<strong>Note</strong> this is only a hint to the underlying UrlConnection
class, implementations and proxies are free to ignore the
setting.</td>
<td align="center" valign="top">No; default "true"</td>
<td>httpusecaches</td>
<td>HTTP only&mdash;if <q>true</q>, allow caching at the <code>HttpUrlConnection</code> level,
if <q>false</q>, turn caching off.<br/><strong>Note</strong> this is only a hint to the
underlying <code>UrlConnection</code> class, implementations and proxies are free to ignore the
setting.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">useragent</td>
<td valign="top">User-Agent HTTP header to send,
defaults to "Apache Ant VERSION"<br/>
<em>since Ant 1.9.3</em></td>
<td align="center" valign="top">No</td>
<td>useragent</td>
<td><code>User-Agent</code> HTTP header to send.<br/><em>since Ant 1.9.3</em></td>
<td>No; defaults to <q>Apache Ant VERSION</q></td>
</tr>
<tr>
<td valign="top">tryGzipEncoding</td>
<td valign="top">When set to true Ant will tell the server it is
willing to accept gzip encoding to reduce the amount of data to
transfer and uncompress the content transparently.<br/>
Setting this to true also means Ant will uncompress
<code>.tar.gz</code> and similar files automatically.<br/>
<em>since Ant 1.9.5</em></td>
<td align="center" valign="top">No; default "false"</td>
<td>tryGzipEncoding</td>
<td>When set to <q>true</q>, Ant will tell the server it is willing to accept gzip encoding to
reduce the amount of data to transfer and uncompress the content transparently.<br/>Setting
this to <q>true</q> also means Ant will uncompress <code>.tar.gz</code> and similar files
automatically.<br/><em>since Ant 1.9.5</em></td>
<td>No; default is <q>false</q></td>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>any resource collection</h4>

<p><a href="../Types/resources.html#collection">Resource
Collection</a>s are used to select groups of URLs to download. If
the collection contains more than one resource, the dest attribute
must point to a directory if it exists or a directory will be
created if it doesn't exist. The destination file name use the
last part of the path of the source URL unless you also specify a
mapper.</p>
<p><a href="../Types/resources.html#collection">Resource Collection</a>s are used to select groups
of URLs to download. If the collection contains more than one resource, the <var>dest</var>
attribute must point to a directory if it exists or a directory will be created if it doesn't exist.
The destination file name use the last part of the path of the source URL unless you also specify a
mapper.</p>

<h4>mapper</h4>

<p>You can define name transformations by using a
nested <a href="../Types/mapper.html">mapper</a> element. You
can also use any filenamemapper type in place of the mapper
element.</p>
<p>You can define name transformations by using a nested <a href="../Types/mapper.html">mapper</a>
element. You can also use any filenamemapper type in place of the mapper element.</p>

<p>The mapper will receive the resource's name as argument. Any
resource for which the mapper returns no or more than one mapped
name will be skipped. If the returned name is a relative path, it
will be considered relative to the <em>dest</em> attribute.</p>
<p>The mapper will receive the resource's name as argument. Any resource for which the mapper
returns no or more than one mapped name will be skipped. If the returned name is a relative path,
it will be considered relative to the <var>dest</var> attribute.</p>

<h4>header</h4>
<p>Any arbitrary number of HTTP headers can be added to a request.<br/>
The attributes of a nested <code>&lt;header/&gt;</code> node are as follows:</p>
<p>Any arbitrary number of HTTP headers can be added to a request.<br/>The attributes of a
nested <code>&lt;header/&gt;</code> node are as follows:</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name or key of this header. Cannot be null or empty. Leading and trailing spaces are removed</td>
<td align="center" valign="top">Yes</td>
<td>name</td>
<td>The name or key of this header. Cannot be null or empty. Leading and trailing spaces are
removed</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">The value to assign to the header. Cannot be null or empty. Leading and trailing spaces are removed</td>
<td align="center" valign="top">Yes</td>
<td>value</td>
<td>The value to assign to the header. Cannot be null or empty. Leading and trailing spaces are
removed</td>
<td>Yes</td>
</tr>
</table>

<h3>Examples</h3>
<pre> &lt;get src=&quot;http://ant.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
<p>Gets the index page of http://ant.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
<pre>&lt;get src=&quot;http://ant.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
<p>Gets the index page of <samp>http://ant.apache.org/</samp>, and stores it in the
file <samp>help/index.html</samp>.</p>

<pre> &lt;get src=&quot;http://www.apache.org/dist/ant/KEYS&quot;
dest=&quot;KEYS&quot;
verbose=&quot;true&quot;
usetimestamp=&quot;true&quot;/&gt;</pre>
<p>
Gets the PGP keys of Ant's (current and past) release managers, if the local copy
is missing or out of date. Uses the verbose option
for progress information.
</p>
<pre>
&lt;get src=&quot;http://www.apache.org/dist/ant/KEYS&quot;
dest=&quot;KEYS&quot;
verbose=&quot;true&quot;
usetimestamp=&quot;true&quot;/&gt;</pre>
<p>Gets the PGP keys of Ant's (current and past) release managers, if the local copy is missing or
out of date. Uses the verbose option for progress information.</p>

<pre> &lt;get src=&quot;https://insecure-bank.org/statement/user=1214&quot;
dest=&quot;statement.html&quot;
username="1214";
password="secret"/&gt;</pre>
<p>
Fetches some file from a server with access control. Because https is being used the
fact that basic auth sends passwords in plaintext is moot if you
ignore the fact that it is part of your build file which may be
readable by third parties. If you need more security, consider using
<pre>
&lt;get src=&quot;https://insecure-bank.org/statement/user=1214&quot;
dest=&quot;statement.html&quot;
username=&quot;1214&quot;
password=&quot;secret&quot;/&gt;</pre>
<p>Fetches some file from a server with access control. Because https is being used the fact that
basic auth sends passwords in plaintext is moot if you ignore the fact that it is part of your build
file which may be readable by third parties. If you need more security, consider using
the <a href="input.html">input task</a> to query for a password.</p>

<p>Using a macro like the following</p>

<pre>
&lt;macrodef name="get-and-checksum">
&lt;attribute name="url"/>
&lt;attribute name="dest"/>
&lt;sequential&gt;
&lt;local name="destdir"/&gt;
&lt;dirname property="destdir" file="@{dest}"/&gt;
&lt;get dest="${destdir}"&gt;
&lt;url url="@{url}"/&gt;
&lt;url url="@{url}.sha1"/&gt;
&lt;firstmatchmapper&gt;
&lt;globmapper from="@{url}.sha1" to="@{dest}.sha"/&gt;
&lt;globmapper from="@{url}" to="@{dest}"/&gt;
&lt;/firstmatchmapper&gt;
&lt;/get&gt;
&lt;local name="checksum.matches"/>
&lt;local name="checksum.matches.fail"/>
&lt;checksum file="@{dest}" algorithm="sha" fileext=".sha"
verifyproperty="checksum.matches"/>
&lt;condition property="checksum.matches.fail">
&lt;equals arg1="${checksum.matches}" arg2="false"/>
&lt;/condition>
&lt;fail if="checksum.matches.fail">Checksum error&lt;/fail>
&lt;/sequential>
&lt;/macrodef>
</pre>

<p>it is possible to download an artifacts together with its SHA1
checksum (assuming a certain naming convention for the checksum
file, of course) and validate the checksum on the fly.</p>
&lt;macrodef name="get-and-checksum"&gt;
&lt;attribute name="url"/&gt;
&lt;attribute name="dest"/&gt;
&lt;sequential&gt;
&lt;local name="destdir"/&gt;
&lt;dirname property="destdir" file="@{dest}"/&gt;
&lt;get dest="${destdir}"&gt;
&lt;url url="@{url}"/&gt;
&lt;url url="@{url}.sha1"/&gt;
&lt;firstmatchmapper&gt;
&lt;globmapper from="@{url}.sha1" to="@{dest}.sha"/&gt;
&lt;globmapper from="@{url}" to="@{dest}"/&gt;
&lt;/firstmatchmapper&gt;
&lt;/get&gt;
&lt;local name="checksum.matches"/&gt;
&lt;local name="checksum.matches.fail"/&gt;
&lt;checksum file="@{dest}" algorithm="sha" fileext=".sha"
verifyproperty="checksum.matches"/&gt;
&lt;condition property="checksum.matches.fail"&gt;
&lt;equals arg1="${checksum.matches}" arg2="false"/&gt;
&lt;/condition&gt;
&lt;fail if="checksum.matches.fail"&gt;Checksum error&lt;/fail&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;</pre>

<p>it is possible to download an artifacts together with its SHA1 checksum (assuming a certain
naming convention for the checksum file, of course) and validate the checksum on the fly.</p>

<pre>
&lt;get dest=&quot;downloads&quot;&gt;
&lt;url url=&quot;http://ant.apache.org/index.html&quot;/&gt;
&lt;url url=&quot;http://ant.apache.org/faq.html&quot;/&gt;
&lt;/get&gt;
</pre>
&lt;/get&gt;</pre>

<p>With custom HTTP headers</p>

<pre>
&lt;get src=&quot;http://ant.apache.org/index.html&quot; dest=&quot;downloads&quot;&gt;
&lt;header name=&quot;header1&quot; value=&quot;headerValue1&quot; /&gt;
&lt;header name=&quot;header2&quot; value=&quot;headerValue2&quot; /&gt;
&lt;header name=&quot;header3&quot; value=&quot;headerValue3&quot; /&gt;
&lt;/get&gt;
</pre>
&lt;header name=&quot;header1&quot; value=&quot;headerValue1&quot;/&gt;
&lt;header name=&quot;header2&quot; value=&quot;headerValue2&quot;/&gt;
&lt;header name=&quot;header3&quot; value=&quot;headerValue3&quot;/&gt;
&lt;/get&gt;</pre>

<p>Gets the index and FAQ pages of http://ant.apache.org/, and stores
them in the directory <code>downloads</code> which will be created if
necessary.</p>
<p>Gets the index and FAQ pages of <samp>http://ant.apache.org/</samp>, and stores them in the
directory <samp>downloads</samp> which will be created if necessary.</p>
</body>
</html>

+ 35
- 49
manual/Tasks/hostinfo.html View File

@@ -30,69 +30,55 @@
<p>Sets the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and <code>ADDR6</code>
properties in the current project.</p>
<p>
The <code>NAME</code> contains the host part of the canonical name of the host.<br/>
If the host is not found, the host will contain the name as provided to the task,
or <code>localhost</code> if no host was provided, and no name for the local
host was found.<br/>
The <code>DOMAIN</code> contains the domain part of the canonical name of the host.<br/>
If the host is not found, the domain will contain the domain as provided to the task,
or <code>localdomain</code> if no host / domain was provided.<br/>
The <code>ADDR4</code> contains the IPv4 address of the host with the widest meaning.<br/>
If no IPv4 address is found and a host has been provided the address <code>0.0.0.0</code>
is returned, when no host was provided the address <code>127.0.0.1</code> is returned.<br/>
The <code>ADDR6</code> contains the IPv6 address of the host with the widest meaning.<br/>
If no IPv6 address is found and a host has been provided the address <code>::</code>
is returned, when no host was provided the address <code>::1</code> is returned.<br/>
</p>
The <code>NAME</code> contains the host part of the canonical name of the host.<br/> If the host is
not found, the host will contain the name as provided to the task, or <code>localhost</code> if no
host was provided, and no name for the local host was found.<br/>The <code>DOMAIN</code> contains
the domain part of the canonical name of the host.<br/>If the host is not found, the domain will
contain the domain as provided to the task, or <code>localdomain</code> if no host / domain was
provided.<br/>The <code>ADDR4</code> contains the IPv4 address of the host with the widest
meaning.<br/>If no IPv4 address is found and a host has been provided the
address <code>0.0.0.0</code> is returned, when no host was provided the
address <code>127.0.0.1</code> is returned.<br/>The <code>ADDR6</code> contains the IPv6 address of
the host with the widest meaning.<br/>If no IPv6 address is found and a host has been provided the
address <code>::</code> is returned, when no host was provided the address <code>::1</code> is
returned.</p>

<p>These properties can be used in the build-file, for instance, to create
host-stamped filenames, or used to replace placeholder tags inside documents
to indicate, for example, the host where the build was performed on.
The best place for this task is probably in an initialization target.</p>
<p>These properties can be used in the build-file, for instance, to create host-stamped filenames,
or used to replace placeholder tags inside documents to indicate, for example, the host where the
build was performed on. The best place for this task is probably in an initialization target.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">Prefix used for all properties set. The default is no prefix.</td>
<td align="center" valign="top">No</td>
<td>prefix</td>
<td>Prefix used for all properties set.</td>
<td>No; defaults to no prefix</td>
</tr>
<tr>
<td valign="top">host</td>
<td valign="top">
The host to retrieve the information for, default is to retrieve
information for the host the task is running on.
</td>
<td align="center" valign="top">No</td>
<td>host</td>
<td>The host to retrieve the information for.</td>
<td>No; default is to retrieve information for the host the task is running on</td>
</tr>
</table>

<h3>Examples</h3>

<pre>
&lt;hostinfo/&gt;
</pre>
<pre>&lt;hostinfo/&gt;</pre>

<p>
Sets the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and
<code>ADDR6</code> for the local host, using the most &quot;global&quot; address
available.</p>
<pre>
&lt;hostinfo prefix=&quot;remotehost&quot; host=&quot;www.apache.org&quot;/&gt;
</pre>
<p>
Sets the properties <code>remotehost.NAME</code> to <code>eos</code>,
<code>remotehost.DOMAIN</code> to <code>apache.org</code>,
<code>remotehost.ADDR4</code> to <code>140.211.11.130</code> and
<code>remotehost.ADDR6</code> to <code>::</code>
for the host with the name www.apache.org (provided the canonical name and ip
addresses do not change).
</p>
<p>Sets the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and <code>ADDR6</code> for
the local host, using the most &quot;global&quot; address available.</p>

<pre>&lt;hostinfo prefix=&quot;remotehost&quot; host=&quot;www.apache.org&quot;/&gt;</pre>
<p>Sets the properties <code>remotehost.NAME</code>
to <samp>eos</samp>, <code>remotehost.DOMAIN</code>
to <samp>apache.org</samp>, <code>remotehost.ADDR4</code> to <samp>140.211.11.130</samp>
and <code>remotehost.ADDR6</code> to <samp>::</samp> for the host with the
name <samp>www.apache.org</samp> (provided the canonical name and IP addresses do not change).</p>

</body>
</html>

+ 106
- 121
manual/Tasks/image.html View File

@@ -33,174 +33,166 @@
<img src="image-classdiagram.gif" border="0" alt="Class-Diagram">

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Boolean value. If false, note errors to the output but keep going.</td>
<td align="center">no (defaults to <i>true</i>)</td>
<td>failonerror</td>
<td>Boolean value. If <q>false</q>, note errors to the output but keep going.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">srcdir</td>
<td valign="top">Directory containing the images.</td>
<td align="center">yes, unless nested fileset is used</td>
<td>srcdir</td>
<td>Directory containing the images.</td>
<td>Yes, unless nested fileset is used</td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">Image encoding type.<br>
Valid (caseinsensitive) are: jpg, jpeg, tif, tiff
<td>encoding</td>
<td>Image encoding type.<br/>Valid (case insensitive)
are: <q>jpg</q>, <q>jpeg</q>, <q>tif</q>, <q>tiff</q>
</td>
<td align="center">no (defaults to <i>JPEG</i>)</td>
<td>No; defaults to <q>jpeg</q></td>
</tr>
<tr>
<td valign="top">overwrite</td>
<td valign="top">Boolean value. Sets whether or not to overwrite
a file if there is naming conflict.
</td>
<td align="center">no (defaults to <i>false</i>)</td>
<td>overwrite</td>
<td>Boolean value. Sets whether or not to overwrite a file if there is naming conflict.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">gc</td>
<td valign="top">Boolean value. Enables garbage collection after
each image processed.
</td>
<td align="center">no (defaults to <i>false</i>)</td>
<td>gc</td>
<td>Boolean value. Enables garbage collection after each image processed.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">destdir</td>
<td valign="top">Directory where the result images are stored.</td>
<td align="center">no (defaults to value of <i>srcdir</i>)</td>
<td>destdir</td>
<td>Directory where the result images are stored.</td>
<td>No; defaults to value of <var>srcdir</var></td>
</tr>
<!-- attributes inherited from MatchingTask -->
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td>name of a file. Each line of this file is taken to be an include pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td>name of a file. Each line of this file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">caseSensitive</td>
<td valign="top">Boolean value. Sets case sensitivity of the file system.</td>
<td align="center">no (defaults to <i>false</i>)</td>
<td>caseSensitive</td>
<td>Boolean value. Sets case sensitivity of the file system.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">followSymlinks</td>
<td valign="top">Boolean value. Sets whether or not symbolic links should be followed.</td>
<td align="center">no (defaults to <i>true</i>)</td>
<td>followSymlinks</td>
<td>Boolean value. Sets whether or not symbolic links should be followed.</td>
<td>No; defaults to <q>true</q></td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code> as well as the
nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.</p>

<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
attributes of <code>&lt;fileset&gt;</code> as well as the
nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
and <code>&lt;patternset&gt;</code> elements.</p>

<h4>ImageOperation</h4>
<p>Adds an ImageOperation to chain.</p>
<h5>Nested Elements</h5>
ImageOperation can handle nested Rotate, Draw, Rectangle, Text and Scale objects.
<p>ImageOperation can handle
nested <code>Rotate</code>, <code>Draw</code>, <code>Rectangle</code>, <code>Text</code>
and <code>Scale</code> objects.</p>

<h4>Rotate</h4>
<p>Adds a Rotate ImageOperation to chain.</p>
<h5>Parameters</h5>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">angle</td>
<td valign="top">Float value. Sets the angle of rotation in degrees.</td>
<td align="center">no (defaults to <i>0.0F</i>)</td>
<td>angle</td>
<td>Float value. Sets the angle of rotation in degrees.</td>
<td>No; defaults to <q>0.0F</q></td>
</tr>
</table>

<h4>Scale</h4>
<p>Adds a Scale ImageOperation to chain.</p>
<h5>Parameters</h5>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">proportions</td>
<td valign="top">Sets which dimension to control proportions from. Valid values are:
<td>proportions</td>
<td>Sets which dimension to control proportions from. Valid values are:
<ul>
<li>&quot;ignore&quot; - treat the dimensions independently.</li>
<li>&quot;height&quot; - keep proportions based on the width.</li>
<li>&quot;width&quot; - keep proportions based on the height.</li>
<li>&quot;cover&quot; - keep proportions and fit in the supplied dimensions.</li>
<li>&quot;fit&quot; - keep proportions and cover the supplied dimensions.</li>
<li><q>ignore</q>&mdash; treat the dimensions independently.</li>
<li><q>height</q>&mdash;keep proportions based on the width.</li>
<li><q>width</q>&mdash;keep proportions based on the height.</li>
<li><q>cover</q>&mdash;keep proportions and fit in the supplied dimensions.</li>
<li><q>fit</q>&mdash;keep proportions and cover the supplied dimensions.</li>
</ul>
</td>
<td align="center">no (defaults to <i>ignore</i>)</td>
<td>No; defaults to <q>ignore</q></td>
</tr>
<tr>
<td valign="top">width</td>
<td valign="top">Sets the width of the image, either as an integer or a %.</td>
<td>width</td>
<td>Sets the width of the image, either as an integer or a %.</td>
<!-- todo: if integer, what kind? cm, px, inches, ... -->
<td align="center">no (defaults to <i>100%</i>)</td>
<td>No; defaults to <q>100%</q></td>
</tr>
<tr>
<td valign="top">height</td>
<td valign="top">Sets the height of the image, either as an integer or a %.</td>
<td>height</td>
<td>Sets the height of the image, either as an integer or a %.</td>
<!-- todo: if integer, what kind? cm, px, inches, ... -->
<td align="center">no (defaults to <i>100%</i>)</td>
<td>No; defaults to <q>100%</q></td>
</tr>
</table>

<h4>Draw</h4>
<p>Adds a Draw ImageOperation to chain. DrawOperation DataType objects can be
nested inside the Draw object.</p>
<p>Adds a Draw ImageOperation to chain. DrawOperation DataType objects can be nested inside the Draw
object.</p>
<h5>Parameters</h5>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">xloc</td>
<td valign="top">X-Position where to draw nested image elements.</td>
<td align="center">no (defaults to <i>0</i>)</td>
<td>xloc</td>
<td>X-Position where to draw nested image elements.</td>
<td>No; defaults to <q>0</q></td>
</tr>
<tr>
<td valign="top">yloc</td>
<td valign="top">Y-Position where to draw nested image elements.</td>
<td align="center">no (defaults to <i>0</i>)</td>
<td>yloc</td>
<td>Y-Position where to draw nested image elements.</td>
<td>No; defaults to <q>0</q></td>
</tr>
</table>

@@ -208,51 +200,44 @@ nested inside the Draw object.</p>
<p><em>Since Apache Ant 1.8.0</em></p>

<p>You can define filename transformations by using a
nested <a href="../Types/mapper.html">mapper</a> element. The
default mapper used by
<code>&lt;image&gt;</code> is
the <a href="../Types/mapper.html#identity-mapper">identity
mapper</a>.</p>
nested <a href="../Types/mapper.html">mapper</a> element. The default mapper used
by <code>&lt;image&gt;</code> is the <a href="../Types/mapper.html#identity-mapper">identity
mapper</a>.</p>

<p>You can also use a filenamemapper type in place of the mapper
element.</p>
<p>You can also use a <code>filenamemapper</code> type in place of the <code>mapper</code>
element.</p>

<h3>Examples</h3>

<pre>
&lt;image destdir="samples/low" overwrite="yes"&gt;
&lt;fileset dir="samples/full"&gt;
&lt;include name="**/*.jpg"/&gt;
&lt;/fileset&gt;
&lt;scale width="160" height="160" proportions="fit"/&gt;
&lt;/image&gt;
</pre>
&lt;image destdir="samples/low" overwrite="yes"&gt;
&lt;fileset dir="samples/full"&gt;
&lt;include name="**/*.jpg"/&gt;
&lt;/fileset&gt;
&lt;scale width="160" height="160" proportions="fit"/&gt;
&lt;/image&gt;</pre>
<p>Create thumbnails of my images and make sure they all fit within the 160x160 size whether the
image is portrait or landscape.</p>

<pre>
&lt;image srcdir="src" includes="*.png"&gt;
&lt;scale proportions="width" width="40"/&gt;
&lt;/image&gt;
</pre>
<p>Creates a thumbnail for all PNG-files in <i>src</i> in the size of 40 pixel keeping the proportions
and stores the <i>src</i>.</p>
&lt;/image&gt;</pre>
<p>Creates a thumbnail for all PNG files in <samp>src</samp> of the size of 40 pixel keeping the
proportions and stores the <samp>src</samp>.</p>

<pre>
&lt;image srcdir="src" destdir="dest" includes="*.png"&gt;
&lt;scale proportions="width" width="40"/&gt;
&lt;/image&gt;
</pre>
<p>Same as above but stores the result in <i>dest</i>.</p>
&lt;/image&gt;</pre>
<p>Same as above but stores the result in <samp>dest</samp>.</p>

<pre>
&lt;image srcdir="src" destdir="dest" includes="*.png"&gt;
&lt;scale proportions="width" width="40"/&gt;
&lt;globmapper from="*" to="scaled-*"/&gt;
&lt;/image&gt;
</pre>
<p>Same as above but stores the resulting file names will be prefixed
by "scaled-".</p>
&lt;/image&gt;</pre>
<p>Same as above but stores the resulting file names will be prefixed by <samp>scaled-</samp>.</p>

</body>
</html>

+ 153
- 210
manual/Tasks/import.html View File

@@ -23,100 +23,81 @@
<body>
<h2 id="import">Import</h2>
<h3>Description</h3>
<p>
Imports another build file into the current project.
</p>

<p>
On execution it will select the proper ProjectHelper to parse the imported
file, using the same algorithm as the one executed at
<a href="../projecthelper.html">startup</a>. The selected ProjectHelper
instance will then be responsible to actually parse the imported file.
</p>

<p>
<strong>Note</strong> as seen above, this task heavily relies on the ProjectHelper
implementation and doesn't really perform any work of its own. If
you have configured Apache 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 the
<a href="http://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>&lt;project&gt;</code>
tag.
</p>

<p>
The import task may only be used as a top-level task. This means that
it may not be used in a target.
</p>
<p>
There are two further functional aspects that pertain to this task and
that are not possible with entity includes:</p>
<ul>
<li>target overriding</li>
<li>special properties</li>
</ul>
<h4>Target overriding</h4>

<p>If a target in the main file is also present in at least one of the
imported files, the one from the main file takes precedence.</p>

<p>So if I import for example a <i>docsbuild.xml</i> file named <b>builddocs</b>,
that contains a &quot;<b>docs</b>&quot; target, I can redefine it in my main
buildfile and that is the one that will be called. This makes it easy to
keep the same target name, so that the overriding target is still called
by any other targets--in either the main or imported buildfile(s)--for which
it is a dependency, with a different implementation. The target from <i>docsbuild.xml</i> is
made available by the name &quot;<b>builddocs</b><b>.docs</b>&quot;.
This enables the new implementation to call the old target, thus
<i>enhancing</i> it with tasks called before or after it.</p>

<p>If you use the <i>as</i> attribute of the task, its value will be
used to prefix the overridden target's name instead of the name
attribute of the project tag.</p>

<h4>Special Properties</h4>

<p>Imported files are treated as they are present in the main
buildfile. This makes it easy to understand, but it makes it impossible
for them to reference files and resources relative to their path.
Because of this, for every imported file, Ant adds a property that
contains the path to the imported buildfile. With this path, the
imported buildfile can keep resources and be able to reference them
relative to its position.</p>

<p>So if I import for example a <i>docsbuild.xml</i> file named <b>builddocs</b>,
I can get its path as <b>ant.file.builddocs</b>, similarly to the <b>ant.file</b>
property of the main buildfile.</p>

<p>Note that &quot;builddocs&quot; is not the filename, but the name attribute
present in the imported project tag.</p>
<p>
If the imported file does not have a name attribute, the ant.file.projectname
property will not be set.
</p>

<p>Since Ant 1.8.0 the task can also import resources from URLs or
classpath resources (which are URLs, really). If you need to know
whether the current build file's source has been a file or an URL
you can consult the
property <b>ant.file.type.<em>projectname</em></b> (using the same
example as above <b>ant.file.type.builddocs</b>) which either have
the value "file" or "url".</p>

<h4>Resolving files against the imported file</h4>

<p>Suppose your main build file called <code>importing.xml</code>
imports a build file <code>imported.xml</code>, located anywhere on
the file system, and <code>imported.xml</code> reads a set of
properties from <code>imported.properties</code>:</p>

<pre>&lt;!-- importing.xml --&gt;
<p>Imports another build file into the current project.</p>

<p>On execution it will select the proper ProjectHelper to parse the imported file, using the same
algorithm as the one executed at <a href="../projecthelper.html">startup</a>. The selected
ProjectHelper instance will then be responsible to actually parse the imported file.</p>

<p><strong>Note</strong> as seen above, this task heavily relies on the ProjectHelper
implementation and doesn't really perform any work of its own. If you have configured Apache
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
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>&lt;project&gt;</code> tag.</p>

<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>

<p>There are two further functional aspects that pertain to this task and that are not possible
with entity includes:</p>
<ul>
<li>target overriding</li>
<li>special properties</li>
</ul>
<h4>Target overriding</h4>

<p>If a target in the main file is also present in at least one of the imported files, the one
from the main file takes precedence.</p>

<p>So if I import for example a <samp>docsbuild.xml</samp> file named <q>builddocs</q>, that
contains a <q>docs</q> target, I can redefine it in my main buildfile and that is the one that
will be called. This makes it easy to keep the same target name, so that the overriding target
is still called by any other targets&mdash;in either the main or imported buildfile(s)&mdash;for
which it is a dependency, with a different implementation. The target
from <samp>docsbuild.xml</samp> is made available by the name <q>builddocs.docs</q>. This
enables the new implementation to call the old target, thus <em>enhancing</em> it with tasks
called before or after it.</p>

<p>If you use the <var>as</var> attribute of the task, its value will be used to prefix the
overridden target's name instead of the <var>name</var> attribute of the <code>project</code>
tag.</p>

<h4>Special Properties</h4>

<p>Imported files are treated as they are present in the main buildfile. This makes it easy to
understand, but it makes it impossible for them to reference files and resources relative to
their path. Because of this, for every imported file, Ant adds a property that contains the
path to the imported buildfile. With this path, the imported buildfile can keep resources and be
able to reference them relative to its position.</p>

<p>So if I import for example a <samp>docsbuild.xml</samp> file named <q>builddocs</q>, I can get
its path as <code>ant.file.builddocs</code>, similarly to the <code>ant.file</code> property of
the main buildfile.</p>

<p>Note that <q>builddocs</q> is not the filename, but the <var>name</var> attribute present in
the imported <code>project</code> tag.</p>

<p>If the imported file does not have a <var>name</var> attribute,
the <code>ant.file.<i>projectname</i></code> property will not be set.</p>

<p><em>Since Ant 1.8.0</em>, the task can also import resources from URLs or classpath resources
(which are URLs, really). If you need to know whether the current build file's source has been
a file or an URL you can consult the property <code>ant.file.type.<i>projectname</i></code>
(using the same example as above <code>ant.file.type.builddocs</code>) which either have the
value <q>file</q> or <q>url</q>.</p>

<h4>Resolving files against the imported file</h4>

<p>Suppose your main build file called <samp>importing.xml</samp> imports a build
file <samp>imported.xml</samp>, located anywhere on the file system,
and <samp>imported.xml</samp> reads a set of properties
from <samp>imported.properties</samp>:</p>

<pre>
&lt;!-- importing.xml --&gt;
&lt;project name="importing" basedir="." default="..."&gt;
&lt;import file="${path_to_imported}/imported.xml"/&gt;
&lt;/project&gt;
@@ -124,156 +105,121 @@ properties from <code>imported.properties</code>:</p>
&lt;!-- imported.xml --&gt;
&lt;project name="imported" basedir="." default="..."&gt;
&lt;property file="imported.properties"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>This snippet however will resolve <code>imported.properties</code>
against the basedir of <code>importing.xml</code>, because the basedir
of <code>imported.xml</code> is ignored by Ant. The right way to use
<code>imported.properties</code> is:</p>
<p>This snippet however will resolve <samp>imported.properties</samp> against
the <var>basedir</var> of <samp>importing.xml</samp>, because the <var>basedir</var>
of <samp>imported.xml</samp> is ignored by Ant. The right way to
use <samp>imported.properties</samp> is:</p>

<pre>
<pre>
&lt;!-- imported.xml --&gt;
&lt;project name="imported" basedir="." default="..."&gt;
&lt;dirname property="imported.basedir" file="${ant.file.imported}"/&gt;
&lt;property file="${imported.basedir}/imported.properties"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>As explained above <code>${ant.file.imported}</code> stores the
path of the build script, that defines the project called
<code>imported</code>, (in short it stores the path to
<code>imported.xml</code>) and <a
href="dirname.html"><code>&lt;dirname&gt;</code></a> takes its
directory. This technique also allows <code>imported.xml</code> to be
used as a standalone file (without being imported in other
project).</p>

<p>The above description only works for imported files that actually
are imported from files and not from URLs. For files imported from
URLs using resources relative to the imported file requires you to
use tasks that can work on non-file resources in the first place.
To create a relative resource you'd use something like:</p>
<p>As explained above <code>ant.file.imported</code> stores the path of the build script, that
defines the project called <q>imported</q>, (in short it stores the path
to <samp>imported.xml</samp>) and <a href="dirname.html"><code>&lt;dirname&gt;</code></a> takes
its directory. This technique also allows <samp>imported.xml</samp> to be used as a standalone
file (without being imported in other project).</p>

<pre>
&lt;loadproperties&gt;
&lt;url baseUrl="${ant.file.imported}"
relativePath="imported.properties"/&gt;
&lt;/loadproperties&gt;
</pre>
<p>The above description only works for imported files that actually are imported from files and
not from URLs. For files imported from URLs using resources relative to the imported file
requires you to use tasks that can work on non-file resources in the first place. To create a
relative resource you'd use something like:</p>

<pre>
&lt;loadproperties&gt;
&lt;url baseUrl="${ant.file.imported}"
relativePath="imported.properties"/&gt;
&lt;/loadproperties&gt;</pre>

<h3>Parameters</h3>
<table>
<table class="attr">
<tbody>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">
file
</td>
<td valign="top">
The file to import. If this is a relative file name, the file name will be resolved
relative to the <i>importing</i> file. <strong>Note</strong>: this is unlike most other
Ant file attributes, where relative files are resolved relative to ${basedir}.
</td>
<td valign="top" align="center">Yes or a nested resource collection</td>
<td>file</td>
<td>The file to import. If this is a relative file name, the file name will be resolved
relative to the <em>importing</em> file. <strong>Note</strong>: this is unlike most other
Ant file attributes, where relative files are resolved relative to <var>basedir</var>.</td>
<td>Yes or a nested resource collection</td>
</tr>
<tr>
<td valign="top">
optional
</td>
<td valign="top">
If true, do not stop the build if the file does not exist,
default is false.
</td>
<td valign="top" align="center">No</td>
<td>optional</td>
<td>If <q>true</q>, do not stop the build if the file does not exist.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">
as
</td>
<td valign="top">
Specifies the prefix prepended to the target names. If
omitted, the name attribute of the project tag of the
imported file will be used.
</td>
<td valign="top" align="center">No</td>
<td>as</td>
<td>Specifies the prefix prepended to the target names.</td>
<td>No; defaults to <var>name</var> attribute of the <code>project</code> tag of the imported
file</td>
</tr>
<tr>
<td valign="top">
prefixSeparator
</td>
<td valign="top">
Specifies the separator to be used between the prefix and the
target name. Defaults to ".".
</td>
<td valign="top" align="center">No</td>
<td>prefixSeparator</td>
<td>Specifies the separator to be used between the prefix and the target name.</td>
<td>No; defaults to <q>.</q></td>
</tr>
</tbody>
</table>

<h3>Parameters specified as nested elements</h3>

<h4>any <a href="../Types/resources.html">resource</a> or resource
collection</h4>
<h4>any <a href="../Types/resources.html">resource</a> or resource collection</h4>

<p>The specified resources will be imported. <em>Since Ant
1.8.0</em></p>
<p>The specified resources will be imported. <em>Since Ant 1.8.0</em></p>

<h3>Examples</h3>
<pre> &lt;import file=&quot;../common-targets.xml&quot;/&gt;</pre>
<pre>&lt;import file=&quot;../common-targets.xml&quot;/&gt;</pre>

<p>Imports targets from the common-targets.xml file that is in a parent
directory.</p>
<p>Imports targets from the <samp>common-targets.xml</samp> file that is in a parent directory.</p>

<pre> &lt;import file=&quot;${deploy-platform}.xml&quot;/&gt;</pre>
<pre>&lt;import file=&quot;${deploy-platform}.xml&quot;/&gt;</pre>

<p>Imports the project defined by the property deploy-platform</p>
<p>Imports the project defined by the property <code>deploy-platform</code></p>

<pre>
&lt;import&gt;
&lt;javaresource name="common/targets.xml"&gt;
&lt;classpath location="common.jar"/&gt;
&lt;/javaresource&gt;
&lt;/import&gt;
</pre>
&lt;import&gt;
&lt;javaresource name="common/targets.xml"&gt;
&lt;classpath location="common.jar"/&gt;
&lt;/javaresource&gt;
&lt;/import&gt;</pre>

<p>Imports targets from the targets.xml file that is inside the
directory common inside the jar file common.jar.</p>
<p>Imports targets from the <samp>targets.xml</samp> file that is inside the
directory <samp>common</samp> inside the jar file <samp>common.jar</samp>.</p>

<h3>How is &lt;import&gt; different
from <a href="include.html">&lt;include&gt;</a>?</h3>
<h3>How is &lt;import&gt; different from <a href="include.html">&lt;include&gt;</a>?</h3>

<p>The short version: Use import if you intend to override a target,
otherwise use include.</p>
<p>The short version: Use <code>import</code> if you intend to override a target, otherwise
use <code>include</code>.</p>

<p>When using import the imported targets are available by up to two
names. Their "normal" name without any prefix and potentially with
a prefixed name (the value of the as attribute or the imported
project's name attribute, if any).</p>
<p>When using <code>import</code> the imported targets are available by up to two names. Their
"normal" name without any prefix and potentially with a prefixed name (the value of
the <var>as</var> attribute or the imported project's <var>name</var> attribute, if any).</p>

<p>When using include the included targets are only available in the
prefixed form.</p>
<p>When using <code>include</code> the included targets are only available in the prefixed form.</p>

<p>When using import, the imported target's depends attribute
remains unchanged, i.e. it uses "normal" names and allows you to
override targets in the dependency list.</p>
<p>When using <code>import</code>, the imported target's <var>depends</var> attribute remains
unchanged, i.e. it uses "normal" names and allows you to override targets in the dependency
list.</p>

<p>When using include, the included targets cannot be overridden and
their depends attributes are rewritten so that prefixed names are
used. This allows writers of the included file to control which
target is invoked as part of the dependencies.</p>
<p>When using <code>include</code>, the included targets cannot be overridden and
their <var>depends</var> attributes are rewritten so that prefixed names are used. This allows
writers of the included file to control which target is invoked as part of the dependencies.</p>

<p>It is possible to include the same file more than once by using
different prefixes, it is not possible to import the same file more
than once.</p>
<p>It is possible to <code>include</code> the same file more than once by using different prefixes,
it is not possible to <code>import</code> the same file more than once.</p>

<h4>Examples</h4>

<p><i>nested.xml</i> shall be:</p>
<p><samp>nested.xml</samp> shall be:</p>

<pre>
&lt;project&gt;
@@ -284,10 +230,9 @@ directory.</p>
&lt;target name="echo" depends="setUp"&gt;
&lt;echo&gt;prop has the value ${prop}&lt;/echo&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>When using import like in</p>
<p>When using <code>import</code> like in</p>

<pre>
&lt;project default="test"&gt;
@@ -298,10 +243,9 @@ directory.</p>
&lt;import file="nested.xml" as="nested"/&gt;

&lt;target name="test" depends="nested.echo"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>Running the build file will emit:
<p>Running the build file will emit:</p>

<pre>
setUp:
@@ -313,7 +257,7 @@ test:

</pre>

<p>When using include like in</p>
<p>When using <code>include</code> like in</p>

<pre>
&lt;project default="test"&gt;
@@ -324,10 +268,9 @@ test:
&lt;include file="nested.xml" as="nested"/&gt;

&lt;target name="test" depends="nested.echo"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>Running the target build file will emit:
<p>Running the target build file will emit:</p>

<pre>
nested.setUp:
@@ -339,7 +282,7 @@ test:

</pre>

<p>and there won't be any target named "echo" on the including build file.</p>
<p>and there won't be any target named <q>echo</q> on the including build file.</p>

</body>
</html>

+ 142
- 200
manual/Tasks/include.html View File

@@ -23,95 +23,75 @@
<body>
<h2 id="include">Include</h2>
<h3>Description</h3>
<p>
Include another build file into the current project.
</p>
<p>Include another build file into the current project.</p>

<p><em>since Apache Ant 1.8.0</em></p>

<p>
<strong>Note</strong> this task heavily relies on the ProjectHelper
implementation and doesn't really perform any work of its own. If
you have configured Ant to use a ProjectHelper other than Ant's
default, this task may or may not work.
</p>

<p>
On execution it will read another Ant file into the same Project
rewriting the included target names and depends lists. This is
different
from <a href="http://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 project's name or the as
attribute and do not appear as if the file was contained in the
including file.
</p>
<p>
The include task may only be used as a top-level task. This means that
it may not be used in a target.
</p>
<p>
There are two further functional aspects that pertain to this task and
that are not possible with entity includes:</p>
<ul>
<li>target rewriting</li>
<li>special properties</li>
</ul>
<h4>Target rewriting</h4>

<p>Any target in the included file will be renamed
to <i>prefix.name</i> where <i>name</i> is the original target's
name and <i>prefix</i> is either the value of the <i>as</i>
attribute or the <i>name</i> attribute of the <i>project</i> tag of
the included file.</p>

<p>The depends attribute of all included targets is rewritten so that
all target names are prefixed as well. This makes the included file
self-contained.</p>

<p>Note that prefixes nest, so if a build file includes a file with
prefix "a" and the included file includes another file with prefix
"b", then the targets of that last build file will be prefixed by
"a.b.".</p>

<p><code>&lt;import&gt;</code> contribute to the prefix as well, but
only if their <code>as</code> attribute has been specified.

<h4>Special Properties</h4>

<p>Included files are treated as they are present in the main
buildfile. This makes it easy to understand, but it makes it impossible
for them to reference files and resources relative to their path.
Because of this, for every included file, Ant adds a property that
contains the path to the included buildfile. With this path, the
included buildfile can keep resources and be able to reference them
relative to its position.</p>

<p>So if I include for example a <i>docsbuild.xml</i> file named <b>builddocs</b>,
I can get its path as <b>ant.file.builddocs</b>, similarly to the <b>ant.file</b>
property of the main buildfile.</p>

<p>Note that &quot;builddocs&quot; is not the filename, but the name attribute
present in the included project tag.</p>
<p>
If the included file does not have a name attribute, the ant.file.projectname
property will not be set.
</p>

<p>If you need to know whether the current build file's source has
been a file or an URL you can consult the
property <b>ant.file.type.<em>projectname</em></b> (using the same
example as above <b>ant.file.type.builddocs</b>) which either have
the value "file" or "url".</p>

<h4>Resolving files against the included file</h4>

<p>Suppose your main build file called <code>including.xml</code>
includes a build file <code>included.xml</code>, located anywhere on
the file system, and <code>included.xml</code> reads a set of
properties from <code>included.properties</code>:</p>

<pre>&lt;!-- including.xml --&gt;
<p><strong>Note</strong> this task heavily relies on the ProjectHelper implementation and doesn't
really perform any work of its own. If you have configured Ant to use a ProjectHelper other
than Ant's default, this task may or may not work.</p>

<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
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
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>
<p>The <code>include</code> task may only be used as a top-level task. This means that
it may not be used in a target.</p>
<p>There are two further functional aspects that pertain to this task and that are not possible
with entity includes:</p>
<ul>
<li>target rewriting</li>
<li>special properties</li>
</ul>
<h4>Target rewriting</h4>

<p>Any target in the included file will be renamed to <q>prefix.name</q> where <q>name</q> is the
original target's name and <q>prefix</q> is either the value of the <var>as</var> attribute or
the <var>name</var> attribute of the <code>project</code> tag of the included file.</p>

<p>The <var>depends</var> attribute of all included targets is rewritten so that all target names
are prefixed as well. This makes the included file self-contained.</p>

<p>Note that prefixes nest, so if a build file includes a file with prefix <q>q</q> and the
included file includes another file with prefix <q>b</q>, then the targets of that last build
file will be prefixed by <q>a.b.</q>.</p>

<p><code>&lt;import&gt;</code> contribute to the prefix as well, but only if their <var>as</var>
attribute has been specified.

<h4>Special Properties</h4>

<p>Included files are treated as they are present in the main buildfile. This makes it easy to
understand, but it makes it impossible for them to reference files and resources relative to
their path. Because of this, for every included file, Ant adds a property that contains the
path to the included buildfile. With this path, the included buildfile can keep resources and be
able to reference them relative to its position.</p>

<p>So if I include for example a <samp>docsbuild.xml</samp> file named <q>builddocs</q>, I can get
its path as <code>ant.file.builddocs</code>, similarly to the <code>ant.file</code> property of
the main buildfile.</p>

<p>Note that <q>builddocs</q> is not the filename, but the <var>name</var> attribute present in
the included <code>project</code> tag.</p>
<p>If the included file does not have a <var>name</var> attribute,
the <code>ant.file.<i>projectname</i></code> property will not be set.</p>

<p>If you need to know whether the current build file's source has been a file or an URL you can
consult the property <code>ant.file.type.<i>projectname</i></code> (using the same example as
above <code>ant.file.type.builddocs</code>) which either have the value <q>file</q>
or <q>url</q>.</p>

<h4>Resolving files against the included file</h4>

<p>Suppose your main build file called <samp>including.xml</samp> includes a build
file <samp>included.xml</samp>, located anywhere on the file system,
and <samp>included.xml</samp> reads a set of properties
from <samp>included.properties</samp>:</p>

<pre>
&lt;!-- including.xml --&gt;
&lt;project name="including" basedir="." default="..."&gt;
&lt;include file="${path_to_included}/included.xml"/&gt;
&lt;/project&gt;
@@ -119,156 +99,121 @@ properties from <code>included.properties</code>:</p>
&lt;!-- included.xml --&gt;
&lt;project name="included" basedir="." default="..."&gt;
&lt;property file="included.properties"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>This snippet however will resolve <code>included.properties</code>
against the basedir of <code>including.xml</code>, because the basedir
of <code>included.xml</code> is ignored by Ant. The right way to use
<code>included.properties</code> is:</p>
<p>This snippet however will resolve <samp>included.properties</samp> against
the <var>basedir</var> of <samp>including.xml</samp>, because the <var>basedir</var>
of <samp>included.xml</samp> is ignored by Ant. The right way to
use <samp>included.properties</samp> is:</p>

<pre>
<pre>
&lt;!-- included.xml --&gt;
&lt;project name="included" basedir="." default="..."&gt;
&lt;dirname property="included.basedir" file="${ant.file.included}"/&gt;
&lt;property file="${included.basedir}/included.properties"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>As explained above <code>${ant.file.included}</code> stores the
path of the build script, that defines the project called
<code>included</code>, (in short it stores the path to
<code>included.xml</code>) and <a
href="dirname.html"><code>&lt;dirname&gt;</code></a> takes its
directory. This technique also allows <code>included.xml</code> to be
used as a standalone file (without being included in other
project).</p>

<p>The above description only works for included files that actually
are included from files and not from URLs. For files included from
URLs using resources relative to the included file requires you to
use tasks that can work on non-file resources in the first place.
To create a relative resource you'd use something like:</p>
<p>As explained above <code>ant.file.included</code> stores the path of the build script, that
defines the project called <q>included</q>, (in short it stores the path
to <samp>included.xml</samp>) and <a href="dirname.html"><code>&lt;dirname&gt;</code></a> takes
its directory. This technique also allows <samp>included.xml</samp> to be used as a standalone
file (without being included in other project).</p>

<pre>
&lt;loadproperties&gt;
&lt;url baseUrl="${ant.file.included}"
relativePath="included.properties"/&gt;
&lt;/loadproperties&gt;
</pre>
<p>The above description only works for included files that actually are included from files and
not from URLs. For files included from URLs using resources relative to the included file
requires you to use tasks that can work on non-file resources in the first place. To create a
relative resource you'd use something like:</p>

<pre>
&lt;loadproperties&gt;
&lt;url baseUrl="${ant.file.included}"
relativePath="included.properties"/&gt;
&lt;/loadproperties&gt;</pre>

<h3>Parameters</h3>
<table>
<table class="attr">
<tbody>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">
file
</td>
<td valign="top">
The file to include. If this is a relative file name, the file name will be resolved
relative to the <i>including</i> file. <strong>Note</strong>, this is unlike most other
ant file attributes, where relative files are resolved relative to ${basedir}.
</td>
<td valign="top" align="center">Yes or a nested resource collection</td>
<td>file</td>
<td>The file to include. If this is a relative file name, the file name will be resolved
relative to the <em>including</em> file. <strong>Note</strong>, this is unlike most other
ant file attributes, where relative files are resolved relative to ${basedir}.</td>
<td>Yes or a nested resource collection</td>
</tr>
<tr>
<td valign="top">
optional
</td>
<td valign="top">
If true, do not stop the build if the file does not exist,
default is false.
</td>
<td valign="top" align="center">No</td>
<td>optional</td>
<td>If <q>true</q>, do not stop the build if the file does not exist.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">
as
</td>
<td valign="top">
Specifies the prefix prepended to the target names. If
omitted, the name attribute of the project tag of the
included file will be used.
</td>
<td valign="top" align="center">Yes, if the included file's
project tag doesn't specify a name attribute.</td>
<td>as</td>
<td>Specifies the prefix prepended to the target names.</td>
<td>Yes, if the included file's <code>project</code> tag doesn't specify a <var>name</var>
attribute (which is otherwise taken as default)</td>
</tr>
<tr>
<td valign="top">
prefixSeparator
</td>
<td valign="top">
Specifies the separator to be used between the prefix and the
target name. Defaults to ".".
</td>
<td valign="top" align="center">No</td>
<td>prefixSeparator</td>
<td>Specifies the separator to be used between the prefix and the target name.</td>
<td>No; defaults to <q>.</q></td>
</tr>
</tbody>
</table>

<h3>Parameters specified as nested elements</h3>

<h4>any <a href="../Types/resources.html">resource</a> or resource
collection</h4>
<h4>any <a href="../Types/resources.html">resource</a> or resource collection</h4>

<p>The specified resources will be included.</p>

<h3>Examples</h3>
<pre> &lt;include file=&quot;../common-targets.xml&quot;/&gt;</pre>
<pre>&lt;include file=&quot;../common-targets.xml&quot;/&gt;</pre>

<p>Includes targets from the common-targets.xml file that is in a parent
directory.</p>
<p>Includes targets from the <samp>common-targets.xml</samp> file that is in a parent directory.</p>

<pre> &lt;include file=&quot;${deploy-platform}.xml&quot;/&gt;</pre>
<pre>&lt;include file=&quot;${deploy-platform}.xml&quot;/&gt;</pre>

<p>Includes the project defined by the property deploy-platform</p>

<pre>
&lt;include&gt;
&lt;javaresource name="common/targets.xml"&gt;
&lt;classpath location="common.jar"/&gt;
&lt;/javaresource&gt;
&lt;/include&gt;
</pre>
&lt;include&gt;
&lt;javaresource name="common/targets.xml"&gt;
&lt;classpath location="common.jar"/&gt;
&lt;/javaresource&gt;
&lt;/include&gt;</pre>

<p>Includes targets from the targets.xml file that is inside the
directory common inside the jar file common.jar.</p>
<p>Includes targets from the <samp>targets.xml</samp> file that is inside the
directory <samp>common</samp> inside the jar file <samp>common.jar</samp>.</p>

<h3>How is <a href="import.html">&lt;import&gt;</a> different
from &lt;include&gt;?</h3>
<h3>How is <a href="import.html">&lt;import&gt;</a> different from &lt;include&gt;?</h3>

<p>The short version: Use import if you intend to override a target,
otherwise use include.</p>
<p>The short version: Use <code>import</code> if you intend to override a target, otherwise
use <code>include</code>.</p>

<p>When using import the imported targets are available by up to two
names. Their "normal" name without any prefix and potentially with
a prefixed name (the value of the as attribute or the imported
project's name attribute, if any).</p>
<p>When using <code>import</code> the imported targets are available by up to two names. Their
"normal" name without any prefix and potentially with a prefixed name (the value of
the <var>as</var> attribute or the imported project's <var>name</var> attribute, if any).</p>

<p>When using include the included targets are only available in the
prefixed form.</p>
<p>When using <code>include</code> the included targets are only available in the prefixed form.</p>

<p>When using import, the imported target's depends attribute
remains unchanged, i.e. it uses "normal" names and allows you to
override targets in the dependency list.</p>
<p>When using <code>import</code>, the imported target's <var>depends</var> attribute remains
unchanged, i.e. it uses "normal" names and allows you to override targets in the dependency
list.</p>

<p>When using include, the included targets cannot be overridden and
their depends attributes are rewritten so that prefixed names are
used. This allows writers of the included file to control which
target is invoked as part of the dependencies.</p>
<p>When using <code>include</code>, the included targets cannot be overridden and
their <var>depends</var> attributes are rewritten so that prefixed names are used. This allows
writers of the included file to control which target is invoked as part of the dependencies.</p>

<p>It is possible to include the same file more than once by using
different prefixes, it is not possible to import the same file more
than once.</p>
<p>It is possible to <code>include</code> the same file more than once by using different prefixes,
it is not possible to <code>import</code> the same file more than once.</p>

<h4>Examples</h4>

<p><i>nested.xml</i> shall be:</p>
<p><samp>nested.xml</samp> shall be:</p>

<pre>
&lt;project&gt;
@@ -279,10 +224,9 @@ directory.</p>
&lt;target name="echo" depends="setUp"&gt;
&lt;echo&gt;prop has the value ${prop}&lt;/echo&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>When using import like in</p>
<p>When using <code>import</code> like in</p>

<pre>
&lt;project default="test"&gt;
@@ -293,10 +237,9 @@ directory.</p>
&lt;import file="nested.xml" as="nested"/&gt;

&lt;target name="test" depends="nested.echo"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>Running the build file will emit:
<p>Running the build file will emit:</p>

<pre>
setUp:
@@ -308,7 +251,7 @@ test:

</pre>

<p>When using include like in</p>
<p>When using <code>include</code> like in</p>

<pre>
&lt;project default="test"&gt;
@@ -319,10 +262,9 @@ test:
&lt;include file="nested.xml" as="nested"/&gt;

&lt;target name="test" depends="nested.echo"/&gt;
&lt;/project&gt;
</pre>
&lt;/project&gt;</pre>

<p>Running the target build file will emit:
<p>Running the target build file will emit:</p>

<pre>
nested.setUp:
@@ -334,7 +276,7 @@ test:

</pre>

<p>and there won't be any target named "echo" on the including build file.</p>
<p>and there won't be any target named <q>echo</q> on the including build file.</p>

</body>
</html>

+ 106
- 123
manual/Tasks/input.html View File

@@ -27,167 +27,150 @@
<h2 id="input">Input</h2>
<h3>Description</h3>

<p>Allows user interaction during the build process by prompting for
input. To do so, it uses the configured
<a href="../inputhandler.html">InputHandler</a>.</p>

<p>The prompt can be set via the message attribute or as character
data nested into the element.</p>

<p>Optionally a set of valid input arguments can be defined via the
validargs attribute. Input task will not accept a value that doesn't match
one of the predefined.</p>

<p>Optionally a property can be created from the value entered by the
user. This property can then be used during the following build
run. Input behaves according to <a href="property.html">property
task</a> which means that existing properties cannot be overridden.
<em>Since Apache Ant 1.6</em>, <code>&lt;input&gt;</code> will not prompt for input if
a property should be set by the task that has already been set in the
project (and the task wouldn't have any effect).</p>

<p>Historically, a regular complaint about this task has been that it echoes
characters to the console, this is a critical security defect, we must fix it
immediately, etc, etc. This problem was due to the lack in early versions of
Java of a (fully functional) facility for handling secure console input.
In Java 6 that shortcoming in Java's API was addressed and Ant versions 1.7.1
and 1.8 have added support for Java 6 secure console input feature
(see <a href="#handler.type">handler type</a>).</p>

<p>
IDE behaviour depends upon the IDE: some hang waiting for input, some let you
type it in. For this situation, place the password in a (secured) property
file and load in before the input task.</p>
<p>Allows user interaction during the build process by prompting for input. To do so, it uses the
configured <a href="../inputhandler.html">InputHandler</a>.</p>

<p>The prompt can be set via the <var>message</var> attribute or as character data nested into the
element.</p>

<p>Optionally a set of valid input arguments can be defined via the <var>validargs</var>
attribute. <code>Input</code> task will not accept a value that doesn't match one of the
predefined.</p>

<p>Optionally a property can be created from the value entered by the user. This property can then
be used during the following build run. <code>Input</code> then behaves
as <a href="property.html">property task</a> which means that existing properties cannot be
overridden. <em>Since Apache Ant 1.6</em>, <code>&lt;input&gt;</code> will not prompt for input if
a property should be set by the task that has already been set in the project (and the task wouldn't
have any effect).</p>

<p>Historically, a regular complaint about this task has been that it echoes characters to the
console, this is a critical security defect, we must fix it immediately, etc, etc. This problem was
due to the lack in early versions of Java of a (fully functional) facility for handling secure
console input. In Java 6 that shortcoming in Java's API was addressed and Ant versions 1.7.1 and
1.8 have added support for Java 6 secure console input feature (see <a href="#handler.type">handler
type</a>).</p>

<p>IDE behaviour depends upon the IDE: some hang waiting for input, some let you type it in. For
this situation, place the password in a (secured) property file and load in before
the <code>input</code> task.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">message</td>
<td valign="top">the Message which gets displayed to the user
during the build run.</td>
<td valign="top" align="center">No</td>
<td>message</td>
<td>the Message which gets displayed to the user during the build run.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">validargs</td>
<td valign="top">comma separated String containing valid input
arguments. If set, input task will reject any input not defined
here. Validargs are compared case sensitive. If you want 'a' and
'A' to be accepted you will need to define both arguments within
validargs.</td>
<td valign="top" align="center">No</td>
<td>validargs</td>
<td>comma separated String containing valid input arguments. If set, <code>input</code> task
will reject any input not defined here. Comparison of input to <var>validargs</var> is case
sensitive. If you want <q>a</q> and
<q>A</q> to be accepted you will need to define both arguments within <var>validargs</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">addproperty</td>
<td valign="top">the name of a property to be created from
input. Behaviour is equal to <a href="property.html">property
task</a> which means that existing properties cannot be
overridden.</td>
<td valign="top" align="center">No</td>
<td>addproperty</td>
<td>the name of a property to be created from input. Behaviour is equal
to <a href="property.html">property task</a> which means that existing properties cannot be
overridden.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultvalue</td>
<td valign="top">Defines the default value of the property to be
created from input. Property value will be set to default if no
input is received.</td>
<td valign="top" align="center">No</td>
<td>defaultvalue</td>
<td>Defines the default value of the property to be created from input. Property value will be
set to default if no input is received.</td>
<td>No</td>
</tr>
</table>
<h3>Parameters Specified as Nested Elements</h3>
<h4>Handler</h4>
<p><em>Since Ant 1.7</em>, a nested &lt;handler&gt; element can be used to
specify an InputHandler, so that different InputHandlers may be used
among different Input tasks.</p>
<p><em>Since Ant 1.7</em>, a nested <code>&lt;handler&gt;</code> element can be used to specify
an <code>InputHandler</code>, so that different <code>InputHandler</code>s may be used among
different <code>Input</code> tasks.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr id="handler.type">
<td valign="top">type</td>
<td valign="top">one of "default","propertyfile", "greedy", or "secure" (<em>since Ant 1.8</em>).
</td>
<td align="center" valign="top" rowspan="3">One of these</td>
<td>type</td>
<td>one of <q>default</q>, <q>propertyfile</q>, <q>greedy</q>, or <q>secure</q> (<em>since Ant
1.8</em>).</td>
<td rowspan="3">One of these</td>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top">Reference to an <code>InputHandler</code>
defined elsewhere in the project.
</td>
<td>refid</td>
<td class="left">Reference to an <code>InputHandler</code> defined elsewhere in the
project.</td>
</tr>
<tr>
<td valign="top">classname</td>
<td valign="top">The name of an <code>InputHandler</code> subclass.</td>
<td>classname</td>
<td class="left">The name of an <code>InputHandler</code> subclass.</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">The classpath to use with <i>classname</i>.</td>
<td valign="top">No</td>
<td>classpath</td>
<td>The classpath to use with <var>classname</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">The refid of a classpath to use with <i>classname</i>.</td>
<td valign="top">No</td>
<td>classpathref</td>
<td>The refid of a classpath to use with <var>classname</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">loaderref</td>
<td valign="top">The refid of a classloader to use with <i>classname</i>.
<td>loaderref</td>
<td>The refid of a classloader to use with <var>classname</var>.
</td>
<td valign="top">No</td>
<td>No</td>
</tr>
</table>
<p>
The classpath can also be specified by means of one or more nested
&lt;classpath&gt; elements.</p>
<p>The classpath can also be specified by means of one or more nested <code>&lt;classpath&gt;</code>
elements.</p>

<h3>Examples</h3>
<pre> &lt;input/&gt;</pre>
<p>Will pause the build run until return key is pressed when using the
<a href="../inputhandler.html#defaulthandler">default
InputHandler</a>, the concrete behavior is defined by the InputHandler
implementation you use.</p>
<pre> &lt;input&gt;Press Return key to continue...&lt;/input&gt;</pre>
<p>Will display the message &quot;Press Return key to
continue...&quot; and pause the build run until return key is pressed
(again, the concrete behavior is implementation dependent).</p>
<pre> &lt;input
message=&quot;Press Return key to continue...&quot;/&gt;</pre>
<p>Will display the message &quot;Press Return key to
continue...&quot; and pause the build run until return key is pressed
(see above).</p>
<pre>&lt;input/&gt;</pre>
<p>Will pause the build run until return key is pressed when using
the <a href="../inputhandler.html#defaulthandler">default InputHandler</a>, the concrete behavior is
defined by the <code>InputHandler</code> implementation you use.</p>
<pre>&lt;input&gt;Press Return key to continue...&lt;/input&gt;</pre>
<p>Will display the message <q>Press Return key to continue...</q> and pause the build run until
return key is pressed (again, the concrete behavior is implementation dependent).</p>
<pre>&lt;input message=&quot;Press Return key to continue...&quot;/&gt;</pre>
<p>Will display the message <q>Press Return key to continue...</q> and pause the build run until
return key is pressed (see above).</p>
<pre>
&lt;input
message=&quot;All data is going to be deleted from DB continue (y/n)?&quot;
validargs=&quot;y,n&quot;
addproperty=&quot;do.delete&quot;/&gt;
&lt;condition property=&quot;do.abort&quot;&gt;
&lt;equals arg1=&quot;n&quot; arg2=&quot;${do.delete}&quot;/&gt;
&lt;/condition&gt;
&lt;fail if=&quot;do.abort&quot;&gt;Build aborted by user.&lt;/fail&gt;
&lt;input message=&quot;All data is going to be deleted from DB continue (y/n)?&quot;
validargs=&quot;y,n&quot;
addproperty=&quot;do.delete&quot;/&gt;
&lt;condition property=&quot;do.abort&quot;&gt;
&lt;equals arg1=&quot;n&quot; arg2=&quot;${do.delete}&quot;/&gt;
&lt;/condition&gt;
&lt;fail if=&quot;do.abort&quot;&gt;Build aborted by user.&lt;/fail&gt;
</pre>
<p>Will display the message &quot;All data is going to be deleted from
DB continue (y/n)?&quot; and require 'y' to continue build or 'n' to
exit build with following message &quot;Build aborted by
user.&quot;.</p>
<pre> &lt;input
message=&quot;Please enter db-username:&quot;
addproperty=&quot;db.user&quot;/&gt;</pre>
<p>Will display the message &quot;Please enter db-username:&quot; and set the
<p>Will display the message <q>All data is going to be deleted from DB continue (y/n)?</q> and
require <q>y</q> to continue build or <q>n</q> to exit build with following message <q>Build aborted
by user.</q>.</p>
<pre>
&lt;input message=&quot;Please enter db-username:&quot;
addproperty=&quot;db.user&quot;/&gt;</pre>
<p>Will display the message <q>Please enter db-username:</q> and set the
property <code>db.user</code> to the value entered by the user.</p>

<pre> &lt;input
message=&quot;Please enter db-username:&quot;
addproperty=&quot;db.user&quot;
defaultvalue=&quot;Scott-Tiger&quot;/&gt;</pre>
<p>Same as above, but will set <code>db.user</code> to the value
<i>Scott- Tiger</i> if the user enters no value (simply types
&lt;return&gt;).</p>
<pre>
&lt;input message=&quot;Please enter db-username:&quot;
addproperty=&quot;db.user&quot;
defaultvalue=&quot;Scott-Tiger&quot;/&gt;</pre>
<p>Same as above, but will set <code>db.user</code> to the value <q>Scott-Tiger</q> if the user
enters no value (simply presses <q>return</q>).</p>

</body>
</html>

+ 398
- 466
manual/Tasks/jar.html View File

@@ -27,522 +27,466 @@
<h2 id="jar">Jar</h2>
<h3>Description</h3>
<p>Jars a set of files.</p>
<p>The <i>basedir</i> attribute is the reference directory from where to jar.</p>
<p>The <var>basedir</var> attribute is the reference directory from where to jar.</p>
<p>Note that file permissions will not be stored in the resulting jarfile.</p>
<p>It is possible to refine the set of files that are being jarred. This can be
done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
the files you want to have excluded. This is also done with patterns. And
finally with the <i>defaultexcludes</i> attribute, you can specify whether you
want to use default exclusions or not. See the section on <a
href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the

<p>It is possible to refine the set of files that are being jarred. This can be done with
the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var>
and <var>defaultexcludes</var> attributes. With the <var>includes</var> or <var>includesfile</var>
attribute you specify the files you want to have included by using patterns. The <var>exclude</var>
or <var>excludesfile</var> attribute is used to specify the files you want to have excluded. This is
also done with patterns. And finally with the <var>defaultexcludes</var> attribute, you can specify
whether you want to use default exclusions or not. 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>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>basedir</code>) as well as the nested
<code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.</p>
<p>You can also use nested file sets for more flexibility, and specify
multiple ones to merge together different trees of files into one JAR.
The extended fileset and groupfileset child elements from the zip task are
also available in the jar task.
See the <a href="zip.html">Zip</a> task for more details and examples.</p>

<p>The <code>update</code> parameter controls what happens if the JAR
file already exists. When set to <code>yes</code>, the JAR file is
updated with the files specified. When set to <code>no</code> (the
default) the JAR file is overwritten. An example use of this is
provided in the <a href="zip.html">Zip task documentation</a>. Please
note that ZIP files store file modification times with a granularity
of two seconds. If a file is less than two seconds newer than the
entry in the archive, Ant will not consider it newer.</p>

<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>basedir</var>) as well as
the nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
and <code>&lt;patternset&gt;</code> elements.</p>
<p>You can also use nested file sets for more flexibility, and specify multiple ones to merge
together different trees of files into one JAR. The extended <code>fileset</code>
and <code>groupfileset</code> child elements from the <code>zip</code> task are also available in
the <code>jar</code> task. See the <a href="zip.html">Zip</a> task for more details and
examples.</p>

<p>The <var>update</var> parameter controls what happens if the JAR file already exists. When set
to <q>yes</q>, the JAR file is updated with the files specified. When set to <q>no</q> (the default)
the JAR file is overwritten. An example use of this is provided in the <a href="zip.html">Zip task
documentation</a>. Please note that ZIP files store file modification times with a granularity of 2
seconds. If a file is less than 2 seconds newer than the entry in the archive, Ant will not
consider it newer.</p>

<p>If the manifest is omitted, a simple one will be supplied by Apache Ant.</p>

<p>The <code>whenmanifestonly</code> parameter controls what happens when no
files, apart from the manifest file, or nested services, match.
If <code>skip</code>, the JAR is not created and a warning is issued.
If <code>fail</code>, the JAR is not created and the build is halted with an error.
If <code>create</code>, (default) an empty JAR file (only containing a manifest and services)
is created.</p>

<p>(The Jar task is a shortcut for specifying the manifest file of a JAR file.
The same thing can be accomplished by using the <i>fullpath</i>
attribute of a zipfileset in a Zip task. The one difference is that if the
<i>manifest</i> attribute is not specified, the Jar task will
include an empty one for you.)</p>

<p>Manifests are processed by the Jar task according to the
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html">Jar file specification.</a>
Note in particular that this may result in manifest lines greater than 72 bytes
<p>The <var>whenmanifestonly</var> parameter controls what happens when no files, apart from the
manifest file, or nested services, match. If <q>skip</q>, the JAR is not created and a warning is
issued. If <q>fail</q>, the JAR is not created and the build is halted with an error.
If <q>create</q> (default), an empty JAR file (only containing a manifest and services) is
created.</p>

<p>(The <code>Jar</code> task has a shortcut for specifying the manifest file of a JAR file. The
same thing can be accomplished by using the <var>fullpath</var> attribute of
a <code>zipfileset</code> in a <code>Zip</code> task. The one difference is that if
the <var>manifest</var> attribute is not specified, the <code>Jar</code> task will include an empty
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>The Jar task checks whether you specified package information according to the
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">
<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>

<p><b>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 users. If you wish
to avoid this behavior you must set the <code>duplicate</code> attribute
to a value other than its default, <code>"add"</code>.</b></p>
<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
users. If you wish to avoid this behavior you must set the <var>duplicate</var> attribute to a value
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 JAR that you create from this task.</p>
<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>

<p>For creating a simple version of a <a target="_blank" href="http://openjdk.java.net/jeps/238">JEP 238 multi-release jar</a>,
you don't need any special tools. Just set the required manifest 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, e.g. decreasing the size by deleting
'same' classes from the versions-branches, you have to do more ...</p>
<p>For creating a simple version of a <a target="_blank" href="http://openjdk.java.net/jeps/238">JEP
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
the <a href="#jep238-example">JEP 238 example</a>. If you want to tune this kind of jar,
e.g. decreasing the size by deleting 'same' classes from the versions-branches, you have to do more
...</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">the JAR file to create.</td>
<td valign="top" align="center">Yes</td>
<td>destfile</td>
<td>the JAR file to create.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">basedir</td>
<td valign="top">the directory from which to jar the files.</td>
<td valign="top" align="center">No</td>
<td>basedir</td>
<td>the directory from which to jar the files.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">compress</td>
<td valign="top">Not only store data but also compress them,
defaults to true. Unless you set the <em>keepcompression</em>
attribute to false, this will apply to the entire archive, not
only the files you've added while updating.</td>
<td align="center" valign="top">No</td>
<td>compress</td>
<td>Not only store data but also compress them. Unless you set the <var>keepcompression</var>
attribute to <q>false</q>, this will apply to the entire archive, not only the files you've
added while updating.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">keepcompression</td>
<td valign="top">For entries coming from existing archives (like
nested <em>zipfileset</em>s or while updating the archive), keep
the compression as it has been originally instead of using the
<em>compress</em> attribute. Defaults to false. <em>Since Ant
1.6</em></td>
<td align="center" valign="top">No</td>
<td>keepcompression</td>
<td>For entries coming from existing archives (like nested <code>zipfileset</code>s or while
updating the archive), keep the compression as it has been originally instead of using the
<var>compress</var> attribute. <em>Since Ant 1.6</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The character encoding to use for filenames
inside the archive. Defaults to UTF8. <strong>It is not
recommended to change this value as the created archive will
most likely be unreadable for Java otherwise.</strong>
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td align="center" valign="top">No</td>
<td>encoding</td>
<td>The character encoding to use for filenames inside the archive. <strong>It is not
recommended to change this value as the created archive will most likely be unreadable for
Java otherwise.</strong> <br/>See also the <a href="zip.html#encoding">discussion in the zip
task page</a></td>
<td>No; defaults to <q>UTF8</q></td>
</tr>
<tr>
<td valign="top">filesonly</td>
<td valign="top">Store only file entries, defaults to false</td>
<td align="center" valign="top">No</td>
<td>filesonly</td>
<td>Store only file entries</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be included</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td>name of a file. Each line of this file is taken to be an include pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td>Name of a file. Each line of this file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not (<q>yes|no</q>)</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">manifest</td>
<td valign="top">the manifest file to use. This can be either the location of a manifest, or the name of a jar added through a fileset. If its the name of an added jar, the task expects the manifest to be in the jar at META-INF/MANIFEST.MF</td>
<td valign="top" align="center">No</td>
<td>manifest</td>
<td>the manifest file to use. This can be either the location of a manifest, or the name of a
jar added through a fileset. If its the name of an added jar, the task expects the manifest
to be in the jar at <samp>META-INF/MANIFEST.MF</samp></td>
<td>No</td>
</tr>
<tr>
<td valign="top">filesetmanifest</td>
<td valign="top">behavior when a Manifest is found in a zipfileset or zipgroupfileset file is found. Valid values are &quot;skip&quot;, &quot;merge&quot;, and &quot;mergewithoutmain&quot;. &quot;merge&quot; will merge all of the manifests together, and merge this into any other specified manifests. &quot;mergewithoutmain&quot; merges everything but the Main section of the manifests. Default value is &quot;skip&quot;.
<td>filesetmanifest</td>
<td>behavior when a manifest 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>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">update</td>
<td valign="top">indicates whether to update or overwrite
the destination file if it already exists. Default is &quot;false&quot;.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">whenmanifestonly</td>
<td valign="top">behavior when no files match. Valid values are &quot;fail&quot;, &quot;skip&quot;, and &quot;create&quot;. Default is &quot;create&quot;.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">duplicate</td>
<td valign="top">behavior when a duplicate file is found. Valid values are &quot;add&quot;, &quot;preserve&quot;, and &quot;fail&quot;. The default value is &quot;add&quot;. </td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">index</td>
<td valign="top">whether to create an <a
href="http://docs.oracle.com/javase/7/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. Defaults to
false.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">indexMetaInf</td>
<td valign="top">whether to include META-INF and its children in
the index. Doesn't have any effect if <em>index</em> is
false.<br/>
Sun's jar implementation used to skip the META-INF 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 META-INF unless
explicitly asked to. Defaults to false.<br/>
<em>Since Ant 1.8.0</em></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">manifestencoding</td>
<td valign="top">The encoding used to read the JAR manifest, when
a manifest file is specified. The task will always use UTF-8
when writing the manifest.</td>
<td valign="top" align="center">No, defaults to the platform encoding.</td>
</tr>
<tr>
<td valign="top">roundup</td>
<td valign="top">Whether the file modification times will be
rounded up to the next even number of seconds.<br>
Zip archives store file modification times with a granularity of
two seconds, so the times will either be rounded up or down. If
you round down, the archive will always seem out-of-date when you
rerun the task, so the default is to round up. Rounding up may
lead to a different type of problems like JSPs inside a web
archive that seem to be slightly more recent than precompiled
pages, rendering precompilation useless.<br>
Defaults to true. <em>Since Ant 1.6.2</em></td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">level</td>
<td valign="top">Non-default level at which file compression should be
performed. Valid values range from 0 (no compression/fastest) to 9
(maximum compression/slowest). <em>Since Ant 1.7</em></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">strict</td>
<td valign="top">Configures how to handle breaks of the packaging version
specification: <ul>
<li><b>fail</b> = throws a BuildException</li>
<li><b>warn</b> = logs a message on warn level</li>
<li><b>ignore</b> = logs a message on verbose level (default)</li>
</ul>
<em>Since Ant 1.7.1</em></td>
<td valign="top" align="center">No, defaults to <tt>ignore</tt>.</td>
</tr>
<tr>
<td valign="top">preserve0permissions</td>
<td valign="top">when updating an archive or adding entries from a
different archive Ant will assume that a Unix permissions value of
0 (nobody is allowed to do anything to the file/directory) means
that the permissions haven't been stored at all rather than real
permissions and will instead apply its own default values.<br/>
Set this attribute to true if you really want to preserve the
original permission field. <em>since Ant 1.8.0</em>
<td>No; defaults to <q>skip</q></td>
</tr>
<tr>
<td>update</td>
<td>indicates whether to update or overwrite the destination file if it already exists</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>whenmanifestonly</td>
<td>behavior when no files match. Valid values are <q>fail</q>, <q>skip</q>,
and <q>create</q>.</td>
<td>No; defaults to <q>create</q></td>
</tr>
<tr>
<td>duplicate</td>
<td>behavior when a duplicate file is found. Valid values are <q>add</q>, <q>preserve</q>,
and <q>fail</q>.</td>
<td>No; defaults to <q>add</q></td>
</tr>
<tr>
<td>index</td>
<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>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>indexMetaInf</td>
<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
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. <em>Since Ant 1.8.0</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>manifestencoding</td>
<td>The encoding used to read the JAR manifest, when a manifest file is specified. The task
will always use UTF-8 when writing the manifest.</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td>roundup</td>
<td>Whether the file modification times will be rounded up to the next even number of
seconds.<br/>Zip archives store file modification times with a granularity of 2 seconds, so
the times will either be rounded up or down. If you round down, the archive will always seem
out-of-date when you rerun the task, so the default is to round up. Rounding up may lead to a
different type of problems like JSPs inside a web archive that seem to be slightly more recent
than precompiled pages, rendering precompilation useless. <em>Since Ant 1.6.2</em></td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td>level</td>
<td>Non-default level at which file compression should be performed. Valid values range
from <q>0</q> (no compression/fastest) to <q>9</q> (maximum compression/slowest). <em>Since
Ant 1.7</em></td>
<td>No</td>
</tr>
<tr>
<td>strict</td>
<td>Configures how to handle breaks of the packaging version specification:
<ul>
<li><q>fail</q> = throws a BuildException</li>
<li><q>warn</q> = logs a message on warn level</li>
<li><q>ignore</q> = logs a message on verbose level (default)</li>
</ul>
<em>Since Ant 1.7.1</em></td>
<td>No; defaults to <q>ignore</q></td>
</tr>
<tr>
<td>preserve0permissions</td>
<td>when updating an archive or adding entries from a different archive Ant will assume that a
Unix permissions value of 0 (nobody is allowed to do anything to the file/directory) means
that the permissions haven't been stored at all rather than real permissions and will instead
apply its own default values.<br/> Set this attribute to <q>true</q> if you really want to
preserve the original permission field. <em>since Ant 1.8.0</em>
</td>
<td valign="top" align="center">No, default is false</td>
</tr>
<tr>
<td valign="top">useLanguageEncodingFlag</td>
<td valign="top">Whether to set the language encoding flag if the
encoding is UTF-8. This setting doesn't have any effect if the
encoding is not UTF-8.
<em>Since Ant 1.8.0</em>.
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td valign="top" align="center">No, default is true</td>
</tr>
<tr>
<td valign="top">createUnicodeExtraFields</td>
<td valign="top">Whether to create unicode extra fields to store
the file names a second time inside the entry's metadata.
<br>Possible values are "never", "always" and "not-encodeable"
which will only add Unicode extra fields if the file name cannot
be encoded using the specified encoding.
<em>Since Ant 1.8.0</em>.
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td align="center" valign="top">No, default is "never"</td>
</tr>
<tr>
<td valign="top">fallbacktoUTF8</td>
<td valign="top">Whether to use UTF-8 and the language encoding
flag instead of the specified encoding if a file name cannot be
encoded using the specified encoding.
<em>Since Ant 1.8.0</em>.
<br/>See also the <a href="zip.html#encoding">discussion in the
zip task page</a></td>
<td align="center" valign="top">No, default is false</td>
</tr>
<tr>
<td valign="top">mergeClassPathAttributes</td>
<td valign="top">Whether to merge the Class-Path attributes found
in different manifests (if merging manifests). If false, only
the attribute of the last merged manifest will be preserved.
<em>Since Ant 1.8.0</em>.
<br/>unless you also set flattenAttributes to true this may
result in manifests containing multiple Class-Path attributes
which violates the manifest specification.</td>
<td align="center" valign="top">No, default is false</td>
</tr>
<tr>
<td valign="top">flattenAttributes</td>
<td valign="top">Whether to merge attributes occurring more than
once in a section (this can only happen for the Class-Path
attribute) into a single attribute.
<em>Since Ant 1.8.0</em>.</td>
<td align="center" valign="top">No, default is false</td>
</tr>
<tr>
<td valign="top">zip64Mode</td>
<td valign="top">When to use Zip64 extensions for entries. The
possible values are "never", "always" and "as-needed".
<em>Since Ant 1.9.1</em>.
<br/>See also the <a href="zip.html#zip64">discussion in the
zip task page</a></td>
<td align="center" valign="top">No, default is "never"</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>useLanguageEncodingFlag</td>
<td>Whether to set the language encoding flag if the encoding is UTF-8. This setting doesn't
have any effect if the encoding is not UTF-8. <em>Since Ant 1.8.0</em>. <br/>See also
the <a href="zip.html#encoding">discussion in the zip task page</a></td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td>createUnicodeExtraFields</td>
<td>Whether to create Unicode extra fields to store the file names a second time inside the
entry's metadata.<br/>Possible values are <q>never</q>, <q>always</q>
and <q>not-encodeable</q> which will only add Unicode extra fields if the file name
cannot.<br/>See also the <a href="zip.html#encoding">discussion in the zip task page</a></td>
<td>No; defaults to <q>never</q></td>
</tr>
<tr>
<td>fallbacktoUTF8</td>
<td>Whether to use UTF-8 and the language encoding flag instead of the specified encoding if a
file name cannot be encoded using the specified encoding. <em>Since Ant 1.8.0</em>.<br/>See
also the <a href="zip.html#encoding">discussion in the zip task page</a></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>mergeClassPathAttributes</td>
<td>Whether to merge the <code>Class-Path</code> attributes found in different manifests (if
merging manifests). If <q>false</q>, only the attribute of the last merged manifest will be
preserved. <em>Since Ant 1.8.0</em>.<br/>Unless you also set <var>flattenAttributes</var>
to <q>true</q>, this may result in manifests containing multiple <code>Class-Path</code>
attributes which violates the manifest specification.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>flattenAttributes</td>
<td>Whether to merge attributes occurring more than once in a section (this can only happen for
the <code>Class-Path</code> attribute) into a single attribute. <em>Since Ant
1.8.0</em>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td>zip64Mode</td>
<td>When to use Zip64 extensions for entries. The possible values
are <q>never</q>, <q>always</q> and <q>as-needed</q>. <em>Since Ant 1.9.1</em>.<br/>See also
the <a href="zip.html#zip64">discussion in the zip task page</a></td>
<td>No; defaults to <q>never</q></td>
</tr>
</table>

<h3>Nested elements</h3>
<h4>metainf</h4>
<p>The nested <code>metainf</code> element specifies a <a
href="../Types/fileset.html">FileSet</a>. All files included in this fileset will
end up in the <code>META-INF</code> directory of the jar file. If this
fileset includes a file named <code>MANIFEST.MF</code>, the file is
ignored and you will get a warning.</p>
<p>The nested <code>metainf</code> element specifies
a <a href="../Types/fileset.html">FileSet</a>. All files included in this fileset will end up in
the <samp>META-INF</samp> directory of the jar file. If this fileset includes a file
named <samp>MANIFEST.MF</samp>, the file is ignored and you will get a warning.</p>

<h4>manifest</h4>
<p>The manifest nested element allows the manifest for the Jar file to
be provided inline in the build file rather than in an external
file. This element is identical to the
<a href="manifest.html">manifest</a> task, but the file and mode
<p>The nested <code>manifest</code> element allows the manifest for the Jar file to be provided
inline in the build file rather than in an external file. This element is identical to the
<a href="manifest.html">manifest</a> task, but the <var>file</var> and <var>mode</var>
attributes must be omitted.</p>
<p>
If both an inline manifest and an external file are both specified, the
manifests are merged.
</p>

<p>When using inline manifests, the Jar task will check whether the manifest
contents have changed (i.e. the manifest as specified is different in any way
from the manifest that exists in the Jar, if it exists.
If the manifest values have changed the jar will be updated or rebuilt, as
appropriate.
</p>
<p>If both an inline manifest and an external file are both specified, the manifests are merged.</p>

<p>When using inline manifests, the <code>Jar</code> task will check whether the manifest contents
have changed (i.e. the manifest as specified is different in any way from the manifest that exists
in the jar, if it exists. If the manifest values have changed, the jar will be updated or rebuilt,
as appropriate.</p>

<h4 id="indexjars">indexjars</h4>

<p><em>since Ant 1.6.2</em></p>

<p>The nested <code>indexjars</code> element specifies a <a
href="../using.html#path">PATH like structure</a>. Its content is
completely ignored unless you set the index attribute of the task to
true.</p>
<p>The nested <code>indexjars</code> element specifies a <a href="../using.html#path">path-like
structure</a>. Its content is completely ignored unless you set the <var>index</var> attribute of
the task to <q>true</q>.</p>

<p>The index created by this task will contain indices for the
archives contained in this path, the names used for the archives
depend on your manifest:</p>
<p>The index created by this task will contain indices for the archives contained in this path, the
names used for the archives depend on your manifest:</p>
<ul>
<li>If the generated jar's manifest contains no Class-Path
attribute, the file name without any leading directory path will be
used and all parts of the path will get indexed.</li>
<li>If the manifest contains a Class-Path attribute, this task will
try to guess which part of the Class-Path belongs to a given
archive. If it cannot guess a name, the archive will be skipped,
otherwise the name listed inside the Class-Path attribute will be
used.</li>
<li>If the generated jar's manifest contains no <code>Class-Path</code> attribute, the file name
without any leading directory path will be used and all parts of the path will get indexed.</li>
<li>If the manifest contains a <code>Class-Path</code> attribute, this task will try to guess
which part of the <code>Class-Path</code> belongs to a given archive. If it cannot guess a name,
the archive will be skipped, otherwise the name listed inside the <code>Class-Path</code>
attribute will be used.</li>
</ul>

<p>This task will not create any index entries for archives that are
empty or only contain files inside the META-INF directory unless
the <code>indexmetainf</code> attribute has been set
to <code>true</code>.</p>
<p>This task will not create any index entries for archives that are empty or only contain files
inside the <samp>META-INF</samp> directory unless the <var>indexmetainf</var> attribute has been set
to <q>true</q>.</p>

<h4 id="service">service</h4>

<p><em>since Ant 1.7.0</em></p>

<p>
The nested <code>service</code> element specifies a service.
Services are described in the
<a href="http://docs.oracle.com/javase/7/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,
META-INF/services/javax.script.ScriptEngineFactory
which can include implementation class names, one per line (usually just one per JAR).

The name of the
service is set by the "type" attribute. The classname implementing
the service is the the "provider" attribute, or it one wants to
specify a number of classes that implement the service, by
"provider" nested elements.
</p>
<p>
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">The name of the service.</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">provider</td>
<td valign="top">
The classname of the class implementing the service.
</td>
<td valign="top" align="center">Yes, unless there is a nested
<code>&lt;provider&gt;</code> element.</td>
<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>

<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
that implement the service, by <code>provider</code> nested elements.</p>
<table class="attr">
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td>type</td>
<td>The name of the service.</td>
<td>Yes</td>
</tr>
<tr>
<td>provider</td>
<td>The classname of the class implementing the service.</td>
<td>Yes, unless there is a nested <code>&lt;provider&gt;</code> element.</td>
</tr>
</table>
<p>
The provider classname is specified either by the "provider" attribute, or
by a nested &lt;provider&gt; element, which has a single "classname" attribute.
If a JAR file has more that one implementation of the service, a number of
nested &lt;provider&gt; elements may be used.
</p>
<p>The provider classname is specified either by the <var>provider</var> attribute, or by a
nested <code>&lt;provider&gt;</code> element, which has a single <var>classname</var> attribute. If
a JAR file has more that one implementation of the service, a number of
nested <code>&lt;provider&gt;</code> elements may be used.</p>

<h3>Examples</h3>

<h4>Simple</h4>
<pre> &lt;jar destfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot;/&gt;</pre>
<p>jars all files in the <code>${build}/classes</code> directory into a file
called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p>

<pre>&lt;jar destfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot;/&gt;</pre>
<p>jars all files in the <samp>${build}/classes</samp> directory into a file
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory.</p>

<h4>With filters</h4>

<pre> &lt;jar destfile=&quot;${dist}/lib/app.jar&quot;
basedir=&quot;${build}/classes&quot;
excludes=&quot;**/Test.class&quot;/&gt;</pre>
<p>jars all files in the <code>${build}/classes</code> directory into a file
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files
with the name <code>Test.class</code> are excluded.</p>

<pre> &lt;jar destfile=&quot;${dist}/lib/app.jar&quot;
basedir=&quot;${build}/classes&quot;
includes=&quot;mypackage/test/**&quot;
excludes=&quot;**/Test.class&quot;/&gt;</pre>
<p>jars all files in the <code>${build}/classes</code> directory into a file
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only
files under the directory <code>mypackage/test</code> are used, and files with
the name <code>Test.class</code> are excluded.</p>
<pre>&lt;jar destfile=&quot;${dist}/lib/app.jar&quot;
basedir=&quot;${build}/classes&quot;
excludes=&quot;**/Test.class&quot;/&gt;</pre>
<p>jars all files in the <samp>${build}/classes</samp> directory into a file
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory. Files with the
name <samp>Test.class</samp> are excluded.</p>

<pre>
&lt;jar destfile=&quot;${dist}/lib/app.jar&quot;
basedir=&quot;${build}/classes&quot;
includes=&quot;mypackage/test/**&quot;
excludes=&quot;**/Test.class&quot;/&gt;</pre>
<p>jars all files in the <samp>${build}/classes</samp> directory into a file
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory. Only files under the
directory <samp>mypackage/test</samp> are used, and files with the name <samp>Test.class</samp> are
excluded.</p>

<h4>Multiple filesets</h4>
<pre> &lt;jar destfile=&quot;${dist}/lib/app.jar&quot;&gt;
<pre>
&lt;jar destfile=&quot;${dist}/lib/app.jar&quot;&gt;
&lt;fileset dir=&quot;${build}/classes&quot;
excludes=&quot;**/Test.class&quot;/&gt;
&lt;fileset dir=&quot;${src}/resources&quot;/&gt;
&lt;/jar&gt;</pre>
<p>jars all files in the <code>${build}/classes</code> directory and also
in the <code>${src}/resources</code> directory together into a file
called <code>app.jar</code> in the <code>${dist}/lib</code> directory.
Files with the name <code>Test.class</code> are excluded.
If there are files such as <code>${build}/classes/mypackage/MyClass.class</code>
and <code>${src}/resources/mypackage/image.gif</code>, they will appear
in the same directory in the JAR (and thus be considered in the same package
by Java).</p>
&lt;/jar&gt;</pre>
<p>jars all files in the <samp>${build}/classes</samp> directory and also in
the <samp>${src}/resources</samp> directory together into a file called <samp>app.jar</samp> in
the <samp>${dist}/lib</samp> directory. Files with the name <samp>Test.class</samp> are excluded.
If there are files such as <samp>${build}/classes/mypackage/MyClass.class</samp>
and <samp>${src}/resources/mypackage/image.gif</samp>, they will appear in the same directory in the
JAR (and thus be considered in the same package by Java).</p>

<h4>Merging archives</h4>

<pre> &lt;jar destfile="build/main/checksites.jar"&gt;
<pre>
&lt;jar destfile="build/main/checksites.jar"&gt;
&lt;fileset dir="build/main/classes"/&gt;
&lt;zipfileset includes="**/*.class" src="lib/main/some.jar"/&gt;
&lt;manifest&gt;
&lt;attribute name="Main-Class"
value="com.acme.checksites.Main"/&gt;
value="com.acme.checksites.Main"/&gt;
&lt;/manifest&gt;
&lt;/jar&gt;</pre>
<p>
Creates an executable jar file with a main class "com.acme.checksites.Main", and
embeds all the classes from the jar <code>lib/main/some.jar</code>.
</p>
&lt;/jar&gt;</pre>
<p>Creates an executable jar file with a main class <samp>com.acme.checksites.Main</samp>, and
embeds all the classes from the jar <samp>lib/main/some.jar</samp>.</p>

<pre> &lt;jar destfile="build/main/checksites.jar"&gt;
<pre>
&lt;jar destfile="build/main/checksites.jar"&gt;
&lt;fileset dir="build/main/classes"/&gt;
&lt;restrict&gt;
&lt;name name="**/*.class"/&gt;
&lt;archives&gt;
&lt;zips&gt;
&lt;fileset dir="lib/main" includes="**/*.jar"/&gt;
&lt;/zips&gt;
&lt;/archives&gt;
&lt;name name="**/*.class"/&gt;
&lt;archives&gt;
&lt;zips&gt;
&lt;fileset dir="lib/main" includes="**/*.jar"/&gt;
&lt;/zips&gt;
&lt;/archives&gt;
&lt;/restrict&gt;
&lt;manifest&gt;
&lt;attribute name="Main-Class"
value="com.acme.checksites.Main"/&gt;
&lt;attribute name="Main-Class"
value="com.acme.checksites.Main"/&gt;
&lt;/manifest&gt;
&lt;/jar&gt;</pre>
<p>
Creates an executable jar file with a main class "com.acme.checksites.Main", and
embeds all the classes from all the jars in <code>lib/main</code>.
</p>
&lt;/jar&gt;</pre>
<p>Creates an executable jar file with a main class <samp>com.acme.checksites.Main</samp>, and
embeds all the classes from all the jars in <samp>lib/main</samp>.</p>

<h4>Inline manifest</h4>
<pre> &lt;jar destfile=&quot;test.jar&quot; basedir=&quot;.&quot;&gt;
<pre>
&lt;jar destfile=&quot;test.jar&quot; basedir=&quot;.&quot;&gt;
&lt;include name=&quot;build&quot;/&gt;
&lt;manifest&gt;
&lt;!-- If this is an Applet or Web Start application, include
the proper attributes from <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/index.html">http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/index.html</a> --&gt;
&lt;attribute name=&quot;Permissions&quot; value=&quot;sandbox&quot;/&gt;
&lt;attribute name=&quot;Codebase&quot; value=&quot;example.com&quot;/&gt;
&lt;!-- Who is building this jar? --&gt;
&lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
&lt;!-- Information about the program itself --&gt;
&lt;attribute name=&quot;Implementation-Vendor&quot; value=&quot;ACME inc.&quot;/&gt;
&lt;attribute name=&quot;Implementation-Title&quot; value=&quot;GreatProduct&quot;/&gt;
&lt;attribute name=&quot;Implementation-Version&quot; value=&quot;1.0.0beta2&quot;/&gt;
&lt;!-- details --&gt;
&lt;section name=&quot;common/MyClass.class&quot;&gt;
&lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
&lt;/section&gt;
&lt;!-- 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> --&gt;
&lt;attribute name=&quot;Permissions&quot; value=&quot;sandbox&quot;/&gt;
&lt;attribute name=&quot;Codebase&quot; value=&quot;example.com&quot;/&gt;
&lt;!-- Who is building this jar? --&gt;
&lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
&lt;!-- Information about the program itself --&gt;
&lt;attribute name=&quot;Implementation-Vendor&quot; value=&quot;ACME inc.&quot;/&gt;
&lt;attribute name=&quot;Implementation-Title&quot; value=&quot;GreatProduct&quot;/&gt;
&lt;attribute name=&quot;Implementation-Version&quot; value=&quot;1.0.0beta2&quot;/&gt;
&lt;!-- details --&gt;
&lt;section name=&quot;common/MyClass.class&quot;&gt;
&lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
&lt;/section&gt;
&lt;/manifest&gt;
&lt;/jar&gt;</pre>
<p>
This is an example of an inline manifest specification including the version of the build
program (Implementation-Version). Note that the Built-By attribute will take the value of the Ant
property ${user.name}. The manifest produced by the above would look like this:
</p>
<pre>Manifest-Version: 1.0
&lt;/jar&gt;</pre>
<p>This is an example of an inline manifest specification including the version of the build program
(<code>Implementation-Version</code>). Note that the <code>Built-By</code> attribute will take the
value of the Ant property <code>user.name</code>. The manifest produced by the above would look like
this:</p>
<pre>
Manifest-Version: 1.0
Permissions: sandbox
Codebase: example.com
Built-By: conor
@@ -556,60 +500,48 @@ Sealed: false</pre>

<h4>Service Provider</h4>

<p>
The following shows how to create a jar file specifying a service
with an implementation of the JDK 6 scripting interface:
</p>
<pre>&lt;jar destfile="pinky.jar"&gt;
&lt;fileset dir="build/classes"/&gt;
&lt;service type="javax.script.ScriptEngineFactory"
provider="org.acme.PinkyLanguage"/&gt;
&lt;/jar&gt;
</pre>

<p>
The following shows how to create a jar file specifying a service
with two implementations of the JDK 6 scripting interface:
</p>
<p>The following shows how to create a jar file specifying a service with an implementation of the
JDK 6 scripting interface:</p>
<pre>
&lt;jar destfile="pinky.jar"&gt;
&lt;fileset dir="build/classes"/&gt;
&lt;service type="javax.script.ScriptEngineFactory"
provider="org.acme.PinkyLanguage"/&gt;
&lt;/jar&gt;</pre>

<p>The following shows how to create a jar file specifying a service with two implementations of the
JDK 6 scripting interface:</p>
<pre>
&lt;jar destfile="pinkyandbrain.jar"&gt;
&lt;fileset dir="classes"/&gt;
&lt;service type="javax.script.ScriptEngineFactory"&gt;
&lt;provider classname="org.acme.PinkyLanguage"/&gt;
&lt;provider classname="org.acme.BrainLanguage"/&gt;
&lt;/service&gt;
&lt;/jar&gt;
</pre>
&lt;fileset dir="classes"/&gt;
&lt;service type="javax.script.ScriptEngineFactory"&gt;
&lt;provider classname="org.acme.PinkyLanguage"/&gt;
&lt;provider classname="org.acme.BrainLanguage"/&gt;
&lt;/service&gt;
&lt;/jar&gt;</pre>

<h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4>
<p>
Here we want to create a <i>Multi-Release JAR File</i> according the specification
<a target="_blank" href="http://openjdk.java.net/jeps/238">JEP 238</a>.
It defines on 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 manifest entry <tt>Multi-Release: true</tt>
and place all additional or overwriting classes in
<tt>META-INF/versions/<i>number</i>/package-structure</tt>, e.g.
<tt>META-INF/versions/9/org/apache/ant/MyClass.class</tt>
</p>
<p>
In this example we expect that the normal classes are compiled into
<code>${java.classes}</code> and the Java 9 classes are compiled into
<code>${java9.classes}</code>.
</p>
<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
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
manifest entry <code>Multi-Release: true</code> and place all additional or overwriting classes
in <samp>META-INF/versions/<i>number</i>/package-structure</samp>,
e.g. <samp>META-INF/versions/9/org/apache/ant/MyClass.class</samp></p>
<p>In this example we expect that the normal classes are compiled into <samp>${java.classes}</samp>
and the Java 9 classes are compiled into <samp>${java9.classes}</samp>.</p>
<pre>
&lt;jar destfile=&quot;mrjar.jar&quot;&gt;
&lt;manifest&gt;
&lt;jar destfile=&quot;mrjar.jar&quot;&gt;
&lt;manifest&gt;
&lt;!-- special mf-entry according to the spec --&gt;
&lt;attribute name=&quot;Multi-Release&quot; value=&quot;true&quot;/&gt;
&lt;/manifest&gt;
&lt;!-- directory structure according to the spec ... --&gt;
&lt;!-- ... default classes loadable by old (&lt;Java 9) versions --&gt;
&lt;fileset dir=&quot;${java.classes}&quot;/&gt;
&lt;!-- ... per release classes, require Java 9+ for loadable via standard ClassLoader --&gt;
&lt;zipfileset prefix=&quot;META-INF/versions/9/&quot; dir=&quot;${java9.classes}&quot;/&gt;
&lt;/jar&gt;
</pre>
&lt;/manifest&gt;
&lt;!-- directory structure according to the spec ... --&gt;
&lt;!-- ... default classes loadable by old (&lt;Java 9) versions --&gt;
&lt;fileset dir=&quot;${java.classes}&quot;/&gt;
&lt;!-- ... per release classes, require Java 9+ for loadable via standard ClassLoader --&gt;
&lt;zipfileset prefix=&quot;META-INF/versions/9/&quot; dir=&quot;${java9.classes}&quot;/&gt;
&lt;/jar&gt;</pre>

</body>
</html>

+ 66
- 74
manual/Tasks/jarlib-available.html View File

@@ -26,106 +26,98 @@

<h2 id="jarlib-available">jarlib-available</h2>
<h3>Description</h3>
<p>Check whether an extension is present in a fileset or an extensionSet.
<p>Check whether an extension is present in a <code>fileset</code> or an <code>extensionSet</code>.
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.
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="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html">
Extension and ExtensionSet documentation</a> for further details</p>
<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>
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of property to set if extensions is available.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>The name of property to set if extensions is available</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to check for extension</td>
<td valign="top" align="center">Yes, unless a nested
extensionSet or fileset is specified</td>
<td>file</td>
<td>The file to check for extension</td>
<td>Yes, unless a nested
<code>&lt;extensionSet&gt;</code> or <code>&lt;fileset&gt;</code> is specified</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>

<h4>extension</h4>
<p><a href="../Types/extension.html">Extension</a> the extension
to search for.</p>
<p><a href="../Types/extension.html">Extension</a> the extension to search for.</p>

<h4>fileset</h4>
<p><a href="../Types/fileset.html">FileSet</a>s are used to select
sets of files to check for extension.</p>
<p><a href="../Types/fileset.html">FileSet</a>s are used to select sets of files to check for
extension.</p>

<h4>extensionSet</h4>
<p><a href="../Types/extensionset.html">ExtensionSet</a>s is the set
of extensions to search for extension in.</p>
<p><a href="../Types/extensionset.html">ExtensionSet</a>s is the set of extensions to search for
extension in.</p>

<h3>Examples</h3>
<p><b>Search for extension in single file</b></p>
<p><strong>Search for extension in single file</strong></p>
<pre>
&lt;jarlib-available property=&quot;myext.present&quot; file=&quot;myfile.jar&quot;&gt;
&lt;extension
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;
&lt;/jarlib-available&gt;
&lt;jarlib-available property=&quot;myext.present&quot; file=&quot;myfile.jar&quot;&gt;
&lt;extension extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;
&lt;/jarlib-available&gt;
</pre>

<p><b>Search for extension in single file referencing external Extension</b></p>
<p><strong>Search for extension in single file referencing external Extension</strong></p>
<pre>
&lt;extension id=&quot;myext&quot;
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;

&lt;jarlib-available property=&quot;myext.present&quot; file=&quot;myfile.jar&quot;&gt;
&lt;extension refid=&quot;myext&quot;/&gt;
&lt;/jarlib-available&gt;
</pre>
<p><b>Search for extension in fileset</b></p>
&lt;extension id=&quot;myext&quot;
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;

&lt;jarlib-available property=&quot;myext.present&quot; file=&quot;myfile.jar&quot;&gt;
&lt;extension refid=&quot;myext&quot;/&gt;
&lt;/jarlib-available&gt;</pre>
<p><strong>Search for extension in fileset</strong></p>
<pre>
&lt;extension id=&quot;myext&quot;
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;

&lt;jarlib-available property=&quot;myext.present&quot;&gt;
&lt;extension refid=&quot;myext&quot;/&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="*.jar"/&gt;
&lt;/fileset&gt;
&lt;/jarlib-available&gt;
</pre>
<p><b>Search for extension in extensionSet</b></p>
&lt;extension id=&quot;myext&quot;
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;

&lt;jarlib-available property=&quot;myext.present&quot;&gt;
&lt;extension refid=&quot;myext&quot;/&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="*.jar"/&gt;
&lt;/fileset&gt;
&lt;/jarlib-available&gt;</pre>
<p><strong>Search for extension in extensionSet</strong></p>
<pre>
&lt;extension id=&quot;myext&quot;
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;

&lt;jarlib-available property=&quot;myext.present&quot;&gt;
&lt;extension refid=&quot;myext&quot;/&gt;
&lt;extensionSet id=&quot;exts3&quot;&gt;
&lt;libfileset
includeUrl=&quot;false&quot;
includeImpl=&quot;true&quot;
dir=&quot;lib&quot;&gt;
&lt;include name=&quot;*.jar&quot;/&gt;
&lt;/libfileset&gt;
&lt;/extensionSet&gt;
&lt;/jarlib-available&gt;
</pre>
&lt;extension id=&quot;myext&quot;
extensionName=&quot;org.apache.tools.ant&quot;
specificationVersion=&quot;1.4.9&quot;
specificationVendor=&quot;Apache Software Foundation&quot;/&gt;

&lt;jarlib-available property=&quot;myext.present&quot;&gt;
&lt;extension refid=&quot;myext&quot;/&gt;
&lt;extensionSet id=&quot;exts3&quot;&gt;
&lt;libfileset includeUrl=&quot;false&quot;
includeImpl=&quot;true&quot;
dir=&quot;lib&quot;&gt;
&lt;include name=&quot;*.jar&quot;/&gt;
&lt;/libfileset&gt;
&lt;/extensionSet&gt;
&lt;/jarlib-available&gt;</pre>

</body>
</html>

+ 25
- 30
manual/Tasks/jarlib-display.html View File

@@ -26,51 +26,46 @@

<h2 id="jarlib-display">jarlib-display</h2>
<h3>Description</h3>
<p>Display the "Optional Package" and "Package Specification" information
contained within the specified jars.</p>
<p>Display the "Optional Package" and "Package Specification" information contained within the
specified jars.</p>

<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> 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="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html">
Extension and ExtensionSet documentation</a> for further details</p>
<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>
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">The file to display extension information about.</td>
<td valign="top" align="center">Yes, unless a nested fileset is specified</td>
<td>file</td>
<td>The file to display extension information about</td>
<td>Yes, unless a nested <code>&lt;fileset&gt;</code> is specified</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>

<h4>fileset</h4>
<p><a href="../Types/fileset.html">FileSet</a>s contain list of files to
display Extension information about.</p>
<p><a href="../Types/fileset.html">FileSet</a>s contain list of files to display Extension
information about.</p>

<h3>Examples</h3>
<p><b>Display Extension info for a single file</b></p>
<pre>
&lt;jarlib-display file=&quot;myfile.jar&quot;&gt;
</pre>
<p><strong>Display Extension info for a single file</strong></p>
<pre>&lt;jarlib-display file=&quot;myfile.jar&quot;&gt;</pre>

<p><b>Display Extension info for a fileset</b></p>
<p><strong>Display Extension info for a fileset</strong></p>
<pre>
&lt;jarlib-display&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="*.jar"/&gt;
&lt;/fileset&gt;
&lt;/jarlib-display&gt;
</pre>
&lt;jarlib-display&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="*.jar"/&gt;
&lt;/fileset&gt;
&lt;/jarlib-display&gt;</pre>

</body>
</html>

+ 40
- 48
manual/Tasks/jarlib-manifest.html View File

@@ -26,76 +26,69 @@

<h2 id="jarlib-manifest">jarlib-manifest</h2>
<h3>Description</h3>
<p>Task to generate a manifest that declares all the dependencies
in manifest. The dependencies are determined by looking in the
specified path and searching for Extension / "Optional Package"
specifications in the manifests of the jars.</p>

<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> 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="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html">
Extension and ExtensionSet documentation</a> for further details</p>
<p>Task to generate a manifest that declares all the dependencies in manifest. The dependencies are
determined by looking in the specified path and searching for Extension / "Optional Package"
specifications in the manifests of the jars.</p>

<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>
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">The file to generate Manifest into</td>
<td valign="top" align="center">Yes.</td>
<td>destfile</td>
<td>The file to generate Manifest into</td>
<td>Yes</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>

<h4>extension</h4>
<p><a href="../Types/extension.html">Extension</a> the extension
that this library implements.</p>
<p><a href="../Types/extension.html">Extension</a> the extension that this library implements.</p>

<h4>depends</h4>
<p><a href="../Types/extensionset.html">ExtensionSet</a>s containing
all dependencies for jar.</p>
<p><a href="../Types/extensionset.html">ExtensionSet</a>s containing all dependencies for jar.</p>

<h4>options</h4>
<p><a href="../Types/extensionset.html">ExtensionSet</a>s containing
all optional dependencies for jar. (Optional dependencies will be used if
present else they will be ignored)</p>
<p><a href="../Types/extensionset.html">ExtensionSet</a>s containing all optional dependencies for
jar. (Optional dependencies will be used if present else they will be ignored)</p>

<h3>Examples</h3>
<p><b>Basic Manifest generated for single Extension</b></p>
<p><strong>Basic Manifest generated for single Extension</strong></p>
<pre>
&lt;extension id=&quot;e1&quot;
extensionName=&quot;MyExtensions&quot;
specificationVersion=&quot;1.0&quot;
specificationVendor=&quot;Peter Donald&quot;
implementationVendorID=&quot;vv&quot;
implementationVendor=&quot;Apache&quot;
implementationVersion=&quot;2.0&quot;
implementationURL=&quot;http://somewhere.com&quot;/&gt;
extensionName=&quot;MyExtensions&quot;
specificationVersion=&quot;1.0&quot;
specificationVendor=&quot;Peter Donald&quot;
implementationVendorID=&quot;vv&quot;
implementationVendor=&quot;Apache&quot;
implementationVersion=&quot;2.0&quot;
implementationURL=&quot;http://somewhere.com&quot;/&gt;

&lt;jarlib-manifest destfile=&quot;myManifest.txt&quot;&gt;
&lt;extension refid=&quot;e1&quot;/&gt;
&lt;/jarlib-manifest&gt;
</pre>
&lt;/jarlib-manifest&gt;</pre>

<p><b>Search for extension in fileset</b></p>
<p><b>A large example with required and optional dependencies</b></p>
<p><strong>Search for extension in fileset</strong></p>
<p><strong>A large example with required and optional dependencies</strong></p>
<pre>
&lt;extension id=&quot;e1&quot;
extensionName=&quot;MyExtensions&quot;
specificationVersion=&quot;1.0&quot;
specificationVendor=&quot;Peter Donald&quot;
implementationVendorID=&quot;vv&quot;
implementationVendor=&quot;Apache&quot;
implementationVersion=&quot;2.0&quot;
implementationURL=&quot;http://somewhere.com&quot;/&gt;
extensionName=&quot;MyExtensions&quot;
specificationVersion=&quot;1.0&quot;
specificationVendor=&quot;Peter Donald&quot;
implementationVendorID=&quot;vv&quot;
implementationVendor=&quot;Apache&quot;
implementationVersion=&quot;2.0&quot;
implementationURL=&quot;http://somewhere.com&quot;/&gt;

&lt;extensionSet id=&quot;option.ext&quot;&gt;
&lt;libfileset dir=&quot;lib/option&quot;&gt;
@@ -113,8 +106,7 @@ Extension and ExtensionSet documentation</a> for further details</p>
&lt;extension refid=&quot;e1&quot;/&gt;
&lt;depends refid=&quot;depends.ext&quot;/&gt;
&lt;options refid=&quot;option.ext&quot;/&gt;
&lt;/jarlib-manifest&gt;
</pre>
&lt;/jarlib-manifest&gt;</pre>

</body>
</html>

+ 116
- 125
manual/Tasks/jarlib-resolve.html View File

@@ -26,180 +26,171 @@

<h2 id="jarlib-resolve">jarlib-resolve</h2>
<h3>Description</h3>
<p>Try to locate a jar to satisfy an extension and place
location of jar into property. The task allows you to
add a number of resolvers that are capable of locating a
library for a specific extension. Each resolver will be attempted
in specified order until library is found or no resolvers are left.
If no resolvers are left and failOnError is true then a BuildException
will be thrown.</p>

<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> 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="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html">
Extension and ExtensionSet documentation</a> for further details</p>
<p>Try to locate a jar to satisfy an extension and place location of jar into property. The task
allows you to add a number of resolvers that are capable of locating a library for a specific
extension. Each resolver will be attempted in specified order until library is found or no resolvers
are left. If no resolvers are left and <var>failOnError</var> is true then a BuildException will be
thrown.</p>

<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>
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of property to set to library location.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>The name of property to set to library location.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">failOnError</td>
<td valign="top">True if failure to locate library should result in build exception.</td>
<td valign="top" align="center">No, defaults to true.</td>
<td>failOnError</td>
<td><q>true</q> if failure to locate library should result in build exception.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">checkExtension</td>
<td valign="top">True if libraries returned by nested resolvers should be checked to see if
they supply extension.</td>
<td valign="top" align="center">No, defaults to true.</td>
<td>checkExtension</td>
<td><q>true</q> if libraries returned by nested resolvers should be checked to see if they
supply extension.</td>
<td>No; defaults to <q>true</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>

<h4>extension</h4>
<p><a href="../Types/extension.html">Extension</a> the extension
to resolve. Must be present</p>
<p><a href="../Types/extension.html">Extension</a> the extension to resolve. Must be present</p>

<h4>location</h4>
<p>The location sub element allows you to look for a library in a
location relative to project directory.</p>
<table>
<p>The <code>location</code> nested element allows you to look for a library in a location relative
to project directory.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">location</td>
<td valign="top">The pathname of library.</td>
<td valign="top" align="center">Yes</td>
<td>location</td>
<td>The pathname of library.</td>
<td>Yes</td>
</tr>
</table>

<h4>url</h4>
<p>The url resolver allows you to download a library from a URL to a
local file.</p>
<table>
<p>The <code>url</code> resolver allows you to download a library from a URL to a local file.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">url</td>
<td valign="top">The URL to download.</td>
<td valign="top" align="center">Yes</td>
<td>url</td>
<td>The URL to download.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">The file to download URL into.</td>
<td valign="top" align="center" rowspan="2">Exactly one of the two</td>
<td>destfile</td>
<td>The file to download URL into.</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">destdir</td>
<td valign="top">The directory in which to place downloaded file.</td>
<td>destdir</td>
<td>The directory in which to place downloaded file.</td>
</tr>
</table>

<h4>ant</h4>
<p>The ant resolver allows you to run an Apache Ant build file to generate a library.</p>
<table>
<p>The <code>ant</code> resolver allows you to run an Apache Ant build file to generate a
library.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">antfile</td>
<td valign="top">The build file.</td>
<td valign="top" align="center">Yes</td>
<td>antfile</td>
<td>The build file.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">The file that the ant build creates.</td>
<td valign="top" align="center">Yes</td>
<td>destfile</td>
<td>The file that the ant build creates.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">target</td>
<td valign="top">The target to run in build file.</td>
<td valign="top" align="center">No</td>
<td>target</td>
<td>The target to run in build file.</td>
<td>No</td>
</tr>
</table>

<h3>Examples</h3>
<p><b>Resolve Extension to file.</b> If file does not exist or file
does not implement extension then throw an exception.</p>
<p><strong>Resolve Extension to file.</strong> If file does not exist or file does not implement
extension then throw an exception.</p>
<pre>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;location location="/opt/jars/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;
</pre>

<p><b>Resolve Extension to url.</b> If url does not exist or can not write
to destfile or files does not implement extension then throw an exception.</p>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;location location="/opt/jars/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;</pre>

<p><strong>Resolve Extension to URL.</strong> If URL does not exist or can not write
to <var>destfile</var> or file does not implement extension then throw an exception.</p>
<pre>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;
</pre>

<p><b>Resolve Extension to file produce by ant build.</b> If file does not get produced
or ant file is missing or build fails then throw an exception (Note does not check
that library implements extension).</p>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;</pre>

<p><strong>Resolve Extension to file produce by Ant build.</strong> If file does not get produced or
Ant file is missing or build fails then throw an exception. (<strong>Note</strong>: does not check
that library implements extension.)</p>
<pre>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library" checkExtension="false"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;
</pre>

<p><b>Resolve Extension via multiple methods.</b> First check local file to see if it implements
extension. If it does not then try to build it from source in parallel directory. If that
fails then finally try to download it from a website. If all steps fail then throw a build
exception.</p>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library" checkExtension="false"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;</pre>

<p><strong>Resolve Extension via multiple methods.</strong> First check local file to see if it
implements extension. If it does not then try to build it from source in parallel directory. If that
fails then finally try to download it from a website. If all steps fail then throw a build
exception.</p>
<pre>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;location location="/opt/jars/dve.jar"/&gt;
&lt;ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/&gt;
&lt;url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;
</pre>
&lt;extension id=&quot;dve.ext&quot;
extensionName=&quot;org.realityforge.dve&quot;
specificationVersion=&quot;1.2&quot;
specificationVendor=&quot;Peter Donald&quot;/&gt;

&lt;jarlib-resolve property="dve.library"&gt;
&lt;extension refid="dve.ext"/&gt;
&lt;location location="/opt/jars/dve.jar"/&gt;
&lt;ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/&gt;
&lt;url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/&gt;
&lt;/jarlib-resolve&gt;</pre>

</body>
</html>

+ 254
- 306
manual/Tasks/java.html View File

@@ -26,228 +26,202 @@

<h2 id="java">Java</h2>
<h3>Description</h3>
<p>Executes a Java class within the running (Apache Ant) VM or forks another VM if
specified.</p>
<p>
If odd things go wrong when you run this task, set fork="true" to use a new
JVM.
<p>Executes a Java class within the running (Apache Ant) JVM or forks another JVM if specified.</p>
<p>If odd things go wrong when you run this task, set <var>fork</var>=<q>true</q> to use a new
JVM.</p>

<p><em>Since Ant 1.6.3</em>, you can interact with a forked VM, as well as
sending input to it via the <code>input</code> and <code>inputstring</code>
attributes.</p>
<p><em>Since Ant 1.6.3</em>, you can interact with a forked JVM, as well as sending input to it via
the <var>input</var> and <var>inputstring</var> attributes.</p>

<h4 id="background">Running Ant as a background process on Unix(-like) systems</h4>

<p>If you run Ant as a background process (like <code>ant &</code>)
and use the <code>&lt;java&gt;</code> task with <code>spawn</code>
set to <code>false</code> and <code>fork</code>
to <code>true</code>, you must provide explicit input to the forked
process or Ant will be suspended because it tries to read from the
standard input.</p>
<p>If you run Ant as a background process (like <code>ant &</code>) and use
the <code>&lt;java&gt;</code> task with <var>spawn</var> set to <q>false</q> and <var>fork</var>
to <q>true</q>, you must provide explicit input to the forked process or Ant will be suspended
because it tries to read from the standard input.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr id="classname">
<td valign="top">classname</td>
<td valign="top">the Java class to execute.</td>
<td align="center" valign="top">Either <tt>jar</tt>, <tt>classname</tt> or <tt>module</tt></td>
<td>classname</td>
<td>the Java class to execute.</td>
<td rowspan="3">Exactly one of the three</td>
</tr>
<tr>
<td valign="top">jar</td>
<td valign="top">the location of the jar file to execute (must have a
Main-Class entry in the manifest). Fork must be set to true if this option is selected.
See notes below for more details.
<td>jar</td>
<td class="left">the location of the jar file to execute (must have a <code>Main-Class</code>
entry in the manifest). <var>fork</var> must be set to <q>true</q> if this option is selected.
See notes below for more details.
</td>
<td align="center" valign="top">Either <tt>jar</tt>, <tt>classname</tt> or <tt>module</tt></td>
</tr>
<tr>
<td valign="top">args</td>
<td valign="top">the arguments for the class that is
executed. <b>deprecated, use nested <code>&lt;arg&gt;</code>
elements instead.</b></td>
<td align="center" valign="top">No</td>
<td>module</td>
<td class="left">The initial or main module to resolve (must have a <code>Main-Class</code>
entry in the manifest). <var>fork</var> must be set to <q>true</q> if this option is
selected. <em>since Ant 1.9.7</em></td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">the classpath to use.</td>
<td align="center" valign="top">No</td>
<td>args</td>
<td>the arguments for the class that is executed. <em><u>Deprecated</u>, use
nested <code>&lt;arg&gt;</code> elements instead.</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">the classpath to use, given as <a
href="../using.html#references">reference</a> to a PATH defined elsewhere.</td>
<td align="center" valign="top">No</td>
<td>classpath</td>
<td>the classpath to use.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">fork</td>
<td valign="top">if enabled triggers the class execution in another VM
(disabled by default)</td>
<td align="center" valign="top">No</td>
<td>classpathref</td>
<td>the classpath to use, given as <a href="../using.html#references">reference</a> to
a <code>Path</code> defined elsewhere.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">spawn</td>
<td valign="top">if enabled allows to start a process which will outlive Ant.<br>
Requires fork=true, and not compatible
with timeout, input, output, error, result attributes.<br>
(disabled by default)</td>
<td align="center" valign="top">No</td>
<td>modulepath</td>
<td>Specify where to find application modules. A list of directories of modules, module files or
exploded modules. <em>since Ant 1.9.7</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">jvm</td>
<td valign="top">the command used to invoke the Java Virtual Machine,
default is 'java'. The command is resolved by java.lang.Runtime.exec().
Ignored if fork is disabled.
</td>
<td align="center" valign="top">No</td>
<td>modulepathref</td>
<td>The modulepath to use, given as <a href="../using.html#references">reference</a> to
a <code>Path</code> defined elsewhere. <em>since Ant 1.9.7</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">jvmargs</td>
<td valign="top">the arguments to pass to the forked VM (ignored
if fork is disabled). <b>deprecated, use nested
<code>&lt;jvmarg&gt;</code> elements instead.</b></td>
<td align="center" valign="top">No</td>
<td>fork</td>
<td>if enabled triggers the class execution in another JVM.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">maxmemory</td>
<td valign="top">Max amount of memory to allocate to the forked VM
(ignored if fork is disabled)</td>
<td align="center" valign="top">No</td>
<td>spawn</td>
<td>if enabled allows to start a process which will outlive Ant.<br/>Requires
that <var>fork</var> is <q>true</q>, and not compatible
with <var>timeout</var>, <var>input</var>, <var>output</var>, <var>error</var>, <var>result</var>
attributes</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">module</td>
<td valign="top">The initial or main module to resolve. To specify
the module main class use the <a href="#classname">classname</a> attribute.
Fork must be set to true if this option is selected. <em>since Ant 1.9.7</em></td>
<td align="center" valign="top">Either <tt>jar</tt>, <tt>classname</tt> or <tt>module</tt></td>
<td>jvm</td>
<td>the command used to invoke JVM. The command is resolved
by <code>java.lang.Runtime.exec()</code>. Ignored if <var>fork</var> is <q>false</q>.
</td>
<td>No, default is <q>java</q></td>
</tr>
<tr>
<td valign="top">modulepath</td>
<td valign="top">Specify where to find application modules. A list of directories of modules, module files or exploded modules. <em>since Ant 1.9.7</em></td>
<td align="center" valign="top">No</td>
<td>jvmargs</td>
<td>the arguments to pass to the forked JVM, ignored if <var>fork</var> is
disabled. <em><u>Deprecated</u>, use nested <code>&lt;jvmarg&gt;</code> elements
instead.</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">modulepathref</td>
<td valign="top">The modulepath to use, given as <a
href="../using.html#references">reference</a> to a PATH defined elsewhere.
<em>since Ant 1.9.7</em></td>
<td align="center" valign="top">No</td>
<td>maxmemory</td>
<td>Max amount of memory to allocate to the forked JVM, ignored if <var>fork</var>
is <q>false</q></td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a
returncode other than 0. Default is "false" (see <a href="#failonerror">note</a>)</td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code other than 0.</td>
<td>No; default is <q>false</q> (see <a href="#failonerror">note</a>)</td>
</tr>
<tr>
<td valign="top">resultproperty</td>
<td valign="top">The name of a property in which the return code of the
command should be stored. Only of interest if failonerror=false
and if fork=true.</td>
<td align="center" valign="top">No</td>
<td>resultproperty</td>
<td>The name of a property in which the return code of the command should be stored. Only of
interest if <var>failonerror</var> is <q>false</q> and if <var>fork</var> is <q>true</q>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">The directory to invoke the VM in. (ignored if
fork is disabled)</td>
<td align="center" valign="top">No</td>
<td>dir</td>
<td>The directory to invoke the JVM in, ignored if <var>fork</var> is <q>false</q>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">output</td>
<td valign="top">Name of a file to which to write the output. If the error stream
is not also redirected to a file or property, it will appear in this output.</td>
<td align="center" valign="top">No</td>
<td>output</td>
<td>Name of a file to which to write the output. If the error stream is not also redirected to a
file or property, it will appear in this output.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">error</td>
<td valign="top">The file to which the standard error of the command should be
redirected.</td>
<td align="center" valign="top">No</td>
<td>error</td>
<td>The file to which the standard error of the command should be redirected.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">logError</td>
<td valign="top">This attribute is used when you wish to see error output in Ant's
log and you are redirecting output to a file/property. The error
output will not be included in the output file/property. If you
redirect error with the &quot;error&quot; or &quot;errorProperty&quot;
attributes, this will have no effect.</td>
<td align="center" valign="top">No</td>
<td>logError</td>
<td>This attribute is used when you wish to see error output in Ant's log and you are
redirecting output to a file/property. The error output will not be included in the output
file/property. If you redirect error with the <var>error</var> or <var>errorProperty</var>
attributes, this will have no effect.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">append</td>
<td valign="top">Whether output and error files should be appended to or overwritten.
Defaults to false.</td>
<td align="center" valign="top">No</td>
<td>append</td>
<td>Whether output and error files should be appended to or overwritten.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">outputproperty</td>
<td valign="top">The name of a property in which the output of the
command should be stored. Unless the error stream is redirected to a separate
file or stream, this property will include the error output.</td>
<td align="center" valign="top">No</td>
<td>outputproperty</td>
<td>The name of a property in which the output of the command should be stored. Unless the error
stream is redirected to a separate file or stream, this property will include the error
output.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">errorproperty</td>
<td valign="top">The name of a property in which the standard error of the
command should be stored.</td>
<td align="center" valign="top">No</td>
<td>errorproperty</td>
<td>The name of a property in which the standard error of the command should be stored.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">input</td>
<td valign="top">A file from which the executed command's standard input
is taken. This attribute is mutually exclusive with the
inputstring attribute</td>
<td align="center" valign="top">No; default is to take standard input from console
(unless <code>spawn="true"</code>)</td>
<td>input</td>
<td>A file from which the executed command's standard input is taken. This attribute is mutually
exclusive with the <var>inputstring</var> attribute</td>
<td>No; default is to take standard input from console
unless <var>spawn</var> is <q>true</q></td>
</tr>
<tr>
<td valign="top">inputstring</td>
<td valign="top">A string which serves as the input stream for the
executed command. This attribute is mutually exclusive with the
input attribute.</td>
<td align="center" valign="top">No; default is to take standard input from console
(unless <code>spawn="true"</code>)</td>
<td>inputstring</td>
<td>A string which serves as the input stream for the executed command. This attribute is
mutually exclusive with the <var>input</var> attribute.</td>
<td>No; default is to take standard input from console unless <var>spawn</var>
is <q>true</q>)</td>
</tr>
<tr>
<td valign="top">newenvironment</td>
<td valign="top">Do not propagate old environment when new
environment variables are specified. Default is &quot;false&quot;
(ignored if fork is disabled).</td>
<td align="center" valign="top">No</td>
<td>newenvironment</td>
<td>Do not propagate old environment when new environment variables are specified.</td>
<td>No; default is <q>false</q>, ignored if <var>fork</var> is <q>false</q></td>
</tr>
<tr>
<td valign="top">timeout</td>
<td valign="top">Stop the command if it doesn't finish within the
specified time (given in milliseconds). <strong>It is highly
recommended to use this feature only if fork is enabled.</strong></td>
<td align="center" valign="top">No</td>
<td>timeout</td>
<td>Stop the command if it doesn't finish within the specified time (given in
milliseconds). <strong>It is highly recommended to use this feature only if <var>fork</var>
is <q>true</q>.</strong></td>
<td>No</td>
</tr>
<tr>
<td valign="top">clonevm</td>
<td valign="top">If set to true, then all system properties
and the bootclasspath of the forked Java Virtual Machine will be
the same as those of the Java VM running Ant. Default is
&quot;false&quot; (ignored if fork is disabled).
<em>since Ant 1.7</em></td>
<td align="center" valign="top">No</td>
<td>clonevm</td>
<td>If set to <q>true</q>, then all system properties and the <var>bootclasspath</var> of the
forked JVM will be the same as those of the JVM running Ant. <em>since Ant 1.7</em></td>
<td>No; default is <q>false</q>, ignored if <var>fork</var> is <q>false</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>arg and jvmarg</h4>
<p>Use nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code>
elements to specify arguments for the Java class and the forked VM respectively.
See <a href="../using.html#arg">Command line arguments</a>.</p>
<p>Use nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code> elements to specify arguments
for the Java class and the forked JVM respectively. See <a href="../using.html#arg">Command line
arguments</a>.</p>
<h4>sysproperty</h4>
<p>Use nested <code>&lt;sysproperty&gt;</code>
elements to specify system properties required by the class.
These properties will be made available to the VM during the execution
of the class (either ANT's VM or the forked VM). The attributes
for this element are the same as for <a href="exec.html#env">environment
variables</a>.</p>
<p>Use nested <code>&lt;sysproperty&gt;</code> elements to specify system properties required by the
class. These properties will be made available to JVM during the execution of the class (either
Ant's JVM or the forked JVM). The attributes for this element are the same as
for <a href="exec.html#env">environment variables</a>.</p>

<h4>syspropertyset</h4>

@@ -257,49 +231,42 @@ with <a href="../Types/propertyset.html">syspropertyset</a>s.</p>
<p><em>since Ant 1.6</em>.</p>

<h4>classpath</h4>
<p><code>Java</code>'s <i>classpath</i> attribute is a <a
href="../using.html#path">PATH like structure</a> and can also be set via a nested
<i>classpath</i> element.</p>
<p><code>Java</code>'s <var>classpath</var> attribute is a <a href="../using.html#path">path-like
structure</a> and can also be set via a nested <code>classpath</code> element.</p>

<h4>bootclasspath</h4>

<p>The location of bootstrap class files can be specified using this
<a href="../using.html#path">PATH like structure</a> - will be ignored
if <i>fork</i> is not <code>true</code> or the target VM doesn't
support it (i.e. Java 1.1).</p>
<p>The location of bootstrap class files can be specified using
this <a href="../using.html#path">path-like structure</a>&mdash;will be ignored if <var>fork</var>
is not <q>true</q> or the target JVM doesn't support it (i.e. Java 1.1).</p>

<p><em>since Ant 1.6</em>.</p>

<h4>env</h4>
<p>It is possible to specify environment variables to pass to the
forked VM via nested <i>env</i> elements. See the description in the
section about <a href="exec.html#env">exec</a></p>
<p>Settings will be ignored if fork is disabled.</p>
<p>It is possible to specify environment variables to pass to the forked JVM via
nested <code>env</code> elements. See the description in the section
about <a href="exec.html#env">exec</a></p>
<p>Settings will be ignored if <var>fork</var> is <q>false</q>.</p>

<h4>permissions</h4>
<p>Security permissions can be revoked and granted during the execution of the
class via a nested <i>permissions</i> element. For more information please
see <a href="../Types/permissions.html">permissions</a></p>
<p>When the permission RuntimePermission exitVM has not been granted (or has
been revoked) the System.exit() call will be intercepted
and treated like indicated in <i>failonerror</i>.</p>
<p><strong>Note</strong>:<br>
If you do not specify permissions,
a set of default permissions will be added to your Java invocation to make
sure that the Ant run will continue or terminated as indicated by
<i>failonerror</i>. All permissions not granted per default will be
checked by whatever security manager was already in place. exitVM will be
disallowed.
</p>
<p>Settings will be ignored if fork is enabled.</p>
<p>Security permissions can be revoked and granted during the execution of the class via a
nested <code>permissions</code> element. For more information please
see <a href="../Types/permissions.html">permissions</a>.</p>
<p>When the permission <code>RuntimePermission exitVM</code> has not been granted (or has been
revoked) the <code>System.exit()</code> call will be intercepted and treated like indicated
in <var>failonerror</var>.</p>
<p><strong>Note</strong>:<br/> If you do not specify permissions, a set of default permissions will
be added to your Java invocation to make sure that the Ant run will continue or terminated as
indicated by <var>failonerror</var>. All permissions not granted per default will be checked by
whatever security manager was already in place. <code>exitVM</code> will be disallowed.</p>
<p>Settings will be ignored if <var>fork</var> is <q>true</q>.</p>

<p><em>since Ant 1.6</em>.</p>

<h4>assertions</h4>

<p>You can control enablement of Java 1.4 assertions with an
<a href="../Types/assertions.html"><tt>&lt;assertions&gt;</tt></a>
subelement.</p>
<p>You can control enablement of Java 1.4 assertions with
an <a href="../Types/assertions.html"><code>&lt;assertions&gt;</code></a> subelement.</p>

<p>Assertion statements are currently ignored in non-forked mode.</p>

@@ -307,153 +274,134 @@ subelement.</p>

<h4 id="redirector">redirector</h4>
<em>Since Ant 1.6.2</em>
<p>A nested <a href="../Types/redirector.html">I/O Redirector</a>
can be specified. In general, the attributes of the redirector behave
as the corresponding attributes available at the task level. The most
notable peculiarity stems from the retention of the <code>&lt;java&gt;</code>
attributes for backwards compatibility. Any file mapping is done
using a <code>null</code> sourcefile; therefore not all
<a href="../Types/mapper.html">Mapper</a> types will return
results. When no results are returned, redirection specifications
will fall back to the task level attributes. In practice this means that
defaults can be specified for input, output, and error output files.
</p>
<p>A nested <a href="../Types/redirector.html">I/O Redirector</a> can be specified. In general, the
attributes of the redirector behave as the corresponding attributes available at the task level.
The most notable peculiarity stems from the retention of the <code>&lt;java&gt;</code> attributes
for backwards compatibility. Any file mapping is done using a <code>null</code> sourcefile;
therefore not all <a href="../Types/mapper.html">Mapper</a> types will return results. When no
results are returned, redirection specifications will fall back to the task level attributes. In
practice this means that defaults can be specified for <var>input</var>, <var>output</var>,
and <var>error</var> output files.</p>
<h3 id="failonerror">Errors and return codes</h3>
By default the return code of a <code>&lt;java&gt;</code> is ignored.
Alternatively, you can set <code>resultproperty</code> to the name
of a property and have it assigned to the result code (barring immutability,
of course).
When you set <code>failonerror="true"</code>, the only possible value for
<code>resultproperty</code> is 0. Any non-zero response is treated as an
error and would mean the build exits.
<p>Similarly, if <code>failonerror="false"</code> and <code>fork="false"</code>,
then <code>&lt;java&gt;</code> <b>must</b> return 0 otherwise the build will
exit, as the class was run by the build JVM.</p>
<p>By default, the return code of a <code>&lt;java&gt;</code> is ignored. Alternatively, you can
set <var>resultproperty</var> to the name of a property and have it assigned to the result code
(barring immutability, of course). When you set <var>failonerror</var>=<q>true</q>, the only
possible value for <var>resultproperty</var> is <q>0</q>. Any non-zero response is treated as an
error and would mean the build exits.</p>
<p>Similarly, if <var>failonerror</var>=<q>false</q> and <var>fork</var>=<q>false</q>,
then <code>&lt;java&gt;</code> <em>must</em> return <q>0</q> otherwise the build will exit, as the
class was run by the build JVM.</p>

<h4 id="modulepath">modulepath</h4>
<em>Since Ant 1.9.7</em>
<p><code>Java</code>'s <i>modulepath</i> attribute is a <a
href="../using.html#path">PATH like structure</a> and can also be set via a nested
<i>modulepath</i> element.</p>
<p><code>Java</code>'s <var>modulepath</var> attribute is a <a href="../using.html#path">path-like
structure</a> and can also be set via a nested <code>modulepath</code> element.</p>

<h4 id="upgrademodulepath">upgrademodulepath</h4>
<em>Since Ant 1.9.7</em>
<p>The location of modules that replace upgradeable modules in the runtime image
can be specified using this <a href="../using.html#path">PATH like structure</a>.</p>
<p>The location of modules that replace upgradeable modules in the runtime image can be specified
using this <a href="../using.html#path">path-like structure</a>.</p>

<h3>JAR file execution</h3>

<p>The parameter of the <tt>jar</tt> attribute is of type <tt>File</tt>;
that is, the parameter is resolved to an absolute file relative to the
base directory of the project, <i>not</i> the directory in which the Java
task is run. If you need to locate a JAR file relative to the directory
the task will be run in, you need to explicitly create the full path
to the JAR file.</p>
<p>When using the <tt>jar</tt> attribute, all classpath settings are
ignored according to <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html">Oracle's
<p>The parameter of the <var>jar</var> attribute is of type <code>File</code>; that is, the
parameter is resolved to an absolute file relative to the base directory of the
project, <em>not</em> the directory in which the Java task is run. If you need to locate a JAR file
relative to the directory the task will be run in, you need to explicitly create the full path to
the JAR file.</p>
<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>.


<h3>Examples</h3>
<pre>
&lt;java classname=&quot;test.Main&quot;&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/classpath&gt;
&lt;/java&gt;
</pre>
&lt;java classname=&quot;test.Main&quot;&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/classpath&gt;
&lt;/java&gt;</pre>
Run a class in this JVM with a new jar on the classpath

<pre>
&lt;java jar=&quot;dist/test.jar&quot;
fork="true"
failonerror="true"
maxmemory="128m"
&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/classpath&gt;
&lt;/java&gt;
</pre>
Run the JAR test.jar in this project's dist/lib directory.
using the manifest supplied entry point, forking (as required),
and with a maximum memory of 128MB. Any non zero return code breaks the build.
&lt;java jar=&quot;dist/test.jar&quot;
fork="true"
failonerror="true"
maxmemory="128m"&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/classpath&gt;
&lt;/java&gt;</pre>
<p>Run the JAR <samp>test.jar</samp> in this project's <samp>dist/lib</samp> directory. using the
manifest supplied entry point, forking (as required), and with a maximum memory of 128 MB. Any non
zero return code breaks the build.</p>

<pre>
&lt;java dir=&quot;${exec.dir}&quot;
jar=&quot;${exec.dir}/dist/test.jar&quot;
fork=&quot;true&quot;
failonerror=&quot;true&quot;
maxmemory=&quot;128m&quot;&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/classpath&gt;
&lt;/java&gt;</pre>
<p>Run the JAR <samp>dist/test.jar</samp> relative to the directory <code>${exec.dir}</code>, this
being the same directory in which JVM is to start up.</p>

<pre>&lt;java classname=&quot;test.Main&quot;/&gt;</pre>
<p>Runs a given class with the current classpath.</p>

<pre>
&lt;java
dir="${exec.dir}"
jar=&quot;${exec.dir}/dist/test.jar&quot;
fork="true"
failonerror="true"
maxmemory="128m"
&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
&lt;/classpath&gt;
&lt;/java&gt;
</pre>
Run the JAR dist/test.jar relative to the directory
<tt>${exec.dir}</tt>, this being the same directory into which the JVM
is to start up.

<pre> &lt;java classname=&quot;test.Main&quot;/&gt;</pre>
Runs a given class with the current classpath.
&lt;java classname=&quot;test.Main&quot;
fork=&quot;yes&quot; &gt;
&lt;sysproperty key=&quot;DEBUG&quot; value=&quot;true&quot;/&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;jvmarg value=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;/&gt;
&lt;/java&gt;</pre>
<p>Add system properties and JVM properties to JVM as in <code>java
-Xrunhprof:cpu=samples,file=log.txt,depth=3 -DDEBUG=true test.Main</code>

<pre>
&lt;java classname=&quot;test.Main&quot;
fork=&quot;yes&quot; &gt;
&lt;sysproperty key=&quot;DEBUG&quot; value=&quot;true&quot;/&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;jvmarg value=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;/&gt;
&lt;/java&gt;
</pre>
Add system properties and JVM-properties to the JVM as in
<code>java ="-Xrunhprof:cpu=samples,file=log.txt,depth=3 -DDEBUG=true test.Main</code>

<pre> &lt;java classname=&quot;ShowJavaVersion&quot; classpath=&quot;.&quot;
jvm=&quot;path-to-java14-home/bin/java&quot; fork=&quot;true&quot;
taskname=&quot;java1.4&quot; &gt;
</pre>
Use a given Java implementation (another the one Ant is currently using) to run the class.
For documentation in the log <code>taskname</code> is used to change the <code>[java]</code>
log-prefix to <code>[java1.4]</code>.


<p><strong>Note</strong>: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the
JVM, as it takes different parameters for other JVMs,
&lt;java classname=&quot;ShowJavaVersion&quot; classpath=&quot;.&quot;
jvm=&quot;path-to-java14-home/bin/java&quot; fork=&quot;true&quot;
taskname=&quot;java1.4&quot;/&gt;</pre>
<p>Use a given Java implementation (other than the one Ant is currently using) to run the class.
For documentation in the log <var>taskname</var> is used to change the <q>[java]</q> log-prefix
to <q>[java1.4]</q>.</p>

<p><strong>Note</strong>: you can not specify the (highly deprecated) MS
JVM, <samp>jview.exe</samp>, as <var>jvm</var>, since it takes different parameters than other JVMs.
That JVM can be started from <code>&lt;exec&gt;</code> if required.</p>

<pre>
&lt;java
fork=&quot;true&quot;
failonerror=&quot;true&quot;
maxmemory=&quot;128m&quot;
module=&quot;TestModule&quot;
modulepath=&quot;lib:dist/test.jar&quot;/&gt;
</pre>
Runs the module TestModule resolved on the modulepath <tt>lib/:dist/test.jar</tt>
with a maximum memory of 128MB. Any non zero return code breaks the build.
&lt;java fork=&quot;true&quot;
failonerror=&quot;true&quot;
maxmemory=&quot;128m&quot;
module=&quot;TestModule&quot;
modulepath=&quot;lib:dist/test.jar&quot;/&gt;</pre>
<p>Runs the module <samp>TestModule</samp> resolved on the
modulepath <samp>lib/:dist/test.jar</samp> with a maximum memory of 128 MB. Any non zero return code
breaks the build.</p>

<pre>
&lt;java
fork=&quot;true&quot;
failonerror=&quot;true&quot;
maxmemory=&quot;128m&quot;
module=&quot;TestModule&quot;
classname=&quot;Main&quot;&gt;
&lt;modulepath&gt;
&lt;pathelement location=&quot;lib&quot;/&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;/modulepath&gt;
&lt;/java&gt;
</pre>
Runs the class Main in module TestModule resolved on the modulepath <tt>lib/:dist/test.jar</tt>
with a maximum memory of 128MB. Any non zero return code breaks the build.
&lt;java fork=&quot;true&quot;
failonerror=&quot;true&quot;
maxmemory=&quot;128m&quot;
module=&quot;TestModule&quot;
classname=&quot;Main&quot;&gt;
&lt;modulepath&gt;
&lt;pathelement location=&quot;lib&quot;/&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;/modulepath&gt;
&lt;/java&gt;</pre>
<p>Runs the class <samp>Main</samp> in module <samp>TestModule</samp> resolved on the
modulepath <samp>lib/:dist/test.jar</samp> with a maximum memory of 128 MB. Any non zero return code
breaks the build.</p>
</body>
</html>

+ 638
- 816
manual/Tasks/javac.html
File diff suppressed because it is too large
View File


+ 104
- 118
manual/Tasks/javacc.html View File

@@ -26,181 +26,167 @@

<h2 id="javacc">JavaCC</h2>
<h3>Description</h3>
<p>
Invokes the <a href="http://javacc.dev.java.net/" target="_top">JavaCC</a> compiler
compiler on a grammar file.
</p>
<p>
To use the javacc task, set the <i>target</i> attribute to the name of the
grammar file to process. You also need to specify the directory containing
the JavaCC installation using the <i>javacchome</i> attribute, so that Apache Ant
can find the JavaCC classes. Optionally, you can also set the
<i>outputdirectory</i> to write the generated file to a specific directory.
Otherwise javacc writes the generated files to the directory containing
the grammar file.
</p>
<p>
This task only invokes JavaCC if the grammar file is newer than the generated
Java files. javacc assumes that the Java class name of the generated parser
is the same as the name of the grammar file, ignoring the .jj.
If this is not the case, the javacc task will still work, but it will always
generate the output files.
</p>
<p>Invokes the <a href="https://javacc.org/" target="_top">JavaCC</a> compiler compiler on a grammar
file.</p>
<p>To use the <code>javacc</code> task, set the <var>target</var> attribute to the name of the
grammar file to process. You also need to specify the directory containing the JavaCC installation
using the <var>javacchome</var> attribute, so that Apache Ant can find the JavaCC classes.
Optionally, you can also set the <var>outputdirectory</var> to write the generated file to a
specific directory. Otherwise JavaCC writes the generated files to the directory containing the
grammar file.</p>
<p>This task only invokes JavaCC if the grammar file is newer than the generated <samp>.java</samp>
files. JavaCC assumes that the Java class name of the generated parser is the same as the name of
the grammar file, ignoring the <samp>.jj</samp>. If this is not the case, the <code>javacc</code>
task will still work, but it will always generate the output files.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">target</td>
<td valign="top">The grammar file to process.</td>
<td valign="top" align="center">Yes</td>
<td>target</td>
<td>The grammar file to process.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">javacchome</td>
<td valign="top">The directory containing the JavaCC distribution.</td>
<td valign="top" align="center">Yes</td>
<td>javacchome</td>
<td>The directory containing the JavaCC distribution.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">outputdirectory</td>
<td valign="top">
The directory to write the generated files to. If not set, the files
are written to the directory containing the grammar file.
</td>
<td valign="top" align="center">No</td>
<td>outputdirectory</td>
<td>The directory to write the generated files to. If not set, the files are written to the
directory containing the grammar file.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">buildparser</td>
<td valign="top">Sets the BUILD_PARSER grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>buildparser</td>
<td>Sets the BUILD_PARSER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">buildtokenmanager</td>
<td valign="top">Sets the BUILD_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>buildtokenmanager</td>
<td>Sets the BUILD_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">cachetokens</td>
<td valign="top">Sets the CACHE_TOKENS grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>cachetokens</td>
<td>Sets the CACHE_TOKENS grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">choiceambiguitycheck</td>
<td valign="top">Sets the CHOICE_AMBIGUITY_CHECK grammar option. This is an integer option.</td>
<td valign="top" align="center">No</td>
<td>choiceambiguitycheck</td>
<td>Sets the CHOICE_AMBIGUITY_CHECK grammar option. This is an integer option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">commontokenaction</td>
<td valign="top">Sets the COMMON_TOKEN_ACTION grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>commontokenaction</td>
<td>Sets the COMMON_TOKEN_ACTION grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">debuglookahead</td>
<td valign="top">Sets the DEBUG_LOOKAHEAD grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>debuglookahead</td>
<td>Sets the DEBUG_LOOKAHEAD grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">debugparser</td>
<td valign="top">Sets the DEBUG_PARSER grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>debugparser</td>
<td>Sets the DEBUG_PARSER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">debugtokenmanager</td>
<td valign="top">Sets the DEBUG_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>debugtokenmanager</td>
<td>Sets the DEBUG_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">errorreporting</td>
<td valign="top">Sets the ERROR_REPORTING grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>errorreporting</td>
<td>Sets the ERROR_REPORTING grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">forcelacheck</td>
<td valign="top">Sets the FORCE_LA_CHECK grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>forcelacheck</td>
<td>Sets the FORCE_LA_CHECK grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">ignorecase</td>
<td valign="top">Sets the IGNORE_CASE grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>ignorecase</td>
<td>Sets the IGNORE_CASE grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">javaunicodeescape</td>
<td valign="top">Sets the JAVA_UNICODE_ESCAPE grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>javaunicodeescape</td>
<td>Sets the JAVA_UNICODE_ESCAPE grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">jdkversion</td>
<td valign="top">Sets the JDK_VERSION option. This is a string option.</td>
<td valign="top" align="center">No</td>
</tr> <tr>
<td valign="top">keeplinecolumn</td>
<td valign="top">Sets the KEEP_LINE_COLUMN grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>jdkversion</td>
<td>Sets the JDK_VERSION option. This is a string option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">lookahead</td>
<td valign="top">Sets the LOOKAHEAD grammar option. This is an integer option.</td>
<td valign="top" align="center">No</td>
<td>keeplinecolumn</td>
<td>Sets the KEEP_LINE_COLUMN grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">optimizetokenmanager</td>
<td valign="top">Sets the OPTIMIZE_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>lookahead</td>
<td>Sets the LOOKAHEAD grammar option. This is an integer option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">otherambiguitycheck</td>
<td valign="top">Sets the OTHER_AMBIGUITY_CHECK grammar option. This is an integer option.</td>
<td valign="top" align="center">No</td>
<td>optimizetokenmanager</td>
<td>Sets the OPTIMIZE_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">sanitycheck</td>
<td valign="top">Sets the SANITY_CHECK grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>otherambiguitycheck</td>
<td>Sets the OTHER_AMBIGUITY_CHECK grammar option. This is an integer option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">static</td>
<td valign="top">Sets the STATIC grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>sanitycheck</td>
<td>Sets the SANITY_CHECK grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">unicodeinput</td>
<td valign="top">Sets the UNICODE_INPUT grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>static</td>
<td>Sets the STATIC grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">usercharstream</td>
<td valign="top">Sets the USER_CHAR_STREAM grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>unicodeinput</td>
<td>Sets the UNICODE_INPUT grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">usertokenmanager</td>
<td valign="top">Sets the USER_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td valign="top" align="center">No</td>
<td>usercharstream</td>
<td>Sets the USER_CHAR_STREAM grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">maxmemory</td>
<td valign="top">Max amount of memory to allocate to the forked
VM. <em>since Ant 1.8.3</em></td>
<td align="center" valign="top">No</td>
<td>usertokenmanager</td>
<td>Sets the USER_TOKEN_MANAGER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td>maxmemory</td>
<td>Max amount of memory to allocate to the forked JVM. <em>since Ant 1.8.3</em></td>
<td>No</td>
</tr>
</table>
<h3>Example</h3>
<pre>
&lt;javacc
target=&quot;src/Parser.jj&quot;
outputdirectory=&quot;build/src&quot;
javacchome=&quot;c:/program files/JavaCC&quot;
static=&quot;true&quot;/&gt;
</pre>
<p>
This invokes JavaCC on grammar file src/Parser.jj, writing the generated
files to build/src. The grammar option STATIC is set to true when
invoking JavaCC.
</p>
&lt;javacc target=&quot;src/Parser.jj&quot;
outputdirectory=&quot;build/src&quot;
javacchome=&quot;c:/program files/JavaCC&quot;
static=&quot;true&quot;/&gt;</pre>
<p>This invokes JavaCC on grammar file <samp>src/Parser.jj</samp>, writing the generated files
to <samp>build/src</samp>. The grammar option STATIC is set to <q>true</q> when invoking
JavaCC.</p>

</body>
</html>

+ 591
- 640
manual/Tasks/javadoc.html
File diff suppressed because it is too large
View File


+ 135
- 148
manual/Tasks/javah.html View File

@@ -27,228 +27,215 @@
<h2 id="javah">Javah</h2>
<h3>Description</h3>
<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 implement native methods. JNI operates differently depending on
whether <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javah.html">JDK 1.2+</a>
or <a href="http://java.sun.com/products/jdk/1.1/docs/tooldocs/win32/javah.html">pre-1.2 JDK</a>
systems are used.</p>
<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
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>

<p>If you are building with Java 8 or above consider
using <a href="javac.html"><code>javac</code></a>'s <code>nativeheaderdir</code>
attribute instead which allows you to compile the classes and
generate the native header files with a single step.</p>
using <a href="javac.html"><code>javac</code></a>'s <var>nativeheaderdir</var> attribute instead
which allows you to compile the classes and generate the native header files in a single step.</p>

<p><strong>Note</strong>: <code>javah</code> has been deprecated in Java 9
and removed in Java 10. Attempts to use it with Java 10 will fail.</p>
<p><strong>Note</strong>: <code>javah</code> has been deprecated in Java 9 and removed in Java
10. Attempts to use it with Java 10 will fail.</p>

<p id="implementationvalues">It is possible to use different
compilers. This can be selected with the <code>implementation</code>
attribute or a nested element. Here are the choices of the
<p id="implementationvalues">It is possible to use different compilers. This can be selected with
the <var>implementation</var> attribute or a nested element. Here are the choices of the
attribute:</p>
<ul>
<li>default - the default compiler for the platform.</li>
<li>sun - the standard compiler of the JDK.</li>
<li>kaffeh - the native standard compiler of <a href="http://www.kaffe.org" target="_top">Kaffe</a>.</li>
<li>gcjh - the native standard compiler
of <a href="http://gcc.gnu.org/java/"
target="_top">gcj and gij</a>. <em>Since Apache Ant 1.8.2</em></li>
<li>forking - runs the javah executable via its command line
interface in a separate process. Default when not running on
Kaffe or gcj/gij <em>since Ant 1.9.8</em></li>
<li><q>default</q>&mdash;the default compiler for the platform.</li>
<li><q>sun</q>&mdash;the standard compiler of the JDK.</li>
<li><q>kaffeh</q>&mdash;the native standard compiler of <a href="http://www.kaffe.org" target="_top">Kaffe</a>.</li>
<li><q>gcjh</q>&mdash;the native standard compiler
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>
<li><q>forking</q>&mdash;runs the <code>javah</code> executable via its command line interface in
a separate process. Default when not running on Kaffe or gcj/gij <em>since Ant 1.9.8</em></li>
</ul>

<p><strong>Note</strong>: if you are using this task to work on multiple files
the command line may become too long on some operating systems.
Unfortunately the javah command doesn't support command argument
files the way javac (for example) does, so all that can be done is
breaking the amount of classes to compile into smaller chunks.</p>
<p><strong>Note</strong>: if you are using this task to work on multiple files the command line may
become too long on some operating systems. Unfortunately the <code>javah</code> command doesn't
support command argument files the way <code>javac</code> (for example) does, so all that can be
done is breaking the amount of classes to compile into smaller chunks.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">class</td>
<td valign="top">the fully-qualified name of the class (or classes,
separated by commas)</td>
<td align="center" valign="top">Yes</td>
<td>class</td>
<td>the fully-qualified name of the class (or classes, separated by commas)</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">outputFile</td>
<td valign="top">concatenates the resulting header or source files for all the classes listed into this file</td>
<td align="center" valign="middle" rowspan="2">Yes</td>
<td>outputFile</td>
<td>concatenates the resulting header or source files for all the classes listed into this
file</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">destdir</td>
<td valign="top">sets the directory where javah saves the header files or the
stub files.</td>
<td>destdir</td>
<td class="left">sets the directory where <code>javah</code> saves the header files or the stub
files.</td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">specifies that output files should always be written (JDK 1.2 only)</td>
<td valign="top" align="center">No</td>
<td>force</td>
<td>specifies that output files should always be written (JDK 1.2 only)</td>
<td>No</td>
</tr>
<tr>
<td valign="top">old</td>
<td valign="top">specifies that old JDK 1.0-style header files should be generated
(otherwise output file contain JNI-style native method function prototypes) (JDK 1.2 only)</td>
<td valign="top" align="center">No</td>
<td>old</td>
<td>specifies that old JDK 1.0-style header files should be generated (otherwise output file
contain JNI-style native method function prototypes) (JDK 1.2 only)</td>
<td>No</td>
</tr>
<tr>
<td valign="top">stubs</td>
<td valign="top">generate C declarations from the Java object file (used with old)</td>
<td valign="top" align="center">No</td>
<td>stubs</td>
<td>generate C declarations from the Java object file (used with <var>old</var>)</td>
<td>No</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">causes Javah to print a message concerning the status of the generated files</td>
<td valign="top" align="center">No</td>
<td>verbose</td>
<td>causes <code>Javah</code> to print a message concerning the status of the generated
files</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">the classpath to use.</td>
<td align="center" valign="top">No</td>
<td>classpath</td>
<td>the classpath to use</td>
<td>No</td>
</tr>
<tr>
<td valign="top">bootclasspath</td>
<td valign="top">location of bootstrap class files.</td>
<td valign="top" align="center">No</td>
<td>bootclasspath</td>
<td>location of bootstrap class files</td>
<td>No</td>
</tr>
<tr>
<td valign="top">extdirs</td>
<td valign="top"> location of installed extensions.</td>
<td valign="top" align="center">No</td>
<td>extdirs</td>
<td>location of installed extensions</td>
<td>No</td>
</tr>
<tr>
<td valign="top">implementation</td>
<td valign="top">The compiler implementation to use. If this
attribute is not set, the default compiler for the current VM
will be used. (See the above <a
href="#implementationvalues">list</a> of valid compilers.)</td>
<td align="center" valign="top">No</td>
<td>implementation</td>
<td>The compiler implementation to use. (See the above <a href="#implementationvalues">list</a>
of valid compilers.)</td>
<td>No; defaults to default compiler for the current JDK</td>
</tr>
</table>
<p>Either outputFile or destdir must be supplied, but not both.</p>

<h3>Parameters specified as nested elements</h3>

<h4>arg</h4>

<p>You can specify additional command line arguments for the compiler
with nested <code>&lt;arg&gt;</code> elements. These elements are
specified like <a href="../using.html#arg">Command-line Arguments</a>
but have an additional attribute that can be used to enable arguments
only if a given compiler implementation will be used.</p>
<p>You can specify additional command line arguments for the compiler with
nested <code>&lt;arg&gt;</code> elements. These elements are specified
like <a href="../using.html#arg">Command-line Arguments</a> but have an additional attribute that
can be used to enable arguments only if a given compiler implementation will be used.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">value</td>
<td align="center" rowspan="4">See
<a href="../using.html#arg">Command-line Arguments</a>.</td>
<td align="center" rowspan="4">Exactly one of these</td>
<td>value</td>
<td rowspan="4">See <a href="../using.html#arg">Command-line Arguments</a>.</td>
<td rowspan="4">Exactly one of these</td>
</tr>
<tr>
<td valign="top">line</td>
<td class="var">line</td>
</tr>
<tr>
<td valign="top">file</td>
<td class="var">file</td>
</tr>
<tr>
<td valign="top">path</td>
<td class="var">path</td>
</tr>
<tr>
<td valign="top">prefix</td>
<td align="center" rowspan="2">See
<a href="../using.html#arg">Command-line Arguments</a>.
<em>Since Ant 1.8</em>.</td>
<td valign="top" align="center">No</td>
<td>prefix</td>
<td rowspan="2">See <a href="../using.html#arg">Command-line Arguments</a>. <em>Since Ant
1.8</em>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suffix</td>
<td valign="top" align="center">No</td>
<td>suffix</td>
<td>No</td>
</tr>
<tr>
<td valign="top">implementation</td>
<td>Only pass the specified argument if the chosen compiler
implementation matches the value of this attribute. Legal values
are the same as those in the above <a
href="#implementationvalues">list</a> of valid compilers.)</td>
<td align="center">No</td>
<td>implementation</td>
<td>Only pass the specified argument if the chosen compiler implementation matches the value of
this attribute. Legal values are the same as those in the
above <a href="#implementationvalues">list</a> of valid compilers.)</td>
<td>No</td>
</tr>
</table>

<h4>implementationclasspath (<em>since Ant 1.8.0</em>)</h4>

<p>A <a href="../using.html#path">PATH like structure</a> holding the
classpath to use when loading the compiler implementation if a
custom class has been specified. Doesn't have any effect when
using one of the built-in compilers.</p>
<p>A <a href="../using.html#path">path-like structure</a> holding the classpath to use when loading
the compiler implementation if a custom class has been specified. Doesn't have any effect when
using one of the built-in compilers.</p>

<h4>Any nested element of a type that implements JavahAdapter
(<em>since Ant 1.8.0</em>)</h4>
<h4>Any nested element of a type that implements JavahAdapter (<em>since Ant 1.8.0</em>)</h4>

<p>If a defined type implements the <code>JavahAdapter</code>
interface a nested element of that type can be used as an
alternative to the <code>implementation</code> attribute.</p>
<p>If a defined type implements the <code>JavahAdapter</code> interface a nested element of that
type can be used as an alternative to the <var>implementation</var> attribute.</p>

<h3>Examples</h3>
<pre> &lt;javah destdir=&quot;c&quot; class=&quot;org.foo.bar.Wibble&quot;/&gt;</pre>
<p>makes a JNI header of the named class, using the JDK 1.2 JNI model. Assuming
the directory 'c' already exists, the file <tt>org_foo_bar_Wibble.h</tt>
is created there. If this file already exists, it is left unchanged.</p>
<pre> &lt;javah outputFile=&quot;wibble.h&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble,org.foo.bar.Bobble&quot;/&gt;
&lt;/javah&gt;</pre>
<pre>&lt;javah destdir=&quot;c&quot; class=&quot;org.foo.bar.Wibble&quot;/&gt;</pre>
<p>makes a JNI header of the named class, using the JDK 1.2 JNI model. Assuming the
directory <samp>c</samp> already exists, the file <samp>org_foo_bar_Wibble.h</samp> is created
there. If this file already exists, it is left unchanged.</p>
<pre>
&lt;javah outputFile=&quot;wibble.h&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble,org.foo.bar.Bobble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>is similar to the previous example, except the output is written to a file
called <tt>wibble.h</tt>
in the current directory.</p>
<pre> &lt;javah destdir=&quot;c&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>writes three header files, one for each of the classes named. Because the
force option is set, these header files are always written when the Javah task
is invoked, even if they already exist.</p>
<pre> &lt;javah destdir=&quot;c&quot; verbose=&quot;yes&quot; old=&quot;yes&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;
&lt;javah destdir=&quot;c&quot; verbose=&quot;yes&quot; stubs=&quot;yes&quot; old=&quot;yes&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>writes the headers for the three classes using the 'old' JNI format, then
writes the corresponding .c stubs. The verbose option will cause Javah to
describe its progress.</p>
<p>If you want to use a custom
JavahAdapter <code>org.example.MyAdapter</code> you can either
use the implementation attribute:</p>
called <samp>wibble.h</samp> in the current directory.</p>
<pre>
&lt;javah destdir=&quot;c&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>writes three header files, one for each of the classes named. Because the force option is set,
these header files are always written when the <code>Javah</code> task is invoked, even if they
already exist.</p>
<pre>
&lt;javah destdir=&quot;c&quot; verbose=&quot;yes&quot; old=&quot;yes&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;
&lt;javah destdir=&quot;c&quot; verbose=&quot;yes&quot; stubs=&quot;yes&quot; old=&quot;yes&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>writes the headers for the three classes using the 'old' JNI format, then writes the
corresponding <samp>.c</samp> stubs. The verbose option will cause <code>Javah</code> to describe
its progress.</p>
<p>If you want to use a custom JavahAdapter <code>org.example.MyAdapter</code> you can either use
the implementation attribute:</p>
<pre>
&lt;javah destdir="c" class="org.foo.bar.Wibble"
implementation="org.example.MyAdapter"/&gt;
</pre>
implementation="org.example.MyAdapter"/&gt;</pre>
<p>or a define a type and nest this into the task like in:</p>
<pre>
&lt;componentdef classname="org.example.MyAdapter"
name="myadapter"/&gt;
&lt;javah destdir="c" class="org.foo.bar.Wibble"&gt;
&lt;myadapter/&gt;
&lt;/javah&gt;
</pre>
<p>in which case your javah adapter can support attributes and
nested elements of its own.</p>
&lt;/javah&gt;</pre>
<p>in which case your <code>javah</code> adapter can support attributes and nested elements of its
own.</p>

</body>
</html>

+ 64
- 70
manual/Tasks/jdepend.html View File

@@ -29,91 +29,92 @@

<p>Invokes the <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> parser.</p>

<p>This parser &quot;traverses a set of Java source file directories and generates design quality metrics for each Java package&quot;.
It allows to &quot;automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to
effectively manage and control package dependencies.&quot;</p>
<p>This parser &quot;traverses a set of Java source file directories and generates design quality
metrics for each Java package&quot;. It allows to &quot;automatically measure the quality of a
design in terms of its extensibility, reusability, and maintainability to effectively manage and
control package dependencies.&quot;</p>

<p>Source file directories are defined by nested
<code>&lt;sourcespath&gt;</code>; Class file directories are defined
by nested <code>&lt;classespath&gt;</code>, see <a
href="#nested">nested elements</a>.</p>
<p>Source file directories are defined by nested <code>&lt;sourcespath&gt;</code>. Class file
directories are defined by nested <code>&lt;classespath&gt;</code>. See <a href="#nested">nested
elements</a>.</p>

<p>Optionally, you can also set the <code>outputfile</code> name where the output is stored. By default the task writes its report to the standard output.</P>
<p>Optionally, you can also set the <var>outputfile</var> name where the output is stored. By
default the task writes its report to the standard output.</p>

<p>The task requires at least the JDepend 1.2 version.</p>

<h3>Parameters</h3>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">outputfile</td>
<td valign="top">The output file name. If not set, the output is printed on the standard output.</td>
<td align="center" valign="top">No</td>
<td>outputfile</td>
<td>The output file name. If not set, the output is printed on the standard output.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">format</td>
<td valign="top">The format to write the output in. The default is "text", the alternative is "xml"</td>
<td align="center" valign="top">No</td>
<td>format</td>
<td>The format to write the output in,
either <q>text</q> (default) or <q>xml</q></td>
<td>No; the default is <q>text</q></td>
</tr>
<tr>
<td valign="top">fork</td>
<td valign="top">Run the tests in a separate VM.</td>
<td align="center" valign="top">No, default is "off"</td>
<td>fork</td>
<td>Run the tests in a separate JVM.</td>
<td>No; default is <q>off</q></td>
</tr>
<tr>
<td valign="top">haltonerror</td>
<td valign="top">Stop the build process if an error occurs during the jdepend analysis.</td>
<td align="center" valign="top">No, default is "off"</td>
<td>haltonerror</td>
<td>Stop the build process if an error occurs during the <code>jdepend</code> analysis.</td>
<td>No; default is <q>off</q></td>
</tr>
<tr>
<td valign="top">timeout</td>
<td valign="top">Cancel the operation if it doesn't finish in the given time (measured in milliseconds). (Ignored if fork is disabled.)</td>
<td align="center" valign="top">No</td>
<td>timeout</td>
<td>Cancel the operation if it doesn't finish in the given time (measured in milliseconds).</td>
<td>No, ignored if <var>fork</var> is <q>false</q></td>
</tr>
<tr>
<td valign="top">jvm</td>
<td valign="top">The command used to invoke the Java Virtual Machine, default is 'java'. The command is resolved by java.lang.Runtime.exec(). (Ignored if fork is disabled.)</td>
<td align="center" valign="top">No, default "java"</td>
<td>jvm</td>
<td>The command used to invoke JVM. The command is resolved
by <code>java.lang.Runtime.exec()</code>.</td>
<td>No; default <q>java</q>, ignored if <var>fork</var> is <q>false</q></td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">The directory to invoke the VM in. (Ignored if fork is disabled)</td>
<td align="center" valign="top">No</td>
<td>dir</td>
<td>The directory to invoke JVM in.</td>
<td>No, ignored if <var>fork</var> is <q>false</q></td>
</tr>
<tr>
<td valign="top">includeruntime</td>
<td valign="top">Implicitly add the classes required to run jdepend
in forked mode. (Ignored if fork is disabled). <em>Since Apache Ant 1.6</em>.</td>
<td align="center" valign="top">No, default is "no".</td>
<td>includeruntime</td>
<td>Implicitly add the classes required to run <code>jdepend</code> in forked mode. <em>Since
Apache Ant 1.6</em>.</td>
<td>No; default is <q>no</q>, ignored if <var>fork</var> is <q>false</q></td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">the classpath to use, given as reference to a PATH defined elsewhere.</td>
<td align="center" valign="top">No</td>
<td>classpathref</td>
<td>the <var>classpath</var> to use, given as reference to a PATH defined elsewhere.</td>
<td>No</td>
</tr>
</table>

<h3 id="nested">Nested Elements</h3>

<p><code>jdepend</code> supports four nested elements:
<code>&lt;classpath&gt;, &lt;classespath&gt;</code> and
<code>&lt;sourcespath&gt;</code>, that represent <a
href="../using.html#path">PATH like structures</a>, and
<code>&lt;exclude&gt;</code>.</p>

<p><code>&lt;sourcespath&gt;</code> is used to define the paths of the
source code to analyze, but it is deprecated. With version 2.5 of
JDepend, only class files are analyzed. The nested element
<code>&lt;classespath&gt;</code> replaces <code>&lt;sourcespath&gt;</code> and is used to define
the paths of compiled class code to analyze; the <code>&lt;sourcespath&gt;</code>
variable is still available in case you are using an earlier version
of JDepend. The <code>&lt;exclude&gt;</code> element can be used to set packages
to ignore (requires JDepend 2.5 or above).</p>
<p><code>jdepend</code> supports four nested
elements: <code>&lt;classpath&gt;</code>, <code>&lt;classespath&gt;</code>
and <code>&lt;sourcespath&gt;</code>, that represent <a href="../using.html#path">path-like
structures</a>, and <code>&lt;exclude&gt;</code>.</p>

<p><code>&lt;sourcespath&gt;</code> is used to define the paths of the source code to analyze, but
it is deprecated. With version 2.5 of JDepend, only class files are analyzed. The nested
element <code>&lt;classespath&gt;</code> replaces <code>&lt;sourcespath&gt;</code> and is used to
define the paths of compiled class code to analyze; the <code>&lt;sourcespath&gt;</code> variable is
still available in case you are using an earlier version of JDepend.
The <code>&lt;exclude&gt;</code> element can be used to set packages to ignore (requires JDepend 2.5
or above).</p>

<h3>Examples</h3>

@@ -122,13 +123,10 @@ to ignore (requires JDepend 2.5 or above).</p>
&lt;classespath&gt;
&lt;pathelement location="build"/&gt;
&lt;/classespath&gt;
&lt;/jdepend&gt;
</pre>

<p>This invokes JDepend on the <code>build</code> directory, writing
the output on the standard output. The classpath is defined using a
classpath reference.</p>
&lt;/jdepend&gt;</pre>

<p>This invokes JDepend on the <samp>build</samp> directory, writing the output on the standard
output. The classpath is defined using a classpath reference.</p>

<pre>
&lt;jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml"&gt;
@@ -139,12 +137,10 @@ classpath reference.</p>
&lt;pathelement location="classes"/&gt;
&lt;pathelement location="lib/jdepend.jar"/&gt;
&lt;/classpath&gt;
&lt;/jdepend&gt;
</pre>
&lt;/jdepend&gt;</pre>

<p>This invokes JDepend in a separate VM on the <code>src</code> and
<code>testsrc</code> directories, writing the output to the
<code>&lt;docs/jdepend.xml&gt;</code> file in xml format. The
<p>This invokes JDepend in a separate JVM on the <samp>src</samp> and <samp>testsrc</samp>
directories, writing the output to the <samp>docs/jdepend.xml</samp> file in xml format. The
classpath is defined using nested elements.</p>

<pre>
@@ -154,12 +150,10 @@ classpath is defined using nested elements.</p>
&lt;classespath&gt;
&lt;pathelement location="build"/&gt;
&lt;/classespath&gt;
&lt;/jdepend&gt;
</pre>
&lt;/jdepend&gt;</pre>

<p>This invokes JDepend with the build directory as the base for class
files to analyze, and will ignore all classes in the java.* and
javax.* packages.</p>
<p>This invokes JDepend with the build directory as the base for class files to analyze, and will
ignore all classes in the <samp>java.*</samp> and <samp>javax.*</samp> packages.</p>

</body>
</html>

+ 41
- 43
manual/Tasks/jjdoc.html View File

@@ -26,76 +26,74 @@
<p><em>Since Apache Ant 1.6</em></p>
<h3>Description</h3>

<p>Invokes the <a href="http://javacc.dev.java.net/">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 jjdoc task, set the <i>target</i> attribute to the name
of the JavaCC grammar file to process. You also need to specify the directory
containing the JavaCC installation using the <i>javacchome</i> attribute,
so that Ant can find the JavaCC classes. Optionally, you can also set the
<i>outputfile</i> to write the generated BNF documentation file to a specific (directory and) file.
Otherwise jjdoc writes the generated BNF documentation file as the JavaCC
grammar file with a suffix .txt or .html.</p>
<p>This task only invokes JJDoc if the grammar file is newer than the
generated BNF documentation file.</p>
<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>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
using the <var>javacchome</var> attribute, so that Ant can find the JavaCC classes. Optionally, you
can also set the <var>outputfile</var> to write the generated BNF documentation file to a specific
(directory and) file. Otherwise <code>jjdoc</code> writes the generated BNF documentation file as
the JavaCC grammar file with a suffix <samp>.txt</samp> or <samp>.html</samp>.</p>
<p>This task only invokes <code>JJDoc</code> if the grammar file is newer than the generated BNF
documentation file.</p>

<h3>Parameters</h3>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>

<tr>
<td valign="top">target</td>
<td valign="top">The javacc grammar file to process.</td>
<td align="center" valign="top">Yes</td>
<td>target</td>
<td>The JavaCC grammar file to process.</td>
<td>Yes</td>
</tr>

<tr>
<td valign="top">javacchome</td>
<td valign="top">The directory containing the JavaCC distribution.</td>
<td align="center" valign="top">Yes</td>
<td>javacchome</td>
<td>The directory containing the JavaCC distribution.</td>
<td>Yes</td>
</tr>

<tr>
<td valign="top">outputfile</td>
<td valign="top">The file to write the generated BNF documentation file to. If not set,
the file is written with the same name as the JavaCC grammar file but with a the suffix .html or .txt</td>
<td align="center" valign="top">No</td>
<td>outputfile</td>
<td>The file to write the generated BNF documentation file to. If not set, the file is written
with the same name as the JavaCC grammar file but with a the suffix <samp>.html</samp>
or <samp>.txt</samp></td>
<td>No</td>
</tr>

<tr>
<td valign="top">text</td>
<td valign="top">Sets the TEXT BNF documentation option. This is a boolean option.</td>
<td align="center" valign="top">No</td>
<td>text</td>
<td>Sets the TEXT BNF documentation option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">onetable</td>
<td valign="top">Sets the ONE_TABLE BNF documentation option. This is a boolean option.</td>
<td align="center" valign="top">No</td>
<td>onetable</td>
<td>Sets the ONE_TABLE BNF documentation option. This is a boolean option.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">maxmemory</td>
<td valign="top">Max amount of memory to allocate to the forked
VM. <em>since Ant 1.8.3</em></td>
<td align="center" valign="top">No</td>
<td>maxmemory</td>
<td>Max amount of memory to allocate to the forked JVM. <em>since Ant 1.8.3</em></td>
<td>No</td>
</tr>
</table>

<h3>Example</h3>

<pre>&lt;jjdoc
target="src/Parser.jj"
outputfile="doc/ParserBNF.html"
javacchome="c:/program files/JavaCC"/&gt;</pre>
<pre>
&lt;jjdoc target="src/Parser.jj"
outputfile="doc/ParserBNF.html"
javacchome="c:/program files/JavaCC"/&gt;</pre>

This invokes JJDoc on grammar file src/Parser.jj, writing the generated
BNF documentation file, ParserBNF.html, file to doc.
<p>This invokes JJDoc on grammar file <samp>src/Parser.jj</samp>, writing the generated BNF
documentation file, <samp>ParserBNF.html</samp>, to <samp>doc</samp>.</p>

</body>
</html>

+ 137
- 173
manual/Tasks/jjtree.html View File

@@ -25,193 +25,153 @@
<h2 id="jjtree">JJTree</h2>

<h3>Description</h3>
<p>Invokes the <a href="http://javacc.dev.java.net/">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>To use the jjtree task, set the <i>target</i> attribute to the name
of the JJTree grammar file to process. You also need to specify the directory
containing the JavaCC installation using the <i>javacchome</i> attribute,
so that Ant can find the JavaCC classes. Optionally, you can also set the
<i>outputdirectory</i>
to write the generated JavaCC grammar and node files to a specific directory.
Otherwise jjtree writes the generated JavaCC grammar and node files to the directory
containing the JJTree grammar file. As an extra option, you can also set the
<i>outputfile</i> to write the generated JavaCC grammar file to a specific (directory and) file.
Otherwise jjtree writes the generated JavaCC grammar file as the JJTree
grammar file with a suffix .jj.</p>
<p>This task only invokes JJTree if the grammar file is newer than the
generated JavaCC file.</p>
<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>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
installation using the <var>javacchome</var> attribute, so that Ant can find the JavaCC
classes. Optionally, you can also set the <var>outputdirectory</var> to write the generated JavaCC
grammar and node files to a specific directory. Otherwise <code>jjtree</code> writes the generated
JavaCC grammar and node files to the directory containing the JJTree grammar file. As an extra
option, you can also set the <var>outputfile</var> to write the generated JavaCC grammar file to a
specific (directory and) file. Otherwise <code>jjtree</code> writes the generated JavaCC grammar
file as the JJTree grammar file with a suffix <samp>.jj</samp>.</p>
<p>This task only invokes JJTree if the grammar file is newer than the generated JavaCC file.</p>

<h3>Parameters</h3>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>

<td valign="top"><b>Description</b></td>

<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>

<tr>
<td valign="top">target</td>

<td valign="top">The jjtree grammar file to process.</td>

<td align="center" valign="top">Yes</td>
<td>target</td>
<td>The JJTree grammar file to process.</td>
<td>Yes</td>
</tr>

<tr>
<td valign="top">javacchome</td>

<td valign="top">The directory containing the JavaCC distribution.</td>

<td align="center" valign="top">Yes</td>
<td>javacchome</td>
<td>The directory containing the JavaCC distribution.</td>
<td>Yes</td>
</tr>

<tr>
<td valign="top">outputdirectory</td>

<td valign="top">The directory to write the generated JavaCC grammar and node files to.
If not set, the files are written to the directory containing the grammar file.</td>

<td align="center" valign="top">No</td>
<td>outputdirectory</td>
<td>The directory to write the generated JavaCC grammar and node files to. If not set, the files
are written to the directory containing the grammar file.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">outputfile</td>

<td valign="top">The file to write the generated JavaCC grammar file
to. If not set, the file is written with the same name as the JJTree
grammar file but with a the suffix <code>.jj</code>. This is a
filename relative to <em>outputdirectory</em> if specified, the
project's basedir.</td>

<td align="center" valign="top">No</td>
<td>outputfile</td>
<td>The file to write the generated JavaCC grammar file to. If not set, the file is written with
the same name as the JJTree grammar file but with a the suffix <code>.jj</code>. This is a
filename relative to <var>outputdirectory</var> if specified, the project's basedir.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">buildnodefiles</td>

<td valign="top">Sets the BUILD_NODE_FILES grammar option. This is a boolean
option.</td>

<td align="center" valign="top">No</td>
<td>buildnodefiles</td>
<td>Sets the BUILD_NODE_FILES grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">multi</td>

<td valign="top">Sets the MULTI grammar option. This is a boolean option.</td>

<td align="center" valign="top">No</td>
<td>multi</td>
<td>Sets the MULTI grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">nodedefaultvoid</td>

<td valign="top">Sets the NODE_DEFAULT_VOID grammar option. This is a boolean
option.</td>

<td align="center" valign="top">No</td>
<td>nodedefaultvoid</td>
<td>Sets the NODE_DEFAULT_VOID grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">nodefactory</td>

<td valign="top">Sets the NODE_FACTORY grammar option. This is boolean option.</td>

<td align="center" valign="top">No</td>
<td>nodefactory</td>
<td>Sets the NODE_FACTORY grammar option. This is boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">nodescopehook</td>

<td valign="top">Sets the NODE_SCOPE_HOOK grammar option. This is a boolean
option.</td>

<td align="center" valign="top">No</td>
<td>nodescopehook</td>
<td>Sets the NODE_SCOPE_HOOK grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">nodeusesparser</td>

<td valign="top">Sets the NODE_USES_PARSER grammar option. This is a boolean
option.</td>

<td align="center" valign="top">No</td>
<td>nodeusesparser</td>
<td>Sets the NODE_USES_PARSER grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">static</td>

<td valign="top">Sets the STATIC grammar option. This is a boolean option.</td>

<td align="center" valign="top">No</td>
<td>static</td>
<td>Sets the STATIC grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">visitor</td>

<td valign="top">Sets the VISITOR grammar option. This is a boolean option.</td>

<td align="center" valign="top">No</td>
<td>visitor</td>
<td>Sets the VISITOR grammar option. This is a boolean option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">nodepackage</td>

<td valign="top">Sets the NODE_PACKAGE grammar option. This is a string option.</td>

<td align="center" valign="top">No</td>
<td>nodepackage</td>
<td>Sets the NODE_PACKAGE grammar option. This is a string option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">visitorexception</td>

<td valign="top">Sets the VISITOR_EXCEPTION grammar option. This is a string
option.</td>

<td align="center" valign="top">No</td>
<td>visitorexception</td>
<td>Sets the VISITOR_EXCEPTION grammar option. This is a string option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">nodeprefix</td>

<td valign="top">Sets the NODE_PREFIX grammar option. This is a string option.</td>

<td align="center" valign="top">No</td>
<td>nodeprefix</td>
<td>Sets the NODE_PREFIX grammar option. This is a string option.</td>
<td>No</td>
</tr>

<tr>
<td valign="top">maxmemory</td>
<td valign="top">Max amount of memory to allocate to the forked
VM. <em>since Ant 1.8.3</em></td>
<td align="center" valign="top">No</td>
<td>maxmemory</td>
<td>Max amount of memory to allocate to the forked JVM. <em>since Ant 1.8.3</em></td>
<td>No</td>
</tr>
</table>

<h3>Example</h3>

<pre>&lt;jjtree
target="src/Parser.jjt"
outputdirectory="build/src"
javacchome="c:/program files/JavaCC"
nodeusesparser="true"/&gt;</pre>
This invokes JJTree on grammar file src/Parser.jjt, writing the generated
grammar file, Parser.jj, file to build/src. The grammar option NODE_USES_PARSER
is set to true when invoking JJTree.
<pre>
&lt;jjtree target="src/Parser.jjt"
outputdirectory="build/src"
javacchome="c:/program files/JavaCC"
nodeusesparser="true"/&gt;</pre>

<h3>Comparison output locations between command line JJTree and different Ant taskdef versions</h3>
<p>This invokes JJTree on grammar file <samp>src/Parser.jjt</samp>, writing the generated grammar
file, <samp>Parser.jj</samp>, file to <samp>build/src</samp>. The grammar option NODE_USES_PARSER is
set to <q>true</q> when invoking JJTree.</p>

<h3>Comparison output locations between command line JJTree and different Ant <code>taskdef</code>
versions</h3>

<table>
<thead class="no-bold">
<tr>
<td><b>Command Line JJTree options</b>
<i>and Generated Files</i> (working directory: <code>/tmp</code>)</td>
<td><b>Ant 1.5.3</b> versus command line</td>
<td><b>Ant 1.6</b> versus command line</td>
<th><strong>Command line JJTree options</strong> and <em>generated files</em> (working directory: <samp>/tmp</samp>)</th>
<th><strong>Ant 1.5.3</strong> versus command line</th>
<th><strong>Ant 1.6</strong> versus command line</th>
</tr>
</thead>
<tbody>
<tr>
<td><pre><b>jjtree grammar.jjt</b>
/tmp/grammar.jj
@@ -232,7 +192,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree /tmp/absolute/grammar.jjt</b>
/tmp/grammar.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -243,7 +203,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:relative grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:relative grammar.jjt</b>
/tmp/relative/grammar.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -251,7 +211,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
/tmp/relative/grammar.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -259,7 +219,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
/tmp/relative/grammar.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -267,7 +227,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
/tmp/absolute/grammar.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -275,7 +235,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
/tmp/absolute/grammar.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -283,7 +243,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
/tmp/absolute/grammar.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -291,7 +251,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj grammar.jjt</b>
/tmp/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -299,7 +259,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj relative/grammar.jjt</b>
/tmp/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -307,7 +267,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj /tmp/absolute/grammar.jjt</b>
/tmp/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -315,7 +275,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:relative grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:relative grammar.jjt</b>
/tmp/relative/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -323,7 +283,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
/tmp/relative/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -331,7 +291,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
/tmp/relative/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -339,7 +299,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
/tmp/absolute/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -347,7 +307,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
/tmp/absolute/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -355,7 +315,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
/tmp/absolute/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -363,7 +323,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -371,7 +331,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj relative/grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -379,7 +339,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj /tmp/absolute/grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -387,7 +347,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:relative grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:relative grammar.jjt</b>
/tmp/relative/subdir/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -395,7 +355,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
/tmp/relative/subdir/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -403,7 +363,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
/tmp/relative/subdir/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -411,7 +371,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
/tmp/absolute/subdir/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -419,7 +379,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
/tmp/absolute/subdir/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -427,7 +387,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
/tmp/absolute/subdir/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -435,7 +395,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -443,7 +403,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj relative/grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -451,7 +411,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj /tmp/absolute/grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -459,7 +419,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:<i><u>D:</u></i>/tmp/subdir/output.jj grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:<i>D:</i>/tmp/subdir/output.jj grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -467,7 +427,7 @@ is set to true when invoking JJTree.
<td>Not Supported *)</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:<i><u>D:</u></i>/tmp/subdir/output.jj relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:<i>D:</i>/tmp/subdir/output.jj relative/grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -475,7 +435,7 @@ is set to true when invoking JJTree.
<td>Not Supported *)</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:<i><u>D:</u></i>/tmp/subdir/output.jj /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:<i>D:</i>/tmp/subdir/output.jj /tmp/absolute/grammar.jjt</b>
/tmp/subdir/output.jj
/tmp/&lt;generated&gt;.java</pre>
</td>
@@ -483,7 +443,7 @@ is set to true when invoking JJTree.
<td>Not Supported *)</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:relative grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:relative grammar.jjt</b>
/tmp/relative/tmp/subdir/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -491,7 +451,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:relative relative/grammar.jjt</b>
/tmp/relative/tmp/subdir/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -499,7 +459,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:relative /tmp/absolute/grammar.jjt</b>
/tmp/relative/tmp/subdir/output.jj
/tmp/relative/&lt;generated&gt;.java</pre>
</td>
@@ -507,7 +467,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ grammar.jjt</b>
/tmp/absolute/tmp/subdir/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -515,7 +475,7 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ relative/grammar.jjt</b>
/tmp/absolute/tmp/subdir/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
@@ -523,26 +483,30 @@ is set to true when invoking JJTree.
<td>Same</td>
</tr>
<tr>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
<td><pre><b>jjtree -OUTPUT_FILE:/tmp/subdir/output.jj -OUTPUT_DIRECTORY:/tmp/absolute/ /tmp/absolute/grammar.jjt</b>
/tmp/absolute/tmp/subdir/output.jj
/tmp/absolute/&lt;generated&gt;.java</pre>
</td>
<td>Not Supported</td>
<td>Same</td>
</tr>
</tbody>
</table>

<p>*) <u>Footnote</u>: When running JJTree with the Ant taskdef <i>jjtree</i> the option <code>-OUTPUT_DIRECTORY</code> must always
be set, because the project's basedir and the Ant working directory might differ. So even if you don't specify the jjtree taskdef
<i>outputdirectory</i> JJTree will be called with the <code>-OUTPUT_DIRECTORY</code> set to the project's basedirectory.
But when the <code>-OUTPUT_DIRECTORY</code> is set, the <code>-OUTPUT_FILE</code> setting is handled as if relative to this
<code>-OUTPUT_DIRECTORY</code>. Thus when the <code>-OUTPUT_FILE</code> is absolute or contains a drive letter we have a
problem.
Therefore absolute <i>outputfile</i>s (when the <i>outputdirectory</i> isn't specified) are made relative to the default directory.
And for this reason <i>outputfile</i>s that contain a drive letter can't be supported.</p>

<p>By the way: specifying a drive letter in the <code>-OUTPUT_FILE</code> when the <code>-OUTPUT_DIRECTORY</code> is set, also
results in strange behavior when running JJTree from the command line.</p>
<p>*) <strong>Footnote</strong>: When running JJTree with the Ant <code>taskdef jjtree</code> the
option <code>-OUTPUT_DIRECTORY</code> must always be set, because the project's <var>basedir</var>
and the Ant working directory might differ. So even if you don't specify
the <var>outputdirectory</var> for <code>taskdef jjtree</code>, JJTree will be called with
the <code>-OUTPUT_DIRECTORY</code> set to the project's <var>basedir</var>. But when
the <code>-OUTPUT_DIRECTORY</code> is set, the <code>-OUTPUT_FILE</code> setting is handled as if
relative to this <code>-OUTPUT_DIRECTORY</code>. Thus when the <code>-OUTPUT_FILE</code> is absolute
or contains a drive letter we have a problem. Therefore absolute <var>outputfile</var>s (when
the <var>outputdirectory</var> isn't specified) are made relative to the default directory. And for
this reason <var>outputfile</var>s that contain a drive letter can't be supported.</p>

<p>By the way: specifying a drive letter in the <code>-OUTPUT_FILE</code> when
the <code>-OUTPUT_DIRECTORY</code> is set, also results in strange behavior when running JJTree from
the command line.</p>

</body>
</html>

+ 66
- 93
manual/Tasks/jlink.html View File

@@ -22,104 +22,80 @@
<body>

<h2 id="jlink">Jlink</h2>
<h3><i>Deprecated</i></h3>
<p><i>This task has been deprecated. Use a <a href="../Types/zipfileset.html">zipfileset</a>
or <a href="../Tasks/zip.html#zipgroupfileset">zipgroupfileset</a> with the
<a href="../Tasks/jar.html">Jar task</a> or <a href="../Tasks/zip.html">Zip task</a>
instead.</i></p>
<h3><em><u>Deprecated</u></em></h3>
<p><em>This task has been <u>deprecated</u>. Use a <a href="../Types/zipfileset.html">zipfileset</a>
or <a href="../Tasks/zip.html#zipgroupfileset">zipgroupfileset</a> with
the <a href="../Tasks/jar.html">Jar task</a> or <a href="../Tasks/zip.html">Zip task</a>
instead.</em></p>

<h3><b>Description:</b></h3>
<h3>Description</h3>
<p>Links entries from sub-builds and libraries.</p>

<p>The jlink task can be used to build jar and zip files, similar to
the <i>jar</i> task.
However, jlink provides options for controlling the way entries from
input files
are added to the output file. Specifically, capabilities for merging
entries from
multiple zip or jar files is available.</p>

<p>If a mergefile is specified directly (eg. at the top level of a
<i>mergefiles</i>
pathelement) <i>and</i> the mergefile ends in &quot;.zip&quot; or
&quot;.jar&quot;,
entries in the mergefile will be merged into the outfile. A file with
any other extension
will be added to the output file, even if it is specified in the
mergefiles element.
Directories specified in either the mergefiles or addfiles element
are added to the
output file as you would expect: all files in subdirectories are
recursively added to
the output file with appropriate prefixes in the output file
(without merging).
</p>

<p>
In the case where duplicate entries and/or files are found among the
files to be merged or
added, jlink merges or adds the first entry and ignores all subsequent entries.
</p>

<p>
jlink ignores META-INF directories in mergefiles. Users should supply their
own manifest information for the output file.
</p>

<p>It is possible to refine the set of files that are being jlinked.
This can be
done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>,
<i>excludesfile</i>,
and <i>defaultexcludes</i> attributes on the <i>addfiles</i> and
<i>mergefiles</i>
nested elements. With the <i>includes</i> or <i>includesfile</i>
attribute you specify the files you want to have included by using patterns.
The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
the files you want to have excluded. This is also done with patterns. And
finally with the <i>defaultexcludes</i> attribute, you can specify whether you
want to use default exclusions or not. 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. The patterns are
relative to the <i>base</i> directory.</p>



<h3>Parameters:</h3>
<table>
<p>The <code>jlink</code> task can be used to build jar and zip files, similar to
the <code>jar</code> task. However, <code>jlink</code> provides options for controlling the way
entries from input files are added to the output file. Specifically, capabilities for merging
entries from multiple zip or jar files is available.</p>

<p>If a mergefile is specified directly (eg. at the top level of a <code>mergefiles</code>
pathelement) <em>and</em> the mergefile ends in <samp>.zip</samp> or <samp>.jar</samp>, entries in
the mergefile will be merged into the <var>outfile</var>. A file with any other extension will be
added to the output file, even if it is specified in the <code>mergefiles</code> element.
Directories specified in either the <code>mergefiles</code> or <code>addfiles</code> element are
added to the output file as you would expect: all files in subdirectories are recursively added to
the output file with appropriate prefixes in the output file (without merging).</p>

<p>In the case where duplicate entries and/or files are found among the files to be merged or
added, <code>jlink</code> merges or adds the first entry and ignores all subsequent entries.</p>

<p><code>jlink</code> ignores <samp>META-INF</samp> directories in <var>mergefiles</var>. Users
should supply their own manifest information for the output file.</p>

<p>It is possible to refine the set of files that are being jlinked. This can be done with
the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var>,
and <var>defaultexcludes</var> attributes on the <code>addfiles</code> and <code>mergefiles</code>
nested elements. With the <var>includes</var> or <var>includesfile</var> attribute you specify the
files you want to have included by using patterns. The <var>exclude</var>
or <var>excludesfile</var> attribute is used to specify the files you want to have excluded. This is
also done with patterns. And finally with the <var>defaultexcludes</var> attribute, you can specify
whether you want to use default exclusions or not. 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. The patterns are relative to
the <em>base</em> directory.</p>

<h3>Parameters</h3>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">outfile</td>
<td valign="top">the path of the output file.</td>
<td valign="top" align="center">Yes</td>
<td>outfile</td>
<td>the path of the output file.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">compress</td>
<td valign="top">whether or not the output should be compressed.
<i>true</i>,
<i>yes</i>, or <i>on</i> result in compressed output.
If omitted, output will be uncompressed (inflated).</td>
<td valign="top" align="center">No</td>
<td>compress</td>
<td>whether or not the output should be compressed. <q>true</q>, <q>yes</q>, or <q>on</q>
result in compressed output.</td>
<td>No; defaults to uncompressed (inflated) output</td>
</tr>
<tr>
<td valign="top">mergefiles</td>
<td valign="top">files to be merged into the output, if possible.</td>
<td valign="middle" align="center" rowspan="2">Exactly one of the two</td>
<td>mergefiles</td>
<td>files to be merged into the output, if possible.</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">addfiles</td>
<td valign="top">files to be added to the output.</td>
<td>addfiles</td>
<td class="left">files to be added to the output.</td>
</tr>
</table>

<h3>Examples</h3>

<p>The following will merge the entries in mergefoo.jar and mergebar.jar
into out.jar.
mac.jar and pc.jar will be added as single entries to out.jar.</p>
<p>The following will merge the entries in <samp>mergefoo.jar</samp> and <samp>mergebar.jar</samp>
into <samp>out.jar</samp>. <samp>mac.jar</samp> and <samp>pc.jar</samp> will be added as single
entries to <samp>out.jar</samp>.</p>
<pre>
&lt;jlink compress=&quot;false&quot; outfile=&quot;out.jar&quot;&gt;
&lt;mergefiles&gt;
@@ -133,7 +109,7 @@ mac.jar and pc.jar will be added as single entries to out.jar.</p>
&lt;/jlink&gt;
</pre>

<p><b>Non-deprecated alternative to the above:</b></p>
<p><strong>Non-deprecated alternative to the above:</strong></p>
<pre>
&lt;jar compress=&quot;false&quot; destfile=&quot;out.jar&quot;&gt;
&lt;zipgroupfileset dir=&quot;${build.dir}&quot;&gt;
@@ -147,28 +123,25 @@ mac.jar and pc.jar will be added as single entries to out.jar.</p>
&lt;/jar&gt;
</pre>

<p>Suppose the file foo.jar contains two entries: bar.class and
barnone/myClass.zip.
Suppose the path for file foo.jar is build/tempbuild/foo.jar. The
following example
will provide the entry tempbuild/foo.jar in the out.jar.</p>
<p>Suppose the file foo.jar contains two entries: <samp>bar.class</samp>
and <samp>barnone/myClass.zip</samp>. Suppose the path for file <samp>foo.jar</samp>
is <samp>build/tempbuild/foo.jar</samp>. The following example will provide the
entry <samp>tempbuild/foo.jar</samp> in the <samp>out.jar</samp>.</p>
<pre>
&lt;jlink compress=&quot;false&quot; outfile=&quot;out.jar&quot;&gt;
&lt;mergefiles&gt;
&lt;pathelement path=&quot;build/tempbuild&quot;/&gt;
&lt;/mergefiles&gt;
&lt;/jlink&gt;
</pre>
&lt;/jlink&gt;</pre>

<p>However, the next example would result in two top-level entries in out.jar,
namely bar.class and barnone/myClass.zip</p>
<p>However, the next example would result in two top-level entries in <samp>out.jar</samp>,
namely <samp>bar.class</samp> and <samp>barnone/myClass.zip</samp></p>
<pre>
&lt;jlink compress=&quot;false&quot; outfile=&quot;out.jar&quot;&gt;
&lt;mergefiles&gt;
&lt;pathelement path=&quot;build/tempbuild/foo.jar&quot;/&gt;
&lt;/mergefiles&gt;
&lt;/jlink&gt;
</pre>
&lt;/jlink&gt;</pre>

</body>
</html>

+ 139
- 192
manual/Tasks/jspc.html View File

@@ -25,233 +25,191 @@
<body>

<h2 id="jspc">jspc</h2>
<h3><i>Deprecated</i></h3>
<p>
<i>If you use this task with Tomcat's Jasper JSP compiler, you should seriously
consider using the task shipping with Tomcat instead.</i> This task is only
tested against Tomcat 4.x. There are known problems with Tomcat 5.x that won't
get fixed in Ant, please use Tomcat's jspc task instead.<br/>
Instead of relying on container specific JSP-compilers we suggest deploying the
raw files (*.jsp) and use the container build-in functions: after deploying run
a test suite
(e.g. with <a href="http://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 <i>and</i> the compiled JSPs.
</p>
<h3><em><u>Deprecated</u></em></h3>
<p><em>If you use this task with Tomcat's Jasper JSP compiler, you should seriously consider using
the task shipping with Tomcat instead.</em> This task is only tested against Tomcat 4.x. There are
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
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>
<h3>Description</h3>

<p>
Apache Ant task to run the JSP compiler and turn JSP pages into Java source.
</p>
<p>Apache Ant task to run the JSP compiler and turn JSP pages into Java source files.</p>

<p>
This task can be used to precompile JSP pages for fast initial invocation of JSP
pages, deployment on a server without the full JDK installed, or simply to
syntax check the pages without deploying them. In most cases, a javac task is
usually the next stage in the build process. The task does basic dependency
checking to prevent unnecessary recompilation - this checking compares source
and destination timestamps, and does not factor in class or taglib dependencies,
or <code>&lt;jsp:include&gt;</code> references.
</p>
<p>This task can be used to precompile JSP pages for fast initial invocation of JSP pages,
deployment on a server without the full JDK installed, or simply to syntax check the pages without
deploying them. In most cases, a <code>javac</code> task is usually the next stage in the build
process. The task does basic dependency checking to prevent unnecessary recompilation&mdash;this
checking compares source and destination timestamps, and does not factor in class or taglib
dependencies, or <code>&lt;jsp:include&gt;</code> references.</p>

<p>
By default the task uses the Jasper JSP compiler. This
means the task needs jasper.jar and jasper-runtime.jar, which come with
builds of Tomcat 4/Catalina from the
<a href="http://tomcat.apache.org/">Apache Tomcat project</a>,
and any other Jar files which may be needed in future versions (it changes)
<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
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>

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>

<p>
There are many limitations with this task which partially stem from the many
versions of Jasper, others from implementation 'issues' in the task
(i.e. nobody's willingness to radically change large bits of it to work around
jasper). Because of this and the fact that JSP pages do not have to be portable
across implementations -or versions of implementations- this task is better used
for validating JSP pages before deployment, rather than precompiling them. For
that, just deploy and run your httpunit junit tests after deployment to compile
and test your pages, all in one go.
</p>
<p>There are many limitations with this task which partially stem from the many versions of Jasper,
others from implementation 'issues' in the task (i.e. nobody's willingness to radically change large
bits of it to work around Jasper). Because of this and the fact that JSP pages do not have to be
portable across implementations&mdash;or versions of implementations&mdash;this task is better used
for validating JSP pages before deployment, rather than precompiling them. For the latter, just
deploy and run your HttpUnit JUnit tests after deployment to compile and test your pages, all in one
go.</p>


<h3>Parameters</h3>
<p>The Task has the following attributes:</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">destdir</td>
<td valign="top">Where to place the generated files. They are located
under here according to the given package name.</td>
<td valign="top" align="center">Yes</td>
<td>destdir</td>
<td>Where to place the generated files. They are located under here according to the given
package name.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">srcdir</td>
<td valign="top">Where to look for source jsp files.</td>
<td valign="top" align="center">Yes</td>
<td>srcdir</td>
<td>Where to look for source JSP files.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">The verbosity integer to pass to the compiler. Default="0"</td>
<td valign="top" align="center">No</td>
<td>verbose</td>
<td>The verbosity integer to pass to the compiler.</td>
<td>No; default <q>0</q></td>
</tr>
<tr>
<td valign="top">package</td>
<td valign="top">Name of the destination package for generated java
classes.</td>
<td valign="top" align="center">No</td>
<td>package</td>
<td>Name of the destination package for generated Java classes.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">compiler</td>
<td valign="top">class name of a JSP compiler adapter,
such as "jasper" or "jasper41"</td>
<td valign="top" align="center">No -defaults to "jasper"</td>
<td>compiler</td>
<td>class name of a JSP compiler adapter, such as <q>jasper</q> or <q>jasper41</q></td>
<td>No; defaults to <q>jasper</q></td>
</tr>
<tr>
<td valign="top">ieplugin</td>
<td valign="top">Java Plugin classid for Internet Explorer.</td>
<td valign="top" align="center">No</td>
<td>ieplugin</td>
<td>Java Plugin classid for Internet Explorer.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">mapped</td>
<td valign="top">(boolean) Generate separate write() calls for each HTML
line in the JSP.</td>
<td valign="top" align="center">No</td>
<td>mapped</td>
<td>(boolean) Generate separate <code>write()</code> calls for each HTML line in the JSP.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">The classpath to use to run the jsp compiler.
This can also be specified
by the nested element <code>classpath</code>
<a href="../using.html#path">Path</a>).</td>
<td valign="top" align="center">No, but it seems to work better when used</td>
<td>classpath</td>
<td>The classpath to use to run the JSP compiler.</td>
<td>No, but it seems to work better when used; can also be specified by the nested
element <a href="../using.html#path"><code>classpath</code></a></td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">A <a href="../using.html#references">Reference</a>. As
per <code>classpath</code></td>
<td valign="top" align="center">No</td>
<td>classpathref</td>
<td>A <a href="../using.html#references">Reference</a>. As per <var>classpath</var>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">flag to control action on compile failures: default=yes</td>
<td valign="top" align="center">No</td>
<td>failonerror</td>
<td>flag to control action on compile failures.</td>
<td>No; default <q>yes</q></td>
</tr>
<tr>
<td valign="top">uribase</td>
<td valign="top">
The uri context of relative URI
references in the JSP pages. If it does not
exist then it is derived from the location of the file
relative to the declared or derived value of <tt>uriroot.</tt>
</td>
<td valign="top" align="center">No</td>
<td>uribase</td>
<td>The context of relative URI references in JSP.</td>
<td>No; derived from the location of the file relative to the declared or derived value
of <var>uriroot</var></td>
</tr>
<tr>
<td valign="top">uriroot</td>
<td valign="top">
The root directory that uri files should be resolved
against.
</td>
<td valign="top" align="center">No</td>
<td>uriroot</td>
<td>The root directory that URIs should be resolved against.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">compiler</td>
<td valign="top">
Class name of jsp compiler adapter to use. Defaults to
the standard adapter for Jasper.
</td>
<td valign="top" align="center">No</td>
<td>compiler</td>
<td>Class name of JSP compiler adapter to use.</td>
<td>No; defaults to the standard adapter for Jasper</td>
</tr>
<tr>
<td valign="top">compilerclasspath</td>
<td valign="top">The classpath used to find the compiler adapter specified
by the <code>compiler</code> attribute.</td>
<td valign="top" align="center">No</td>
<td>compilerclasspath</td>
<td>The classpath used to find the compiler adapter specified by the <var>compiler</var>
attribute.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">webinc</td>
<td valign="top">Output file name for the fraction of web.xml that lists servlets.</td>
<td valign="top" align="center">No</td>
<td>webinc</td>
<td>Output file name for the fraction of <samp>web.xml</samp> that lists servlets.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">webxml</td>
<td valign="top">File name for web.xml to be generated</td>
<td valign="top" align="center">No</td>
<td>webxml</td>
<td>File name for <samp>web.xml</samp> to be generated</td>
<td>No</td>
</tr>
</table>

<p>The <tt>mapped</tt> option will, if set to true, split the JSP text content into a
one line per call format. There are comments above and below the mapped
write calls to localize where in the JSP file each line of text comes
from. This can lead to a minor performance degradation (but it is bound
by a linear complexity). Without this options all adjacent writes are
concatenated into a single write.</p>
<p>The <var>mapped</var> option will, if set to <q>true</q>, split the JSP text content into a one
line per call format. There are comments above and below the mapped write calls to localize where
in the JSP file each line of text comes from. This can lead to a minor performance degradation (but
it is bound by a linear complexity). Without this option all adjacent writes are concatenated into
a single write.</p>

<p>The <tt>ieplugin</tt> option is used by the <tt>&lt;jsp:plugin&gt;</tt> tags.
If the Java Plug-in COM Class-ID you want to use changes then it can be
specified here. This should not need to be altered.</p>
<p>The <var>ieplugin</var> option is used by the <code>&lt;jsp:plugin&gt;</code> tags. If the Java
Plug-in COM Class-ID you want to use changes then it can be specified here. This should not need to
be altered.</p>

<p><tt>uriroot</tt> specifies the root of the web
application. This is where all absolute uris will be resolved from.
If it is not specified then the first JSP page will be used to derive
it. To derive it each parent directory of the first JSP page is
searched for a <tt>WEB-INF</tt> directory, and the directory closest to
the JSP page that has one will be used. If none can be found then the
directory Jasperc was called from will be used. This only affects pages
translated from an explicitly declared JSP file - including references
to taglibs</p>
<p><var>uriroot</var> specifies the root of the web application. This is where all absolute URIs
will be resolved from. If it is not specified then the first JSP page will be used to derive it.
To derive it each parent directory of the first JSP page is searched for a <samp>WEB-INF</samp>
directory, and the directory closest to the JSP page that has one will be used. If none can be
found then the directory Jasperc was called from will be used. This only affects pages translated
from an explicitly declared JSP file&mdash;including references to taglibs.</p>

<p><tt>uribase</tt> is used to establish the uri context of
relative URI references in the JSP pages. If it does not exist then it
is derived from the location of the file relative to the declared or
derived value of <tt>uriroot</tt>. This only affects pages
translated from an explicitly declared JSP file.</p>
<p><var>uribase</var> is used to establish the context of relative URI references in the JSP pages.
If it does not exist then it is derived from the location of the file relative to the declared or
derived value of <var>uriroot</var>. This only affects pages translated from an explicitly declared
JSP file.</p>

<h3>Parameters specified as nested elements</h3>

<p>
This task is a <a href="../dirtasks.html">directory based task</a>, like
<strong>javac</strong>, so the jsp files to be compiled are located as java
files are by <strong>javac</strong>. That is, elements such as <tt>includes</tt> and
<tt>excludes</tt> can be used directly inside the task declaration.
</p>
<p>This task is a <a href="../dirtasks.html">directory based task</a>, like <code>javac</code>, so
the <samp>.jsp</samp> files to be compiled are located as <samp>.java</samp> files are
by <code>javac</code>. That is, elements such as <code>includes</code> and <code>excludes</code> can
be used directly inside the task declaration.</p>

<p>
Elements specific to the jspc task are:
</p>
<p>Elements specific to the <code>jspc</code> task are:</p>

<h4>classpath</h4>

The classpath used to compile the JSP pages, specified as for any other
classpath.
<p>The classpath used to compile the JSP pages, specified as for any other classpath.</p>

<h4>classpathref</h4>

a reference to an existing classpath
<p>a reference to an existing classpath</p>

<h4>webapp</h4>

Instructions to jasper to build an entire web application.
The base directory must have a WEB-INF subdirectory beneath it.
When used, the task hands off all dependency checking to the compiler.
<table>
<p>Instructions to Jasper to build an entire web application. The base directory must have
a <samp>WEB-INF</samp> subdirectory beneath it. When used, the task hands off all dependency
checking to the compiler.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">basedir</td>
<td valign="top">the base directory of the web application</td>
<td valign="top" align="center">Yes</td>
<td>basedir</td>
<td>the base directory of the web application</td>
<td>Yes</td>
</tr>
</table>
<h3>Example</h3>
@@ -262,50 +220,39 @@ When used, the task hands off all dependency checking to the compiler.
compiler="jasper41"
verbose="9"&gt;
&lt;include name="**/*.jsp"/&gt;
&lt;/jspc&gt;
</pre>
Build all jsp pages under src/war into the destination /gensrc, in a
package hierarchy beginning with com.i3sp.jsp.
&lt;/jspc&gt;</pre>
<p>Build all <samp>.jsp</samp> files under <samp>src/war</samp> into the
destination <samp>/gensrc</samp>, in a package hierarchy beginning
with <samp>com.i3sp.jsp</samp>.</p>
<pre>
&lt;jspc
destdir="interim"
&lt;jspc destdir="interim"
verbose="1"
srcdir="src"
compiler="jasper41"
package="com.i3sp.jsp"&gt;
&lt;include name="**/*.jsp"/&gt;
&lt;/jspc&gt;
&lt;depend
srcdir="interim"
&lt;depend srcdir="interim"
destdir="build"
cache="build/dependencies"
classpath="lib/taglibs.jar"/&gt;
&lt;javac
srcdir="interim"
&lt;javac srcdir="interim"
destdir="build"
classpath="lib/taglibs.jar"
debug="on"/&gt;
</pre>
Generate jsp pages then javac them down to
bytecodes. Include lib/taglib jar in the java compilation.
Dependency checking is used to scrub the
java files if class dependencies indicate it is needed.
debug="on"/&gt;</pre>
<p>Generate <samp>.java</samp> files from <samp>.jsp</samp> files then <code>javac</code> them down
to bytecodes. Include <samp>lib/taglibs.jar</samp> in the Java compilation. Dependency checking is
used to scrub the <samp>.java</samp> files if class dependencies indicate it is needed.</p>

<h4>Notes</h4>
<p>
Using the <code>package</code> attribute it is possible to identify the resulting
java files and thus do full dependency checking - this task should only rebuild
java files if their jsp file has been modified. However, this only works
with some versions of jasper. By default the checking supports tomcat 4.0.x
with the "jasper" compiler, set the compiler to "jasper41" for the tomcat4.1.x
dependency checking.
Even when it does work, changes in
.TLD imports or in compile time includes do not get picked up.
</p>
<p>
Jasper generates JSP pages against the JSP1.2 specification -a copy of
version 2.3 of the servlet specification is needed on the classpath to
compile the Java code.
</p>
<p>Using the <var>package</var> attribute it is possible to identify the
resulting <samp>.java</samp> files and thus do full dependency checking&mdash;this task should only
rebuild <samp>.java</samp> files if their <samp>.jsp</samp> file has been modified. However, this
only works with some versions of Jasper. By default the checking supports Tomcat 4.0.x with
the <q>jasper</q> compiler, set the compiler to <q>jasper41</q> for the Tomcat 4.1.x dependency
checking. Even when it does work, changes in <samp>.tld</samp> imports or in compile time includes
do not get picked up.</p>
<p>Jasper generates JSP pages against the JSP 1.2 specification&mdash;a copy of version 2.3 of the
servlet specification is needed on the classpath to compile the Java code.</p>
</body>
</html>

+ 475
- 569
manual/Tasks/junit.html
File diff suppressed because it is too large
View File


+ 96
- 101
manual/Tasks/junitreport.html View File

@@ -24,172 +24,167 @@

<h2 id="junitreport">JUnitReport</h2>
<h3>Description</h3>
Merge the individual XML files generated by the JUnit task and eventually apply
a stylesheet on the resulting merged document to provide a browsable report of
the testcases results.
<p>Merge the individual XML files generated by the <code>JUnit</code> task and eventually apply a
stylesheet on the resulting merged document to provide a browsable report of the testcases
results.</p>

<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 information.</p>
<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
information.</p>

<h3>Requirements</h3>

<p>The task needs Apache <a
href="http://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/">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>
<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>XSLTC</td><td>JDK 1.5.x</td><td>OK</td></tr>
<tr><td>2.x</td><td>JDK 1.4.x</td><td>DEPRECATED<br><i>Use ${ant.home}/etc/junit-frames-xalan1.xsl
<br>Upgrade Xalan using the JDK endorsement mechanism</i></td></tr>
<tr><td>2.x</td><td>JDK 1.4.x</td><td><em><u>Deprecated</u>, use <samp>${ant.home}/etc/junit-frames-xalan1.xsl</samp>
<br/>Upgrade Xalan using the JDK endorsement mechanism</em></td></tr>
</table>

<p>In Ant 1.6.2, we had to decide between supporting Xalan 1/Xalan 2.4.1-
and Xalan 2.4.1+/XSLTC, because there was no way to support both couples at the same
time.</p>
<p><em>Since Ant 1.7</em>, we dropped support for Xalan 1, because Xalan 1 was not
available anymore for quite some time.</p>
<p>In Ant 1.6.2, we had to decide between supporting Xalan 1/Xalan 2.4.1- and Xalan 2.4.1+/XSLTC,
because there was no way to support both couples at the same time.</p>
<p><em>Since Ant 1.7</em>, we dropped support for Xalan 1, because Xalan 1 was not available anymore
for quite some time.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">tofile</td>
<td valign="top">The name of the XML file that will aggregate all individual
XML testsuite previously generated by the JUnit task.</td>
<td align="center" valign="top">No. Default to TESTS-TestSuites.xml</td>
<td>tofile</td>
<td>The name of the XML file that will aggregate all individual XML testsuites previously
generated by the <code>JUnit</code> task.</td>
<td>No; defaults to <samp>TESTS-TestSuites.xml</samp></td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">The directory where should be written the file resulting
from the individual XML testsuite aggregation.</td>
<td align="center" valign="top">No. Default to current directory</td>
<td>todir</td>
<td>The directory where the file resulting from the individual XML testsuite aggregation should
be written.</td>
<td>No; defaults to current directory</td>
</tr>
</table>
<h3 id="nested">Nested Elements</h3>
<h4>fileset</h4>
<p><code>junitreport</code> collects individual xml files generated by the JUnit
task using the nested <a href="../Types/fileset.html"><code>&lt;FileSet&gt;</code></a>
element.</p>
<p><code>junitreport</code> collects individual xml files generated by the <code>JUnit</code> task
using the nested <a href="../Types/fileset.html"><code>&lt;FileSet&gt;</code></a> element.</p>
<h4>report</h4>
<p>Generate a browsable report based on the document created by the merge.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">format</td>
<td valign="top">The format of the generated report. Must be &quot;noframes&quot;
or &quot;frames&quot;.</td>
<td align="center" valign="top">No, default to &quot;frames&quot;</td>
<td>format</td>
<td>The format of the generated report. Must be either <q>noframes</q> or <q>frames</q>.</td>
<td>No; defaults to <q>frames</q></td>
</tr>
<tr>
<td valign="top">styledir</td>
<td valign="top">The directory where the stylesheets are defined. They must
be conforming to the following conventions:
<td>styledir</td>
<td>The directory where the stylesheets are defined. They must be conforming to the following
conventions:
<ul>
<li>frames format: the stylesheet must be named <i>junit-frames.xsl</i>, or <i>junit-frames-saxon.xsl if you are using Saxon 9+.</li>
<li>noframes format: the stylesheet must be named <i>junit-noframes.xsl</i>, or <i>junit-noframes-saxon.xsl if you are using Saxon 9+.</li>
<li><q>frames</q> format: the stylesheet must be named <samp>junit-frames.xsl</samp>, or <i>junit-frames-saxon.xsl if you are using Saxon 9+.</li>
<li><q>noframes</q> format: the stylesheet must be named <samp>junit-noframes.xsl</samp>, or <i>junit-noframes-saxon.xsl if you are using Saxon 9+.</li>
</ul>
</td>
<td align="center" valign="top">No. Default to embedded stylesheets.</td>
<td>No; defaults to embedded stylesheets</td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">The directory where the files resulting from the
transformation should be written to.</td>
<td align="center" valign="top">No. Default to current directory</td>
<td>todir</td>
<td>The directory where the files resulting from the transformation should be written to.</td>
<td>No; defaults to current directory</td>
</tr>
</table>
<p>Ant assumes the following concerning the <tt>frames</tt> and <tt>noframes</tt> formats:</p>
<p>The <tt>frames</tt> format uses
a stylesheet which is generating output <em>only</em> by redirecting.</p>
<p>The
<tt>noframes</tt> format does not use redirecting and generates one
file called <tt>junit-noframes.html</tt>.</p>
<p>Custom versions of <tt>junit-frames.xsl</tt> or <tt>junit-noframes.xsl</tt> must adhere to the above conventions.</p>
<p>Ant assumes the following concerning the <q>frames</q> and <q>noframes</q> formats:</p>
<ul>
<li>The <q>frames</q> format uses a stylesheet which is generating output <em>only</em> by
redirecting.</li>
<li>The <q>noframes</q> format does not use redirecting and generates one file
called <samp>junit-noframes.html</samp>.</li>
</ul>
<p>Custom versions of <samp>junit-frames.xsl</samp> or <samp>junit-noframes.xsl</samp> must adhere
to the above conventions.</p>

<h3>Nested Element of the report tag</h3>
<h4>param</h4>
<em>Since Ant 1.7</em>the report tag supports nested param tags.
These tags can pass XSL parameters to the stylesheet.
<p><em>Since Ant 1.7</em>, the <var>report</var> tag supports nested <code>param</code> tags. These
tags can pass XSL parameters to the stylesheet.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">Name of the XSL parameter</td>
<td align="center" valign="top">Yes</td>
<td>name</td>
<td>Name of the XSL parameter</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">expression</td>
<td valign="top">Text value to be placed into the param.<br>
Was originally intended to be an XSL expression.</td>
<td align="center" valign="top">Yes</td>
<td>expression</td>
<td>Text value to be placed into the <code>param</code>.<br/>Was originally intended to be an
XSL expression.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">if</td>
<td valign="top">The param will only be passed <a href="../properties.html#if+unless">if this property is set</a>.</td>
<td align="center" valign="top">No</td>
<td>if</td>
<td>The <code>param</code> will only be passed <a href="../properties.html#if+unless">if this
property is set</a>.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">unless</td>
<td valign="top">The param will not be passed <a href="../properties.html#if+unless">if this property is set</a>.</td>
<td align="center" valign="top">No</td>
<td>unless</td>
<td>The <code>param</code> will not be passed <a href="../properties.html#if+unless">if this
property is set</a>.</td>
<td>No</td>
</tr>
</table>

<p>The built-in stylesheets support the following parameters:</p>
<table>
<tr>
<td valign="top"><b>XSL-Parameter</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>XSL Parameter</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">TITLE</td>
<td valign="top">Title used in &lt;title&gt; and &lt;h1&gt; tags</td>
<td align="center" valign="top">No. Defaults to <i>Unit Test Results.</i></td>
<td>TITLE</td>
<td>Title used in <code>&lt;title&gt;</code> and <code>&lt;h1&gt;</code> tags</td>
<td>No; defaults to <q>Unit Test Results</q></td>
</tr>
</table>

<h4>classpath</h4>
<p><em>Since Ant 1.9.5</em>.
Like for the <a href="../Tasks/style.html#classpath">XSLT task</a>,
a nested &lt;classpath&gt; will be used to load the processor.</p>
<p><em>Since Ant 1.9.5</em>. Like for the <a href="../Tasks/style.html#classpath">XSLT task</a>, a
nested <code>&lt;classpath&gt;</code> will be used to load the processor.</p>

<h4>factory</h4>
<p><em>Since Ant 1.9.5</em>.
Like for the <a href="../Tasks/style.html#factory">XSLT task</a>,
a nested &lt;factory&gt; can be used to specify factory settings.</p>

<p><em>Since Ant 1.9.5</em>. Like for the <a href="../Tasks/style.html#factory">XSLT task</a>, a
nested <code>&lt;factory&gt;</code> can be used to specify factory settings.</p>

<h3>Example of report</h3>
<pre>&lt;junitreport todir=&quot;./reports&quot;&gt;
&lt;fileset dir=&quot;./reports&quot;&gt;
&lt;include name=&quot;TEST-*.xml&quot;/&gt;
&lt;/fileset&gt;
&lt;report format=&quot;frames&quot; todir=&quot;./report/html&quot;/&gt;
<pre>
&lt;junitreport todir=&quot;./reports&quot;&gt;
&lt;fileset dir=&quot;./reports&quot;&gt;
&lt;include name=&quot;TEST-*.xml&quot;/&gt;
&lt;/fileset&gt;
&lt;report format=&quot;frames&quot; todir=&quot;./report/html&quot;/&gt;
&lt;/junitreport&gt;</pre>

<p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
generate the default framed report in the directory <tt>report/html</tt>.</p>
<p>would generate a <samp>TESTS-TestSuites.xml</samp> file in the directory <samp>reports</samp> and
generate the default framed report in the directory <samp>report/html</samp>.</p>

<h3>Example of report with xsl params</h3>
<pre>
@@ -205,8 +200,8 @@ generate the default framed report in the directory <tt>report/html</tt>.</p>
&lt;/report&gt;
&lt;/junitreport&gt;</pre>

<p>This example requires a file called <tt>junitreport/junit-frames.xsl</tt>.
The XSL parameters key1 and key2 will be passed to the XSL transformation.</p>
<p>This example requires a file called <samp>junitreport/junit-frames.xsl</samp>. The XSL
parameters <q>key1</q> and <q>key2</q> will be passed to the XSL transformation.</p>

</body>
</html>

+ 54
- 54
manual/Tasks/length.html View File

@@ -26,100 +26,100 @@

<h2>Length</h2>
<h3>Description</h3>
<p>Display or set a property containing length information for
a string, a file, or one or more nested
<a href="../Types/resources.html#collection">Resource Collection</a>s.
Can also be used as a condition. <em>Since Apache Ant 1.6.3</em></p>
<p>Display or set a property containing length information for a string, a file, or one or more
nested <a href="../Types/resources.html#collection">Resource Collection</a>s. Can also be used as
a <code>condition</code>. <em>Since Apache Ant 1.6.3</em></p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th rowspan="2">Attribute</th>
<th rowspan="2">Description</th>
<th colspan="2">Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The property to set. If omitted
the results are written to the log. Ignored when
processing as a condition.</td>
<td valign="top" align="center">No</td>
<th>Task</th>
<th>Condition</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">Single file whose length to report.</td>
<td valign="top" align="center" rowspan="3">One of these,
or one or more nested filesets</td>
<td>property</td>
<td>The property to set.</td>
<td class="center">No; by default, output value to the log</td>
<td>Ignored</td>
</tr>
<tr>
<td valign="top">resource</td>
<td valign="top">Single resource whose length to report (using extended
<a href="../properties.html#propertyHelper">properties handling</a>).
<em>Since Ant 1.8.1</em>
</td>
<td>mode</td>
<td>File length mode; when <q>all</q> the resulting value is the sum of all included resources'
lengths; when <q>each</q> the task outputs the absolute path and length of each included
resource, one per line.</td>
<td class="center">No; default is <q>all</q></td>
<td>Ignored</td>
</tr>
<tr>
<td>file</td>
<td>Single file whose length to report.</td>
<td rowspan="3" colspan="2">One of these, or one or more nested filesets</td>
</tr>
<tr>
<td valign="top">string</td>
<td valign="top">The string whose length to report.</td>
<td>resource</td>
<td class="left">Single resource whose length to report (using
extended <a href="../properties.html#propertyHelper">properties handling</a>). <em>Since Ant
1.8.1</em>
</td>
</tr>
<tr>
<td valign="top">mode</td>
<td valign="top">File length mode; when &quot;all&quot; the resulting
value is the sum of all included resources' lengths; when &quot;each&quot;
the task outputs the absolute path and length of each included resource,
one per line. Ignored when processing as a condition.</td>
<td valign="top" align="center">No; default is &quot;all&quot;</td>
<td>string</td>
<td class="left">The string whose length to report.</td>
</tr>
<tr>
<td valign="top">trim</td>
<td valign="top">Whether to trim when operating on a string. Default <i>false</i>.</td>
<td valign="top" align="center">No; only valid when string is set</td>
<td>trim</td>
<td>Whether to trim when operating on a string.</td>
<td colspan="2">No; default is <q>false</q>, ignored unless <var>string</var> is set</td>
</tr>
<tr>
<td valign="top">length</td>
<td valign="top">Comparison length for processing as a condition.</td>
<td valign="top" align="center">Yes, in condition mode</td>
<td>length</td>
<td>Comparison length.</td>
<td class="center">Ignored</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">when</td>
<td valign="top">Comparison type: "equal", "eq", "greater", "gt", "less",
"lt", "ge" (greater or equal), "ne" (not equal), "le" (less or equal)
for use when operating as a condition.</td>
<td valign="top" align="center">No; default is "equal"</td>
<td>when</td>
<td>Comparison
type: <q>equal</q>, <q>eq</q>, <q>greater</q>, <q>gt</q>, <q>less</q>, <q>lt</q>, <q>ge</q>
(greater or equal), <q>ne</q> (not equal), <q>le</q> (less or equal).</td>
<td class="center">Ignored</td>
<td>No; default is <q>equal</q></td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>

<h4>Resource Collections</h4>
<p>You can include resources via nested
<a href="../Types/resources.html#collection">Resource Collection</a>s.</p>
<p>You can include resources via nested <a href="../Types/resources.html#collection">Resource
Collection</a>s.</p>

<h3>Examples</h3>

<pre>&lt;length string=&quot;foo&quot; property=&quot;length.foo&quot; /&gt;
</pre>
<p>Stores the length of the string &quot;foo&quot; in the property named
<i>length.foo</i>.</p>
<pre>&lt;length string=&quot;foo&quot; property=&quot;length.foo&quot;/&gt;</pre>
<p>Stores the length of the string <q>foo</q> in the property named <code>length.foo</code>.</p>

<pre>&lt;length file=&quot;bar&quot; property=&quot;length.bar&quot; /&gt;
</pre>
<p>Stores the length of file &quot;bar&quot; in the property named
<i>length.bar</i>.</p>
<pre>&lt;length file=&quot;bar&quot; property=&quot;length.bar&quot;/&gt;</pre>
<p>Stores the length of file <samp>bar</samp> in the property named <code>length.bar</code>.</p>

<pre>
&lt;length property=&quot;length&quot; mode=&quot;each&quot;&gt;
&lt;fileset dir=&quot;.&quot; includes=&quot;foo,bar&quot;/&gt;
&lt;/length&gt;
</pre>
<p>Writes the file paths of <i>foo</i> and <i>bar</i> and their length into
the property <i>length</i>.</p>
<p>Writes the file paths of <samp>foo</samp> and <samp>bar</samp> and their length into the
property <code>length</code>.</p>

<pre>
&lt;length property=&quot;length&quot; mode=&quot;all&quot;&gt;
&lt;fileset dir=&quot;.&quot; includes=&quot;foo,bar&quot;/&gt;
&lt;/length&gt;
</pre>
<p>Adds the length of <i>foo</i> and <i>bar</i> and stores the result in property <i>length</i>.</p>
<p>Adds the length of <samp>foo</samp> and <samp>bar</samp> and stores the result in
property <code>length</code>.</p>

</body>
</html>

+ 64
- 75
manual/Tasks/loadfile.html View File

@@ -22,107 +22,96 @@

<body>


<h2 id="loadfile">LoadFile</h2>
<h3>Description</h3>
<p>
Specialization of <a href="loadresource.html">loadresource</a> that
works on files exclusively and provides a srcFile attribute for
convenience. Unless an encoding is specified, the encoding of the
current locale is used.
</p>
<p>If the resource content is empty (maybe after processing a filterchain)
the property is not set.</p>

<p>Specialization of <a href="loadresource.html">loadresource</a> that works on files exclusively
and provides a <var>srcFile</var> attribute for convenience. Unless an <var>encoding</var> is
specified, the encoding of the current locale is used.</p>
<p>If the resource content is empty (maybe after processing a <code>filterchain</code>) the property
is not set.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">srcFile</td>
<td valign="top">source file</td>
<td valign="top" align="center">Yes</td>
<td>srcFile</td>
<td>source file</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">property to save to</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>property to save to</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">encoding to use when loading the file</td>
<td align="center" valign="top">No</td>
<td>encoding</td>
<td>encoding to use when loading the file</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Whether to halt the build on failure</td>
<td align="center" valign="top">No, default "true"</td>
<td>failonerror</td>
<td>Whether to halt the build on failure</td>
<td>No; default <q>true</q></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">Do not display a diagnostic message (unless Apache Ant has been
invoked with the <code>-verbose</code> or <code>-debug</code>
switches) or modify the exit status to reflect an error. Setting this to
"true" implies setting failonerror to "false".
<em>Since Ant 1.7.0</em>.
<td>quiet</td>
<td>Do not display a diagnostic message (unless Apache Ant has been invoked with
the <code>-verbose</code> or <code>-debug</code> switches) or modify the exit status to
reflect an error. Setting this to <q>true</q> implies setting <var>failonerror</var>
to <q>false</q>. <em>Since Ant 1.7.0</em>.
</td>
<td align="center" valign="top">No, default "false"</td>
<td>No; default <q>false</q></td>
</tr>

</table>
<p>
The LoadFile task supports nested <a href="../Types/filterchain.html">
FilterChain</a>s.
<p>The LoadFile task supports nested <a href="../Types/filterchain.html"> FilterChain</a>s.</p>

<h3>Examples</h3>
<pre> &lt;loadfile property="message"
srcFile="message.txt"/&gt;
</pre>
Load file message.txt into property "message"; an <tt>&lt;echo&gt;</tt>
can print this. This is identical to
<pre> &lt;loadresource property="message"&gt;
&lt;file file="message.txt"/&gt;
&lt;/loadresource&gt;
</pre>
<pre>
&lt;loadfile property="message"
srcFile="message.txt"/&gt;</pre>
<p>Load file message.txt into property <code>message</code>; an <code>&lt;echo&gt;</code> can print
this. This is identical to</p>
<pre>
&lt;loadresource property="message"&gt;
&lt;file file="message.txt"/&gt;
&lt;/loadresource&gt;</pre>

<pre> &lt;loadfile property="encoded-file"
srcFile="loadfile.xml"
encoding="ISO-8859-1"/&gt;
</pre>
Load a file using the latin-1 encoding
<pre>
&lt;loadfile property="encoded-file"
srcFile="loadfile.xml"
encoding="ISO-8859-1"/&gt;</pre>
<p>Load a file using the Latin-1 encoding</p>

<pre> &lt;loadfile
property="optional.value"
srcFile="optional.txt"
failonerror="false"/&gt;
</pre>
Load a file, don't fail if it is missing (a message is printed, though)
<pre>
&lt;loadfile property="optional.value"
srcFile="optional.txt"
failonerror="false"/&gt;</pre>
<p>Load a file, don't fail if it is missing (a message is printed, though)</p>

<pre> &lt;loadfile
property="mail.recipients"
srcFile="recipientlist.txt"&gt;
&lt;filterchain&gt;
<pre>
&lt;loadfile property="mail.recipients"
srcFile="recipientlist.txt"&gt;
&lt;filterchain&gt;
&lt;<a href="../Types/filterchain.html#striplinebreaks">striplinebreaks</a>/&gt;
&lt;/filterchain&gt;
&lt;/loadfile&gt;
</pre>
Load a property which can be used as a parameter for another task (in this case mail),
merging lines to ensure this happens.
&lt;/filterchain&gt;
&lt;/loadfile&gt;</pre>
<p>Load a property which can be used as a parameter for another task (in this
case <code>mail</code>), merging lines to ensure this happens.</p>

<pre> &lt;loadfile
property="system.configuration.xml"
srcFile="configuration.xml"&gt;
&lt;filterchain&gt;
&lt;<a href="../Types/filterchain.html#expandproperties">expandproperties</a>/&gt;
&lt;/filterchain&gt;
&lt;/loadfile&gt;
</pre>
Load an XML file into a property, expanding all properties declared
in the file in the process.
<pre>
&lt;loadfile property="system.configuration.xml"
srcFile="configuration.xml"&gt;
&lt;filterchain&gt;
&lt;<a href="../Types/filterchain.html#expandproperties">expandproperties</a>/&gt;
&lt;/filterchain&gt;
&lt;/loadfile&gt;</pre>
<p>Load an XML file into a property, expanding all properties declared in the file in the
process.</p>

</body>
</html>

+ 57
- 69
manual/Tasks/loadproperties.html View File

@@ -25,66 +25,58 @@

<h2 id="loadproperties">LoadProperties</h2>
<h3>Description</h3>
<p>
Load a file's contents as Apache Ant properties. This is equivalent
to <code>&lt;property file|resource=&quot;...&quot;/&gt;</code> except that it
supports nested <code>&lt;filterchain&gt;</code> elements.
Also if the file is missing, the build is halted with an error, rather
than a warning being printed.
</p>

<p><strong>Note</strong>: the default value of this
task's <code>prefixValues</code> attribute is different from the
default value of the same attribute in
the <a href="property.html"><code>&lt;property&gt;</code></a>
task.</p>
<p>Load a file's contents as Apache Ant properties. This is equivalent to <code>&lt;property
file|resource=<q>...</q>/&gt;</code> except that it supports nested <code>&lt;filterchain&gt;</code>
elements. Also if the file is missing, the build is halted with an error, rather than a warning
being printed.</p>

<p><strong>Note</strong>: the default value of this task's <var>prefixValues</var> attribute is
different from the default value of the same attribute in
the <a href="property.html"><code>&lt;property&gt;</code></a> task.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">srcFile</td>
<td valign="top">source file</td>
<td valign="top" rowspan="2" align="center">One of these or a
nested resource</td>
<td>srcFile</td>
<td>source file</td>
<td rowspan="2">One of these or a nested resource</td>
</tr>
<tr>
<td valign="top">resource</td>
<td valign="top">the resource name of the property file</td>
<td>resource</td>
<td class="left">the resource name of the property file</td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">encoding to use when loading the file</td>
<td align="center" valign="top">No</td>
<td>encoding</td>
<td>encoding to use when loading the file</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">the classpath to use when looking up a resource.</td>
<td align="center" valign="top">No</td>
<td>classpath</td>
<td>the classpath to use when looking up a resource.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">the classpath to use when looking up a resource,
given as <a href="../using.html#references">reference</a>
to a <code>&lt;path&gt;</code> defined elsewhere..</td>
<td align="center" valign="top">No</td>
<td>classpathref</td>
<td>the classpath to use when looking up a resource, given
as <a href="../using.html#references">reference</a> to a <code>&lt;path&gt;</code> defined
elsewhere.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">Prefix to apply to loaded properties;
a "." is appended to the prefix if not specified. <em>Since Ant 1.8.1</em></td>
<td align="center" valign="top">No</td>
<td>prefix</td>
<td>Prefix to apply to loaded properties. <em>Since Ant 1.8.1</em></td>
<td>No; default is <q>.</q></td>
</tr>
<tr>
<td valign="top">prefixValues</td>
<td valign="top">Whether to apply the prefix when expanding the
right hand side of the properties.
<em>Since Ant 1.8.2</em></td>
<td align="center" valign="top">No (default=<tt>true</tt>)</td>
<td>prefixValues</td>
<td>Whether to apply the prefix when expanding the right hand side of the properties. <em>Since
Ant 1.8.2</em></td>
<td>No; default is <q>true</q></td>
</tr>
</table>

@@ -99,40 +91,36 @@ resource collection</h4>

<h4>classpath</h4>

<p>for use with the <i>resource</i> attribute.</p>
<p>for use with the <var>resource</var> attribute.</p>

<h3>Examples</h3>
<pre> &lt;loadproperties srcFile="file.properties"/&gt;
</pre>
or
<pre>&lt;loadproperties srcFile="file.properties"/&gt;</pre>
<p>or</p>
<pre>
&lt;loadproperties&gt;
&lt;file file="file.properties"/&gt;
&lt;/loadproperties&gt;</pre>
<p>Load contents of file.properties as Ant properties.</p>

<pre>
&lt;loadproperties&gt;
&lt;file file="file.properties"/&gt;
&lt;/loadproperties&gt;
</pre>
Load contents of file.properties as Ant properties.

<pre> &lt;loadproperties srcFile="file.properties"&gt;
&lt;filterchain&gt;
&lt;loadproperties srcFile="file.properties"&gt;
&lt;filterchain&gt;
&lt;<a href="../Types/filterchain.html#linecontains">linecontains</a>&gt;
&lt;contains value=&quot;import.&quot;/&gt;
&lt;contains value=&quot;import.&quot;/&gt;
&lt;/linecontains&gt;
&lt;/filterchain&gt;
&lt;/loadproperties&gt;
</pre>
Read the lines that contain the string &quot;import.&quot;
from the file &quot;file.properties&quot; and load them as
Ant properties.
&lt;/filterchain&gt;
&lt;/loadproperties&gt;</pre>
<p>Read the lines that contain the string <q>import.</q> from the file <samp>file.properties</samp>
and load them as Ant properties.</p>

<pre>
&lt;loadproperties&gt;
&lt;<a href="../Types/resources.html#gzipresource">gzipresource</a>&gt;
&lt;loadproperties&gt;
&lt;<a href="../Types/resources.html#gzipresource">gzipresource</a>&gt;
&lt;<a href="../Types/resources.html#url">url</a> url="http://example.org/url.properties.gz"/&gt;
&lt;/gzipresource&gt;
&lt;/loadproperties&gt;
</pre>
Load contents of http://example.org/url.properties.gz, uncompress it
on the fly and load the contents as Ant properties.
&lt;/gzipresource&gt;
&lt;/loadproperties&gt;</pre>
<p>Load contents of <samp>http://example.org/url.properties.gz</samp>, uncompress it on the fly and
load the contents as Ant properties.</p>

</body>
</html>

+ 30
- 38
manual/Tasks/loadresource.html View File

@@ -28,62 +28,54 @@
<p><em>Since Apache Ant 1.7</em></p>

<h3>Description</h3>
<p>
Load a text resource into a single property. Unless an encoding is
specified, the encoding of the current locale is used. Resources to
load are specified as nested <a
href="../Types/resources.html">resource</a> elements or single
element resource collections. If the resource content is empty (maybe after
processing a filterchain) the property is not set.
</p>
<p>Load a text resource into a single property. Unless an encoding is specified, the encoding of the
current locale is used. Resources to load are specified as
nested <a href="../Types/resources.html">resource</a> elements or single element resource
collections. If the resource content is empty (maybe after processing a <code>filterchain</code>)
the property is not set.</p>

<p>Since properties are immutable, the task will not change the value
of an existing property.</p>
<p>Since properties are immutable, the task will not change the value of an existing property.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">property to save to</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>property to save to</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">encoding to use when loading the resource</td>
<td align="center" valign="top">No</td>
<td>encoding</td>
<td>encoding to use when loading the resource</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Whether to halt the build on failure</td>
<td align="center" valign="top">No, default "true"</td>
<td>failonerror</td>
<td>Whether to halt the build on failure</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">Do not display a diagnostic message (unless Ant has been
invoked with the <code>-verbose</code> or <code>-debug</code>
switches) or modify the exit status to reflect an error. Setting this to
"true" implies setting failonerror to "false".
</td>
<td align="center" valign="top">No, default "false"</td>
<td>quiet</td>
<td>Do not display a diagnostic message (unless Ant has been invoked with
the <code>-verbose</code> or <code>-debug</code> switches) or modify the exit status to
reflect an error. Setting this to <q>true</q> implies setting <var>failonerror</var>
to <q>false</q>.</td>
<td>No; default is <q>false</q></td>
</tr>
</table>
<p>
The LoadResource task supports nested <a href="../Types/filterchain.html">
FilterChain</a>s.
<p>The LoadResource task supports nested <a href="../Types/filterchain.html"> FilterChain</a>s.</p>

<h3>Examples</h3>
<pre>
&lt;loadresource property="homepage"&gt;
&lt;url url="http://ant.apache.org/index.html"/&gt;
&lt;/loadresource&gt;
</pre>
Load the entry point of Ant's homepage into property "homepage"; an
<tt>&lt;echo&gt;</tt> can print this.
&lt;url url="http://ant.apache.org/index.html"/&gt;
&lt;/loadresource&gt;</pre>
<p>Load the entry point of Ant's homepage into property <code>homepage</code>;
an <code>&lt;echo&gt;</code> can print this.</p>

<p>For more examples see the <a href="loadfile.html">loadfile</a> task.</p>



+ 96
- 107
manual/Tasks/local.html View File

@@ -26,30 +26,29 @@

<h2>Local</h2>
<h3>Description</h3>
<p>Adds a local property to the current scope. Property scopes exist at Apache Ant's
various "block" levels. These include targets as well as the
<a href="parallel.html">Parallel</a> and <a href="sequential.html">Sequential</a>
task containers (including <a href="macrodef.html">Macrodef</a> bodies). A local
property at a given scope "shadows" properties of the same name at higher scopes,
including the global scope. Note that using the Local task at the global
level effectively makes the property local to the "anonymous target" in which
top-level operations are carried out; it will not be defined for other targets
in the buildfile. <em>Since Ant 1.8</em></p>
<p>Adds a local property to the current scope. Property scopes exist at Apache Ant's various "block"
levels. These include targets as well as the <a href="parallel.html">Parallel</a>
and <a href="sequential.html">Sequential</a> task containers
(including <a href="macrodef.html">Macrodef</a> bodies). A local property at a given scope "shadows"
properties of the same name at higher scopes, including the global scope. Note that using
the <code>Local</code> task at the global level effectively makes the property local to the
"anonymous target" in which top-level operations are carried out; it will not be defined for other
targets in the buildfile. <em>Since Ant 1.8</em></p>

<p>A property is made local if the <code>&lt;local&gt;</code> task
precedes its definition. See the examples section.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The property to declare in the current scope</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The property to declare in the current scope</td>
<td>Yes</td>
</tr>
</table>

@@ -58,19 +57,18 @@ in the buildfile. <em>Since Ant 1.8</em></p>
<h4>Temporarily shadow a global property's value</h4>

<pre>
&lt;property name="foo" value="foo"/&gt;
&lt;property name="foo" value="foo"/&gt;

&lt;target name="step1"&gt;
&lt;echo&gt;Before local: foo is ${foo}&lt;/echo&gt;
&lt;local name="foo"/&gt;
&lt;property name="foo" value="bar"/&gt;
&lt;echo&gt;After local: foo is ${foo}&lt;/echo&gt;
&lt;/target&gt;
&lt;target name="step1"&gt;
&lt;echo&gt;Before local: foo is ${foo}&lt;/echo&gt;
&lt;local name="foo"/&gt;
&lt;property name="foo" value="bar"/&gt;
&lt;echo&gt;After local: foo is ${foo}&lt;/echo&gt;
&lt;/target&gt;

&lt;target name="step2" depends="step1"&gt;
&lt;echo&gt;In step2: foo is ${foo}&lt;/echo&gt;
&lt;/target&gt;
</pre>
&lt;target name="step2" depends="step1"&gt;
&lt;echo&gt;In step2: foo is ${foo}&lt;/echo&gt;
&lt;/target&gt;</pre>

<p>outputs</p>

@@ -80,106 +78,97 @@ step1:
[echo] After local: foo is bar

step2:
[echo] In step2: foo is foo
</pre>
[echo] In step2: foo is foo</pre>

<p>here the local-task shadowed the global definition
of <code>foo</code> for the remainder of the target step1.</p>
<p>here the <code>local</code> task shadowed the global definition of <code>foo</code> for the
remainder of the target <q>step1</q>.</p>

<h4>Creating thread local properties</h4>

<pre>
&lt;property name="foo" value="foo"/&gt;

&lt;parallel&gt;
&lt;echo&gt;global 1: foo is ${foo}&lt;/echo&gt;
&lt;sequential&gt;
&lt;local name="foo"/&gt;
&lt;property name="foo" value="bar.1"/&gt;
&lt;echo&gt;First sequential: foo is ${foo}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;sequential&gt;
&lt;sleep seconds="1"/&gt;
&lt;echo&gt;global 2: foo is ${foo}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;sequential&gt;
&lt;local name="foo"/&gt;
&lt;property name="foo" value="bar.2"/&gt;
&lt;echo&gt;Second sequential: foo is ${foo}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;echo&gt;global 3: foo is ${foo}&lt;/echo&gt;
&lt;/parallel&gt;
</pre>
&lt;property name="foo" value="foo"/&gt;

&lt;parallel&gt;
&lt;echo&gt;global 1: foo is ${foo}&lt;/echo&gt;
&lt;sequential&gt;
&lt;local name="foo"/&gt;
&lt;property name="foo" value="bar.1"/&gt;
&lt;echo&gt;First sequential: foo is ${foo}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;sequential&gt;
&lt;sleep seconds="1"/&gt;
&lt;echo&gt;global 2: foo is ${foo}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;sequential&gt;
&lt;local name="foo"/&gt;
&lt;property name="foo" value="bar.2"/&gt;
&lt;echo&gt;Second sequential: foo is ${foo}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;echo&gt;global 3: foo is ${foo}&lt;/echo&gt;
&lt;/parallel&gt;</pre>

<p>outputs something similar to</p>

<pre>
[echo] global 3: foo is foo
[echo] global 1: foo is foo
[echo] First sequential: foo is bar.1
[echo] Second sequential: foo is bar.2
[echo] global 2: foo is foo
</pre>
[echo] global 3: foo is foo
[echo] global 1: foo is foo
[echo] First sequential: foo is bar.1
[echo] Second sequential: foo is bar.2
[echo] global 2: foo is foo</pre>

<h4>Use inside macrodef</h4>
<h4>Use inside <code>macrodef</code></h4>

<p>This probably is where local can be applied in the most useful
way. If you needed a "temporary property" inside a macrodef in Ant
prior to Ant 1.8.0 you had to try to come up with a property name
that would be unique across macro invocations.</p>
<p>This probably is where <code>local</code> can be applied in the most useful way. If you needed a
"temporary property" inside a <code>macrodef</code> in Ant prior to Ant 1.8.0 you had to try to come
up with a property name that would be unique across macro invocations.</p>

<p>Say you wanted to write a macro that created the parent directory
of a given file. A naive approach would be:</p>
<p>Say you wanted to write a macro that created the parent directory of a given file. A naive
approach would be:</p>

<pre>
&lt;macrodef name="makeparentdir"&gt;
&lt;attribute name="file"/&gt;
&lt;sequential&gt;
&lt;dirname property="parent" file="@{file}"/&gt;
&lt;mkdir dir="${parent}"/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
&lt;makeparentdir file="some-dir/some-file"/&gt;
</pre>

<p>but this would create a global property "parent" on the first
invocation - and since properties are not mutable, any subsequent
invocation will see the same value and try to create the same
directory as the first invocation.</p>

<p>The recommendation prior to Ant 1.8.0 was to use a property name
based on one of the macro's attributes, like</p>
&lt;macrodef name="makeparentdir"&gt;
&lt;attribute name="file"/&gt;
&lt;sequential&gt;
&lt;dirname property="parent" file="@{file}"/&gt;
&lt;mkdir dir="${parent}"/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
&lt;makeparentdir file="some-dir/some-file"/&gt;</pre>

<p>but this would create a global property <code>parent</code> on the first invocation&mdash;and
since properties are not mutable, any subsequent invocation will see the same value and try to
create the same directory as the first invocation.</p>

<p>The recommendation prior to Ant 1.8.0 was to use a property name based on one of the macro's
attributes, like</p>

<pre>
&lt;macrodef name="makeparentdir"&gt;
&lt;attribute name="file"/&gt;
&lt;sequential&gt;
&lt;dirname property="parent.@{file}" file="@{file}"/&gt;
&lt;mkdir dir="${parent.@{file}}"/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>

<p>Now invocations for different files will set different properties
and the directories will get created. Unfortunately this "pollutes"
the global properties space. In addition it may be hard to come up
with unique names in some cases.</p>
&lt;macrodef name="makeparentdir"&gt;
&lt;attribute name="file"/&gt;
&lt;sequential&gt;
&lt;dirname property="parent.@{file}" file="@{file}"/&gt;
&lt;mkdir dir="${parent.@{file}}"/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;</pre>

<p>Now invocations for different files will set different properties and the directories will get
created. Unfortunately this "pollutes" the global properties space. In addition, it may be hard to
come up with unique names in some cases.</p>

<p>Enter <code>&lt;local&gt;</code>:</p>

<pre>
&lt;macrodef name="makeparentdir"&gt;
&lt;attribute name="file"/&gt;
&lt;sequential&gt;
&lt;local name="parent"/&gt;
&lt;dirname property="parent" file="@{file}"/&gt;
&lt;mkdir dir="${parent}"/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>

<p>Each invocation gets its own property name "parent" and there will
be no global property of that name at all.</p>
&lt;macrodef name="makeparentdir"&gt;
&lt;attribute name="file"/&gt;
&lt;sequential&gt;
&lt;local name="parent"/&gt;
&lt;dirname property="parent" file="@{file}"/&gt;
&lt;mkdir dir="${parent}"/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;</pre>

<p>Each invocation gets its own property named <code>parent</code> and there will be no global
property of that name at all.</p>

</body>
</html>

+ 154
- 232
manual/Tasks/macrodef.html View File

@@ -26,267 +26,204 @@

<h2 id="macrodef">MacroDef</h2>
<h3>Description</h3>
<p>
This defines a new task using a <code>&lt;sequential&gt;</code>
nested task as a template. Nested elements <code>&lt;attribute&gt;</code> and
<code>&lt;element&gt;</code> are used to specify attributes and elements of
the new task. These get substituted into the <code>&lt;sequential&gt;</code>
task when the new task is run.
</p>
<p>This defines a new task using a <code>&lt;sequential&gt;</code> nested task as a
template. Nested elements <code>&lt;attribute&gt;</code> and <code>&lt;element&gt;</code> are
used to specify attributes and elements of the new task. These get substituted into
the <code>&lt;sequential&gt;</code> task when the new task is run.</p>
<h3>Note</h3>
<p>
You can also use <i>prior defined</i> attributes for default-values in
other attributes. See the examples.
</p>
<p>
<em>since Apache Ant 1.6</em>
</p>
<p>You can also use <em>prior defined</em> attributes for <var>default</var> values in other
attributes. See the examples.</p>
<p><em>since Apache Ant 1.6</em></p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name of the new definition.</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The name of the new definition.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">uri</td>
<td valign="top">
<td>uri</td>
<td>
The uri that this definition should live in.
</td>
<td valign="top" align="center">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">description</td>
<td valign="top">A description of the macrodef
<td>description</td>
<td>A description of the macrodef
(for documentation purposes only).
</td>
<td valign="top" align="center">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">backtrace</td>
<td valign="top">
This controls the error traceback if there is an
error detected when running the macro. If this is
set to true, there will be an error trackback, if false
there will not be one. <em>Since Ant 1.7</em>.
</td>
<td valign="top" align="center">No; default <em>true</em></td>
<td>backtrace</td>
<td>This controls the error traceback if there is an error detected when running the
macro. If this is set to <q>true</q>, there will be an error trackback, if <q>false</q>
there will be none. <em>Since Ant 1.7</em>.</td>
<td>No; default <q>true</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h3>Parameters specified as nested elements</h3>
<h4>attribute</h4>
<p>
This is used to specify attributes of the new task. The values
of the attributes get substituted into the templated task.
The attributes will be required attributes unless a default
value has been set.
</p>
<p>
This attribute is placed in the body of the templated
task using a notation similar to the Ant property notation
- @{attribute name}. (May be remembered as "put the substitution
AT this location").
</p>
<p>
The escape sequence @@ is used to escape @. This allows @{x} to be
placed in the text without substitution of x by using @@{x}.
This corresponds to the $$ escape sequence for properties.
</p>
<p>
The case of the attribute is ignored, so @{myAttribute} is treated the
same as @{MyAttribute}.
</p>
<p>This is used to specify attributes of the new task. The values of the attributes get
substituted into the templated task. The attributes will be required attributes unless a
default value has been set.</p>
<p>This attribute is placed in the body of the templated task using a notation similar to the
Ant property notation&mdash;<code>@{attribute name}</code>. (May be remembered as "put the
substitution AT this location").</p>
<p>The escape sequence <code>@@</code> is used to escape <code>@</code>. This
allows <code>@{x}</code> to be placed in the text without substitution of <code>x</code> by
using <code>@@{x}</code>. This corresponds to the <code>$$</code> escape sequence for
properties.</p>
<p>The case of the attribute is ignored, so <code>@{myAttribute}</code> is treated the same
as <code>@{MyAttribute}</code>.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name of the new attribute</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The name of the new attribute</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">default</td>
<td valign="top">
The default value of the attribute.
</td>
<td valign="top" align="center">No</td>
<td>default</td>
<td>The default value of the attribute.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">description</td>
<td valign="top">
This contains a description of the attribute.
<em>Since Ant 1.6.1</em>
</td>
<td valign="top" align="center">No</td>
<td>description</td>
<td>This contains a description of the attribute. <em>Since Ant 1.6.1</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">doubleexpanding</td>
<td valign="top">
Controls whether or not property references in the attribute are expanded twice or just once.
See the <a href="http://ant.apache.org/faq.html#macrodef-property-expansion">FAQ</a> for details.
<em>Since Ant 1.8.3</em>
</td>
<td valign="top" align="center">No; default true</td>
<td>doubleexpanding</td>
<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>
<td>No; default is <q>true</q></td>
</tr>
</table>
<h4>element</h4>
<p>
This is used to specify nested elements of the new task.
The contents of the nested elements of the task instance
are placed in the templated task at the tag name.
</p>
<p>
The case of the element name is ignored.
</p>
<p>This is used to specify nested elements of the new task. The contents of the nested elements
of the task instance are placed in the templated task at the tag name.</p>
<p>The case of the <code>element</code> name is ignored.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name of the element</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The name of the element.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">optional</td>
<td valign="top">
If true this nested element is optional. Default is
false - i.e the nested element is required in
the new task.
</td>
<td valign="top" align="center">No</td>
<td>optional</td>
<td>If <q>true</q> this nested element is optional.</td>
<td>No; default is <q>false</q>&mdash;the nested element is required in the new task</td>
</tr>
<tr>
<td valign="top">implicit</td>
<td valign="top">
If true this nested element is implicit. This means that
any nested elements of the macrodef instance will be placed
in the element indicated by the name of this element.
There can only be one element if an element is implicit.
The default value is false. <em>Since Ant 1.6.2</em>
</td>
<td valign="top" align="center">No</td>
<td>implicit</td>
<td>If <q>true</q> this nested element is implicit. This means that any nested elements of
the <code>macrodef</code> instance will be placed in the element indicated by the name of
this element. There can only be one element if an element is implicit. <em>Since Ant
1.6.2</em></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">description</td>
<td valign="top">
This contains a description
informing the user what the contents of the element are expected to be.
<em>Since Ant 1.6.1</em>
</td>
<td valign="top" align="center">No</td>
<td>description</td>
<td>This contains a description informing the user what the contents of the element are
expected to be. <em>Since Ant 1.6.1</em></td>
<td>No</td>
</tr>
</table>
<h4>text</h4>
<p>
This is used to specify the treatment of text contents of the macro invocation.
If this element is not present, then any nested text in the macro invocation
will be an error. If the text element is present, then the name
becomes an attribute that gets set to the nested text of the macro invocation.
<em>Since Ant 1.6.1</em>.
</p>
<p>
The case of the text name is ignored.
</p>
<p>This is used to specify the treatment of text contents of the macro invocation. If this
element is not present, then any nested text in the macro invocation will be an error. If
the <code>text</code> element is present, then the name becomes an attribute that gets set to
the nested text of the macro invocation. <em>Since Ant 1.6.1</em>.</p>
<p>The case of the <code>text</code> name is ignored.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name of the text attribute</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>The name of the text attribute.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">optional</td>
<td valign="top">
If true nested text in the macro is optional, default is "false".
</td>
<td valign="top" align="center">No</td>
<td>optional</td>
<td>If <q>true</q> nested text in the macro is optional.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">trim</td>
<td valign="top">
If true, the nested text is trimmed of white space,
default is "false".
</td>
<td valign="top" align="center">No</td>
<td>trim</td>
<td>If <q>true</q>, the nested text is trimmed of white space.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">description</td>
<td valign="top">
This contains a description
informing the user what the nested text of the macro is expected
to be.
</td>
<td valign="top" align="center">No</td>
<td>description</td>
<td>This contains a description informing the user what the nested text of the macro is
expected to be.</td>
<td>No</td>
</tr>
</table>

<h3>Examples</h3>
<p>
The following example defined a task called testing and
runs it.
</p>
<pre class=code>
<p>The following example defined a task called testing and runs it.</p>
<pre class="code">
&lt;macrodef name="testing"&gt;
&lt;attribute name="v" default="NOT SET"/&gt;
&lt;element name="some-tasks" optional="yes"/&gt;
&lt;sequential&gt;
&lt;echo&gt;v is @{v}&lt;/echo&gt;
&lt;some-tasks/&gt;
&lt;/sequential&gt;
&lt;attribute name="v" default="NOT SET"/&gt;
&lt;element name="some-tasks" optional="yes"/&gt;
&lt;sequential&gt;
&lt;echo&gt;v is @{v}&lt;/echo&gt;
&lt;some-tasks/&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;

&lt;testing v="This is v"&gt;
&lt;some-tasks&gt;
&lt;echo&gt;this is a test&lt;/echo&gt;
&lt;/some-tasks&gt;
&lt;/testing&gt;
</pre>
<p>
The following fragment defines a task called <code>&lt;call-cc&gt;</code> which
take the attributes "target", "link" and "target.dir" and the
nested element "cc-elements". The body of the task
uses the <code>&lt;cc&gt;</code> task from the
<a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> project.
</p>
<pre class="code">
&lt;some-tasks&gt;
&lt;echo&gt;this is a test&lt;/echo&gt;
&lt;/some-tasks&gt;
&lt;/testing&gt;</pre>
<p>The following fragment defines a task called <code>&lt;call-cc&gt;</code> which take the
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>&lt;cc&gt;</code> task
from the <a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> project.</p>
<pre class="code">
&lt;macrodef name="call-cc"&gt;
&lt;attribute name="target"/&gt;
&lt;attribute name="link"/&gt;
&lt;attribute name="target.dir"/&gt;
&lt;element name="cc-elements"/&gt;
&lt;sequential&gt;
&lt;mkdir dir="${obj.dir}/@{target}"/&gt;
&lt;mkdir dir="@{target.dir}"/&gt;
&lt;cc link="@{link}" objdir="${obj.dir}/@{target}"
outfile="@{target.dir}/@{target}"&gt;
&lt;attribute name="target"/&gt;
&lt;attribute name="link"/&gt;
&lt;attribute name="target.dir"/&gt;
&lt;element name="cc-elements"/&gt;
&lt;sequential&gt;
&lt;mkdir dir="${obj.dir}/@{target}"/&gt;
&lt;mkdir dir="@{target.dir}"/&gt;
&lt;cc link="@{link}" objdir="${obj.dir}/@{target}"
outfile="@{target.dir}/@{target}"&gt;
&lt;compiler refid="compiler.options"/&gt;
&lt;cc-elements/&gt;
&lt;/cc&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>
This then can be used as follows:
</p>
<pre class="code">
&lt;/cc&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;</pre>
<p>This then can be used as follows:</p>
<pre class="code">
&lt;call-cc target="unittests" link="executable"
target.dir="${build.bin.dir}"&gt;
&lt;cc-elements&gt;
@@ -296,14 +233,10 @@
&lt;fileset dir="${gen.dir}" includes = "*.cpp"/&gt;
&lt;linker refid="linker-libs"/&gt;
&lt;/cc-elements&gt;
&lt;/call-cc&gt;
</pre>
<p>
The following fragment shows &lt;call-cc&gt;, but this time
using an implicit element and with the link and target.dir arguments
having default values.
</p>
<pre class="code">
&lt;/call-cc&gt;</pre>
<p>The following fragment shows &lt;call-cc&gt;, but this time using an implicit element and
with the <var>link</var> and <var>target.dir</var> arguments having default values.</p>
<pre class="code">
&lt;macrodef name="call-cc"&gt;
&lt;attribute name="target"/&gt;
&lt;attribute name="link" default="executable"/&gt;
@@ -314,17 +247,13 @@
&lt;mkdir dir="@{target.dir}"/&gt;
&lt;cc link="@{link}" objdir="${obj.dir}/@{target}"
outfile="@{target.dir}/@{target}"&gt;
&lt;compiler refid="compiler.options"/&gt;
&lt;cc-elements/&gt;
&lt;compiler refid="compiler.options"/&gt;
&lt;cc-elements/&gt;
&lt;/cc&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>
This then can be used as follows, note that &lt;cc-elements&gt;
is not specified.
</p>
<pre class="code">
&lt;/macrodef&gt;</pre>
<p>This then can be used as follows, note that &lt;cc-elements&gt; is not specified.</p>
<pre class="code">
&lt;call-cc target="unittests"&gt;
&lt;includepath location="${gen.dir}"/&gt;
&lt;includepath location="test"/&gt;
@@ -332,11 +261,9 @@
&lt;fileset dir="${gen.dir}" includes = "*.cpp"/&gt;
&lt;linker refid="linker-libs"/&gt;
&lt;/call-cc&gt;
</pre>
<p>
The following shows the use of the <code>text</code> element.
</p>
<pre class="code">
</pre>
<p>The following shows the use of the <code>text</code> element.</p>
<pre class="code">
&lt;macrodef name="echotest"&gt;
&lt;text name="text"/&gt;
&lt;sequential&gt;
@@ -346,25 +273,20 @@
&lt;echotest&gt;
Hello world
&lt;/echotest&gt;
</pre>
<p>
The following uses a prior defined attribute for setting the
default value of another. The output would be
<tt>one=test two=test</tt>. If you change the order of lines
*1 and *2 the output would be <tt>one=test two=@{one}</tt>,
because while processing the <i>two</i>-line the value for
<i>one</i> is not set.
</p>
<pre class="code">
</pre>
<p>The following uses a prior defined attribute for setting the default value of another. The
output would be <code>one=test two=test</code>. If you change the order of lines *1 and *2 the
output would be <code>one=test two=@{one}</code>, because while processing
the <var>two</var>-line the value for <var>one</var> is not set.</p>
<pre class="code">
&lt;macrodef name="test"&gt;
&lt;attribute name="one"/&gt; <b>*1</b>
&lt;attribute name="two" default="@{one}"/&gt; <b>*2</b>
&lt;attribute name="one"/&gt; <strong>*1</strong>
&lt;attribute name="two" default="@{one}"/&gt; <strong>*2</strong>
&lt;sequential&gt;
&lt;echo&gt;one=@{one} two=@{two}&lt;/echo&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;
&lt;test one="test"/&gt;
</pre>
&lt;test one="test"/&gt;</pre>

</body>
</html>

+ 161
- 200
manual/Tasks/mail.html View File

@@ -26,282 +26,247 @@

<h2 id="mail">Mail</h2>
<h3>Description</h3>
<p>
A task to send SMTP email.
</p>
<p>
This task can send mail using either plain
text, UU encoding, or MIME format mail, depending on what is available.
</p>
<p>
SMTP auth and SSL/TLS require JavaMail and are only available in MIME format.
</p>
<p>
Attachments may be sent using nested
<code>&lt;attachments&gt;</code> elements, which are <a
href="../using.html#path">path-like structures</a>. This means
any filesystem based <a
href="../Types/resources.html">resource</a> or resource
collection can be used to point to attachments. Prior to Apache Ant 1.7
only <code>&lt;fileset&gt;</code> has been supported as a nested
element, you can still use this directly without an
<code>&lt;attachments&gt;</code> container.
</p>
<p>
<strong>Note</strong>: This task may depend on external libraries
that are not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library Dependencies</a>
for more information.
</p>
<p>A task to send SMTP email.</p>
<p>This task can send mail using either plain text, UU encoding, or MIME format mail, depending on
what is available.</p>
<p>SMTP auth and SSL/TLS require JavaMail and are only available in MIME format.</p>
<p>Attachments may be sent using nested <code>&lt;attachments&gt;</code> elements, which
are <a href="../using.html#path">path-like structures</a>. This means any filesystem
based <a href="../Types/resources.html">resource</a> or resource collection can be used to point to
attachments. Prior to Apache Ant 1.7 only <code>&lt;fileset&gt;</code> has been supported as a
nested element, you can still use this directly without an <code>&lt;attachments&gt;</code>
container.</p>
<p><strong>Note</strong>: This task may depend on external libraries that are not included in the
Ant distribution. See <a href="../install.html#librarydependencies">Library Dependencies</a> for
more information.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">from</td>
<td valign="top">Email address of sender.</td>
<td align="center" valign="top">Either a <code>from</code> attribute, or a <code>&lt;from&gt;</code>
element.</td>
<td>from</td>
<td>Email address of sender.</td>
<td>Either a <var>from</var> attribute, or a <code>&lt;from&gt;</code> element.</td>
</tr>
<tr>
<td valign="top">replyto</td>
<td valign="top">Replyto email address.</td>
<td align="center" valign="top">No</td>
<td>replyto</td>
<td>Reply-to email address.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">tolist</td>
<td valign="top">Comma-separated list of recipients.</td>
<td align="center" valign="middle" rowspan="3">At least one of these, or the
equivalent nested elements</td>
<td>tolist</td>
<td>Comma-separated list of recipients.</td>
<td rowspan="3">At least one of these, or the equivalent nested elements</td>
</tr>
<tr>
<td valign="top">cclist</td>
<td valign="top">Comma-separated list of recipients to carbon copy</td>
<td>cclist</td>
<td class="left">Comma-separated list of recipients to carbon copy</td>
</tr>
<tr>
<td valign="top">bcclist</td>
<td valign="top">Comma-separated list of recipients to blind carbon copy
<td>bcclist</td>
<td class="left">Comma-separated list of recipients to blind carbon copy
</td>
</tr>
<tr>
<td valign="top">message</td>
<td valign="top">Message to send in the body of the email.</td>
<td align="center" valign="middle" rowspan="2">One of these or a
<code>&lt;message&gt;</code> element.</td>
<td>message</td>
<td>Message to send in the body of the email.</td>
<td rowspan="2">One of these or a <code>&lt;message&gt;</code> element.</td>
</tr>
<tr>
<td valign="top">messagefile</td>
<td valign="top">File to send as the body of the email. Property
values in the file will be expanded.</td>
<td>messagefile</td>
<td class="left">File to send as the body of the email. Property values in the file will be
expanded.</td>
</tr>
<tr>
<td valign="top">messagefileinputencoding</td>
<td valign="top">
Specifies the encoding of the input file. Please see
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html">
Supported Encodings</a> for a list of possible
values. Defaults to the platform's default character
encoding. <em>Since Ant 1.9.4</em>
<td>messagefileinputencoding</td>
<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>
</td>
<td valign="top" align="center">No</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td valign="top">messagemimetype</td>
<td valign="top">The content type of the message. The default is
<code>text/plain</code>.</td>
<td align="center" valign="top">No</td>
<td>messagemimetype</td>
<td>The content type of the message.</td>
<td>No; default is <q>text/plain</q></td>
</tr>
<tr>
<td valign="top">files</td>
<td valign="top">Files to send as attachments to the email. Separate multiple
file names using a comma or space. You can also use <code>&lt;fileset&gt;</code>
elements to specify files.</td>
<td align="center" valign="top">No</td>
<td>files</td>
<td>Files to send as attachments to the email. Separate multiple file names using a comma or
space. You can also use <code>&lt;fileset&gt;</code> elements to specify files.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">flag to indicate whether to halt the build on
any error. The default value is <code>true</code>.</td>
<td align="center" valign="top">No.</td>
<td>failonerror</td>
<td>flag to indicate whether to halt the build on any error.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">includefilenames</td>
<td valign="top">Include filename(s) before file contents.
Valid only when the <code>plain</code> encoding is used. The default
value is <code>false</code>.</td>
<td align="center" valign="top">No</td>
<td>includefilenames</td>
<td>Include filename(s) before file contents.</td>
<td>No; default is <q>false</q>, ignored unless <q>plain</q> encoding is used</td>
</tr>
<tr>
<td valign="top">mailhost</td>
<td valign="top">Host name of the SMTP server. The default value is
<code>localhost</code>.</td>
<td align="center" valign="top">No</td>
<td>mailhost</td>
<td>Host name of the SMTP server.</td>
<td>No; default is <q>localhost</q></td>
</tr>
<tr>
<td valign="top">mailport</td>
<td valign="top">TCP port of the SMTP server. The default value is 25.</td>
<td align="center" valign="top">No</td>
<td>mailport</td>
<td>TCP port of the SMTP server.</td>
<td>No; default is <q>25</q></td>
</tr>
<tr>
<td valign="top">user</td>
<td valign="top">user name for SMTP auth</td>
<td valign="center">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>user</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>
</tr>
<tr>
<td valign="top">password</td>
<td valign="top">password for SMTP auth</td>
<td valign="center">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>password</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>
</tr>
<tr>
<td valign="top">ssl</td>
<td valign="top">"true", "on" or "yes" accepted here<br>
indicates whether you need TLS/SSL</td>
<td align="center" valign="top">No</td>
<td>ssl</td>
<td><q>true</q>, <q>on</q>, or <q>yes</q> accepted here<br/>indicates whether you need
TLS/SSL</td>
<td>No</td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">Specifies the encoding to use for the content of the email.
Values are <code>mime</code>, <code>uu</code>, <code>plain</code>, or
<code>auto</code>. The default value is <code>auto</code>.
<code>uu</code> or <code>plain</code> are not compatible with SMTP auth</td>
<td align="center" valign="top">No</td>
<td>encoding</td>
<td>Specifies the encoding to use for the content of the email. Values
are <q>mime</q>, <q>uu</q>, <q>plain</q>, or <q>auto</q>. <q>uu</q> or <q>plain</q> are not
compatible with SMTP auth</td>
<td>No; default is <q>auto</q></td>
</tr>
<tr>
<td valign="top">charset</td>
<td valign="top">Character set of the email.<br>
You can also set the charset in the message nested element.<br>
These options are mutually exclusive.</td>
<td align="center" valign="top">No</td>
<td>charset</td>
<td>Character set of the email.<br/>You can also set the <var>charset</var> in
the <code>message</code> nested element.<br> These options are mutually exclusive.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">subject</td>
<td valign="top">Email subject line.</td>
<td align="center" valign="top">No</td>
<td>subject</td>
<td>Email subject line.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">ignoreInvalidRecipients</td>
<td valign="top">Boolean. Whether the task should try to send
the message to as many recipients as possible and should only
fail if neither is reachable. <em>Since Ant 1.8.0</em>.</td>
<td align="center" valign="top">No, default is false</td>
<td>ignoreInvalidRecipients</td>
<td>(boolean) Whether the task should try to send the message to as many recipients as possible
and should only fail if neither is reachable. <em>Since Ant 1.8.0</em>.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">enableStartTLS</td>
<td valign="top">"true", "on" or "yes" accepted here<br>
whether the STARTTLS command used to switch to an encrypted
connection for authentication should be supported. Requires
JavaMail. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No</td>
<td>enableStartTLS</td>
<td>(boolean) Whether the <code>STARTTLS</code> command used to switch to an encrypted
connection for authentication should be supported. Requires JavaMail. <em>Since Ant
1.8.0</em></td>
<td>No</td>
</tr>
</table>

<h3>Note regarding the attributes containing email addresses</h3>
Since Ant 1.6, the attributes from, replyto, tolist, cclist, bcclist
can contain email addresses of the form :
<p><em>Since Ant 1.6</em>, the
attributes <var>from</var>, <var>replyto</var>, <var>tolist</var>, <var>cclist</var>, <var>bcclist</var>
can contain email addresses of the form:</p>
<ul>
<li>address@xyz.com</li>
<li>name &lt;address@xyz.com&gt;</li>
<li>&lt;address@xyz.com&gt; name</li>
<li>(name) address@xyz.com</li>
<li>address@xyz.com (name)</li>
<li><samp>address@xyz.com</samp></li>
<li><samp>name &lt;address@xyz.com&gt;</samp></li>
<li><samp>&lt;address@xyz.com&gt; name</samp></li>
<li><samp>(name) address@xyz.com</samp></li>
<li><samp>address@xyz.com (name)</samp></li>
</ul>
<p>You need to enter the angle brackets as XML entities
<code>&amp;gt;</code> and <code>&amp;lt;</code>.</p>
<p>You need to enter the angle brackets as XML entities <q>&amp;gt;</q> and <q>&amp;lt;</q>.</p>

<h3>Parameters specified as nested elements</h3>

<h4>to / cc / bcc / from/ replyto</h4>
<p>Adds an email address element. It takes the following attributes:</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The display name for the address.</td>
<td align="center" valign="top">No</td>
<td>name</td>
<td>The display name for the address.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">address</td>
<td valign="top">The email address.</td>
<td align="center" valign="top">Yes</td>
<td>address</td>
<td>The email address.</td>
<td>Yes</td>
</tr>
</table>

<h4>message</h4>

<p>Specifies the message to include in the email body. It takes the following
attributes:</p>
<p>Specifies the message to include in the email body. It takes the following attributes:</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">src</td>
<td valign="top">The file to use as the message.</td>
<td align="center" valign="top">No</td>
<td>src</td>
<td>The file to use as the message.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">mimetype</td>
<td valign="top">The content type to use for the message.</td>
<td align="center" valign="top">No</td>
<td>mimetype</td>
<td>The content type to use for the message.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">charset</td>
<td valign="top">Character set of the message<br>
You can also set the charset as attribute of the enclosing mail task.<br>
These options are mutually exclusive.</td>
<td align="center" valign="top">No</td>
<td>charset</td>
<td>Character set of the message<br/>You can also set the <var>charset</var> as attribute of the
enclosing <code>mail</code> task.<br> These options are mutually exclusive.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">inputencoding</td>
<td valign="top">
Specifies the encoding of the input file. Please see
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html">
Supported Encodings</a> for a list of possible
values. Defaults to the platform's default character
encoding. <em>Since Ant 1.9.4</em>
<td>inputencoding</td>
<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>
</td>
<td valign="top" align="center">No</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
</table>

<p>If the <code>src</code> attribute is not specified, then text can be added
inside the <code>&lt;message&gt;</code> element. Property expansion will occur
in the message, whether it is specified as an external file or as text within
the <code>&lt;message&gt;</code> element.</p>
<p>If the <var>src</var> attribute is not specified, then text can be added inside
the <code>&lt;message&gt;</code> element. Property expansion will occur in the message, whether it
is specified as an external file or as text within the <code>&lt;message&gt;</code> element.</p>

<h4>header</h4>
<p><em>Since Ant 1.7</em>, arbitrary mail headers can be added by
specifying these attributes on one or more nested header elements:</p>
<p><em>Since Ant 1.7</em>, arbitrary mail headers can be added by specifying these attributes on one
or more nested header elements:</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">The name associated with this mail header.</td>
<td align="center" valign="top">Yes</td>
<td>name</td>
<td>The name associated with this mail header.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">The value to assign to this mail header.</td>
<td align="center" valign="top">Yes</td>
<td>value</td>
<td>The value to assign to this mail header.</td>
<td>Yes</td>
</tr>
</table>

@@ -313,12 +278,10 @@ the <code>&lt;message&gt;</code> element.</p>
&lt;mail from=&quot;me&quot;
tolist=&quot;you&quot;
subject=&quot;Results of nightly build&quot;
files=&quot;build.log&quot;/&gt;
</pre>
files=&quot;build.log&quot;/&gt;</pre>

<p>Sends an email from <i>me</i> to <i>you</i> with a subject of
<i>Results of nightly build</i> and includes the contents of the file
<i>build.log</i> in the body of the message.</p>
<p>Sends an email from <q>me</q> to <q>you</q> with a subject of <q>Results of nightly build</q> and
includes the contents of the file <samp>build.log</samp> in the body of the message.</p>

<pre>
&lt;mail mailhost=&quot;smtp.myisp.com&quot; mailport=&quot;1025&quot; subject=&quot;Test build&quot;&gt;
@@ -331,15 +294,14 @@ the <code>&lt;message&gt;</code> element.</p>
&lt;include name=&quot;**/*.zip&quot;/&gt;
&lt;/fileset&gt;
&lt;/attachments&gt;
&lt;/mail&gt;
</pre>
&lt;/mail&gt;</pre>

<p>Sends an eMail from <i>config@myisp.com</i> to <i>all@xyz.com</i> with a subject of
<i>Test Build</i>. Replies to this email will go to <i>me@myisp.com</i>.
Any zip files from the dist directory are attached. The
task will attempt to use JavaMail and fall back to UU encoding or no encoding in
that order depending on what support classes are available. <code>${buildname}</code>
will be replaced with the <code>buildname</code> property's value.</p>
<p>Sends an eMail from <q>config@myisp.com</q> to <q>all@xyz.com</q> with a subject of <q>Test
Build</q>. Replies to this email will go to <q>me@myisp.com</q>. Any zip files from
the <samp>dist</samp> directory are attached. The task will attempt to use JavaMail and fall back to
UU encoding or no encoding in that order depending on what support classes are
available. <samp>${buildname}</samp> will be replaced with the <code>buildname</code> property's
value.</p>

<pre>
&lt;property name=&quot;line2&quot; value=&quot;some_international_message&quot;/&gt;
@@ -349,11 +311,10 @@ will be replaced with the <code>buildname</code> property's value.</p>
&lt;from address=&quot;me@myist.com&quot;/&gt;
&lt;to address=&quot;all@xyz.com&quot;/&gt;
&lt;message&gt;some international text:${line2}&lt;/message&gt;
&lt;/mail&gt;
</pre>
&lt;/mail&gt;</pre>

<p>Sends an eMail from <i>me@myisp.com</i> to <i>all@xyz.com</i> with a subject of
<i>Test Build</i>, the message body being coded in UTF-8
<p>Sends an eMail from <q>me@myisp.com</q> to <q>all@xyz.com</q> with a subject of <q>Test
Build</q>, the message body being coded in UTF-8.

</body>
</html>

+ 33
- 74
manual/Tasks/makeurl.html View File

@@ -26,98 +26,57 @@

<h2>Makeurl Task</h2>
<h3 id="description">Description</h3>
This task takes one or more filenames and turns them into URLs, which it then assigns to a property.
Useful when setting up RMI or JNLP codebases, for example.
Nested filesets are supported; if present, these are turned into the URLs with the supplied separator between them (default: space).
<p>Examples:</p>
<pre>
&lt;makeurl file="${user.home}/.m2/repository" property="m2.repository.url"/&gt;
</pre>
Sets the property <code>m2.repository.url</code> to the file: URL of the local Maven2 repository.
<pre>
&lt;makeurl property="codebase"&gt;&lt;fileset dir="lib includes="*.jar"/&gt;&lt;/makeurl&gt;
</pre>
Set the property <code>codebase</code> to the three URLs of the files provided as nested elements.
<p>This task takes one or more filenames and turns them into URLs, which it then assigns to a
property. Useful when setting up RMI or JNLP codebases, for example. Nested filesets are
supported; if present, these are turned into the URLs with the supplied <var>separator</var> between
them.</p>
<h3 id="attributes">Parameters</h3>
<table>
<tr>
<td valign="top" align="left">
<b>Attribute</b>
</td>
<td valign="top" align="left">
<b>Description</b>
</td>
<td valign="top" align="left">
<b>Type</b>
</td>
<td valign="top" align="left">
<b>Requirement</b>
</td>
<th>Attribute</th>
<th>Description</th>
<th>Type</th>
<th>Required</th>
</tr>
<tr>
<td valign="top" align="left">
file
</td>
<td valign="top" align="left">
name of a file to be converted into a URL
</td>
<td valign="top" align="left">
File
</td>
<td valign="top" align="left">
optional, if a nested fileset or path is supplied
</td>
<td>file</td>
<td>name of a file to be converted into a URL</td>
<td>File</td>
<td>No, if a nested fileset or path is supplied</td>
</tr>
<tr>
<td valign="top" align="left">
property
</td>
<td valign="top" align="left">
name of a property to set to the URL
</td>
<td valign="top" align="left">
String
</td>
<td valign="top" align="left">
required
</td>
<td>property</td>
<td>name of a property to set to the URL</td>
<td>String</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top" align="left">
separator
</td>
<td valign="top" align="left">
separator for the multi-URL option
</td>
<td valign="top" align="left">
String
</td>
<td valign="top" align="left">
optional
</td>
<td>separator</td>
<td>separator for the multi-URL option</td>
<td>String</td>
<td>No; default is space</td>
</tr>
<tr>
<td valign="top" align="left">
validate
</td>
<td valign="top" align="left">
validate that every named file exists
</td>
<td valign="top" align="left">
boolean
</td>
<td valign="top" align="left">
optional; default: true
</td>
<td>validate</td>
<td>validate that every named file exists</td>
<td>boolean</td>
<td>No; default is <q>true</q></td>
</tr>
</table>
<h3 id="elements">Parameters as nested elements</h3>
<h4><strong>fileset</strong> (org.apache.tools.ant.types.FileSet)</h4>

A fileset of JAR files to include in the URL list, each separated by the separator.
<p>A fileset of JAR files to include in the URL list, each separated by the separator.</p>

<h4><strong>path</strong> (org.apache.tools.ant.types.Path)</h4>

Add a path to the URL. All elements in the path will be converted to individual URL entries.
<p>Add a path to the URL. All elements in the path will be converted to individual URL entries.</p>
<h3>Examples</h3>
<pre>&lt;makeurl file="${user.home}/.m2/repository" property="m2.repository.url"/&gt;</pre>
<p>Sets the property <code>m2.repository.url</code> to the file: URL of the local Maven2
repository.</p>
<pre>&lt;makeurl property="codebase"&gt;&lt;fileset dir="lib includes="*.jar"/&gt;&lt;/makeurl&gt;</pre>
<p>Set the property <code>codebase</code> to the three URLs of the files provided as nested
elements.</p>
</body>
</html>

+ 90
- 107
manual/Tasks/manifest.html View File

@@ -28,151 +28,136 @@
<h3>Description</h3>
<p>Creates a manifest file.</p>

<p>This task can be used to write a Manifest file, optionally
replacing or updating an existing file.</p>

<p>Manifests are processed according to the
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html">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 manifest lines
greater than 72 bytes being wrapped and continued on the next
line.</p>

<p>
The Apache Ant team regularly gets complaints that this task in generating invalid
manifests. By and large, this is not the case: we believe that we are following
the specification to the letter. The usual problem is that some third party
manifest reader is not following the same specification as well as they think
they should; we cannot generate invalid manifest files just because one
single application is broken. J2ME runtimes appear to be particularly troublesome.
</p>

<p>
If you find that Ant generates manifests incompatible with your runtime, take
a manifest it has built, fix it up however you need and switch to using the <a href="zip.html">zip</a>
task to create the JAR, feeding in the hand-crafted manifest.
</p>


<p>This task can be used to write a Manifest file, optionally replacing or updating an existing
file.</p>

<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
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>

<p>The Apache Ant team regularly gets complaints that this task in generating invalid manifests. By
and large, this is not the case: we believe that we are following the specification to the
letter. The usual problem is that some third party manifest reader is not following the same
specification as well as they think they should; we cannot generate invalid manifest files just
because one single application is broken. Java ME runtimes appear to be particularly
troublesome.</p>

<p>If you find that Ant generates manifests incompatible with your runtime, take a manifest it has
built, fix it up however you need and switch to using the <a href="zip.html">zip</a> task to create
the JAR, feeding in the hand-crafted manifest.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the manifest-file to create/update.</td>
<td valign="top" align="center">Yes</td>
<td>file</td>
<td>the manifest-file to create/update.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">mode</td>
<td valign="top">One of "update" or "replace", default is "replace".</td>
<td valign="top" align="center">No</td>
<td>mode</td>
<td>One of <q>update</q> or <q>replace</q>.</td>
<td>No; default is <q>replace</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The encoding used to read the existing manifest
when updating. The task will always use UTF-8 when writing the
manifest.</td>
<td valign="top" align="center">No, defaults to UTF-8 encoding.</td>
<td>encoding</td>
<td>The encoding used to read the existing manifest when updating. The task will always use
UTF-8 when writing the manifest.</td>
<td>No; defaults to UTF-8 encoding</td>
</tr>
<tr>
<td valign="top">mergeClassPathAttributes</td>
<td valign="top">Whether to merge the Class-Path attributes found
in different manifests (if updating). If false, only the
attribute of the most recent manifest will be preserved.
<em>Since Ant 1.8.0</em>.
<br/>Unless you also set flattenAttributes to true this may
result in manifests containing multiple Class-Path attributes
which violates the manifest specification.</td>
<td align="center" valign="top">No, default is false</td>
<td>mergeClassPathAttributes</td>
<td>Whether to merge the <code>Class-Path</code> attributes found in different manifests (if
updating). If <q>false</q>, only the attribute of the most recent manifest will be
preserved. <em>Since Ant 1.8.0</em>.<br/>Unless you also set <var>flattenAttributes</var>
to <q>true</q> this may result in manifests containing multiple <code>Class-Path</code>
attributes which violates the manifest specification.</td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">flattenAttributes</td>
<td valign="top">Whether to merge attributes occurring more than
once in a section (this can only happen for the Class-Path
attribute) into a single attribute.
<em>Since Ant 1.8.0</em>.</td>
<td align="center" valign="top">No, default is false</td>
<td>flattenAttributes</td>
<td>Whether to merge attributes occurring more than once in a section (this can only happen for
the <code>Class-Path</code> attribute) into a single attribute. <em>Since Ant
1.8.0</em>.</td>
<td>No; default is <q>false</q></td>
</tr>
</table>

<h3>Nested elements</h3>
<h4 id="attribute">attribute</h4>
<p>One attribute for the manifest file. Those attributes that are
not nested into a section will be added to the "Main" section.</p>
<table>
<p>One attribute for the manifest file. Those attributes that are not nested into a section will be
added to the main section.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">the name of the attribute, <br>
must match the regexp <tt>[A-Za-z0-9][A-Za-z0-9-_]*</tt>.
<td>name</td>
<td>the name of the attribute, must match the regexp <q>[A-Za-z0-9][A-Za-z0-9-_]*</q>.
</td>
<td valign="top" align="center">Yes</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">the value of the attribute.</td>
<td valign="top" align="center">Yes</td>
<td>value</td>
<td>the value of the attribute.</td>
<td>Yes</td>
</tr>
</table>


<h4>section</h4>
<p>A manifest section - you can nest <a
href="#attribute">attribute</a> elements into sections.</p>
<p>A manifest section&mdash;you can nest <a href="#attribute">attribute</a> elements into
sections.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">the name of the section.</td>
<td valign="top" align="center">No, if omitted it will be assumed
to be the main section.</td>
<td>name</td>
<td>the name of the section.</td>
<td>No, defaults to the main section</td>
</tr>
</table>

<h3>Examples</h3>

<pre>
&lt;manifest file=&quot;MANIFEST.MF&quot;&gt;
&lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
&lt;section name=&quot;common&quot;&gt;
&lt;attribute name=&quot;Specification-Title&quot; value=&quot;Example&quot;/&gt;
&lt;attribute name=&quot;Specification-Version&quot; value=&quot;${version}&quot;/&gt;
&lt;attribute name=&quot;Specification-Vendor&quot; value=&quot;Example Organization&quot;/&gt;
&lt;attribute name=&quot;Implementation-Title&quot; value=&quot;common&quot;/&gt;
&lt;attribute name=&quot;Implementation-Version&quot; value=&quot;${version} ${TODAY}&quot;/&gt;
&lt;attribute name=&quot;Implementation-Vendor&quot; value=&quot;Example Corp.&quot;/&gt;
&lt;/section&gt;
&lt;section name=&quot;common/class1.class&quot;&gt;
&lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
&lt;/section&gt;
&lt;/manifest&gt;
</pre>

<p>Creates or replaces the file MANIFEST.MF. Note that the Built-By
attribute will take the value of the Ant property ${user.name}. The
same is true for the ${version} and ${TODAY} properties. This example
produces a MANIFEST.MF that contains
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">package
version identification</a> for the package <code>common</code>.</p>
&lt;manifest file=&quot;MANIFEST.MF&quot;&gt;
&lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
&lt;section name=&quot;common&quot;&gt;
&lt;attribute name=&quot;Specification-Title&quot; value=&quot;Example&quot;/&gt;
&lt;attribute name=&quot;Specification-Version&quot; value=&quot;${version}&quot;/&gt;
&lt;attribute name=&quot;Specification-Vendor&quot; value=&quot;Example Organization&quot;/&gt;
&lt;attribute name=&quot;Implementation-Title&quot; value=&quot;common&quot;/&gt;
&lt;attribute name=&quot;Implementation-Version&quot; value=&quot;${version} ${TODAY}&quot;/&gt;
&lt;attribute name=&quot;Implementation-Vendor&quot; value=&quot;Example Corp.&quot;/&gt;
&lt;/section&gt;
&lt;section name=&quot;common/class1.class&quot;&gt;
&lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
&lt;/section&gt;
&lt;/manifest&gt;</pre>

<p>Creates or replaces the file <samp>MANIFEST.MF</samp>. Note that the <code>Built-By</code>
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
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>

<p>The manifest produced by the above would look like this:</p>

<pre>Manifest-Version: 1.0
<pre>
Manifest-Version: 1.0
Built-By: bodewig
Created-By: Apache Ant 1.9

@@ -185,9 +170,7 @@ Implementation-Version: 1.2 September 10, 2013
Implementation-Title: common

Name: common/class1.class
Sealed: false

</pre>
Sealed: false</pre>

</body>
</html>

+ 45
- 59
manual/Tasks/manifestclasspath.html View File

@@ -27,87 +27,73 @@
<h2 id="manifestclasspath">Manifestclasspath</h2>

<h3>Description</h3>
<p>Converts a <a href="../using.html#path">Path</a> into a property
whose value is appropriate for a <a href="manifest.html">Manifest</a>'s
<code>Class-Path</code> attribute.</p>
<p>Converts a <a href="../using.html#path">Path</a> into a property whose value is appropriate for
a <a href="manifest.html">Manifest</a>'s <code>Class-Path</code> attribute.</p>

<p>This task is often used to work around command line limitations on Windows
when using very long class paths when launching an application. The long class
path normally specified on the command line is replaced by a single (possibly
empty) jar file which an in-manifest Class-Path attribute whose value lists
all the jar and zip files the class path should contain. The files referenced
from this attribute must be found relatively to the jar file itself, usually
in the same directory. The Java VM automatically uses all file entries listed
in the Class-Path attributes of a jar to locate/load classes. Note though that
it silently ignores entries for which it cannot find any corresponding file.</p>
<p>This task is often used to work around command line limitations on Windows when using very long
class paths when launching an application. The long class path normally specified on the command
line is replaced by a single (possibly empty) jar file which an in-manifest <code>Class-Path</code>
attribute whose value lists all the jar and zip files the classpath should contain. The files
referenced from this attribute must be found relatively to the jar file itself, usually in the same
directory. JVM automatically uses all file entries listed in the <code>Class-Path</code> attributes
of a jar to locate/load classes. Note though that it silently ignores entries for which it cannot
find any corresponding file.</p>

<p>Note that the property value created may be longer than a manifest's maximum
72 characters per line, but will be properly wrapped as per the Jar
specification by the <code>&lt;manifest&gt;</code> element, where the
defined property is re-referenced.</p>
<p>Note that the property value created may be longer than a manifest's maximum 72 characters per
line, but will be properly wrapped as per the Jar specification by the <code>&lt;manifest&gt;</code>
element, where the defined property is re-referenced.</p>

<p>For this task to work properly the relative path from the file
given in the <code>jarfile</code> attribute to the elements of the
nested <code>classpath</code> must be the same as you expect them to
be when deploying the jar.</p>
<p>For this task to work properly the relative path from the file given in the <code>jarfile</code>
attribute to the elements of the nested <code>classpath</code> must be the same as you expect them
to be when deploying the jar.</p>

<p><em>since Apache Ant 1.7</em></p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">the name of the property to set. This property must
not already be set.</td>
<td valign="top" align="center">Yes</td>
<td>property</td>
<td>the name of the property to set. This property must not already be set.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">jarfile</td>
<td valign="top">
the filename for the Jar which will contain the manifest that will
use the property this task will set. This file need not exist yet,
but its parent directory must exist.
</td>
<td valign="top" align="center">Yes</td>
<td>jarfile</td>
<td>the filename for the Jar which will contain the manifest that will use the property this
task will set. This file need not exist yet, but its parent directory must exist.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">maxParentLevels</td>
<td valign="top">
The maximum number of parent directories one is allowed to traverse
to navigate from the jar file to the path entry. Put differently, the
maximum number of .. which is allowed in the relative path from the
jar file to a given class path entry. Specify 0 to enforce a path
entry to be in the same directory (or one of its sub-directories)
as the jar file itself. Defaults to 2 levels.</td>
<td valign="top" align="center">No</td>
<td>maxParentLevels</td>
<td>The maximum number of parent directories one is allowed to traverse to navigate from the jar
file to the path entry. Put differently, the maximum number of <q>..</q> which is allowed in
the relative path from the jar file to a given class path entry. Specify <q>0</q> to enforce a
path entry to be in the same directory (or one of its sub-directories) as the jar file
itself.</td>
<td>No; defaults to <q>2</q></td>
</tr>
</table>

<h3>Parameters specified as nested elements</h3>
<h4>classpath</h4>
<p>A <a href="../using.html#path">Path-like</a> element, which can be
defined in-place, or refer to a path defined elsewhere using the
<code>&lt;classpath refid="<em>pathid</em>" /&gt;</code> syntax.
<p>A <a href="../using.html#path">path-like</a> element, which can be defined in-place, or refer to
a path defined elsewhere using the <code>&lt;classpath refid=&quot;pathid&quot;/&gt;</code> syntax.
This classpath must not be empty, and is required.</p>

<h3>Examples</h3>
<pre>
&lt;manifestclasspath property="jar.classpath"
jarfile="build/acme.jar"&gt;
&lt;classpath refid="classpath" /&gt;
&lt;/manifestclasspath&gt;
</pre>
<p>Assuming a path of id "classpath" was already defined, convert this
path relatively to the build/ directory that will contain acme.jar, which
can later be created with <code>&lt;jar&gt;</code> with a nested
<code>&lt;manifest&gt;</code> element that lists an
<code>&lt;attribute name="Class-Path" value="${jar.classpath}"/&gt;</code>.
</p>
<pre>
&lt;manifestclasspath property="jar.classpath"
jarfile="build/acme.jar"&gt;
&lt;classpath refid="classpath"/&gt;
&lt;/manifestclasspath&gt;</pre>
<p>Assuming a path of id <q>classpath</q> was already defined, convert this path relatively to
the <samp>build/</samp> directory that will contain <samp>acme.jar</samp>, which can later be
created with <code>&lt;jar&gt;</code> with a nested <code>&lt;manifest&gt;</code> element that lists
an <code>&lt;attribute name="Class-Path" value="${jar.classpath}"/&gt;</code>.</p>

</body>
</html>

+ 48
- 49
manual/Tasks/mimemail.html View File

@@ -26,83 +26,82 @@

<h2 id="mimemail">MimeMail</h2>

<h3><i>Deprecated</i></h3>
<p><i>This task has been deprecated. Use the <a href="../Tasks/mail.html">mail</a> task instead.</i></p>
<h3><em><u>Deprecated</u></em></h3>
<p><em>This task has been <u>deprecated</u>. Use the <a href="../Tasks/mail.html">mail</a> task instead.</em></p>

<h3>Description</h3>
<p>Sends SMTP mail with MIME attachments.
<a href="http://www.oracle.com/technetwork/java/index-138643.html">JavaMail</a>
and <a href="http://www.oracle.com/technetwork/java/javase/jaf-135115.html">Java
Activation Framework</a> are required for this task.</p>
<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>
<p>Multiple files can be attached using <a href="../Types/fileset.html">FileSets.</a></p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">message</td>
<td valign="top">The message body</td>
<td valign="top" align="center" rowspan="2">Exactly one of these, or a nested fileset</td>
<td>message</td>
<td>The message body</td>
<td rowspan="2">Exactly one of these, or a nested fileset</td>
</tr>
<tr>
<td valign="top">messageFile</td>
<td valign="top">A filename to read and used as the message body</td>
<td>messageFile</td>
<td class="left">A filename to read and used as the message body</td>
</tr>
<tr>
<td valign="top">messageMimeType</td>
<td valign="top">MIME type to use for 'message' or 'messageFile' when
attached.</td>
<td align="center" valign="top">No, defaults to "text/plain"</td>
<td>messageMimeType</td>
<td>MIME type to use for <var>message</var> or <var>messageFile</var> when attached.</td>
<td>No; defaults to <q>text/plain</q></td>
</tr>
<tr>
<td valign="top">tolist</td>
<td valign="top">Comma-separated list of To: recipients</td>
<td valign="top" align="center" rowspan="3">Yes, at least one of these</td>
<td>tolist</td>
<td>Comma-separated list of <code>To:</code> recipients</td>
<td rowspan="3">Yes, at least one of these</td>
</tr>
<tr>
<td valign="top">cclist</td>
<td valign="top">Comma-separated list of CC: recipients</td>
<td>cclist</td>
<td class="left">Comma-separated list of <code>CC:</code> recipients</td>
</tr>
<tr>
<td valign="top">bcclist</td>
<td valign="top">Comma-separated list of BCC: recipients</td>
<td>bcclist</td>
<td class="left">Comma-separated list of <code>BCC:</code> recipients</td>
</tr>
<tr>
<td valign="top">mailhost</td>
<td valign="top">Host name of the mail server.</td>
<td valign="top" align="center">No, default to &quot;localhost&quot;</td>
<td>mailhost</td>
<td>Host name of the mail server.</td>
<td>No; default to <q>localhost</q></td>
</tr>
<tr>
<td valign="top">subject</td>
<td valign="top">Email subject line.</td>
<td valign="top" align="center">No</td>
<td>subject</td>
<td>Email subject line.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">from</td>
<td valign="top">Email address of sender.</td>
<td valign="top" align="center">Yes</td>
<td>from</td>
<td>Email address of sender.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the build process if an error occurs sending the
e-mail.</td>
<td valign="top" align="center">No, default to &quot;true&quot;</td>
<td>failonerror</td>
<td>Stop the build process if an error occurs sending the e-mail.</td>
<td>No; default to <q>true</q></td>
</tr>
</table>
<h3>Examples</h3>
<p><b>Send a single HTML file as the body of a message</b></p>
<pre> &lt;mimemail messageMimeType=&quot;text/html&quot; messageFile=&quot;overview-summary.html&quot;
tolist=&quot;you&quot; subject=&quot;JUnit Test Results: ${TODAY}&quot; from=&quot;me&quot;/&gt;</pre>
<p><b>Sends all files in a directory as attachments</b></p>
<pre> &lt;mimemail message=&quot;See attached files&quot; tolist=&quot;you&quot; subject=&quot;Attachments&quot; from=&quot;me&quot;&gt;
&lt;fileset dir=&quot;.&quot;&gt;
&lt;include name=&quot;dist/*.*&quot;/&gt;
&lt;/fileset&gt;
&lt;/mimemail&gt;
</pre>
<p><strong>Send a single HTML file as the body of a message</strong></p>
<pre>
&lt;mimemail messageMimeType=&quot;text/html&quot; messageFile=&quot;overview-summary.html&quot;
tolist=&quot;you&quot; subject=&quot;JUnit Test Results: ${TODAY}&quot; from=&quot;me&quot;/&gt;</pre>
<p><strong>Sends all files in a directory as attachments</strong></p>
<pre>
&lt;mimemail message=&quot;See attached files&quot; tolist=&quot;you&quot; subject=&quot;Attachments&quot; from=&quot;me&quot;&gt;
&lt;fileset dir=&quot;.&quot;&gt;
&lt;include name=&quot;dist/*.*&quot;/&gt;
&lt;/fileset&gt;
&lt;/mimemail&gt;</pre>

</body>
</html>

+ 9
- 9
manual/Tasks/mkdir.html View File

@@ -26,19 +26,19 @@

<h2 id="mkdir">Mkdir</h2>
<h3>Description</h3>
<p>Creates a directory. Also non-existent parent directories are created, when
necessary. Does nothing if the directory already exist.</p>
<p>Creates a directory. Also non-existent parent directories are created, when necessary. Does
nothing if the directory already exist.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">the directory to create.</td>
<td align="center" valign="top">Yes</td>
<td>dir</td>
<td>the directory to create.</td>
<td>Yes</td>
</tr>
</table>
<h3>Examples</h3>


+ 129
- 175
manual/Tasks/move.html View File

@@ -26,231 +26,185 @@

<h2 id="move">Move</h2>
<h3>Description</h3>
<p>Moves a file to a new file or directory, or collections of files to
a new directory. By default, the
destination file is overwritten if it already exists. When <var>overwrite</var> is
turned off, then files are only moved if the source file is newer than
the destination file, or when the destination file does not exist.</p>
<p>Moves a file to a new file or directory, or collections of files to a new directory. By default,
the destination file is overwritten if it already exists. When <var>overwrite</var> is turned off,
then files are only moved if the source file is newer than the destination file, or when the
destination file does not exist.</p>

<p><a href="../Types/resources.html#collection">Resource
Collection</a>s are used to select a group of files to move. Only
file system based resource collections are supported, this includes <a
href="../Types/fileset.html">fileset</a>s, <a
href="../Types/filelist.html">filelist</a> and <a
href="../using.html#path">path</a>. Prior to Apache Ant 1.7 only
<code>&lt;fileset&gt;</code> has been supported as a nested element.
To use a resource collection, the <code>todir</code> attribute must be
set.</p>
<p><a href="../Types/resources.html#collection">Resource Collection</a>s are used to select a group
of files to move. Only file system based resource collections are supported, this
includes <a href="../Types/fileset.html">fileset</a>s, <a href="../Types/filelist.html">filelist</a>
and <a href="../using.html#path">path</a>. Prior to Apache Ant 1.7
only <code>&lt;fileset&gt;</code> has been supported as a nested element. To use a resource
collection, the <var>todir</var> attribute must be set.</p>

<p><em>Since Ant 1.6.3</em>, the <i>file</i> attribute may be used to move
(rename) an entire directory. If <i>tofile</i> denotes an existing file, or
there is a directory by the same name in <i>todir</i>, the action will fail.
</p>
<p><em>Since Ant 1.6.3</em>, the <var>file</var> attribute may be used to move (rename) an entire
directory. If <var>tofile</var> denotes an existing file, or there is a directory by the same name
in <var>todir</var>, the action will fail.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file or directory to move</td>
<td valign="top" align="center">One of <var>file</var> or
at least one nested resource collection element</td>
<td>file</td>
<td>the file or directory to move</td>
<td>One of <var>file</var> or at least one nested resource collection element</td>
</tr>
<tr>
<td valign="top">preservelastmodified</td>
<td valign="top">Give the moved files the same last modified
time as the original source files.
<td>preservelastmodified</td>
<td>Give the moved files the same last modified time as the original source files.
(<strong>Note</strong>: Ignored on Java 1.1)</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">tofile</td>
<td valign="top">the file to move to</td>
<td valign="top" align="center" rowspan="2">With the <var>file</var> attribute,
either <var>tofile</var> or <var>todir</var> can be used. With nested filesets,
if the fileset size is greater than 1 or if the only entry in the fileset is a
directory or if the <var>file</var> attribute is already specified, only
<var>todir</var> is allowed</td>
<td>tofile</td>
<td>the file to move to</td>
<td rowspan="2">With the <var>file</var> attribute, either <var>tofile</var> or <var>todir</var>
can be used. With nested filesets, if the fileset size is greater than 1 or if the only entry
in the fileset is a directory or if the <var>file</var> attribute is already specified,
only <var>todir</var> is allowed</td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">the directory to move to</td>
<td>todir</td>
<td class="left">the directory to move to</td>
</tr>
<tr>
<td valign="top">overwrite</td>
<td valign="top">overwrite existing files even if the destination
files are newer (default is &quot;true&quot;)</td>
<td valign="top" align="center">No</td>
<td>overwrite</td>
<td>overwrite existing files even if the destination files are newer</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">Overwrite read-only destination
files. <em>since Ant 1.8.2</em></td>
<td valign="top" align="center">No; defaults to false.</td>
<td>force</td>
<td>Overwrite read-only destination files. <em>since Ant 1.8.2</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">filtering</td>
<td valign="top">indicates whether token filtering should take place during
the move. See the <a href="filter.html">filter</a> task for a description of
how filters work.</td>
<td valign="top" align="center">No</td>
<td>filtering</td>
<td>indicates whether token filtering should take place during the move. See
the <a href="filter.html">filter</a> task for a description of how filters work.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">flatten</td>
<td valign="top">ignore directory structure of source directory,
copy all files into a single directory, specified by the <var>todir</var>
attribute (default is &quot;false&quot;).Note that you can achieve the
same effect by using a <a href="../Types/mapper.html#flatten-mapper">flatten mapper</a></td>
<td valign="top" align="center">No</td>
<td>flatten</td>
<td>ignore directory structure of source directory, copy all files into a single directory,
specified by the <var>todir</var> attribute. Note that you can achieve the same effect by
using a <a href="../Types/mapper.html#flatten-mapper">flatten mapper</a></td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">includeEmptyDirs</td>
<td valign="top">Copy empty directories included with the nested FileSet(s).
Defaults to &quot;yes&quot;.</td>
<td valign="top" align="center">No</td>
<td>includeEmptyDirs</td>
<td>Copy empty directories included with the nested FileSet(s).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">If false, log a warning message, but do not stop the
build, when the file to copy does not exist or one of the nested
filesets points to a directory that doesn't exist or an error occurs
while moving.
</td>
<td valign="top" align="center">No; defaults to true.</td>
<td>failonerror</td>
<td>If false, log a warning message, but do not stop the build, when the file to copy does not
exist or one of the nested filesets points to a directory that doesn't exist or an error
occurs while moving.</td>
<td>No; defaults to <q>true</q></td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">If true and failonerror is false, then do not log a
warning message when the file to copy does not exist or one of the nested
filesets points to a directory that doesn't exist or an error occurs
while copying. <em>since Ant 1.8.3</em>.
</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>quiet</td>
<td>If <q>true</q> and <var>failonerror</var> is <q>false</q>, then do not log a warning message
when the file to copy does not exist or one of the nested filesets points to a directory that
doesn't exist or an error occurs while copying. <em>since Ant 1.8.3</em>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Log the files that are being moved.</td>
<td valign="top" align="center">No; defaults to false.</td>
<td>verbose</td>
<td>Log the files that are being moved.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The encoding to assume when filter-copying the
files. <em>since Ant 1.5</em>.</td>
<td align="center">No - defaults to default JVM encoding</td>
<td>encoding</td>
<td>The encoding to assume when filter-copying the files. <em>since Ant 1.5</em>.</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td valign="top">outputencoding</td>
<td valign="top">The encoding to use when writing the files.
<em>since Ant 1.6</em>.</td>
<td align="center">No - defaults to the value of the encoding
attribute if given or the default JVM encoding otherwise.</td>
<td>outputencoding</td>
<td>The encoding to use when writing the files. <em>since Ant 1.6</em>.</td>
<td>No; defaults to <var>encoding</var> if set or default JVM character encoding otherwise</td>
</tr>
<tr>
<td valign="top">enablemultiplemappings</td>
<td valign="top">
If true the task will process to all the mappings for a
given source path. If false the task will only process
the first file or directory. This attribute is only relevant
if there is a mapper subelement.
<em>since Ant 1.6</em>.</td>
<td align="center">No - defaults to false.</td>
<td>enablemultiplemappings</td>
<td>If <q>true</q> the task will process to all the mappings for a given source
path. If <q>false</q> the task will only process the first file or directory. This attribute
is only relevant if there is a <code>mapper</code> subelement. <em>since Ant 1.6</em>.</td>
<td>No; defaults to <q>false</q></td>
</tr>
<tr>
<td valign="top">granularity</td>
<td valign="top">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. Default is 0 milliseconds, or 2 seconds on DOS
systems. This can also be useful if source and target files live
on separate machines with clocks being out of sync. <em>since Ant
1.6</em>.</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. This can also be useful if source and target files live on separate
machines with clocks being out of sync. <em>since Ant 1.6</em>.</td>
<td>No; default is 0 milliseconds, or 2 seconds on DOS systems</td>
</tr>
<tr>
<td valign="top">performGCOnFailedDelete</td>
<td valign="top">
If Ant fails to delete a file or directory it will retry the
operation once. If this flag is set to true it will perform a
garbage collection before retrying the delete.<br/>
Setting this flag to true is known to resolve some problems on
Windows (where it defaults to true) but also for directory trees
residing on an NFS share.
<em>Since Ant 1.8.3</em></td>
<td align="center" valign="top">No, default &quot;true&quot; on
Windows and &quot;true&quot; on any other OS.</td>
<td>performGCOnFailedDelete</td>
<td>If Ant fails to delete a file or directory it will retry the operation once. If this flag
is set to <q>true</q> it will perform a garbage collection before retrying the delete.<br/>
Setting this flag to <q>true</q> is known to resolve some problems on Windows (where it
defaults to <q>true</q>) but also for directory trees residing on an NFS share. <em>Since Ant
1.8.3</em></td>
<td>No; defaults to <q>true</q> on Windows and <q>false</q> on any other OS</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>mapper</h4>
<p>You can define file name transformations by using a nested <a
href="../Types/mapper.html">mapper</a> element. The default mapper used by
<code>&lt;move&gt;</code> is the <a
href="../Types/mapper.html#identity-mapper">identity</a>.</p>
<p>Note that the source name handed to the mapper depends on the
resource collection you use. If you use <code>&lt;fileset&gt;</code>
or any other collection that provides a base directory, the name
passed to the mapper will be a relative filename, relative to the base
directory. In any other case the absolute filename of the source will
be used.</p>
<p>You can define file name transformations by using a
nested <a href="../Types/mapper.html">mapper</a> element. The default mapper used
by <code>&lt;move&gt;</code> is the <a href="../Types/mapper.html#identity-mapper">identity</a>.</p>
<p>Note that the source name handed to the mapper depends on the resource collection you use. If
you use <code>&lt;fileset&gt;</code> or any other collection that provides a base directory, the
name passed to the mapper will be a relative filename, relative to the base directory. In any other
case the absolute filename of the source will be used.</p>
<h4>filterchain</h4>
<p>The Move task supports nested <a href="../Types/filterchain.html">
FilterChain</a>s.</p>

<p>
If <code>&lt;filterset&gt;</code> and <code>&lt;filterchain&gt;</code> elements are used inside the
same <code>&lt;move&gt;</code> task, all <code>&lt;filterchain&gt;</code> elements are processed first
followed by <code>&lt;filterset&gt;</code> elements.
</p>
<p>The Move task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p>
<p>If <code>&lt;filterset&gt;</code> and <code>&lt;filterchain&gt;</code> elements are used inside
the same <code>&lt;move&gt;</code> task, all <code>&lt;filterchain&gt;</code> elements are processed
first followed by <code>&lt;filterset&gt;</code> elements.</p>

<h3>Examples</h3>
<p><b>Move a single file (rename a file)</b></p>
<pre>
&lt;move file=&quot;file.orig&quot; tofile=&quot;file.moved&quot;/&gt;
</pre>
<p><b>Move a single file to a directory</b></p>
<pre>
&lt;move file=&quot;file.orig&quot; todir=&quot;dir/to/move/to&quot;/&gt;
</pre>
<p><b>Move a directory to a new directory</b></p>
<pre>
&lt;move todir=&quot;new/dir/to/move/to&quot;&gt;
&lt;fileset dir=&quot;src/dir&quot;/&gt;
&lt;/move&gt;
</pre>
<i>or, since Ant 1.6.3:</i>
<p><strong>Move a single file (rename a file)</strong></p>
<pre>&lt;move file=&quot;file.orig&quot; tofile=&quot;file.moved&quot;/&gt;</pre>
<p><strong>Move a single file to a directory</strong></p>
<pre>&lt;move file=&quot;file.orig&quot; todir=&quot;dir/to/move/to&quot;/&gt;</pre>
<p><strong>Move a directory to a new directory</strong></p>
<pre>
&lt;move file=&quot;src/dir&quot; tofile=&quot;new/dir/to/move/to&quot;/&gt;
</pre>
<p><b>Move a set of files to a new directory</b></p>
&lt;move todir=&quot;new/dir/to/move/to&quot;&gt;
&lt;fileset dir=&quot;src/dir&quot;/&gt;
&lt;/move&gt;</pre>
<p>or, <em>since Ant 1.6.3</em>:</p>
<pre>&lt;move file=&quot;src/dir&quot; tofile=&quot;new/dir/to/move/to&quot;/&gt;</pre>
<p><strong>Move a set of files to a new directory</strong></p>
<pre>
&lt;move todir=&quot;some/new/dir&quot;&gt;
&lt;fileset dir=&quot;my/src/dir&quot;&gt;
&lt;include name=&quot;**/*.jar&quot;/&gt;
&lt;exclude name=&quot;**/ant.jar&quot;/&gt;
&lt;/fileset&gt;
&lt;/move&gt;
</pre>
<p><b>Move a list of files to a new directory</b></p>
&lt;move todir=&quot;some/new/dir&quot;&gt;
&lt;fileset dir=&quot;my/src/dir&quot;&gt;
&lt;include name=&quot;**/*.jar&quot;/&gt;
&lt;exclude name=&quot;**/ant.jar&quot;/&gt;
&lt;/fileset&gt;
&lt;/move&gt;</pre>
<p><strong>Move a list of files to a new directory</strong></p>
<pre>
&lt;move todir=&quot;some/new/dir&quot;&gt;
&lt;filelist dir=&quot;my/src/dir&quot;&gt;
&lt;file name="file1.txt"/&gt;
&lt;file name="file2.txt"/&gt;
&lt;/filelist&gt;
&lt;/move&gt;
</pre>
<p><b>Append <code>&quot;.bak&quot;</code> to the names of all files
in a directory.</b></p>
&lt;move todir=&quot;some/new/dir&quot;&gt;
&lt;filelist dir=&quot;my/src/dir&quot;&gt;
&lt;file name="file1.txt"/&gt;
&lt;file name="file2.txt"/&gt;
&lt;/filelist&gt;
&lt;/move&gt;</pre>
<p><strong>Append <code>&quot;.bak&quot;</code> to the names of all files in a
directory.</strong></p>
<pre>
&lt;move todir=&quot;my/src/dir&quot; includeemptydirs=&quot;false&quot;&gt;
&lt;fileset dir=&quot;my/src/dir&quot;&gt;
&lt;exclude name=&quot;**/*.bak&quot;/&gt;
&lt;/fileset&gt;
&lt;mapper type=&quot;glob&quot; from=&quot;*&quot; to=&quot;*.bak&quot;/&gt;
&lt;/move&gt;
</pre>
&lt;move todir=&quot;my/src/dir&quot; includeemptydirs=&quot;false&quot;&gt;
&lt;fileset dir=&quot;my/src/dir&quot;&gt;
&lt;exclude name=&quot;**/*.bak&quot;/&gt;
&lt;/fileset&gt;
&lt;mapper type=&quot;glob&quot; from=&quot;*&quot; to=&quot;*.bak&quot;/&gt;
&lt;/move&gt;</pre>

</body>
</html>

+ 107
- 151
manual/Tasks/native2ascii.html View File

@@ -22,131 +22,104 @@
<body>
<h2>Native2Ascii</h2>

<h3>Description:</h3>

<p>
Converts files from native encodings to ASCII with escaped Unicode.
A common usage is to convert source files maintained in a native
operating system encoding, to ASCII prior to compilation.
</p>

<p>
Files in the directory <em>src</em>
are converted from a native encoding to ASCII.
By default, all files in the directory are converted.
However, conversion may be limited to selected files using
<em>includes</em> and <em>excludes</em> attributes.
For more information on file matching patterns,
see the section on
<a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>.
If no <em>encoding</em> is specified,
the default encoding for the JVM is used.
If <em>ext</em> is specified, then output files are renamed
to use it as a new extension.
More sophisticated file name translations can be achieved using a nested
<em><code>&lt;mapper&gt;</code></em> element. By default an
<a href="../Types/mapper.html#identity-mapper">identity mapper</a> will be used.
If <em>dest</em> and <em>src</em> point to the same directory,
the <em>ext</em> attribute or a nested <em><code>&lt;mapper&gt;</code></em>
is required.
</p>

<p>
This task forms an implicit <a href="../Types/fileset.html">File Set</a>,
and supports most attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>src</code>) as well as
<h3>Description</h3>

<p>Converts files from native encodings to ASCII with escaped Unicode. A common usage is to
convert source files maintained in a native operating system encoding, to ASCII prior to
compilation.</p>

<p>Files in the directory <var>src</var> are converted from a native encoding to ASCII. By
default, all files in the directory are converted. However, conversion may be limited to
selected files using <var>includes</var> and <var>excludes</var> attributes. For more
information on file matching patterns, see the section
on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>. If
no <var>encoding</var> is specified, the default encoding for the JVM is used.
If <var>ext</var> is specified, then output files are renamed to use it as a new extension.
More sophisticated file name translations can be achieved using a
nested <code>&lt;mapper&gt;</code> element. By default
an <a href="../Types/mapper.html#identity-mapper">identity mapper</a> will be used.
If <var>dest</var> and <var>src</var> point to the same directory, the <var>ext</var>
attribute or a nested <code>&lt;mapper&gt;</code> is required.</p>

<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a>, and supports most
attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>src</var>) as well as
nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>,
and <code>&lt;patternset&gt;</code> elements.
</p>

<p id="implementationvalues">
It is possible to use different converters. This can be selected
with the <code>implementation</code> attribute or a nested
element. Here are the choices of the attribute:
</p>
and <code>&lt;patternset&gt;</code> elements.</p>

<p id="implementationvalues">It is possible to use different converters. This can be selected
with the <var>implementation</var> attribute or a nested element. Here are the choices of the
attribute:</p>
<ul>
<li>default - the default converter for the platform: kaffe
when run on Kaffe, builtin otherwise.</li>
<li>sun - used to be the standard converter of the JDK &lt; 9</li>
<li>kaffe - the standard converter
of <a href="http://www.kaffe.org" target="_top">Kaffe</a></li>
<li>builtin - Ant's internal implementation. <em>Since Ant
1.9.8</em></li>
<li><q>default</q>&mdash;the default converter for the platform: kaffe when run on Kaffe,
builtin otherwise.</li>
<li><q>sun</q>&mdash;used to be the standard converter of the JDK &lt; 9</li>
<li><q>kaffe</q>&mdash;the standard converter of <a href="http://www.kaffe.org"
target="_top">Kaffe</a></li>
<li><q>builtin</q>&mdash;Ant's internal implementation. <em>Since Ant 1.9.8</em></li>
</ul>

<table>
<table class="attr">
<tr>
<td><b>Attribute</b></td>
<td><b>Description</b></td>
<td><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td>reverse</td>
<td>Reverse the sense of the conversion,
i.e. convert from ASCII to native <b>only supported by the
sun and builtin converters</b></td>
<td align="center">No</td>
<td>Reverse the sense of the conversion, i.e. convert from ASCII to native <strong>only
supported by the <q>sun</q> and <q>builtin</q> converters</strong></td>
<td>No</td>
</tr>
<tr>
<td>encoding</td>
<td>The native encoding the files are in
(default is the default encoding for the JVM)</td>
<td align="center">No</td>
<td>The native encoding the files are in</td>
<td>No; defaults to default JVM character encoding</td>
</tr>
<tr>
<td>src</td>
<td>The directory to find files in (default is <em>basedir</em>)</td>
<td align="center">No</td>
<td>The directory to find files in; default is <var>basedir</var></td>
<td>No</td>
</tr>
<tr>
<td>dest</td>
<td>The directory to output file to</td>
<td align="center">Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>ext</td>
<td>File extension to use in renaming output files</td>
<td align="center">No</td>
</tr>
<tr>
<td>defaultexcludes</td>
<td>indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;).
Default excludes are used when omitted.
</td>
<td align="center">No</td>
<td>No</td>
</tr>
<tr>
<td>includes</td>
<td>comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td align="center">No</td>
<td>Comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td>includesfile</td>
<td>the name of a file. Each line of this file is
taken to be an include pattern</td>
<td align="center">No</td>
<td>Name of a file. Each line of this file is taken to be an include pattern</td>
<td>No</td>
</tr>
<tr>
<td>excludes</td>
<td>comma- or space-separated list of patterns of files that must be excluded.
No files (except default excludes) are excluded when omitted.</td>
<td align="center">No</td>
<td>Comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td>excludesfile</td>
<td>the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td align="center">No</td>
<td>Name of a file. Each line of this file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td>defaultexcludes</td>
<td>Indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">implementation</td>
<td valign="top">The converter implementation to use.
If this attribute is not set, the default converter for the
current VM will be used. (See the above <a
href="#implementationvalues">list</a> of valid converters.)</td>
<td align="center" valign="top">No</td>
<td>implementation</td>
<td>The converter implementation to use. (See the
above <a href="#implementationvalues">list</a> of valid converters.)</td>
<td>No; defaults to default converter for the current JVM</td>
</tr>
</table>

@@ -154,101 +127,84 @@

<h4>arg</h4>

<p>You can specify additional command line arguments for the converter
with nested <code>&lt;arg&gt;</code> elements. These elements are
specified like <a href="../using.html#arg">Command-line Arguments</a>
but have an additional attribute that can be used to enable arguments
only if a given converter implementation will be used.</p>
<p>You can specify additional command line arguments for the converter with
nested <code>&lt;arg&gt;</code> elements. These elements are specified
like <a href="../using.html#arg">Command-line Arguments</a> but have an additional attribute that
can be used to enable arguments only if a given converter implementation will be used.</p>

<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">value</td>
<td align="center" rowspan="4">See
<a href="../using.html#arg">Command-line Arguments</a>.</td>
<td align="center" rowspan="4">Exactly one of these</td>
<td>value</td>
<td rowspan="4">See <a href="../using.html#arg">Command-line Arguments</a>.</td>
<td rowspan="4">Exactly one of these</td>
</tr>
<tr>
<td valign="top">line</td>
<td class="var">line</td>
</tr>
<tr>
<td valign="top">file</td>
<td class="var">file</td>
</tr>
<tr>
<td valign="top">path</td>
<td class="var">path</td>
</tr>
<tr>
<td valign="top">implementation</td>
<td>Only pass the specified argument if the chosen converter
implementation matches the value of this attribute. Legal values
are the same as those in the above <a
href="#implementationvalues">list</a> of valid compilers.)</td>
<td align="center">No</td>
<td>implementation</td>
<td>Only pass the specified argument if the chosen converter implementation matches the value of
this attribute. Legal values are the same as those in the
above <a href="#implementationvalues">list</a> of valid compilers.)</td>
<td>No</td>
</tr>
</table>

<h4>implementationclasspath (<em>since Apache Ant 1.8.0</em>)</h4>

<p>A <a href="../using.html#path">PATH like structure</a> holding the
classpath to use when loading the converter implementation if a
custom class has been specified. Doesn't have any effect when
using one of the built-in converters.</p>
<p>A <a href="../using.html#path">path-like structure</a> holding the classpath to use when loading
the converter implementation if a custom class has been specified. Doesn't have any effect when
using one of the built-in converters.</p>

<h4>Any nested element of a type that implements Native2AsciiAdapter
(<em>since Ant 1.8.0</em>)</h4>
<h4>Any nested element of a type that implements Native2AsciiAdapter (<em>since Ant 1.8.0</em>)</h4>

<p>If a defined type implements the <code>Native2AsciiAdapter</code>
interface a nested element of that type can be used as an
alternative to the <code>implementation</code> attribute.</p>
<p>If a defined type implements the <code>Native2AsciiAdapter</code> interface a nested element of
that type can be used as an alternative to the <var>implementation</var> attribute.</p>

<h3>Examples</h3>
<h3>Examples</h3>

<pre>
<pre>
&lt;native2ascii encoding=&quot;EUCJIS&quot; src=&quot;srcdir&quot; dest=&quot;srcdir&quot;
includes=&quot;**/*.eucjis&quot; ext=&quot;.java&quot;/&gt;
</pre>
includes=&quot;**/*.eucjis&quot; ext=&quot;.java&quot;/&gt;</pre>

<p>
Converts all files in the directory <em>srcdir</em>
ending in <code>.eucjis</code> from the EUCJIS encoding to ASCII
and renames them to end in <code>.java</code>.
</p>
<p>Converts all files in the directory <samp>srcdir</samp> ending in <samp>.eucjis</samp> from
the EUCJIS encoding to ASCII and renames them to end in <samp>.java</samp>.</p>

<pre>
&lt;native2ascii encoding=&quot;EUCJIS&quot; src=&quot;native/japanese&quot; dest=&quot;src&quot;
includes=&quot;**/*.java&quot;/&gt;
</pre>

<p>
Converts all the files ending in <code>.java</code>
in the directory <em>native/japanese</em> to ASCII,
placing the results in the directory <em>src</em>.
The names of the files remain the same.
</p>

<p>If you want to use a custom
Native2AsciiAdapter <code>org.example.MyAdapter</code> you can either
use the implementation attribute:</p>
includes=&quot;**/*.java&quot;/&gt;</pre>

<p>Converts all the files ending in <samp>.java</samp> in the directory <samp>native/japanese</samp>
to ASCII, placing the results in the directory <samp>src</samp>. The names of the files remain the
same.</p>

<p>If you want to use a custom Native2AsciiAdapter <code>org.example.MyAdapter</code> you can either
use the implementation attribute:</p>
<pre>
&lt;native2ascii encoding="EUCJIS" src="srcdir" dest="srcdir"
includes="**/*.eucjis" ext=".java"
implementation="org.example.MyAdapter"/&gt;
</pre>
includes="**/*.eucjis" ext=".java"
implementation="org.example.MyAdapter"/&gt;</pre>
<p>or a define a type and nest this into the task like in:</p>
<pre>
&lt;componentdef classname="org.example.MyAdapter"
name="myadapter"/&gt;
&lt;native2ascii encoding="EUCJIS" src="srcdir" dest="srcdir"
includes="**/*.eucjis" ext=".java"&gt;
&lt;myadapter/&gt;
&lt;/native2ascii&gt;
</pre>
<p>in which case your native2ascii adapter can support attributes and
nested elements of its own.</p>
includes="**/*.eucjis" ext=".java"&gt;
&lt;myadapter/&gt;
&lt;/native2ascii&gt;</pre>
<p>in which case your native2ascii adapter can support attributes and nested elements of its
own.</p>

</body>
</html>

+ 180
- 216
manual/Tasks/netrexxc.html View File

@@ -26,312 +26,276 @@

<h2 id="netrexxc">NetRexxC</h2>
<h3>Description</h3>
<p>Compiles a <a href="http://www2.hursley.ibm.com/netrexx" target="_top">NetRexx</a>
source tree within the running (Apache Ant) VM.</p>
<p>The source and destination directory will be recursively scanned for
NetRexx source files to compile. Only NetRexx files that have no corresponding
class file or where the class file is older than the java file will be compiled.</p>
<p>Files in the source tree are copied to the destination directory,
allowing support files to be located properly in the classpath. The source
files are copied because the NetRexx compiler cannot produce class files in a
specific directory via parameters</p>
<p>The directory structure of the source tree should follow the package
hierarchy.</p>
<p>It is possible to refine the set of files that are being compiled/copied.
This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and
<i>defaultexcludes</i> attributes. With the <i>includes</i> or <i>includesfile</i> attribute you
specify the files you want to have included by using patterns. The
<i>exclude</i> or <i>excludesfile</i> attribute is used to specify the files you want to have
excluded. This is also done with patterns. And finally with the
<i>defaultexcludes</i> attribute, you can specify whether you
want to use default exclusions or not. See the section on <a
href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
<p>Compiles a <a href="https://www.ibm.com/software/awdtools/netrexx/library.html"
target="_top">NetRexx</a> source tree within the running (Apache Ant) JVM.</p>
<p>The source and destination directory will be recursively scanned for NetRexx source files to
compile. Only NetRexx files that have no corresponding class file or where the class file is older
than the java file will be compiled.</p>
<p>Files in the source tree are copied to the destination directory, allowing support files to be
located properly in the classpath. The source files are copied because the NetRexx compiler cannot
produce class files in a specific directory via parameters</p>
<p>The directory structure of the source tree should follow the package hierarchy.</p>
<p>It is possible to refine the set of files that are being compiled/copied. This can be done with
the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var>
and <var>defaultexcludes</var> attributes. With the <var>includes</var> or <var>includesfile</var>
attribute you specify the files you want to have included by using patterns. The <var>exclude</var>
or <var>excludesfile</var> attribute is used to specify the files you want to have excluded. This
is also done with patterns. And finally with the <var>defaultexcludes</var> attribute, you can
specify whether you want to use default exclusions or not. 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>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
supports most attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>srcdir</code>) as well as the nested
<code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.</p>
<p>All properties except classpath, srcdir and destDir are also available as properties in the form
<code>ant.netrexxc.<i>attributename</i></code>, eg.<br>
<code>&lt;property name="ant.netrexxc.verbose" value="noverbose"/&gt;</code><br>
or from the command line as<br>
<code>ant -Dant.netrexxc.verbose=noverbose ...</code>
</p>
<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 information.</p>
<p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and supports most
attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>srcdir</var>) as well as the
nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
and <code>&lt;patternset&gt;</code> elements.</p>
<p>All attributes except <var>classpath</var>, <var>srcdir</var> and <var>destDir</var> are also
available as properties in the form <code>ant.netrexxc.<i>attributename</i></code>,
eg.<br/><code>&lt;property name="ant.netrexxc.verbose" value="noverbose"/&gt;</code><br> or from the
command line as<br/><code>ant -Dant.netrexxc.verbose=noverbose ...</code></p>
<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
information.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">binary</td>
<td valign="top">Whether literals are treated as the java binary
type rather than the NetRexx types</td>
<td valign="top" align="center">No</td>
<td>binary</td>
<td>Whether literals are treated as the Java binary type rather than the NetRexx types</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">The classpath to use during compilation</td>
<td valign="top" align="center">No</td>
<td>classpath</td>
<td>The classpath to use during compilation</td>
<td>No</td>
</tr>
<tr>
<td valign="top">comments</td>
<td valign="top">Whether comments are passed through to the
generated java source</td>
<td valign="top" align="center">No</td>
<td>comments</td>
<td>Whether comments are passed through to the generated Java source file</td>
<td>No</td>
</tr>
<tr>
<td valign="top">compact</td>
<td valign="top">Whether error messages come out in compact or
verbose format. Default is the compact format.</td>
<td valign="top" align="center">No</td>
<td>compact</td>
<td>Whether error messages come out in compact or verbose format.</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">compile</td>
<td valign="top">Whether the NetRexx compiler should compile the
generated java code</td>
<td valign="top" align="center">No</td>
<td>compile</td>
<td>Whether the NetRexx compiler should compile the generated Java code</td>
<td>No</td>
</tr>
<tr>
<td valign="top">console</td>
<td valign="top">Whether or not messages should be displayed on the
'console'. Note that this task will rely on the default value for filtering compile messages.</td>
<td valign="top" align="center">No</td>
<td>console</td>
<td>Whether or not messages should be displayed on the 'console'. Note that this task will rely
on the default value for filtering compile messages.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">crossref</td>
<td valign="top">Whether variable cross references are generated</td>
<td valign="top" align="center">No</td>
<td>crossref</td>
<td>Whether variable cross references are generated</td>
<td>No</td>
</tr>
<tr>
<td valign="top">decimal</td>
<td valign="top">Whether decimal arithmetic should be used for the
NetRexx code. Setting this to off will report decimal arithmetic
as an error, for performance critical applications.</td>
<td valign="top" align="center">No</td>
<td>decimal</td>
<td>Whether decimal arithmetic should be used for the NetRexx code. Setting this to <q>off</q>
will report decimal arithmetic as an error, for performance critical applications.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
<td valign="top">indicates whether default excludes should be used or not
(&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
omitted.</td>
<td valign="top" align="center">No</td>
<td>defaultexcludes</td>
<td>Whether default excludes should be used or not (<q>yes|no</q>).</td>
<td>No; defaults to <q>yes</q></td>
</tr>
<tr>
<td valign="top">destDir</td>
<td valign="top">the destination directory into which the NetRexx
source files should be copied and then compiled</td>
<td valign="top" align="center">Yes</td>
<td>destDir</td>
<td>the destination directory into which the NetRexx source files should be copied and then
compiled</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">diag</td>
<td valign="top">Whether diagnostic information about the compile is
generated</td>
<td valign="top" align="center">No</td>
<td>diag</td>
<td>Whether diagnostic information about the compile is generated</td>
<td>No</td>
</tr>
<tr>
<td valign="top">excludes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
excluded. No files (except default excludes) are excluded when
omitted.</td>
<td valign="top" align="center">No</td>
<td>excludes</td>
<td>Comma- or space-separated list of patterns of files that must be excluded.</td>
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
</tr>
<tr>
<td valign="top">excludesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an exclude pattern</td>
<td valign="top" align="center">No</td>
<td>excludesfile</td>
<td>Name of a file. Each line of this file is taken to be an exclude pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">explicit</td>
<td valign="top">Whether variables must be declared explicitly
before use</td>
<td valign="top" align="center">No</td>
<td>explicit</td>
<td>Whether variables must be declared explicitly before use</td>
<td>No</td>
</tr>
<tr>
<td valign="top">format</td>
<td valign="top">Whether the generated java code is formatted nicely
or left to match NetRexx line numbers for call stack debugging</td>
<td valign="top" align="center">No</td>
<td>format</td>
<td>Whether the generated Java code is formatted nicely or left to match NetRexx line numbers
for call stack debugging</td>
<td>No</td>
</tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma- or space-separated list of patterns of files that must be
included. All files are included when omitted.</td>
<td valign="top" align="center">No</td>
<td>includes</td>
<td>Comma- or space-separated list of patterns of files that must be included.</td>
<td>No; defaults to all (<q>**</q>)</td>
</tr>
<tr>
<td valign="top">includesfile</td>
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
<td valign="top" align="center">No</td>
<td>includesfile</td>
<td>Name of a file. Each line of this file is taken to be an include pattern</td>
<td>No</td>
</tr>
<tr>
<td valign="top">java</td>
<td valign="top">Whether the generated java code is produced</td>
<td valign="top" align="center">No</td>
<td>java</td>
<td>Whether the generated Java code is produced</td>
<td>No</td>
</tr>
<tr>
<td valign="top">keep</td>
<td valign="top">Sets whether the generated java source file should be kept
after compilation. The generated files will have an extension of
.java.keep, <b>not</b> .java. Use removeKeepExtension to change that.</td>
<td valign="top" align="center">No</td>
<td>keep</td>
<td>Sets whether the generated java source file should be kept after compilation. The generated
files will have an extension
of <samp>.java.keep</samp>, <strong>not</strong> <samp>.java</samp>. Use <q>removeKeepExtension</q>
to change that.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">logo</td>
<td valign="top">Whether the compiler text logo is displayed when
compiling</td>
<td valign="top" align="center">No</td>
<td>logo</td>
<td>Whether the compiler text logo is displayed when compiling</td>
<td>No</td>
</tr>
<tr>
<td valign="top">removeKeepExtension</td>
<td valign="top">Tells whether the trailing .keep in nocompile-mode should
be removed so that the resulting java source really ends on .java. This
facilitates the use of the javadoc tool lateron.</td>
<td valign="top" align="center">No</td>
<td>removeKeepExtension</td>
<td>Tells whether the trailing <samp>.keep</samp> in <var>compile</var>=<q>false</q> mode should
be removed so that the resulting Java source file really ends on <samp>.java</samp>. This
facilitates the use of the <code>javadoc</code> tool later on.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">replace</td>
<td valign="top">Whether the generated .java file should be replaced
when compiling</td>
<td valign="top" align="center">No</td>
<td>replace</td>
<td>Whether the generated <samp>.java</samp> files should be replaced when compiling</td>
<td>No</td>
</tr>
<tr>
<td valign="top">savelog</td>
<td valign="top">Whether the compiler messages will be written to
NetRexxC.log as well as to the console</td>
<td valign="top" align="center">No</td>
<td>savelog</td>
<td>Whether the compiler messages will be written to <samp>NetRexxC.log</samp> as well as to the
console</td>
<td>No</td>
</tr>
<tr>
<td valign="top">sourcedir</td>
<td valign="top">Tells the NetRexx compiler to store the class files in the
same directory as the source files. The alternative is the working
directory</td>
<td valign="top" align="center">No</td>
<td>sourcedir</td>
<td>Tells the NetRexx compiler to store the class files in the same directory as the source
files. The alternative is the working directory</td>
<td>No</td>
</tr>
<tr>
<td valign="top">srcDir</td>
<td valign="top">Set the source dir to find the source NetRexx
files</td>
<td valign="top" align="center">Yes</td>
<td>srcDir</td>
<td>Sets the directory to find the source NetRexx files in</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">strictargs</td>
<td valign="top">Tells the NetRexx compiler that method calls always
need parentheses, even if no arguments are needed, e.g.
<code>aStringVar.getBytes</code> vs.
<code>aStringVar.getBytes()</code></td>
<td valign="top" align="center">No</td>
<td>strictargs</td>
<td>Tells the NetRexx compiler that method calls always need parentheses, even if no arguments
are needed, e.g. <code>aStringVar.getBytes</code> vs. <code>aStringVar.getBytes()</code></td>
<td>No</td>
</tr>
<tr>
<td valign="top">strictassign</td>
<td valign="top">Tells the NetRexx compile that assignments must
match exactly on type</td>
<td valign="top" align="center">No</td>
<td>strictassign</td>
<td>Tells the NetRexx compile that assignments must match exactly on type</td>
<td>No</td>
</tr>
<tr>
<td valign="top">strictcase</td>
<td valign="top">Specifies whether the NetRexx compiler should be
case sensitive or not</td>
<td valign="top" align="center">No</td>
<td>strictcase</td>
<td>Specifies whether the NetRexx compiler should be case sensitive or not</td>
<td>No</td>
</tr>
<tr>
<td valign="top">strictimport</td>
<td valign="top">Whether classes need to be imported explicitly using an
<code>import</code> statement. By default the NetRexx compiler will
import certain packages automatically</td>
<td valign="top" align="center">No</td>
<td>strictimport</td>
<td>Whether classes need to be imported explicitly using an <code>import</code> statement</td>
<td>No; by default the NetRexx compiler will import certain packages automatically</td>
</tr>
<tr>
<td valign="top">strictprops</td>
<td valign="top">Whether local properties need to be qualified
explicitly using <code>this</code></td>
<td valign="top" align="center">No</td>
<td>strictprops</td>
<td>Whether local properties need to be qualified explicitly using <code>this</code></td>
<td>No</td>
</tr>
<tr>
<td valign="top">strictsignal</td>
<td valign="top">Whether the compiler should force catching of
exceptions by explicitly named types</td>
<td valign="top" align="center">No</td>
<td>strictsignal</td>
<td>Whether the compiler should force catching of exceptions by explicitly named types</td>
<td>No</td>
</tr>
<tr>
<td valign="top">symbols</td>
<td valign="top">Whether debug symbols should be generated into the
class file</td>
<td valign="top" align="center">No</td>
<td>symbols</td>
<td>Whether debug symbols should be generated into the class file</td>
<td>No</td>
</tr>
<tr>
<td valign="top">time</td>
<td valign="top">Asks the NetRexx compiler to print compilation
times to the console</td>
<td valign="top" align="center">No</td>
<td>time</td>
<td>Asks the NetRexx compiler to print compilation times to the console</td>
<td>No</td>
</tr>
<tr>
<td valign="top">trace</td>
<td valign="top">Turns on or off tracing and directs the resultant
trace output</td>
<td valign="top" align="center">No</td>
<td>trace</td>
<td>Turns on or off tracing and directs the resultant trace output</td>
<td>No</td>
</tr>
<tr>
<td valign="top">utf8</td>
<td valign="top">Tells the NetRexx compiler that the source is in UTF8</td>
<td valign="top" align="center">No</td>
<td>utf8</td>
<td>Tells the NetRexx compiler that the source is in UTF8</td>
<td>No</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether lots of warnings and error messages should
be generated</td>
<td valign="top" align="center">No</td>
<td>verbose</td>
<td>Tells whether lots of warnings and error messages should be generated</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suppressMethodArgumentNotUsed</td>
<td valign="top">Tells whether we should filter out the
&amp;Method argument not used&amp; messages in strictargs mode.</td>
<td valign="top" align="center">No</td>
<td>suppressMethodArgumentNotUsed</td>
<td>Tells whether we should filter out the <q>Method argument not used</q> messages
in <var>strictargs</var> mode.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suppressPrivatePropertyNotUsed</td>
<td valign="top">Tells whether we should filter out the
&amp;Private Property defined, but not used&amp; messages in strictargs mode.</td>
<td valign="top" align="center">No</td>
<td>suppressPrivatePropertyNotUsed</td>
<td>Tells whether we should filter out the <q>Private Property defined, but not used</q>
messages in <var>strictargs</var> mode.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suppressVariableNotUsed</td>
<td valign="top">Tells whether we should filter out the
&amp;Variable set but not used&amp; messages in strictargs mode.
Please be careful with this one, as you can hide errors behind it!</td>
<td valign="top" align="center">No</td>
<td>suppressVariableNotUsed</td>
<td>Tells whether we should filter out the <q>Variable set but not used</q> messages
in <var>strictargs</var> mode. Please be careful with this one, as you can hide errors behind
it!</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suppressExceptionNotSignalled</td>
<td valign="top">Tells whether we should filter out the
&amp;Exception is declared, but not signalled within the method&amp;
messages in strictsignal mode.</td>
<td valign="top" align="center">No</td>
<td>suppressExceptionNotSignalled</td>
<td>Tells whether we should filter out the <q>Exception is declared, but not signalled within
the method</q> messages in <var>strictsignal</var> mode.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">suppressDeprecation</td>
<td valign="top">Tells whether we should filter out any deprecation-messages
of the compiler out.</td>
<td valign="top" align="center">No</td>
<td>suppressDeprecation</td>
<td>Tells whether we should filter out any deprecation messages of the compiler output</td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>

<pre>&lt;netrexxc srcDir=&quot;/source/project&quot;
includes=&quot;vnr/util/*&quot;
destDir=&quot;/source/project/build&quot;
classpath=&quot;/source/project2/proj.jar&quot;
comments=&quot;true&quot;
crossref=&quot;false&quot; replace=&quot;true&quot;
keep=&quot;true&quot;/&gt;</pre>
<pre>
&lt;netrexxc srcDir=&quot;/source/project&quot;
includes=&quot;vnr/util/*&quot;
destDir=&quot;/source/project/build&quot;
classpath=&quot;/source/project2/proj.jar&quot;
comments=&quot;true&quot;
crossref=&quot;false&quot; replace=&quot;true&quot;
keep=&quot;true&quot;/&gt;</pre>

</body>
</html>

+ 21
- 28
manual/Tasks/nice.html View File

@@ -26,43 +26,36 @@

<h2 id="echo">Nice</h2>
<h3>Description</h3>
<p>Provide "nice-ness" to the current thread
and/or query the current value.</p>
<p>Provide &quot;nice-ness&quot; to the current thread and/or query the current value.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">currentpriority</td>
<td valign="top">the name of the property whose value should be
set to the current &quot;nice-ness&quot; level.
</td>
<td valign="top" align="center">No</td>
<td>currentpriority</td>
<td>name of the property whose value should be set to the current &quot;nice-ness&quot;
level.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">newpriority</td>
<td valign="top">the value to which the
&quot;nice-ness&quot; level should be set.
Must be a valid Java Thread priority.
</td>
<td valign="top" align="center">No</td>
<td>newpriority</td>
<td>value to which the &quot;nice-ness&quot; level should be set. Must be a valid Java Thread
priority.</td>
<td>No</td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;nice newpriority=&quot;10&quot;/&gt;</pre>
Set the Thread priority to 10 (highest).
<pre> &lt;nice currentpriority=&quot;priority&quot;/&gt;</pre>
Store the current Thread priority in the user property "priority".
<pre>
&lt;nice currentpriority=&quot;currentpriority&quot; newpriority=&quot;1&quot;/&gt;
</pre>
<p>Set the current Thread priority to 1 (lowest), storing the original
priority in the user property "currentpriority". This
can be used to set the priority back to its original value later.
</p>
<pre>&lt;nice newpriority=&quot;10&quot;/&gt;</pre>
<p>Set the Thread priority to 10 (highest).</p>
<pre>&lt;nice currentpriority=&quot;priority&quot;/&gt;</pre>
<p>Store the current Thread priority in the user property <code>priority</code>.</p>
<pre>&lt;nice currentpriority=&quot;currentpriority&quot; newpriority=&quot;1&quot;/&gt;</pre>
<p>Set the current Thread priority to 1 (lowest), storing the original priority in the user
property <code>currentpriority</code>. This can be used to set the priority back to its original
value later.</p>

</body>
</html>

+ 25
- 35
manual/Tasks/pack.html View File

@@ -26,59 +26,49 @@

<h2 id="pack">GZip/BZip2/XZ</h2>
<h3>Description</h3>
<p>Packs a resource using the GZip, BZip2 or XZ algorithm.
The output file is only generated if it doesn't exist or the source
resource is newer.</p>
<p>Packs a resource using the GZip, BZip2 or XZ algorithm. The output file is only generated if it
doesn't exist or the source resource is newer.</p>

<p>XZ compression support has been added with Apache Ant 1.10.1 and
depends on external libraries not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library
Dependencies</a> for more information.</p>
<p>XZ compression support has been added <em>since Apache Ant 1.10.1</em> and depends on external
libraries not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">src</td>
<td valign="top">the file to gzip/bzip/xz.</td>
<td align="center" valign="top">Yes, or a nested resource collection.</td>
<td>src</td>
<td>the file to gzip/bzip/xz.</td>
<td>Yes, or a nested resource collection</td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">the destination file to create.</td>
<td align="center" valign="top" rowspan="2">Exactly one of the two</td>
<td>destfile</td>
<td>the destination file to create.</td>
<td rowspan="2">Exactly one of the two</td>
</tr>
<tr>
<td valign="top">zipfile</td>
<td valign="top">the <i>deprecated</i> old name of destfile.</td>
<td>zipfile</td>
<td class="left"><em><u>deprecated</u></em> old name of <var>destfile</var>.</td>
</tr>
</table>
<h4>any <a href="../Types/resources.html">resource</a> or single element
resource collection</h4>
<h4>any <a href="../Types/resources.html">resource</a> or single element resource collection</h4>

<p>The specified resource will be used as src. <em>Since Apache Ant 1.7</em></p>
<p>The specified resource will be used as <var>src</var>. <em>Since Apache Ant 1.7</em></p>

<h3>Examples</h3>
<pre>
&lt;gzip src=&quot;test.tar&quot; destfile=&quot;test.tar.gz&quot;/&gt;
</pre>
<pre>
&lt;bzip2 src=&quot;test.tar&quot; destfile=&quot;test.tar.bz2&quot;/&gt;
</pre>
<pre>
&lt;xz src=&quot;test.tar&quot; destfile=&quot;test.tar.xz&quot;/&gt;
</pre>
<pre>&lt;gzip src=&quot;test.tar&quot; destfile=&quot;test.tar.gz&quot;/&gt;</pre>
<pre>&lt;bzip2 src=&quot;test.tar&quot; destfile=&quot;test.tar.bz2&quot;/&gt;</pre>
<pre>&lt;xz src=&quot;test.tar&quot; destfile=&quot;test.tar.xz&quot;/&gt;</pre>
<pre>
&lt;gzip destfile=&quot;archive.tar.gz&quot;&gt;
&lt;url url="http://example.org/archive.tar"/&gt;
&lt;/gzip&gt;
</pre>
<p>downloads <i>http://example.org/archive.tar</i> and compresses it
to <i>archive.tar.gz</i> in the project's basedir on the fly.</p>
&lt;/gzip&gt;</pre>
<p>downloads <samp>http://example.org/archive.tar</samp> and compresses it
to <samp>archive.tar.gz</samp> in the project's <var>basedir</var> on the fly.</p>

</body>
</html>

+ 116
- 147
manual/Tasks/parallel.html View File

@@ -26,136 +26,114 @@

<h2>Parallel</h2>
<h3>Description</h3>
<p>
Executes nested tasks in parallel with no guarantees of thread safety.
Every task will run in its own thread, with the likelihood of
concurrency problems scaling with the number of CPUs on the host system.
</p>
<p><b>Warning:</b> While the Apache Ant core is believed to be thread safe, no such
guarantees are made about tasks, which are not tested for thread safety during
Ant's test process.
Third party tasks may or may not be thread safe, and some of Ant's core tasks, such as
<code>&lt;javac&gt;</code> are definitely not re-entrant. This is because they use libraries that
were never designed to be used in a multithreaded environment.
</p>
<p>
The primary use case for <code>&lt;parallel&gt;</code> is to run external programs
such as an application server, and the JUnit or TestNG test suites at the
same time. Anyone trying to run large Ant task sequences in parallel, such
as javadoc and javac at the same time, is implicitly taking on the task
of identifying and fixing all concurrency bugs the tasks that they run.

</p>
<p>
Accordingly, while this task has uses, it should be considered an advanced
task which should be used in certain batch-processing or testing situations,
rather than an easy trick to speed up build times on a multicore CPU.
</p>
<p>Executes nested tasks in parallel with no guarantees of thread safety. Every task will run in
its own thread, with the likelihood of concurrency problems scaling with the number of CPUs on the
host system.</p>
<p><strong>Warning</strong>: While the Apache Ant core is believed to be thread safe, no such
guarantees are made about tasks, which are not tested for thread safety during Ant's test process.
Third party tasks may or may not be thread safe, and some of Ant's core tasks, such
as <code>&lt;javac&gt;</code> are definitely not re-entrant. This is because they use libraries that
were never designed to be used in a multithreaded environment.</p>
<p>The primary use case for <code>&lt;parallel&gt;</code> is to run external programs such as an
application server, and the JUnit or TestNG test suites at the same time. Anyone trying to run large
Ant task sequences in parallel, such as <code>javadoc</code> and <code>javac</code> at the same
time, is implicitly taking on the task of identifying and fixing all concurrency bugs the tasks that
they run.</p>
<p>Accordingly, while this task has uses, it should be considered an advanced task which should be
used in certain batch processing or testing situations, rather than an easy trick to speed up build
times on a multicore CPU.</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">threadCount</td>
<td valign="top">Maximum numbers of thread to use.</td>
<td align="center" valign="top">No</td>
<td>threadCount</td>
<td>Maximum numbers of thread to use.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">threadsPerProcessor</td>
<td valign="top">Maximum number of threads to use per available processor
(Java 1.4+)</td>
<td align="center" valign="top">No, defers to threadCount</td>
<td>threadsPerProcessor</td>
<td>Maximum number of threads to use per available processor (Java 1.4+)</td>
<td>No; defers to <var>threadCount</var></td>
</tr>
<tr>
<td valign="top">timeout</td>
<td valign="top">Number of milliseconds before execution is terminated</td>
<td align="center" valign="top">No</td>
<td>timeout</td>
<td>Number of milliseconds before execution is terminated</td>
<td>No</td>
</tr>
<tr>
<td valign="top">failonany</td>
<td valign="top">If any of the nested tasks fails, execution of the task completes
at that point without waiting for any other tasks to complete.</td>
<td align="center" valign="top">No, default is false.</td>
<td>failonany</td>
<td>If any of the nested tasks fails, execution of the task completes at that point without
waiting for any other tasks to complete.</td>
<td>No; default is <q>false</q>.</td>
</tr>
<tr>
<td valign="top">pollInterval</td>
<td valign="top">Currently has no effect</td>
<td align="center" valign="top">No, default is 1000</td>
<td>pollInterval</td>
<td>Currently has no effect</td>
<td>No; default is <q>1000</q></td>
</tr>
</table>

<p>Parallel tasks have a number of uses in an Ant build file including:</p>
<ul>
<li>Taking advantage of available processing resources to execute external
programs simultaneously.</li>
<li>Testing servers, where the server can be run in one thread and the test
harness is run in another thread.</li>
<li>Taking advantage of available processing resources to execute external programs
simultaneously.</li>
<li>Testing servers, where the server can be run in one thread and the test harness is run in
another thread.</li>
</ul>

<p>Any valid Ant task may be embedded within a
parallel task, including other parallel tasks, though there is no guarantee that
the tasks will be thread safe in such an environment.</p>

<p>While the tasks within the parallel task are being run, the main
thread will be blocked waiting for all the child threads to complete. If
execution is terminated by a timeout or a nested task failure when the
<code>failonany</code>
flag is set, the parallel task will complete without waiting for other nested
tasks to complete in other threads.
</p>

<p>If any of the tasks within the <code>&lt;parallel&gt;</code> task fails and failonany is
not set, the remaining tasks in other threads will continue to run until
all threads have completed. In this situation, the parallel task will also fail.</p>

<p>The parallel 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>

<p>The <code>threadCount</code> attribute can be used to place a maximum number of available
threads for the execution. When not present all child tasks will be executed at
once. When present then the maximum number of concurrently executing tasks will
not exceed the number of threads specified. Furthermore, each task will be
started in the order they are given. But no guarantee is made as to the speed
of execution or the order of completion of the tasks, only that each will be
started before the next.<p>

<p>If you are using Java 1.4 or later you can also use the <code>threadsPerProcessor</code>
and the number of available threads will be the stated multiple of the number of
processors (there is no affinity to a particular processor however). This will
override the value in <code>threadCount</code>. If <code>threadsPerProcessor</code>
is specified on any older JVM, then the value in <code>threadCount</code> will be used as is.</p>

<p>When using <code>threadCount</code> and <code>threadsPerProcessor</code>
care should be taken to ensure that the build does not deadlock.
This can be caused by tasks such as <code>waitfor</code>
taking up all available threads before the tasks that would unlock the
<code>waitfor</code>
would occur. This is not a replacement for Java Language level thread
semantics and is best used for "embarrassingly parallel" tasks.</p>

<p>Any valid Ant task may be embedded within a <code>parallel</code> task, including
other <code>parallel</code> tasks, though there is no guarantee that the tasks will be thread safe
in such an environment.</p>

<p>While the tasks within the <code>parallel</code> task are being run, the main thread will be
blocked waiting for all the child threads to complete. If execution is terminated by a timeout or a
nested task failure when the <var>failonany</var> flag is set, the <code>parallel</code> task will
complete without waiting for other nested tasks to complete in other threads.</p>

<p>If any of the tasks within the <code>&lt;parallel&gt;</code> task fails and <var>failonany</var>
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>

<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>

<p>The <var>threadCount</var> attribute can be used to place a maximum number of available threads
for the execution. When not present all child tasks will be executed at once. When present then
the maximum number of concurrently executing tasks will not exceed the number of threads specified.
Furthermore, each task will be started in the order they are given. But no guarantee is made as to
the speed of execution or the order of completion of the tasks, only that each will be started
before the next.<p>

<p>If you are using Java 1.4 or later you can also use the <var>threadsPerProcessor</var> and the
number of available threads will be the started multiple of the number of processors (there is no
affinity to a particular processor, however). This will override the value
in <var>threadCount</var>. If <var>threadsPerProcessor</var> is specified on any older JVM, then
the value in <var>threadCount</var> will be used as is.</p>

<p>When using <var>threadCount</var> and <var>threadsPerProcessor</var> care should be taken to
ensure that the build does not deadlock. This can be caused by tasks such as <code>waitfor</code>
taking up all available threads before the tasks that would unlock the <code>waitfor</code> would
occur. This is not a replacement for Java Language level thread semantics and is best used for
"embarrassingly parallel" tasks.</p>

<h3>Parameters specified as nested elements</h3>

<h4>daemons</h4>
<p>
The parallel task supports a <code>&lt;daemons&gt;</code> nested element. This is a list of tasks
which are to be run in parallel daemon threads. The parallel task will not wait for
these tasks to complete. Being daemon threads, however, they will not prevent Ant from
completing, whereupon the threads are terminated. Failures in daemon threads which
occur before the parallel task itself finishes will be reported and can cause
parallel to throw an exception. Failures which occur after parallel has completed are not
reported.
</p>

<p>Daemon tasks can be used, for example, to start test servers which might not be easily
terminated from Ant. By using <code>&lt;daemons&gt;</code> such servers do not halt the build.
</p>
<p>The <code>parallel</code> task supports a <code>&lt;daemons&gt;</code> nested element. This is a
list of tasks which are to be run in parallel daemon threads. The parallel task will not wait for
these tasks to complete. Being daemon threads, however, they will not prevent Ant from completing,
whereupon the threads are terminated. Failures in daemon threads which occur before
the <code>parallel</code> task itself finishes will be reported and can cause <code>parallel</code>
to throw an exception. Failures which occur after <code>parallel</code> has completed are not
reported.</p>

<p>Daemon tasks can be used, for example, to start test servers which might not be easily terminated
from Ant. By using <code>&lt;daemons&gt;</code> such servers do not halt the build.</p>

<h3>Examples</h3>
<pre>
@@ -166,15 +144,13 @@ terminated from Ant. By using <code>&lt;daemons&gt;</code> such servers do not h
&lt;junit fork="true" forkmode="once" ... &gt;
&lt;wlstop/&gt;
&lt;/sequential&gt;
&lt;/parallel&gt;
</pre>
<p>This example represents a typical pattern for testing a server application.
In one thread the server is started (the <code>&lt;wlrun&gt;</code> task).
The other thread consists
of a three tasks which are performed in sequence. The <code>&lt;sleep&gt;</code> task is used to
give the server time to come up. Another task which is capable of validating
that the server is available could be used in place of the <code>&lt;sleep&gt;</code> task. The
<code>&lt;junit&gt;</code> test harness then runs, again in its own JVM. Once the tests are complete, the server is stopped
&lt;/parallel&gt;</pre>
<p>This example represents a typical pattern for testing a server application. In one thread the
server is started (the <code>&lt;wlrun&gt;</code> task). The other thread consists of a three tasks
which are performed in sequence. The <code>&lt;sleep&gt;</code> task is used to give the server time
to come up. Another task which is capable of validating that the server is available could be used
in place of the <code>&lt;sleep&gt;</code> task. The <code>&lt;junit&gt;</code> test harness then
runs, again in its own JVM. Once the tests are complete, the server is stopped
(using <code>&lt;wlstop&gt;</code> in this example), allowing both threads to complete. The
<code>&lt;parallel&gt;</code> task will also complete at this time and the build will then
continue.</p>
@@ -183,51 +159,44 @@ continue.</p>
&lt;parallel&gt;
&lt;javac fork="true"...&gt; &lt;!-- compiler servlet code --&gt;
&lt;wljspc ...&gt; &lt;!-- precompile JSPs --&gt;
&lt;/parallel&gt;
</pre>

<p>This example shows two independent tasks being run to achieve better
resource utilization during the build. In this instance, some servlets are being
compiled in one thead and a set of JSPs is being precompiled in another. Developers
need to be careful that the two tasks are independent, both in
terms of their dependencies and in terms of their potential interactions in
Ant's external environment. Here we set <code>fork="true"</code> for the
<code>&lt;javac&gt;</code> task, so that it runs in a new process;
if the <code>&lt;wljspc&gt;</code> task used the javac compiler in-VM
(it may), concurrency problems may arise.
</p>
&lt;/parallel&gt;</pre>

<p>This example shows two independent tasks being run to achieve better resource utilization during
the build. In this instance, some servlets are being compiled in one thread and a set of JSPs is
being precompiled in another. Developers need to be careful that the two tasks are independent, both
in terms of their dependencies and in terms of their potential interactions in Ant's external
environment. Here we set <var>fork</var>=<q>true</q> for the <code>&lt;javac&gt;</code> task, so
that it runs in a new process; if the <code>&lt;wljspc&gt;</code> task used the <code>javac</code>
compiler in-VM (it may), concurrency problems may arise.</p>

<pre>
&lt;macrodef name="dbpurge"&gt;
&lt;attribute file="file"/&gt;
&lt;sequential&gt;
&lt;java jar="utils/dbpurge.jar" fork="true" &gt;
&lt;arg file="@{file} /&gt;
&lt;arg file="@{file}/&gt;
&lt;/java&gt;
&lt;/sequential&gt;
&lt;/macrodef&gt;

&lt;parallel threadCount="4"&gt;
&lt;dbpurge file="db/one" /&gt;
&lt;dbpurge file="db/two" /&gt;
&lt;dbpurge file="db/three" /&gt;
&lt;dbpurge file="db/four" /&gt;
&lt;dbpurge file="db/five" /&gt;
&lt;dbpurge file="db/six" /&gt;
&lt;dbpurge file="db/seven" /&gt;
&lt;dbpurge file="db/eight" /&gt;
&lt;dbpurge file="db/one"/&gt;
&lt;dbpurge file="db/two"/&gt;
&lt;dbpurge file="db/three"/&gt;
&lt;dbpurge file="db/four"/&gt;
&lt;dbpurge file="db/five"/&gt;
&lt;dbpurge file="db/six"/&gt;
&lt;dbpurge file="db/seven"/&gt;
&lt;dbpurge file="db/eight"/&gt;
&lt;!-- repeated about 40 times --&gt;
&lt;/parallel&gt;
</pre>

<p>This example represents a typical need for use of the threadCount and
threadsPerProcessor attributes. Spinning up all 40 of those tasks could cripple
the system for memory and CPU time. By limiting the number of
concurrent executions you can reduce contention for CPU, memory and disk IO,
and so actually finish faster. This is also a good
candidate for use of threadCount (and possibly threadsPerProcessor) because
each task is independent (every new JVM is forked) and has no dependencies on
the other tasks.</p>
&lt;/parallel&gt;</pre>

<p>This example represents a typical need for use of the <var>threadCount</var>
and <var>threadsPerProcessor</var> attributes. Spinning up all 40 of those tasks could cripple the
system for memory and CPU time. By limiting the number of concurrent executions you can reduce
contention for CPU, memory and disk IO, and so actually finish faster. This is also a good
candidate for use of <var>threadCount</var> (and possibly <var>threadsPerProcessor</var>) because
each task is independent (every new JVM is forked) and has no dependencies on the other tasks.</p>

</body>
</html>

+ 46
- 51
manual/Tasks/patch.html View File

@@ -26,83 +26,78 @@

<h2 id="patch">Patch</h2>
<h3>Description</h3>
<p>Applies a diff file to originals. Requires "patch" to be on the execution path.</p>
<p>Applies a diff file to originals. Requires <code>patch</code> to be on the execution path.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">patchfile</td>
<td valign="top">the file that includes the diff output</td>
<td align="center" valign="top">Yes</td>
<td>patchfile</td>
<td>the file that includes the diff output</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">originalfile</td>
<td valign="top">the file to patch</td>
<td align="center" valign="top">No, tries to guess it from the diff
file</td>
<td>originalfile</td>
<td>the file to patch</td>
<td>No; tries to guess it from the diff file</td>
</tr>
<tr>
<td valign="top">destfile</td>
<td valign="top">the file to send the output to instead of
patching the file(s) in place. <em>since Apache Ant 1.6</em></td>
<td align="center" valign="top">No.</td>
<td>destfile</td>
<td>the file to send the output to instead of patching the file(s) in place. <em>since Apache
Ant 1.6</em></td>
<td>No</td>
</tr>
<tr>
<td valign="top">backups</td>
<td valign="top">Keep backups of the unpatched files</td>
<td align="center" valign="top">No</td>
<td>backups</td>
<td>Keep backups of the unpatched files</td>
<td>No</td>
</tr>
<tr>
<td valign="top">quiet</td>
<td valign="top">Work silently unless an error occurs</td>
<td align="center" valign="top">No</td>
<td>quiet</td>
<td>Work silently unless an error occurs</td>
<td>No</td>
</tr>
<tr>
<td valign="top">reverse</td>
<td valign="top">Assume patch was created with old and new files
swapped.</td>
<td align="center" valign="top">No</td>
<td>reverse</td>
<td>Assume patch was created with old and new files swapped.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">ignorewhitespace</td>
<td valign="top">Ignore whitespace differences.</td>
<td align="center" valign="top">No</td>
<td>ignorewhitespace</td>
<td>Ignore whitespace differences.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">strip</td>
<td valign="top">Strip the smallest prefix containing <i>num</i> leading
slashes from filenames.</td>
<td align="center" valign="top">No</td>
<td>strip</td>
<td>Strip the smallest prefix containing <q>num</q> leading slashes from filenames.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">dir</td>
<td valign="top">The directory in which to run the patch command.</td>
<td align="center" valign="top">No, default is the project's basedir.</td>
<td>dir</td>
<td>The directory in which to run the <code>patch</code> command.</td>
<td>No; default is the project's <var>basedir</var></td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a
return code signaling failure. Defaults to false.
<em>since Ant 1.8.0</em></td>
<td align="center" valign="top">No</td>
<td>failonerror</td>
<td>Stop the build process if the command exits with a return code signaling failure. <em>since
Ant 1.8.0</em></td>
<td>No; defaults to <q>false</q></td>
</tr>
</table>
<h3>Examples</h3>
<pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot;/&gt;</pre>
<p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
files in base directory guessing the filename(s) from the diff output.</p>
<pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot;/&gt;</pre>
<p>like above but one leading directory part will be removed. i.e. if
the diff output looked like</p>
<pre>&lt;patch patchfile=&quot;module.1.0-1.1.patch&quot;/&gt;</pre>
<p>applies the diff included in <samp>module.1.0-1.1.patch</samp> to the files in base directory
guessing the filename(s) from the diff output.</p>
<pre>&lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot;/&gt;</pre>
<p>like above but one leading directory part will be removed. i.e. if the diff output looked
like</p>
<pre>
--- a/mod1.0/A Mon Jun 5 17:28:41 2000
+++ a/mod1.1/A Mon Jun 5 17:28:49 2000
</pre>
the leading <i>a/</i> will be stripped.
--- a/mod1.0/A Mon Jun 5 17:28:41 2000
+++ a/mod1.1/A Mon Jun 5 17:28:49 2000</pre>
the leading <samp>a/</samp> will be stripped.

</body>
</html>

+ 101
- 144
manual/Tasks/pathconvert.html View File

@@ -26,197 +26,154 @@

<h2 id="pathconvert">Pathconvert</h2>
<h3>Description</h3>
<p>Converts nested <a href="../Types/resources.html#collection">
ResourceCollection</a>s, or a reference to just one, into a path
form for a particular platform, optionally storing the result into
a given property. It can also be used when you need
to convert a Resource Collection into a list, separated by a given
character, such as a comma or space, or, conversely, e.g. to convert a list
of files in a FileList into a path.
</p>
<p>Nested <code>&lt;map&gt;</code> elements can be specified to map Windows
drive letters to Unix paths, and vice-versa.</p>
<p>More complex transformations can be achieved using a nested
<a href="../Types/mapper.html"><code>&lt;mapper&gt;</code></a>
(<em>since Apache Ant 1.6.2</em>).
</p>
<p>Converts nested <a href="../Types/resources.html#collection"> ResourceCollection</a>s, or a
reference to just one, into a path form for a particular platform, optionally storing the result
into a given property. It can also be used when you need to convert a Resource Collection into a
list, separated by a given character, such as a comma or space, or, conversely, e.g. to convert a
list of files in a FileList into a path.</p>
<p>Nested <code>&lt;map&gt;</code> elements can be specified to map Windows drive letters to Unix
paths, and vice-versa.</p>
<p>More complex transformations can be achieved using a
nested <a href="../Types/mapper.html"><code>&lt;mapper&gt;</code></a> (<em>since Apache Ant
1.6.2</em>).</p>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">targetos</td>
<td valign="top">
The target architecture. Must be one of 'unix', 'windows',
'netware', 'tandem' or 'os/2'.
This is a shorthand mechanism for specifying both
<code>pathsep</code> and <code>dirsep</code>
according to the specified target architecture.
</td>
<td valign="top" align="center">No</td>
<td>targetos</td>
<td>The target architecture. Must be one
of <q>unix</q>, <q>windows</q>, <q>netware</q>, <q>tandem</q> or <q>os/2</q>. This is a
shorthand mechanism for specifying both <var>pathsep</var> and <var>dirsep</var> according
to the specified target architecture.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">dirsep</td>
<td valign="top">
The character(s) to use as the directory separator in the
generated paths.
</td>
<td valign="top" align="center">No, defaults to current JVM <tt>File.separator</tt></td>
<td>dirsep</td>
<td>The character(s) to use as the directory separator in the generated paths.</td>
<td>No; defaults to current JVM <code>File.separator</code></td>
</tr>
<tr>
<td valign="top">pathsep</td>
<td valign="top">
The character(s) to use as the path-element separator in the
generated paths.
</td>
<td valign="top" align="center">No, defaults to current JVM <tt>File.pathSeparator</tt></td>
<td>pathsep</td>
<td>The character(s) to use as the path-element separator in the generated paths.</td>
<td>No; defaults to current JVM <code>File.pathSeparator</code></td>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The name of the property in which to place the converted path.</td>
<td valign="top" align="center">No, result will be logged if unset</td>
<td>property</td>
<td>The name of the property in which to place the converted path.</td>
<td>No, result will be logged if unset</td>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top">What to convert, given as a
<a href="../using.html#references">reference</a> to a
<code>&lt;path&gt;</code>, <code>&lt;fileset&gt;</code>,
<code>&lt;dirset&gt;</code>, or <code>&lt;filelist&gt;</code>
defined elsewhere</td>
<td valign="top" align="center">No; if omitted, a nested
<code>&lt;path&gt;</code> element must be supplied.</td>
<td>refid</td>
<td>What to convert, given as a <a href="../using.html#references">reference</a> to
a <code>&lt;path&gt;</code>, <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code>,
or <code>&lt;filelist&gt;</code> defined elsewhere</td>
<td>Yes, unless a nested <code>&lt;path&gt;</code> element is supplied</td>
</tr>
<tr>
<td valign="top">setonempty</td>
<td valign="top">Should the property be set, even if the result
is the empty string?
<td valign="top" align="center">No; default is &quot;true&quot;.
<td>setonempty</td>
<td>Should the property be set, even if the result is the empty string?</td>
<td>No; default is <q>true</q></td>
</tr>
<tr>
<td valign="top">preserveduplicates</td>
<td valign="top">Whether to preserve duplicate resources. <em>Since Ant 1.8</em></td>
<td valign="top" align="center">No; default &quot;false&quot;.
<td>preserveduplicates</td>
<td>Whether to preserve duplicate resources. <em>Since Ant 1.8</em></td>
<td>No; default is <q>false</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>map</h4>
<p>Specifies the mapping of path prefixes between Unix and Windows.</p>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">from</td>
<td valign="top">
The prefix to match. Note that this value is case-insensitive when
the build is running on a Windows platform and case-sensitive
when running on a Unix platform.
<em>Since Ant 1.7.0</em>, on Windows this value is also insensitive
to the slash style used for directories, one can use '/' or '\'.
</td>
<td valign="top" align="center">Yes</td>
<td>from</td>
<td>The prefix to match. Note that this value is case-insensitive when the build is running on
a Windows platform and case-sensitive when running on a Unix platform. <em>Since Ant
1.7.0</em>, on Windows this value is also insensitive to the slash style used for directories,
one can use <q>/</q> or <q>\</q>.</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">to</td>
<td valign="top">The replacement text to use when <code>from</code> is matched.</td>
<td valign="top" align="center">Yes</td>
<td>to</td>
<td>The replacement text to use when <var>from</var> is matched.</td>
<td>Yes</td>
</tr>
</table>

<p>Each map element specifies a single replacement map to be applied to the elements of
the path being processed. If no map entries are specified, then no path prefix mapping
is performed.
</p>
<p><strong>Note</strong>: The map elements are applied in the order specified,
and only the first matching map element is applied. So, the ordering of
your map elements can be important, if any <code>from</code> values are
prefixes of other <code>from</code> values.
</p>
<p>Each map element specifies a single replacement map to be applied to the elements of the path
being processed. If no map entries are specified, then no path prefix mapping is performed.</p>
<p><strong>Note</strong>: The map elements are applied in the order specified, and only the first
matching map element is applied. So, the ordering of your map elements can be important, if
any <var>from</var> values are prefixes of other <var>from</var> values.</p>
<h4>Resource Collections</h4>
<p>If the <code>refid</code> attribute is not specified, then one or more
nested <a href="../Types/resources.html#collection">Resource
Collection</a>s must be supplied.</p>
<p>If the <var>refid</var> attribute is not specified, then one or more
nested <a href="../Types/resources.html#collection">Resource Collection</a>s must be supplied.</p>
<h4>mapper</h4>
<p>A single nested <a href="../Types/mapper.html">
<code>&lt;mapper&gt;</code></a> element can be specified
to perform any of various filename transformations (<em>since Ant 1.6.2</em>).
</p>
<p>A single nested <a href="../Types/mapper.html"> <code>&lt;mapper&gt;</code></a> element can be
specified to perform any of various filename transformations (<em>since Ant 1.6.2</em>).</p>

<h3>Examples</h3>
<p>In the examples below, assume that the <code>${wl.home}</code> property
has the value
<code>d:\weblogic</code>, and <code>${wl.home.unix}</code> has the value
<code>/weblogic</code>.</p>
<p>In the examples below, assume that the <samp>${wl.home}</samp> property has the
value <samp>d:\weblogic</samp>, and <samp>${wl.home.unix}</samp> has the
value <samp>/weblogic</samp>.</p>
<h4>Example 1</h4>
<pre>
&lt;path id="wl.path"&gt;
&lt;pathelement location=&quot;${wl.home}/lib/weblogicaux.jar&quot;/&gt;
&lt;pathelement location=&quot;${wl.home}/classes&quot;/&gt;
&lt;pathelement location=&quot;${wl.home}/mssqlserver4/classes&quot;/&gt;
&lt;pathelement location=&quot;c:\winnt\System32&quot;/&gt;
&lt;/path&gt;
&lt;path id="wl.path"&gt;
&lt;pathelement location=&quot;${wl.home}/lib/weblogicaux.jar&quot;/&gt;
&lt;pathelement location=&quot;${wl.home}/classes&quot;/&gt;
&lt;pathelement location=&quot;${wl.home}/mssqlserver4/classes&quot;/&gt;
&lt;pathelement location=&quot;c:\winnt\System32&quot;/&gt;
&lt;/path&gt;

&lt;pathconvert targetos=&quot;unix&quot; property=&quot;wl.path.unix&quot; refid=&quot;wl.path&quot;&gt;
&lt;map from=&quot;${wl.home}&quot; to=&quot;${wl.home.unix}&quot;/&gt;
&lt;map from=&quot;c:&quot; to=&quot;&quot;/&gt;
&lt;/pathconvert&gt;
</pre>
<p>
will generate the path shown below and store it in the property named <code>wl.path.unix</code>.
</p>
<pre>
/weblogic/lib/weblogicaux.jar:/weblogic/classes:/weblogic/mssqlserver4/classes:/WINNT/SYSTEM32
</pre>
&lt;pathconvert targetos=&quot;unix&quot; property=&quot;wl.path.unix&quot; refid=&quot;wl.path&quot;&gt;
&lt;map from=&quot;${wl.home}&quot; to=&quot;${wl.home.unix}&quot;/&gt;
&lt;map from=&quot;c:&quot; to=&quot;&quot;/&gt;
&lt;/pathconvert&gt;</pre>
<p>will generate the path shown below and store it in the property
named <code>wl.path.unix</code>.</p>
<pre>/weblogic/lib/weblogicaux.jar:/weblogic/classes:/weblogic/mssqlserver4/classes:/WINNT/SYSTEM32</pre>

<h4>Example 2</h4>
Given a FileList defined as:
<pre>
&lt;filelist id=&quot;custom_tasks.jars&quot;
dir=&quot;${env.HOME}/ant/lib&quot;
files=&quot;njavac.jar,xproperty.jar&quot;/&gt;
</pre>
then:
<p>Given a FileList defined as:</p>
<pre>
&lt;pathconvert targetos=&quot;unix&quot; property=&quot;custom_tasks.jars&quot; refid=&quot;custom_tasks.jars&quot;&gt;
&lt;map from=&quot;${env.HOME}&quot; to=&quot;/usr/local&quot;/&gt;
&lt;/pathconvert&gt;
</pre>
will convert the list of files to the following Unix path:
&lt;filelist id=&quot;custom_tasks.jars&quot;
dir=&quot;${env.HOME}/ant/lib&quot;
files=&quot;njavac.jar,xproperty.jar&quot;/&gt;</pre>
<p>then:</p>
<pre>
/usr/local/ant/lib/njavac.jar:/usr/local/ant/lib/xproperty.jar
</pre>
&lt;pathconvert targetos=&quot;unix&quot; property=&quot;custom_tasks.jars&quot; refid=&quot;custom_tasks.jars&quot;&gt;
&lt;map from=&quot;${env.HOME}&quot; to=&quot;/usr/local&quot;/&gt;
&lt;/pathconvert&gt;</pre>
<p>will convert the list of files to the following Unix path:</p>
<pre>/usr/local/ant/lib/njavac.jar:/usr/local/ant/lib/xproperty.jar</pre>

<h4>Example 3</h4>
<pre>
&lt;fileset dir=&quot;${src.dir}&quot; id=&quot;src.files&quot;&gt;
&lt;include name=&quot;**/*.java&quot;/&gt;
&lt;/fileset&gt;
&lt;fileset dir=&quot;${src.dir}&quot; id=&quot;src.files&quot;&gt;
&lt;include name=&quot;**/*.java&quot;/&gt;
&lt;/fileset&gt;

&lt;pathconvert pathsep=&quot;,&quot; property=&quot;javafiles&quot; refid=&quot;src.files&quot;/&gt;
</pre>
&lt;pathconvert pathsep=&quot;,&quot; property=&quot;javafiles&quot; refid=&quot;src.files&quot;/&gt;</pre>
<p>This example takes the set of files determined by the fileset (all files ending
in <tt>.java</tt>), joins them together separated by commas, and places the resulting
list into the property <tt>javafiles</tt>. The directory separator is not specified, so
it defaults to the appropriate character for the current platform. Such a list could
then be used in another task, like <tt>javadoc</tt>, that requires a comma separated
list of files.
</p>
in <samp>.java</samp>), joins them together separated by commas, and places the resulting list into
the property <code>javafiles</code>. The directory separator is not specified, so it defaults to
the appropriate character for the current platform. Such a list could then be used in another task,
like <code>javadoc</code>, that requires a comma separated list of files.</p>
<h4>Example 4</h4>
<pre>
&lt;pathconvert property="prop" dirsep="|"&gt;
&lt;map from="${basedir}/abc/" to=''/&gt;
&lt;path location="abc/def/ghi"/&gt;
&lt;/pathconvert&gt;
</pre>
<p>
This example sets the property "prop" to "def|ghi" on
Windows and on Unix.
</p>
&lt;pathconvert property="prop" dirsep="|"&gt;
&lt;map from="${basedir}/abc/" to=&quot;&quot;/&gt;
&lt;path location="abc/def/ghi"/&gt;
&lt;/pathconvert&gt;</pre>
<p>This example sets the property <code>prop</code> to <q>def|ghi</q> on Windows and on Unix.</p>
</body>
</html>

+ 47
- 77
manual/Tasks/presetdef.html View File

@@ -26,72 +26,55 @@

<h2 id="presetdef">PreSetDef</h2>
<h3>Description</h3>
<p>
The preset definition generates a new definition
based on a current definition with some attributes
or elements preset.
</p>
<p>
<em>since Apache Ant 1.6</em>
</p>
<p>
The resolution of properties in any of the attributes or
nested text takes place with the definition is used and <em>not</em>
when the preset definition is defined.
</p>
<p>The preset definition generates a new definition based on a current definition with some
attributes or elements preset.</p>
<p><em>since Apache Ant 1.6</em></p>
<p>The resolution of properties in any of the attributes or nested text takes place with the
definition is used and <em>not</em> when the preset definition is defined.</p>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">the name of the new definition</td>
<td valign="top" align="center">Yes</td>
<td>name</td>
<td>the name of the new definition</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">uri</td>
<td valign="top">
The uri that this definition should live in.
</td>
<td valign="top" align="center">No</td>
<td>uri</td>
<td>The URI that this definition should live in.</td>
<td>No</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>another type with attributes or elements set</h4>
<p>The <code>&lt;presetdef&gt;</code> task takes one nested element as a parameter.
This nested element can be any other type or task. The attributes
and elements that need to be preset are placed here.
</p>
<p>The <code>&lt;presetdef&gt;</code> task takes one nested element as a parameter. This nested
element can be any other type or task. The attributes and elements that need to be preset are
placed here.</p>

<h3>Examples</h3>
The following fragment defines a javac task with the debug, deprecation
srcdir and destdir
attributes set. It also has a src element to source files from a generated
directory.
<pre class="code">
<p>The following fragment defines a <code>javac</code> task with
the <var>debug</var>, <var>deprecation</var>, <var>srcdir</var> and <var>destdir</var>
attributes set. It also has a <code>src</code> element to source files from a generated
directory.</p>
<pre class="code">
&lt;presetdef name="my.javac"&gt;
&lt;javac debug="${debug}" deprecation="${deprecation}"
srcdir="${src.dir}" destdir="${classes.dir}"&gt;
&lt;src path="${gen.dir}"/&gt;
&lt;/javac&gt;
&lt;/presetdef&gt;
</pre>
This can be used as a normal javac task - example:
<pre class="code">
&lt;my.javac/&gt;
</pre>
The attributes specified in the preset task may be overridden - i.e.
they may be seen as optional attributes - example:
<pre class="code">
&lt;my.javac srcdir="${test.src}" deprecation="no"/&gt;
</pre>
One may put a presetdef definition in an antlib.
For example suppose the jar file antgoodies.jar has
the antlib.xml as follows:
<pre class="code">
&lt;/presetdef&gt;</pre>
<p>This can be used as a normal <code>javac</code> task&mdash;for example:</p>
<pre class="code">&lt;my.javac/&gt;</pre>
<p>The attributes specified in the preset task may be overridden&mdash;i.e. they may be seen as
optional attributes&mdash;for example:</p>
<pre class="code">&lt;my.javac srcdir="${test.src}" deprecation="no"/&gt;</pre>
<p>One may put a <code>presetdef</code> definition in an antlib. For example suppose the jar
file <samp>antgoodies.jar</samp> has the <samp>antlib.xml</samp> as follows:</p>
<pre class="code">
&lt;antlib&gt;
&lt;taskdef resource="com/acme/antgoodies/tasks.properties"/&gt;
&lt;!-- Implement the common use of the javac command --&gt;
@@ -99,10 +82,9 @@
&lt;javac deprecation="${deprecation}" debug="${debug}"
srcdir="src" destdir="classes"/&gt;
&lt;/presetdef&gt;
&lt;/antlib&gt;
</pre>
One may then use this in a build file as follows:
<pre class="code">
&lt;/antlib&gt;</pre>
<p>One may then use this in a build file as follows:</p>
<pre class="code">
&lt;project default="example" xmlns:antgoodies="antlib:com.acme.antgoodies"&gt;
&lt;target name="example"&gt;
&lt;!-- Compile source --&gt;
@@ -110,13 +92,9 @@
&lt;!-- Compile test code --&gt;
&lt;antgoodies:javac srcdir="src/test"/&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
<p>
The following is an example of evaluation of properties when the
definition is used:
</p>
<pre class="code">
&lt;/project&gt;</pre>
<p>The following is an example of evaluation of properties when the definition is used:</p>
<pre class="code">
&lt;target name="defineandcall"&gt;
&lt;presetdef name="showmessage"&gt;
&lt;echo&gt;message is '${message}'&lt;/echo&gt;
@@ -130,34 +108,26 @@
&lt;/target&gt;
&lt;target name="called"&gt;
&lt;showmessage/&gt;
&lt;/target&gt;
</pre>
<p>
The command ant defineandcall results in the output:
</p>
<pre class="code">
&lt;/target&gt;</pre>
<p>The command <code>ant defineandcall</code> results in the output:</p>
<pre class="code">
defineandcall:
[showmessage] message is '${message}'
[showmessage] message is 'Message 1'

called:
[showmessage] message is 'Message 2'
</pre>
<p>
It is possible to use a trick to evaluate properties when the definition is
<em>made</em> rather than used. This can be useful if you do not expect some
properties to be available in child builds run with
<code>&lt;ant ... inheritall="false"&gt;</code>:
</p>
<pre class="code">
[showmessage] message is 'Message 2'</pre>
<p>It is possible to use a trick to evaluate properties when the definition is <em>made</em>
rather than used. This can be useful if you do not expect some properties to be available in
child builds run with <code>&lt;ant ... inheritall="false"&gt;</code>:</p>
<pre class="code">
&lt;macrodef name="showmessage-presetdef"&gt;
&lt;attribute name="messageval"/&gt;
&lt;presetdef name="showmessage"&gt;
&lt;echo&gt;message is '@{messageval}'&lt;/echo&gt;
&lt;/presetdef&gt;
&lt;/macrodef&gt;
&lt;showmessage-presetdef messageval="${message}"/&gt;
</pre>
&lt;showmessage-presetdef messageval="${message}"/&gt;</pre>

</body>
</html>

+ 10
- 13
manual/Tasks/projecthelper.html View File

@@ -26,29 +26,26 @@

<h2>ProjectHelper</h2>
<h3>Description</h3>
<p>This task is provided for the purpose of allowing the user to install a different
ProjectHelper at runtime.
</p>
<p>The helpers will be added after all the already registered helpers, but before
the default one (ProjectHelper2)
</p>
<p>See the description of Apache Ant's
<a href="../projecthelper.html">Project Helper</a> for more information.
</p>
<p>This task is provided for the purpose of allowing the user to install a different ProjectHelper
at runtime.</p>
<p>The helpers will be added after all the already registered helpers, but before the default one
(<code>ProjectHelper2</code>)</p>
<p>See the description of Apache Ant's <a href="../projecthelper.html">Project Helper</a> for more
information.</p>
<p><em>Since Ant 1.8.2</em></p>

<h3>Parameters specified as nested elements</h3>

You may specify many configured <code>org.apache.tools.ant.ProjectHelper</code> instances.
<p>You may specify many configured <code>org.apache.tools.ant.ProjectHelper</code> instances.</p>

<h3>Example</h3>

<p>Install a custom ProjectHelper implementation
(assuming <code>MyProjectHelper extends ProjectHelper</code>):</p>
<p>Install a custom ProjectHelper implementation (assuming <code>MyProjectHelper extends
ProjectHelper</code>):</p>

<pre>
&lt;typedef classname="org.example.MyProjectHelper"
name="myprojecthelper"/>
name="myprojecthelper"/>
&lt;projecthelper>
&lt;myprojecthelper/>
&lt;/projecthelper>


+ 178
- 207
manual/Tasks/property.html View File

@@ -26,276 +26,247 @@

<h2 id="property">Property</h2>
<h3>Description</h3>
<p>Sets a <a href="../using.html#properties">property</a>
(by name and value), or set of properties (from file or
resource) in the project. Properties are case sensitive.</p>
Properties are immutable: whoever sets a property first freezes it for the
rest of the build; they are most definitely not variables.
<p>Sets a <a href="../using.html#properties">property</a> (by name and value), or set of properties
(from file or resource) in the project. Properties are case sensitive.</p>
<p>Properties are immutable: whoever sets a property first freezes it for the rest of the build;
they are most definitely not variables.</p>
<p>There are seven ways to set properties:</p>
<ul>
<li>By supplying both the <i>name</i> and one of <i>value</i> or <i>location</i> attribute.</li>
<li>By supplying the <i>name</i> and nested text.</li>
<li>By supplying both the <i>name</i> and <i>refid</i> attribute.</li>
<li>By setting the <i>file</i> attribute with the filename of the property
file to load. This property file has the format as defined by the file used
in the class java.util.Properties, with the same rules about how
non-ISO8859-1 characters must be escaped.</li>
<li>By setting the <i>url</i> attribute with the url from which to load the
properties. This url must be directed to a file that has the format as defined
by the file used in the class java.util.Properties.</li>
<li>By setting the <i>resource</i> attribute with the resource name of the
property file to load. A resource is a property file on the current
classpath, or on the specified classpath.</li>
<li>By setting the <i>environment</i> attribute with a prefix to use.
Properties will be defined for every environment variable by
prefixing the supplied name and a period to the name of the variable.</li>
<li>By supplying both the <var>name</var> and one of <var>value</var> or <var>location</var>
attributes.</li>
<li>By supplying the <var>name</var> and nested text.</li>
<li>By supplying both the <var>name</var> and <var>refid</var> attributes.</li>
<li>By setting the <var>file</var> attribute with the filename of the property file to load. This
property file has the format as defined by the file used in the
class <code>java.util.Properties</code>, with the same rules about how non-ISO-8859-1 characters
must be escaped.</li>
<li>By setting the <var>url</var> attribute with the URL from which to load the properties. This
URL must be directed to a file that has the format as defined by the file used in the
class <code>java.util.Properties</code>.</li>
<li>By setting the <var>resource</var> attribute with the resource name of the property file to
load. A resource is a property file on the current classpath, or on the specified
classpath.</li>
<li>By setting the <var>environment</var> attribute with a prefix to use. Properties will be
defined for every environment variable by prefixing the supplied name and a period to the name
of the variable.</li>
</ul>
<p>Although combinations of these ways are possible, only one should be used
at a time. Problems might occur with the order in which properties are set, for
instance.</p>
<p>The value part of the properties being set, might contain references to other
properties. These references are resolved at the time these properties are set.
This also holds for properties loaded from a property file.</p>
<p>A list of predefined properties can be 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 to <a href="http://java.sun.com/dtd/properties.dtd">Suns DTD</a>,
if Java 5+ is present. For this the name of the file, resource or url has
to end with <tt>.xml</tt>.</p>
<p>Although combinations of these ways are possible, only one should be used at a time. Problems
might occur with the order in which properties are set, for instance.</p>
<p>The value part of the properties being set might contain references to other properties. These
references are resolved at the time these properties are set. This also holds for properties loaded
from a property file.</p>
<p>A list of predefined properties can be
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
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>

<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">the name of the property to set.</td>
<td valign="top" align="center">No</td>
<td>name</td>
<td>the name of the property to set.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">the value of the property.</td>
<td valign="middle" align="center" rowspan="3">One of these or
nested text, when using the name attribute</td>
<td>value</td>
<td>the value of the property.</td>
<td rowspan="3">One of these or nested text, when the <var>name</var> attribute is set</td>
</tr>
<tr>
<td valign="top">location</td>
<td valign="top">Sets the property to the absolute filename of the
given file. If the value of this attribute is an absolute path, it
is left unchanged (with / and \ characters converted to the
current platforms conventions). Otherwise it is taken as a path
relative to the project's basedir and expanded.</td>
<td>location</td>
<td class="left">Sets the property to the absolute filename of the given file. If the value of
this attribute is an absolute path, it is left unchanged (with <q>/</q> and <q>\</q>
characters converted to the current platforms conventions). Otherwise it is taken as a path
relative to the project's <var>basedir</var> and expanded.</td>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top"><a href="../using.html#references">Reference</a> to an object
defined elsewhere. Only yields reasonable results for references
to <a href="../using.html#path">PATH like structures</a> or properties.</td>
<td>refid</td>
<td class="left"><a href="../using.html#references">Reference</a> to an object defined
elsewhere. Only yields reasonable results for references
to <a href="../using.html#path">path-like structures</a> or properties.</td>
</tr>
<tr>
<td valign="top">resource</td>
<td valign="top"> the name of the classpath resource containing
properties settings in properties file format.</td>
<td valign="middle" align="center" rowspan="4">One of these, when
<b>not</b> using the name attribute</td>
<td>resource</td>
<td>the name of the classpath resource containing properties settings in properties file
format.</td>
<td rowspan="4">One of these, <strong>unless</strong> the <var>name</var> attribute is set</td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the location of the properties file to load.</td>
<td>file</td>
<td class="left">the location of the properties file to load.</td>
</tr>
<tr>
<td valign="top">url</td>
<td valign="top">a url containing properties-format settings.</td>
<td>url</td>
<td class="left">a URL containing properties-format settings.</td>
</tr>
<tr>
<td valign="top">environment</td>
<td valign="top">the prefix to use when retrieving environment variables. Thus
if you specify environment=&quot;myenv&quot; you will be able to access OS-specific
environment variables via property names &quot;myenv.PATH&quot; or
&quot;myenv.TERM&quot;. Note that if you supply a property name with a final
&quot;.&quot; it will not be doubled; i.e. environment=&quot;myenv.&quot; will still
allow access of environment variables through &quot;myenv.PATH&quot; and
&quot;myenv.TERM&quot;. This functionality is currently only implemented
on <a href="#notes-env">select platforms</a>. Feel free to send patches to increase the
number of platforms on which this functionality is supported ;).<br>
Note also that properties are case-sensitive, even if the
environment variables on your operating system are not; e.g. Windows 2000's
system path variable is set to an Ant property named "env.Path"
rather than "env.PATH".</td>
<td>environment</td>
<td class="left">the prefix to use when retrieving environment variables. Thus if you
specify <var>environment</var>=<q>myenv</q> you will be able to access OS-specific environment
variables via property names <code>myenv.PATH</code> or <code>myenv.TERM</code>. Note that if
you supply a property <var>name</var> with a final <q>.</q> it will not be doubled;
i.e. <var>environment</var>=<q>myenv.</q> will still allow access of environment variables
through <code>myenv.PATH</code> and <code>myenv.TERM</code>. This functionality is currently
only implemented on <a href="#notes-env">select platforms</a>. Feel free to send patches to
increase the number of platforms on which this functionality is supported ;-).<br/>Note also
that properties are case-sensitive, even if the environment variables on your operating system
are not; e.g. Windows 2000 or later system path variable is set to an Ant property
named <code>env.Path</code> rather than <code>env.PATH</code>.</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">the classpath to use when looking up a resource.</td>
<td align="center" valign="top">No</td>
<td>classpath</td>
<td>the classpath to use when looking up a resource.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">classpathref</td>
<td valign="top">the classpath to use when looking up a resource,
given as <a href="../using.html#references">reference</a> to a <code>&lt;path&gt;</code> defined
<td>classpathref</td>
<td>the classpath to use when looking up a resource, given
as <a href="../using.html#references">reference</a> to a <code>&lt;path&gt;</code> defined
elsewhere..</td>
<td align="center" valign="top">No</td>
<td>No</td>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">Prefix to apply to properties loaded using <code>file</code>,
<code>resource</code>, or <code>url</code>.
A "." is appended to the prefix if not specified.</td>
<td align="center" valign="top">No</td>
<td>prefix</td>
<td>Prefix to apply to properties loaded using <var>file</var>, <var>resource</var>,
or <var>url</var>. A <q>.</q> is appended to the prefix if not specified.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">prefixValues</td>
<td valign="top">Whether to apply the prefix when expanding the
right hand side of properties loaded using <code>file</code>,
<code>resource</code>, or <code>url</code>.
<em>Since Ant 1.8.2</em></td>
<td align="center" valign="top">No (default=<tt>false</tt>)</td>
<td>prefixValues</td>
<td>Whether to apply the prefix when expanding the right hand side of properties loaded
using <var>file</var>, <var>resource</var>, or <var>url</var>. <em>Since Ant 1.8.2</em></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">relative</td>
<td valign="top">If set to <tt>true</tt> the relative path
to <tt>basedir</tt> is set. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No (default=<tt>false</tt>)</td>
<td>relative</td>
<td>If set to <q>true</q> the relative path to <var>basedir</var> is set. <em>Since Ant
1.8.0</em></td>
<td>No; default is <q>false</q></td>
</tr>
<tr>
<td valign="top">basedir</td>
<td valign="top">The basedir to calculate the relative path
from. <em>Since Ant 1.8.0</em></td>
<td align="center" valign="top">No (default=<tt>${basedir}</tt>)</td>
<td>basedir</td>
<td>The <var>basedir</var> to calculate the relative path from. <em>Since Ant 1.8.0</em></td>
<td>No; default is project's <var>basedir</var></td>
</tr>
</table>

<h4>OpenVMS Users</h4>
<p>With the <code>environment</code> attribute this task will load all defined
logicals on an OpenVMS system. Logicals with multiple equivalence names get
mapped to a property whose value is a comma separated list of all equivalence
names. If a logical is defined in multiple tables, only the most local
definition is available (the table priority order being PROCESS, JOB, GROUP,
SYSTEM).
</p>
<p>With the <var>environment</var> attribute this task will load all defined logicals on an OpenVMS
system. Logicals with multiple equivalence names get mapped to a property whose value is a comma
separated list of all equivalence names. If a logical is defined in multiple tables, only the most
local definition is available (the table priority order being PROCESS, JOB, GROUP, SYSTEM).</p>

<h4>Any OS except OpenVMS</h4>
<p><em>Since Ant 1.8.2</em>, if Ant detects it is running on a Java 5
or newer VM, Ant will 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
see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=49366">Bugzilla
Issue 49366</a>. In particular:</p>
<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
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>
<ul>
<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
<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
these variables starts with an equals sign.</li>
<li>Some users reported that some Cygwin specific variables (in
particular PROMPT) was no longer present.</li>
<li>On OS/2, Ant no longer returns the BEGINLIBPATH variable.</li>
<li>Some users reported that some Cygwin specific variables (in particular <code>PROMPT</code>)
was no longer present.</li>
<li>On OS/2, Ant no longer returns the <code>BEGINLIBPATH</code> variable.</li>
</ul>

<h3>Parameters specified as nested elements</h3>
<h4>classpath</h4>
<p><code>Property</code>'s <i>classpath</i> attribute is a <a
href="../using.html#path">PATH like structure</a> and can also be set via a nested
<i>classpath</i> element.</p>
<p><code>Property</code>'s <var>classpath</var> attribute is
a <a href="../using.html#path">path-like structure</a> and can also be set via a
nested <code>classpath</code> element.</p>

<h3>Examples</h3>
<pre> &lt;property name=&quot;foo.dist&quot; value=&quot;dist&quot;/&gt;</pre>
<p>sets the property <code>foo.dist</code> to the value &quot;dist&quot;.</p>
<pre>&lt;property name=&quot;foo.dist&quot; value=&quot;dist&quot;/&gt;</pre>
<p>sets the property <code>foo.dist</code> to the value <q>dist</q>.</p>

<pre> &lt;property name=&quot;foo.dist&quot;&gt;dist&lt;/property&gt;</pre>
<p>sets the property <code>foo.dist</code> to the value &quot;dist&quot;.</p>
<pre>&lt;property name=&quot;foo.dist&quot;&gt;dist&lt;/property&gt;</pre>
<p>sets the property <code>foo.dist</code> to the value <q>dist</q>.</p>

<pre> &lt;property file=&quot;foo.properties&quot;/&gt;</pre>
<p>reads a set of properties from a file called &quot;foo.properties&quot;.</p>
<pre>&lt;property file=&quot;foo.properties&quot;/&gt;</pre>
<p>reads a set of properties from a file called <samp>foo.properties</samp>.</p>

<pre> &lt;property url=&quot;http://www.mysite.com/bla/props/foo.properties&quot;/&gt;</pre>
<p>reads a set of properties from the address &quot;http://www.mysite.com/bla/props/foo.properties&quot;.</p>
<pre>&lt;property url=&quot;http://www.mysite.com/bla/props/foo.properties&quot;/&gt;</pre>
<p>reads a set of properties from the
address <samp>http://www.mysite.com/bla/props/foo.properties</samp>.</p>

<pre> &lt;property resource=&quot;foo.properties&quot;/&gt;</pre>
<p>reads a set of properties from a resource called &quot;foo.properties&quot;.</p>
<p>Note that you can reference a global properties file for all of your Ant
builds using the following:</p>
<pre>&lt;property resource=&quot;foo.properties&quot;/&gt;</pre>
<p>reads a set of properties from a resource called <samp>foo.properties</samp>.</p>
<p>Note that you can reference a global properties file for all of your Ant builds using the
following:</p>

<pre> &lt;property file=&quot;${user.home}/.ant-global.properties&quot;/&gt;</pre>
<p>since the &quot;user.home&quot; property is defined by the Java virtual machine
to be your home directory. Where the &quot;user.home&quot; property resolves to in
the file system depends on the operating system version and the JVM implementation.
On Unix based systems, this will map to the user's home directory. On modern Windows
variants, this will most likely resolve to the user's directory in the &quot;Documents
and Settings&quot; or &quot;Users&quot; folder. Older windows variants such as Windows 98/ME are less
predictable, as are other operating system/JVM combinations.</p>
<pre>&lt;property file=&quot;${user.home}/.ant-global.properties&quot;/&gt;</pre>
<p>since the <code>user.home</code> property is defined by JVM to be your home directory. Where
the <code>user.home</code> property resolves to in the file system depends on the operating system
version and the JVM implementation. On Unix based systems, this will map to the user's home
directory. On modern Windows variants, this will most likely resolve to the user's directory in
the <samp>Documents and Settings</samp> or <samp>Users</samp> folder. Older Windows variants such as
Windows 98/ME are less predictable, as are other operating system/JVM combinations.</p>

<pre>
&lt;property environment=&quot;env&quot;/&gt;
&lt;echo message=&quot;Number of Processors = ${env.NUMBER_OF_PROCESSORS}&quot;/&gt;
&lt;echo message=&quot;ANT_HOME is set to = ${env.ANT_HOME}&quot;/&gt;
</pre>
<p>reads the system environment variables and stores them in properties, prefixed with &quot;env&quot;.
Note that this only works on <em>select</em> operating systems.
Two of the values are shown being echoed.
&lt;property environment=&quot;env&quot;/&gt;
&lt;echo message=&quot;Number of Processors = ${env.NUMBER_OF_PROCESSORS}&quot;/&gt;
&lt;echo message=&quot;ANT_HOME is set to = ${env.ANT_HOME}&quot;/&gt;</pre>
<p>reads the system environment variables and stores them in properties, prefixed with <q>env</q>.
Note that this only works on <em>select</em> operating systems. Two of the values are shown being
echoed.
</p>

<pre>
&lt;property environment=&quot;env&quot;/&gt;
&lt;property file=&quot;${user.name}.properties&quot;/&gt;
&lt;property file=&quot;${env.STAGE}.properties&quot;/&gt;
&lt;property file=&quot;build.properties&quot;/&gt;
</pre>
<p>This buildfile uses the properties defined in <tt>build.properties</tt>. Regarding to the
environment variable <tt>STAGE</tt> some or all values could be overwritten, e.g. having
<tt>STAGE=test</tt> and a <tt>test.properties</tt> you have special values for that (like another
name for the test server). Finally all these values could be overwritten by personal settings with
a file per user.</p>

<pre>
&lt;property name=&quot;foo&quot; location=&quot;my/file.txt&quot; relative=&quot;true&quot; basedir=&quot;..&quot;/&gt;
</pre>
<p>Stores the relative path in <tt>foo</tt>: projectbasedir/my/file.txt</p>
&lt;property environment=&quot;env&quot;/&gt;
&lt;property file=&quot;${user.name}.properties&quot;/&gt;
&lt;property file=&quot;${env.STAGE}.properties&quot;/&gt;
&lt;property file=&quot;build.properties&quot;/&gt;</pre>
<p>This buildfile uses the properties defined in <samp>build.properties</samp>. Regarding to the
environment variable <code>STAGE</code> some or all values could be overwritten,
e.g. having <code>STAGE=test</code> and a <samp>test.properties</samp> you have special values for
that (like another name for the test server). Finally all these values could be overwritten by
personal settings with a file per user.</p>

<pre>
&lt;property name=&quot;foo&quot; location=&quot;my/file.txt&quot; relative=&quot;true&quot; basedir=&quot;cvs&quot;/&gt;
</pre>
<p>Stores the relative path in <tt>foo</tt>: ../my/file.txt</p>
<pre>&lt;property name=&quot;foo&quot; location=&quot;my/file.txt&quot; relative=&quot;true&quot; basedir=&quot;..&quot;/&gt;</pre>
<p>Stores the relative path in <code>foo</code>: <samp>../my/file.txt</samp></p>

<pre>&lt;property name=&quot;foo&quot; location=&quot;my/file.txt&quot; relative=&quot;true&quot; basedir=&quot;cvs&quot;/&gt;</pre>
<p>Stores the relative path in <code>foo</code>: <samp>cvs/my/file.txt</samp></p>

<h3>Property Files</h3>

As stated, this task will load in a properties file stored in the file
system, or as a resource on a classpath. Here are some interesting facts
about this feature
<p>As stated, this task will load in a properties file stored in the file system, or as a resource
on a classpath. Here are some interesting facts about this feature</p>
<ol>
<li>If the file is not there, nothing is printed except at -verbose log
level. This lets you have optional configuration files for every
project, that team members can customize.
<li>The rules for this format match <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.InputStream%29">java.util.Properties</a>.</li>
<li>Trailing spaces are not stripped. It may have been what you wanted.</li>
<li>Want unusual characters? Escape them \u0456 or \&quot; style.</li>
<li>Ant Properties are expanded in the file</li>
<li>If you want to expand properties defined inside the same file and
you use the prefix attribute of the task, you must use the same
prefix when expanding the properties or
set <code>prefixValues</code> to true.</li>
<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.
<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>
<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>\&quot;</code> style.</li>
<li>Ant Properties are expanded in the file</li>
<li>If you want to expand properties defined inside the same file and you use
the <var>prefix</var> attribute of the task, you must use the same prefix when expanding the
properties or set <var>prefixValues</var> to <q>true</q>.</li>
</ol>
In-file property expansion is very cool. Learn to use it.
<p>
Example:
<p>In-file property expansion is very cool. Learn to use it.</p>
<p>Example:</p>
<pre>
build.compiler=jikes
deploy.server=lucky
deploy.port=8080
deploy.url=http://${deploy.server}:${deploy.port}/
</pre>
deploy.url=http://${deploy.server}:${deploy.port}/</pre>

<h3 id="notes-env">Notes about environment variables</h3>
<p>
Ant runs on Java 1.2 therefore it cannot use Java 5 features for accessing environment
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 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=24e5a0e881dba01a6f012c4a271b743946412a0d">
Execute.java</a> (method <tt>getProcEnvCommand()</tt>):
<p>Ant runs on Java 1.2 therefore it cannot use Java 5 features for accessing environment
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
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>):
</p>
<table>
<tr>
@@ -304,38 +275,38 @@ deploy.url=http://${deploy.server}:${deploy.port}/
</tr>
<tr>
<td>os/2</td>
<td>cmd /c set</td>
<td><code>cmd /c set</code></td>
</tr>
<tr>
<td colspan="2"> windows</td>
<td colspan="2">windows</td>
</tr>
<tr>
<td>* win9x</td>
<td>command.com /c set</td>
<td><code>command.com /c set</code></td>
</tr>
<tr>
<td>* other</td>
<td>cmd /c set</td>
<td><code>cmd /c set</code></td>
</tr>
<tr>
<td>z/os</td>
<td>/bin/env <b>OR</b> /usr/bin/env <b>OR</b> env <i>(depending on read rights)</i></td>
<td><code>/bin/env</code> <strong>OR</strong> <code>/usr/bin/env</code> <strong>OR</strong> <code>env</code> (<em>depending on read rights</em>)</td>
</tr>
<tr>
<td>unix</td>
<td>/bin/env <b>OR</b> /usr/bin/env <b>OR</b> env <i>(depending on read rights)</i></td>
<td><code>/bin/env</code> <strong>OR</strong> <code>/usr/bin/env</code> <strong>OR</strong> <code>env</code> (<em>depending on read rights</em>)</td>
</tr>
<tr>
<td>netware</td>
<td>env</td>
<td><code>env</code></td>
</tr>
<tr>
<td>os/400</td>
<td>env</td>
<td><code>env</code></td>
</tr>
<tr>
<td>openvms</td>
<td>show logical</td>
<td><code>show logical</code></td>
</tr>
</table>



+ 140
- 150
manual/Tasks/propertyfile.html View File

@@ -26,139 +26,138 @@
<h1>PropertyFile</h1>
<hr/>
<h2 id="introduction">Introduction</h2>
<p>Apache Ant provides an optional task for editing property files. This is
very useful when wanting to make unattended modifications to
configuration files for application servers and
applications. Currently, the task maintains a working property file
with the ability to add properties or make changes to existing
ones. <em>Since Ant 1.8.0</em> comments and layout of the original properties
file are preserved.</p>

<p><em>Since Ant 1.8.2</em> the linefeed-style of the original file
will be preserved as well, as long as style used to be consistent.
In general, linefeeds of the updated file will be the same as the
first linefeed found when reading it.</p>
<p>Apache Ant provides an optional task for editing property files. This is very useful when wanting
to make unattended modifications to configuration files for application servers and
applications. Currently, the task maintains a working property file with the ability to add
properties or make changes to existing ones. <em>Since Ant 1.8.0</em> comments and layout of the
original properties file are preserved.</p>

<p><em>Since Ant 1.8.2</em> the linefeed-style of the original file will be preserved as well, as
long as style used to be consistent. In general, linefeeds of the updated file will be the same as
the first linefeed found when reading it.</p>

<hr/>

<h2 id="proptask">PropertyFile Task</h2>
<h3>Parameters</h3>
<table>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">Location of the property file to be edited</td>
<td valign="top">Yes</td>
<td>file</td>
<td>Location of the property file to be edited</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">comment</td>
<td valign="top">Header for the file itself</td>
<td valign="top">no</td>
<td>comment</td>
<td>Header for the file itself</td>
<td>No</td>
</tr>
<tr>
<td valign="top">jdkproperties</td>
<td valign="top">Use java.lang.Properties, which will
lose comments and layout of file (default is 'false'). <em>since
<td>jdkproperties</td>
<td>Use <code>java.lang.Properties</code>, which will lose comments and layout of file. <em>since
Ant 1.8.0</em></td>
<td valign="top">no</td>
<td>No; default is <q>false</q></td>
</tr>
</table>

<p>The boolean attribute 'jdkproperties' is provided to recover the
previous behaviour of the task, in which the layout and any comments
in the properties file were lost by the task.</p>
<p>The boolean attribute <var>jdkproperties</var> is provided to recover the previous behaviour of
the task, in which the layout and any comments in the properties file were lost by the task.</p>

<h3>Parameters specified as nested elements</h3>
<h4 id="entryElement">Entry</h4>
<p>Use nested <code>&lt;entry&gt;</code>
elements to specify actual modifications to the property file itself.</p>
<table>
<p>Use nested <code>&lt;entry&gt;</code> elements to specify actual modifications to the property
file itself.</p>
<table class="attr">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">key</td>
<td valign="top">Name of the property name/value pair</td>
<td valign="top" align="center">Yes</td>
<td>key</td>
<td>Name of the property name/value pair</td>
<td>Yes</td>
</tr>
<tr>
<td valign="top">value</td>
<td valign="top">Value to set (=), to add (+) or subtract (-)</td>
<td valign="top" align="center" rowspan="2">At least one must be specified, if <i>operation</i> is not <i>delete</i></td>
<td>value</td>
<td>Value to set (<q>=</q>), to add (<q>+</q>) or subtract (<q>-</q>)</td>
<td rowspan="2">At least one must be specified, if <var>operation</var> is not <q>del</q></td>
</tr>
<tr>
<td valign="top">default</td>
<td valign="top">Initial value to set for a property if it is not
already defined in the property file.<br>
For type date, an additional keyword is allowed: &quot;now&quot;</td>
</tr>
<td>default</td>
<td class="left">Initial value to set for a property if it is not already defined in the
property file.<br/>For type <var>date</var>, an additional keyword is
allowed: <q>now</q></td></tr>
<tr>
<td valign="top">type</td>
<td valign="top">Regard the value as : int, date or string (default)</td>
<td valign="top" align="center">No</td>
<td>type</td>
<td>Regard the value as: <q>int</q>, <q>date</q> or <q>string</q> (default)</td>
<td>No; defaults to <q>string</q></td>
</tr>
<tr>
<td valign="top">operation</td>
<td valign="top">One of the following operations:<br><br>
<b>for all datatypes:</b><ul>
<li>&quot;del&quot; : deletes an entry</li>
<li>&quot;+&quot; : adds a value to the existing value</li>
<li>&quot;=&quot; : sets a value instead of the existing value (default)</li>
</ul><br><b>for date and int only:</b><ul>
<li>&quot;-&quot; : subtracts a value from the existing value</li>
</ul>
<td>operation</td>
<td>One of the following operations:<br><br>
<strong>for all datatypes:</strong>
<ul>
<li><q>del</q> : deletes an entry</li>
<li><q>+</q> : adds a value to the existing value</li>
<li><q>=</q> : sets a value instead of the existing value (default)</li>
</ul>
<strong>for <var>date</var> and <var>int</var> only:</strong>
<ul>
<li><q>-</q> : subtracts a value from the existing value</li>
</ul>
</td>
<td valign="top" align="center">No</td>
<td>No; defaults to <q>=</q></td>
</tr>
<tr>
<td valign="top">pattern</td>
<td valign="top">For int and date type only. If present, Values will
be parsed and formatted accordingly.</td>
<td valign="top" align="center">No</td>
<td>pattern</td>
<td>For <var>int</var> and <var>date</var> type only. If present, values will be parsed and
formatted accordingly.</td>
<td>No</td>
</tr>
<tr>
<td valign="top">unit</td>
<td valign="top">The unit of the value to be applied to date +/- operations.
Valid Values are:
<ul>
<li>millisecond</li>
<li>second</li>
<li>minute</li>
<li>hour</li>
<li>day (default)</li>
<li>week</li>
<li>month</li>
<li>year</li>
</ul>
This only applies to date types using a +/- operation.
<td>unit</td>
<td>The unit of the value to be applied to <var>date</var> <q>+</q>/<q>-</q> operations. Valid
Values are:
<ul>
<li><q>millisecond</q></li>
<li><q>second</q></li>
<li><q>minute</q></li>
<li><q>hour</q></li>
<li><q>day</q> (default)</li>
<li><q>week</q></li>
<li><q>month</q></li>
<li><q>year</q></li>
</ul>
This only applies to <var>date</var> types using a <q>+</q>/<q>-</q> operation.
</td>
<td align="center" valign="top">No</td>
<td>No; defaults to <q>day</q></td>
</tr>
</table>
<p>The rules used when setting a property value are shown below. The
operation occurs <b>after</b> these rules are considered.</p>
<p>The rules used when setting a property value are shown below. The operation
occurs <strong>after</strong> these rules are considered.</p>

<ul>
<li>If only value is specified, the property is set to it regardless of its
previous value.</li>
<li>If only default is specified and the property previously existed in the
property file, it is unchanged.</li>
<li>If only default is specified and the property did not exist in the
property file, the property is set to default.</li>
<li>If value and default are both specified and the property previously
existed in the property file, the property is set to value.</li>
<li>If value and default are both specified and the property did not exist in
the property file, the property is set to default.</li>
<li>If only <var>value</var> is specified, the property is set to it regardless of its previous
value.</li>
<li>If only <var>default</var> is specified and the property previously existed in the property
file, it is unchanged.</li>
<li>If only <var>default</var> is specified and the property did not exist in the property file,
the property is set to <var>default</var>.</li>
<li>If <var>value</var> and <var>default</var> are both specified and the property previously
existed in the property file, the property is set to <var>value</var>.</li>
<li>If <var>value</var> and <var>default</var> are both specified and the property did not exist
in the property file, the property is set to <var>default</var>.</li>
</ul>

<h3>Examples</h3>

<p>The following changes the my.properties file. Assume my.properties look like:</p>
<p>The following changes the <samp>my.properties</samp> file. Assume <samp>my.properties</samp>
looks like:</p>

<pre># A string value
akey=original value
@@ -167,8 +166,7 @@ akey=original value
# each time the build is run.
anint=1</pre>

<p>After running, the file would now look like
</p>
<p>After running, the file would now look like</p>
<pre>#My properties
#Wed Aug 31 13:47:19 BST 2005
# A string value
@@ -183,63 +181,55 @@ adate=2005/08/31 13\:47
formated.int=0014

formated.date=243 13\:47</pre>
<p>
The slashes conform to the expectations of the Properties class. The file will be stored in a manner so that each character is examined and escaped if necessary.
</p>

<p>
The layout and comment of the original file is preserved. New properties are added at the end of the file. Existing properties are overwritten in place.
</p>

<pre>&lt;propertyfile
file=&quot;my.properties&quot;
comment=&quot;My properties&quot;&gt;
&lt;entry key=&quot;akey&quot; value=&quot;avalue&quot;/&gt;
&lt;entry key=&quot;adate&quot; type=&quot;date&quot; value=&quot;now&quot;/&gt;
&lt;entry key=&quot;anint&quot; type=&quot;int&quot; default=&quot;0&quot; operation=&quot;+&quot;/&gt;
&lt;entry key=&quot;formated.int&quot; type=&quot;int&quot; default=&quot;0013&quot; operation=&quot;+&quot; pattern=&quot;0000&quot;/&gt;
&lt;entry key=&quot;formated.date&quot; type=&quot;date&quot; value=&quot;now&quot; pattern=&quot;DDD HH:mm&quot;/&gt;
&lt;/propertyfile&gt;
</pre>
<p>
To produce dates relative from today :</p>
<pre>&lt;propertyfile
file=&quot;my.properties&quot;
comment=&quot;My properties&quot;&gt;
&lt;entry key=&quot;formated.date-1&quot;
type=&quot;date&quot; default=&quot;now&quot; pattern=&quot;DDD&quot;
operation=&quot;-&quot; value=&quot;1&quot;/&gt;
&lt;entry key=&quot;formated.tomorrow&quot;
type=&quot;date&quot; default=&quot;now&quot; pattern=&quot;DDD&quot;
operation=&quot;+&quot; value=&quot;1&quot;/&gt;
&lt;/propertyfile&gt;
</pre>

<p>
Concatenation of strings :</p>
<pre>&lt;propertyfile
file=&quot;my.properties&quot;
comment=&quot;My properties&quot;&gt;
&lt;entry key=&quot;progress&quot; default=&quot;&quot; operation=&quot;+&quot; value=&quot;.&quot;/&gt;
&lt;/propertyfile&gt;
</pre>
<p>Each time called, a &quot;.&quot; will be appended to &quot;progress&quot;
</p>

<p>Pumps the project version to the next minor version (increase minor and set path=0):</p>
<pre>&lt;target name="nextMinorVersion"&gt;
&lt;property
name="header"
value="##Generated file - do not modify!"/&gt;
&lt;propertyfile file="version.properties" comment="${header}"&gt;
&lt;entry key="product.build.major" type="int" value="3" /&gt;
&lt;entry key="product.build.minor" type="int" operation="+" /&gt;
&lt;entry key="product.build.patch" type="int" value="0" /&gt;
&lt;entry key="product.build.date" type="date" value="now" /&gt;
&lt;/propertyfile&gt;
&lt;/target&gt;
</pre>
After running this target the version changed e.g. from 3.2.2 to 3.3.0.
<p>The slashes conform to the expectations of the Properties class. The file will be stored in a
manner so that each character is examined and escaped if necessary.</p>

<p>The layout and comment of the original file is preserved. New properties are added at the end of
the file. Existing properties are overwritten in place.</p>

<pre>
&lt;propertyfile file=&quot;my.properties&quot;
comment=&quot;My properties&quot;&gt;
&lt;entry key=&quot;akey&quot; value=&quot;avalue&quot;/&gt;
&lt;entry key=&quot;adate&quot; type=&quot;date&quot; value=&quot;now&quot;/&gt;
&lt;entry key=&quot;anint&quot; type=&quot;int&quot; default=&quot;0&quot; operation=&quot;+&quot;/&gt;
&lt;entry key=&quot;formated.int&quot; type=&quot;int&quot; default=&quot;0013&quot; operation=&quot;+&quot; pattern=&quot;0000&quot;/&gt;
&lt;entry key=&quot;formated.date&quot; type=&quot;date&quot; value=&quot;now&quot; pattern=&quot;DDD HH:mm&quot;/&gt;
&lt;/propertyfile&gt;</pre>
<p>To produce dates relative from today:</p>
<pre>
&lt;propertyfile file=&quot;my.properties&quot;
comment=&quot;My properties&quot;&gt;
&lt;entry key=&quot;formated.date-1&quot;
type=&quot;date&quot; default=&quot;now&quot; pattern=&quot;DDD&quot;
operation=&quot;-&quot; value=&quot;1&quot;/&gt;
&lt;entry key=&quot;formated.tomorrow&quot;
type=&quot;date&quot; default=&quot;now&quot; pattern=&quot;DDD&quot;
operation=&quot;+&quot; value=&quot;1&quot;/&gt;
&lt;/propertyfile&gt;</pre>

<p>Concatenation of strings:</p>
<pre>
&lt;propertyfile file=&quot;my.properties&quot;
comment=&quot;My properties&quot;&gt;
&lt;entrykey=&quot;progress&quot; default=&quot;&quot; operation=&quot;+&quot; value=&quot;.&quot;/&gt;
&lt;/propertyfile&gt;</pre>
<p>Each time called, a <q>.</q> will be appended to <code>progress</code></p>

<p>Pumps the project version to the next minor version (increase minor and
set <code>patch=0</code>):</p>
<pre>
&lt;target name="nextMinorVersion"&gt;
&lt;property name="header"
value="##Generated file - do not modify!"/&gt;
&lt;propertyfile file="version.properties" comment="${header}"&gt;
&lt;entry key="product.build.major" type="int" value="3"/&gt;
&lt;entry key="product.build.minor" type="int" operation="+"/&gt;
&lt;entry key="product.build.patch" type="int" value="0"/&gt;
&lt;entry key="product.build.date" type="date" value="now"/&gt;
&lt;/propertyfile&gt;
&lt;/target&gt;</pre>
<p>After running this target the version changed e.g. from 3.2.2 to 3.3.0.</p>

</body>
</html>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save