glennm 00/10/03 21:35:36
Modified: docs index.html
Log:
Consolidation of Copyfile, Copydir, Delete, Deltree, and Rename into
Copy, Move, and Delete tasks.
Revision Changes Path
1.121 +191 -29 jakarta-ant/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- index.html 2000/09/29 15:40:29 1.120
+++ index.html 2000/10/04 04:35:34 1.121
@@ -846,6 +846,7 @@
<li><a href="#antstructure">AntStructure</a></li>
<li><a href="#available">Available</a></li>
<li><a href="#chmod">Chmod</a></li>
+ <li><a href="#copy">Copy</a></li>
<li><a href="#copydir">Copydir</a></li>
<li><a href="#copyfile">Copyfile</a></li>
<li><a href="#cvs">Cvs</a></li>
@@ -867,6 +868,7 @@
<li><a href="#javadoc">Javadoc/Javadoc2</a></li>
<li><a href="#mail">Mail</a></li>
<li><a href="#mkdir">Mkdir</a></li>
+ <li><a href="#move">Move</a></li>
<li><a href="#patch">Patch</a></li>
<li><a href="#property">Property</a></li>
<li><a href="#rename">Rename</a></li>
@@ -1172,7 +1174,91 @@
with <code>id</code> <code>other.shared.sources</code> get the same
permissions.</p>
<hr>
+<h2><a name="copy">Copy</a></h2>
+<h3>Description</h3>
+<p>Copies a file or directory to a new file or directory. 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="#fileset">FileSet</a>s are used to select files to copy.
+To use a fileset, the <var>todir</var> attribute must be set.</p>
+<h3>Parameters</h3>
+<table border="1" cellpadding="2" cellspacing="0">
+ <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">file</td>
+ <td valign="top">the file to copy</td>
+ <td valign="top" align="center" rowspan="2">One of <var>file</var> or
+ <var>dir</var> are required, or at least one nested fileset element.</td>
+ </tr>
+ <tr>
+ <td valign="top">dir</td>
+ <td valign="top">the directory to copy</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 <var>file</var>
attribute,
+ either <var>tofile</var> or <var>todir</var> can be used. With the
<var>dir</var>
+ attribute and nested filesets, only <var>todir</var> is allowed.</td>
+ </tr>
+ <tr>
+ <td valign="top">todir</td>
+ <td valign="top">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 (default is no)</td>
+ <td valign="top" align="center">No</td>
+ </tr>
+ <tr>
+ <td valign="top">filtering</td>
+ <td valign="top">indicates whether token filtering should take place
during
+ the copy (default is no)</td>
+ <td valign="top" align="center">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 false)</td>
+ <td valign="top" align="center">No</td>
+ </tr>
+</table>
+<h3>Examples</h3>
+<p><b>Copy a single file</b></p>
+<pre>
+ <copy file="myfile.txt" tofile="mycopy.txt" />
+</pre>
+<p><b>Copy a file to a directory</b></p>
+<pre>
+ <copy file="myfile.txt" todir="../some/dir/tree"
/>
+</pre>
+<p><b>Copy a directory to another directory</b></p>
+<pre>
+ <copy dir="src_dir" todir="../new/dir" />
+</pre>
+<p><b>Copy a set of files to a directory</b></p>
+<pre>
+ <copy todir="../dest/dir" >
+ <fileset dir="src_dir" >
+ <exclude name="**/*.java" />
+ </fileset>
+ </copy>
+
+ <copy todir="../dest/dir" >
+ <fileset dir="src_dir" excludes="**/*.java" />
+ </copy>
+</pre>
+<hr>
<h2><a name="copydir">Copydir</a></h2>
+<h3><i>Deprecated</i></h3>
+<p><i>This task has been deprecated. Use the Copy task instead.</i></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
@@ -1277,6 +1363,8 @@
directory.</p>
<hr>
<h2><a name="copyfile">Copyfile</a></h2>
+<h3><i>Deprecated</i></h3>
+<p><i>This task has been deprecated. Use the Copy task instead.</i></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
@@ -1396,21 +1484,9 @@
<hr>
<h2><a name="delete">Delete</a></h2>
<h3>Description</h3>
-<p>Deletes either a single file or
-all files in a specified directory and its sub-directories.</p>
-<p>It is possible to refine the set of files that are being deleted. 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 in the deletion process by using patterns. The <i>exclude</i>
or <i>excludesfile</i> attribute is used to specify
-the files you want to have excluded from the deletion process. 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="#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="#fileset">FileSet</a> and
-supports all attributes of <code><fileset></code> as well as the
-nested <code><include></code>, <code><exclude></code> and
-<code><patternset></code> elements.</p>
+<p>Deletes either a single file, all files in a specified directory and its
+sub-directories, or a set of files specified by one or more <a
href="#fileset">FileSet</a>s.
+When specifying a set of files, empty directories are <em>not</em>
removed.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -1428,56 +1504,58 @@
<td valign="top">The directory to delete files from.</td>
</tr>
<tr>
+ <td valign="top">verbose</td>
+ <td valign="top">Show name of each deleted file
("true"/"false").
+ Default is "false" when omitted.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
<td valign="top">includes</td>
- <td valign="top">Comma separated list of patterns of files that must be
+ <td valign="top"><i>Deprecated.</i> Comma separated list of patterns of
files that must be
deleted. All files are in the current directory
and any sub-directories are deleted when omitted.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">includesfile</td>
- <td valign="top">the name of a file. Each line of this file is
+ <td valign="top"><i>Deprecated.</i> 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>
</tr>
<tr>
<td valign="top">excludes</td>
- <td valign="top">Comma separated list of patterns of files that must be
+ <td valign="top"><i>Deprecated.</i> Comma separated list of patterns of
files that must be
excluded from the deletion list. No files (except default excludes)
are excluded when omitted.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">excludesfile</td>
- <td valign="top">the name of a file. Each line of this file is
+ <td valign="top"><i>Deprecated.</i> 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>
</tr>
<tr>
<td valign="top">defaultexcludes</td>
- <td valign="top">Indicates whether default excludes should be used or not
+ <td valign="top"><i>Deprecated.</i> Indicates whether default excludes
should be used or not
("yes"/"no"). Default excludes are used when
omitted.</td>
<td valign="top" align="center">No</td>
</tr>
- <tr>
- <td valign="top">verbose</td>
- <td valign="top">Show name of each deleted file
("true"/"false").
- Default is "false" when omitted.</td>
- <td align="center" valign="top">No</td>
- </tr>
</table>
<h3>Examples</h3>
<pre> <delete file="/lib/ant.jar" /></pre>
<p>deletes the file <code>/lib/ant.jar</code>.</p>
<pre> <delete dir="lib" /></pre>
<p>deletes all files in the <code>/lib</code> directory.</p>
-<pre> <delete dir="."
- includes="**/*.bak"
- />
+<pre> <delete>
+ <fileset dir="." includes="**/*.bak" />
+ </delete>
</pre>
<p>deletes all files with the extension "<code>.bak</code>" from
the current directory
and any sub-directories.</p>
<hr>
<h2><a name="deltree">Deltree</a></h2>
+<h3><i>Deprecated</i></h3>
+<p><i>This task has been deprecated. Use the Delete task instead.</i></p>
<h3>Description</h3>
<p>Deletes a directory with all its files and subdirectories.</p>
<h3>Parameters</h3>
@@ -3135,6 +3213,88 @@
<pre><mkdir dir="${dist}/lib" /></pre>
<p>creates a directory <code>${dist}/lib</code>.</p>
<hr>
+<h2><a name="move">Move</a></h2>
+<h3>Description</h3>
+<p>Moves a file or directory to a new file or directory, or sets 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="#fileset">FileSet</a>s are used to select sets of files
+to move to the <var>todir</var> directory.</p>
+<h3>Parameters</h3>
+<table border="1" cellpadding="2" cellspacing="0">
+ <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">file</td>
+ <td valign="top">the file to move</td>
+ <td valign="top" align="center" rowspan="2">One of <var>file</var> or
+ <var>dir</var> are required, or at least one nested fileset element</td>
+ </tr>
+ <tr>
+ <td valign="top">dir</td>
+ <td valign="top">the directory to move</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 the
<var>dir</var>
+ attribute or a nested fileset, only <var>todir</var> is allowed.</td>
+ </tr>
+ <tr>
+ <td valign="top">todir</td>
+ <td valign="top">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 "true")</td>
+ <td valign="top" align="center">No</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">filter</a> task for a description
of
+ how filters work.</td>
+ <td valign="top" align="center">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 "false").</td>
+ <td valign="top" align="center">No</td>
+ </tr>
+</table>
+<h3>Examples</h3>
+<p><b>Move a single file (rename a file)</b></p>
+<pre>
+ <move file="file.orig" tofile="file.moved" />
+</pre>
+<p><b>Move a single file to a directory</b></p>
+<pre>
+ <move file="file.orig" todir="dir/to/move/to" />
+</pre>
+<p><b>Move a directory to a new directory</b></p>
+<pre>
+ <move dir="src/dir" todir="new/dir/to/move/to" />
+</pre>
+<p>Note that the directory src/dir will be removed.</p>
+<p><b>Move a set of files to a new directory</b></p>
+<pre>
+ <move todir="some/new/dir" >
+ <fileset dir="my/src/dir" >
+ <include name="**/*.jar" />
+ <exclude name="**/ant.jar" />
+ </fileset>
+ </move>
+</pre>
+<hr>
<h2><a name="patch">Patch</a></h2>
<h3>Description</h3>
<p>Applies a diff file to originals.
@@ -3272,6 +3432,8 @@
implementations may use other values for the home directory on Windows.
<hr>
<h2><a name="rename">Rename</a></h2>
+<h3><i>Deprecated</i></h3>
+<p><i>This task has been deprecated. Use the Move task instead.</i></p>
<h3>Description</h3>
<p>Renames a given file.</p>
<h3>Parameters</h3>