This is an automated email from the ASF dual-hosted git repository. bodewig pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ant.git
commit 8593dbc3d1a40540cdeb3dc0726a94aded1ec238 Merge: 4da6c49 033f8dc Author: Stefan Bodewig <[email protected]> AuthorDate: Thu Aug 19 14:30:27 2021 +0200 Merge branch '1.9.x' manual/Tasks/copy.html | 3 ++- manual/Tasks/move.html | 3 ++- src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --cc manual/Tasks/copy.html index 48f07d9,2e39116..29a459e --- a/manual/Tasks/copy.html +++ b/manual/Tasks/copy.html @@@ -24,130 -24,163 +24,131 @@@ <body> -<h2><a name="copy">Copy</a></h2> +<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 - please see -the <code>granularity</code> attribute for Ant's idea -of <em>newer</em>. -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> ++exist - please see the <var>granularity</var> attribute for Ant's idea of <em>newer</em>. ++However, you can explicitly overwrite files with the <code>overwrite</code> 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 collections</a> 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 border="1" cellpadding="2" cellspacing="0"> +<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 scope="col">Attribute</th> + <th scope="col">Description</th> + <th scope="col">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><fileset></code>, or if the - <code>file</code> attribute is also specified, then only - <code>todir</code> is allowed.<br/> - <em>Prior to Apache Ant 1.8.2</em> the <code>tofile</code> attribute - only supported filesystem resources top 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><fileset></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 class="left">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. - <em>Note</em>: Nested <code><filterset></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><filterset></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> diff --cc manual/Tasks/move.html index d9baefe,3692c9d..5ea337a --- a/manual/Tasks/move.html +++ b/manual/Tasks/move.html @@@ -24,133 -24,164 +24,134 @@@ <body> -<h2><a name="move">Move</a></h2> +<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 -- please see the <code>granularity</code> attribute for Ant's idea -of <em>newer</em>.</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> ++destination file does not exist ++- please see the <var>granularity</var> attribute for Ant's idea of <em>newer</em>.</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><fileset></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 collections</a> 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><fileset></code> has been supported as a nested element. To use a resource +collection, the <var>todir</var> attribute must be set.</p> -<p><b>Since Ant 1.6.3</b>, 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 border="1" cellpadding="2" cellspacing="0"> +<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 scope="col">Attribute</th> + <th scope="col">Description</th> + <th scope="col">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. - (<em>Note</em>: Ignored on Java 1.1)</td> - <td valign="top" align="center">No; defaults to false.</td> + <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>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 "true")</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 "false").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 "yes".</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 "true" on - Windows and "true" 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>
