bodewig 00/12/01 07:27:14
Modified: docs index.html
Log:
Documentation for tasks that can have a nested <mapper> element.
Revision Changes Path
1.162 +52 -7 jakarta-ant/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- index.html 2000/12/01 14:06:57 1.161
+++ index.html 2000/12/01 15:27:13 1.162
@@ -1558,7 +1558,8 @@
<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. Defaults to "no".</td>
+ attribute. Defaults to "no". Note that you can achieve the
+ same effect by using a <a href="#flatten-mapper">flatten
mapper</a></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
@@ -1568,6 +1569,12 @@
<td valign="top" align="center">No</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="#mapper">mapper</a> element. The default mapper used by
+<code><copy></code> is the <a
+href="#identity-mapper">identity</a>.</p>
<h3>Examples</h3>
<p><b>Copy a single file</b></p>
<pre>
@@ -1595,6 +1602,14 @@
<fileset dir="src_dir" excludes="**/*.java" />
</copy>
</pre>
+<p><b>Copy a set of files to a directory appending
+"<code>.bak</code>" to the file name on the fly</b></p>
+<pre>
+ <copy todir="../backup/dir" >
+ <fileset dir="src_dir" />
+ <mapper type="glob" from="*" to="*.bak"
/>
+ </copy>
+</pre>
<hr>
<h2><a name="copydir">Copydir</a></h2>
<h3><i>Deprecated</i></h3>
@@ -3662,7 +3677,8 @@
<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 "false").</td>
+ attribute (default is "false").Note that you can achieve the
+ same effect by using a <a href="#flatten-mapper">flatten
mapper</a></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
@@ -3672,6 +3688,12 @@
<td valign="top" align="center">No</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="#mapper">mapper</a> element. The default mapper used by
+<code><copy></code> is the <a
+href="#identity-mapper">identity</a>.</p>
<h3>Examples</h3>
<p><b>Move a single file (rename a file)</b></p>
<pre>
@@ -3696,6 +3718,16 @@
</fileset>
</move>
</pre>
+<p><b>Append <code>".bak"</code> to the names of all files
+in a directory.</b></p>
+<pre>
+ <move todir="my/src/dir" >
+ <fileset dir="my/src/dir" >
+ <exclude name="**/*.bak" />
+ </fileset>
+ <mapper type="glob" from="*" to="*.bak"
/>
+ </move>
+</pre>
<hr>
<h2><a name="patch">Patch</a></h2>
<h3>Description</h3>
@@ -4470,11 +4502,17 @@
<hr>
<h2><a name="uptodate">Uptodate</a></h2>
<h3>Description</h3>
-<p>Sets a property if a Target file is more up to date than a set of
+<p>Sets a property if a target files are more up to date than a set of
Source files. Source files are specified by nested <srcfiles>
-elements, these are <a href="#fileset">FileSet</a>s.</p>
-<p>The value part of the property being set is <i>true</i> if the timestamp
of the
-Target file is more recent than the timestamp of every Source file.</p>
+elements, these are <a href="#fileset">FileSet</a>s, while target
+files are specified using a nested <a href="#mapper">mapper</a>
+element.</p>
+<p>The value part of the property being set is <i>true</i> if the
+timestamp of the target files is more recent than the timestamp of
+every corresponding source file.</p>
+<p>The default behavior is to use a <a href="merge-mapper">merge
+mapper</a> whith the <code>to</code> attribute set to the value of the
+targetfile attribute.</p>
<p>Normally, this task is used to set properties that are useful to avoid
target
execution depending on the relative age of the specified files.</p>
<h3>Parameters</h3>
@@ -4492,7 +4530,8 @@
<tr>
<td valign="top">targetfile</td>
<td valign="top">the file for which we want to determine the status.</td>
- <td valign="top" align="center">Yes</td>
+ <td valign="top" align="center">Yes, unless a nested mapper element is
+ present.</td>
</tr>
</table>
<h3>Examples</h3>
@@ -4501,6 +4540,12 @@
</uptodate></pre>
<p>sets the property <code><i>xmlBuild.notRequired</i></code> to the value
"true"
if the <i>${deploy}/xmlClasses.jar</i> is more up to date than any of the
DTD files in the <i>${src}/xml</i> directory.</p>
+<p>This can be written as
+<pre> <uptodate property="xmlBuild.notRequired" >
+ <srcfiles dir= "${src}/xml" includes="**/*.dtd"
/>
+ <mapper type="merge"
to="${deploy}\xmlClasses.jar" />
+ </uptodate></pre>
+<p>as well.</p>
<hr>
<h2><a name="unzip">Unjar/Unwar/Unzip</a></h2>
<h3>Description</h3>