Browse Source

Tidy tag soup, remove inlined styling, adjust formatting

master
Gintas Grigelionis 7 years ago
parent
commit
94d36a9fe7
27 changed files with 1007 additions and 1138 deletions
  1. +9
    -15
      manual/Types/antlib.html
  2. +12
    -19
      manual/Types/assertions.html
  3. +16
    -20
      manual/Types/classfileset.html
  4. +5
    -10
      manual/Types/custom-programming.html
  5. +3
    -5
      manual/Types/description.html
  6. +2
    -4
      manual/Types/dirset.html
  7. +4
    -9
      manual/Types/extension.html
  8. +4
    -8
      manual/Types/extensionset.html
  9. +13
    -16
      manual/Types/filelist.html
  10. +4
    -7
      manual/Types/fileset.html
  11. +431
    -454
      manual/Types/filterchain.html
  12. +57
    -59
      manual/Types/filterset.html
  13. +51
    -52
      manual/Types/mapper.html
  14. +2
    -4
      manual/Types/multirootfileset.html
  15. +12
    -12
      manual/Types/namespace.html
  16. +8
    -11
      manual/Types/patternset.html
  17. +12
    -12
      manual/Types/permissions.html
  18. +3
    -6
      manual/Types/propertyset.html
  19. +5
    -7
      manual/Types/redirector.html
  20. +7
    -6
      manual/Types/regexp.html
  21. +121
    -151
      manual/Types/resources.html
  22. +5
    -11
      manual/Types/selectors-program.html
  23. +157
    -182
      manual/Types/selectors.html
  24. +8
    -10
      manual/Types/tarfileset.html
  25. +29
    -32
      manual/Types/xmlcatalog.html
  26. +18
    -16
      manual/Types/zipfileset.html
  27. +9
    -0
      manual/stylesheets/style.css

+ 9
- 15
manual/Types/antlib.html View File

@@ -17,13 +17,13 @@
<html>

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

<body>
<h2><a name="antlib">Antlib</a></h2>
<h2 id="antlib">Antlib</h2>


<h3>Description</h3>
@@ -108,7 +108,7 @@
</blockquote>


<h3><a name="antlibnamespace">Antlib namespace</a></h3>
<h3 id="antlibnamespace">Antlib namespace</h3>
<p>
The name space URIs with the pattern <b>antlib:<i>java package</i></b>
are given special treatment.
@@ -152,14 +152,14 @@
</blockquote>
<p>
The requirement that the resource is in the default classpath
may be removed in future versions of Ant.</p>
may be removed in future versions of Ant.
</p>


<h3><a name="loadFromInside">Load antlib from inside of the buildfile</a></h3>
<h3 id="loadFromInside">Load antlib from inside of the buildfile</h3>
<p>
If you want to separate the antlib from your local Ant installation, e.g. because you
want to hold that jar in your projects SCM system, you have to specify a classpath, so
If you want to separate the antlib from your local Ant installation, e.g. because you
want to hold that jar in your projects SCM system, you have to specify a classpath, so
that Ant could find that jar. The best solution is loading the antlib with <tt>&lt;taskdef&gt;</tt>.
</p>
<blockquote>
@@ -168,7 +168,7 @@
&lt;taskdef uri="<font color="red">antlib:net.sf.antcontrib</font>"
resource="net/sf/antcontrib/antlib.xml"
classpath="path/to/ant-contrib.jar"/&gt;
&lt;target name="iterate"&gt;
&lt;<font color="green">antcontrib</font>:for param="file"&gt;
&lt;fileset dir="."/&gt;
@@ -181,10 +181,7 @@
</pre>
</blockquote>


<h3><a name="currentnamespace">Current namespace</a></h3>
<h3 id="currentnamespace">Current namespace</h3>
<p>
Definitions defined in antlibs may be used in antlibs. However
the namespace that definitions are placed in are dependent on
@@ -258,9 +255,6 @@
&lt;/project&gt;
</pre>
</blockquote>


</body>
</html>


+ 12
- 19
manual/Types/assertions.html View File

@@ -24,22 +24,22 @@

<body>

<h2><a name="assertions">Assertions</a></h2>
<h2 id="assertions">Assertions</h2>
<p>
The <tt>assertions</tt> type enables or disables the Java 1.4 assertions feature,
on a whole Java program, or components of a program. It can be used
in <a href="../Tasks/java.html"><code>&lt;java&gt;</code></a> and
<a href="../Tasks/junit.html"><code>&lt;junit&gt;</code></a> to add extra validation to code.
<a href="../Tasks/junit.html"><code>&lt;junit&gt;</code></a> to add extra validation to code.

<p>
Assertions are covered in the
Assertions are covered in the
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html">Java SE documentation</a>,
and the
<a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.10">Java Language Specification</a>.

<p>
The key points to note are that a <tt>java.lang.AssertionError</tt>
is thrown when an assertion fails, and that the facility is only available
is thrown when an assertion fails, and that the facility is only available
on Java 1.4 and later. To enable assertions one must set <tt>source="1.4"</tt>
(or later) in <tt>&lt;javac&gt;</tt> when the source is being compiled, and
that the code must contain <tt>assert</tt> statements to be tested. The
@@ -47,20 +47,16 @@ result of such an action is code that neither compiles or runs on earlier
versions of Java. For this reason Apache Ant itself currently contains no assertions.
<p>

When assertions are enabled (or disabled) in a task through nested
assertions elements, the class loader or command line is modified with the
When assertions are enabled (or disabled) in a task through nested
assertions elements, the class loader or command line is modified with the
appropriate options. This means that the JVM executed must be a Java 1.4
or later JVM, even if there are no assertions in the code. Attempting to
enable assertions on earlier VMs will result in an "Unrecognized option"
error and the JVM will not start.
enable assertions on earlier VMs will result in an "Unrecognized option"
error and the JVM will not start.

<p>
<h4>Attributes</h4>
<p>


</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -75,7 +71,7 @@ error and the JVM will not start.
<p>
When system assertions have been neither enabled nor disabled, then
the JVM is not given any assertion information - the default action of the
current JVMs is to disable system assertions.
current JVMs is to disable system assertions.
<p>
Note also that there is no apparent documentation for what parts of the
JRE come with useful assertions.
@@ -87,7 +83,7 @@ JRE come with useful assertions.
Enable assertions in portions of code.
If neither a package nor class is specified, assertions are turned on in <i>all</i> (user) code.
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -113,7 +109,7 @@ If neither a package nor class is specified, assertions are turned on in <i>all<
Disable assertions in portions of code.

</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -138,7 +134,6 @@ Disable assertions in portions of code.
Because assertions are disabled by default, it only makes sense to disable
assertions where they have been enabled in a parent package.


<h4>Examples</h4>

<h5>Example: enable assertions in all user classes</h5>
@@ -190,7 +185,6 @@ Disable system assertions; enable those in the anonymous package
&lt;/assertions&gt;
</pre>


<h5>Example: referenced assertions</h5>

This type is a datatype, so you can declare assertions and use them later
@@ -203,6 +197,5 @@ This type is a datatype, so you can declare assertions and use them later
&lt;assertions refid="project.assertions"/&gt;
</pre>


</body>
</html>

+ 16
- 20
manual/Types/classfileset.html View File

@@ -22,9 +22,9 @@
</head>

<body>
<h2><a name="fileset">ClassFileSet</a></h2>
<p>A classfileset is a specialized type of fileset which, given a set of
&quot;root&quot; classes, will include all of the class files upon which the
<h2 id="fileset">ClassFileSet</h2>
<p>A classfileset is a specialized type of fileset which, given a set of
&quot;root&quot; classes, will include all of the class files upon which the
root classes depend. This is typically used to create a jar with all of the
required classes for a particular application.
</p>
@@ -37,14 +37,13 @@ is expected.
This type requires the <code>BCEL</code> <a href="../install.html#librarydependencies">library</a>.
</p>


<h3>Attributes</h3>
<p>The class fileset support the following attributes in addition
to those supported by the
<a href="../Types/fileset.html">standard fileset</a>:
to those supported by the
<a href="fileset.html">standard fileset</a>:
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -64,7 +63,7 @@ to those supported by the
When more than one root class is required, multiple nested <code>&lt;root&gt;</code> elements
may be used
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -79,9 +78,9 @@ may be used

<h4>RootFileSet</h4>
<p>
A root fileset is used to add a set of root classes from a fileset. In this case the entries in
the fileset are expected to be Java class files. The name of the Java class is determined by the
relative location of the classfile in the fileset. So, the file
A root fileset is used to add a set of root classes from a fileset. In this case the entries in
the fileset are expected to be Java class files. The name of the Java class is determined by the
relative location of the classfile in the fileset. So, the file
<code>org/apache/tools/ant/Project.class</code> corresponds to the Java class
<code>org.apache.tools.ant.Project</code>.</p>

@@ -92,9 +91,9 @@ relative location of the classfile in the fileset. So, the file
&lt;/classfileset&gt;
</pre></blockquote>

<p>This example creates a fileset containing all the class files upon which the
<code>org.apache.tools.ant.Project</code> class depends. This fileset could
then be used to create a jar.
<p>This example creates a fileset containing all the class files upon which the
<code>org.apache.tools.ant.Project</code> class depends. This fileset could
then be used to create a jar.
</p>

<blockquote><pre>
@@ -109,11 +108,8 @@ then be used to create a jar.
&lt;/classfileset&gt;
</pre></blockquote>

<p>This example constructs the classfileset using all the class with names starting with Project
in the org.apache.tools.ant package</p>


<p>This example constructs the classfileset using all the class with names starting with Project
in the org.apache.tools.ant package</p>

</body>
</html>


+ 5
- 10
manual/Types/custom-programming.html View File

@@ -16,7 +16,7 @@
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us"></meta>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>Custom Components</title>
</head>
@@ -57,7 +57,7 @@
After the class has been written, it is added to the ant system
by using <code>&lt;typedef&gt;</code>.
</p>
<h3><a name="customconditions">Custom Conditions</a></h3>
<h3 id="customconditions">Custom Conditions</h3>
<p>
Custom conditions are datatypes that implement
<code>org.apache.tools.ant.taskdefs.condition.Condition</code>.
@@ -112,7 +112,7 @@ public class AllUpperCaseCondition implements Condition {
&lt;/condition&gt;
</pre>
</blockquote>
<h3><a name="customselectors">Custom Selectors</a></h3>
<h3 id="customselectors">Custom Selectors</h3>
<p>
Custom selectors are datatypes that implement
<code>org.apache.tools.ant.types.selectors.FileSelector</code>.
@@ -265,12 +265,11 @@ public class MatchNumberSelectors extends BaseSelectorContainer {
core selectors demonstrate how to do that because they can
also be used as custom selectors.</p>


<p>Once that is written, you include it in your build file by using
the <code>&lt;custom&gt;</code> tag.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -315,7 +314,6 @@ public class MatchNumberSelectors extends BaseSelectorContainer {
&lt;/fileset&gt;
</pre></blockquote>


<p>The core selectors that can also be used as custom selectors
are</p>

@@ -351,7 +349,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer {
<p>Selects all files in the base directory and one directory below
that.</p>

<h3><a name="filterreaders">Custom Filter Readers</a></h3>
<h3 id="filterreaders">Custom Filter Readers</h3>
<p>
Custom filter readers selectors are datatypes that implement
<code>org.apache.tools.ant.types.filters.ChainableReader</code>.
@@ -408,8 +406,5 @@ public class AddLineNumber extends ChainableReaderFilter {
</pre>
</blockquote>


<hr></hr>
</body>
</html>


+ 3
- 5
manual/Types/description.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="description">Description</a></h2>
<h2 id="description">Description</h2>
<h3>Description</h3>
<p>Allows for a description of the project to be specified that
will be included in the output of the <code>ant &#x2011;projecthelp</code>
@@ -33,14 +33,12 @@ command.</p>
<h3>Parameters</h3>
<p>(none)</p>
<h3>Examples</h3>
<pre>
<pre>
&lt;description&gt;
This buildfile is used to build the Foo subproject within
This buildfile is used to build the Foo subproject within
the large, complex Bar project.
&lt;/description&gt;
</pre>


</body>
</html>


+ 2
- 4
manual/Types/dirset.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="dirset">DirSet</a></h2>
<h2 id="dirset">DirSet</h2>
<p>A DirSet is a group of directories. These directories can be found in a
directory tree starting in a base directory and are matched by
patterns taken from a number of <a href="patternset.html">PatternSets</a>
@@ -41,7 +41,7 @@ elements of <code>&lt;patternset&gt;</code> directly, as well as
If any of the selectors within the DirSet do not select the directory, it
is not considered part of the DirSet. This makes a DirSet
equivalent to an <code>&lt;and&gt;</code> selector container.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -148,7 +148,5 @@ using the same patterns as the above example.</p>
<p>Selects all directories somewhere under <code>${workingdir}</code>
which contain a <code>${markerfile}</code>.</p>


</body>
</html>


+ 4
- 9
manual/Types/extension.html View File

@@ -22,7 +22,7 @@
</head>

<body>
<h2><a name="fileset">Extension</a></h2>
<h2 id="fileset">Extension</h2>
<p>Utility type that represents either an available "Optional Package"
(formerly known as "Standard Extension") as described in the manifest
of a JAR file, or the requirement for such an optional package.</p>
@@ -32,14 +32,12 @@ works with extensions as defined by the "Optional Package" specification.
<em>Optional Package Versioning</em> in the documentation bundle for your
Java2 Standard Edition package, in file
<code>guide/extensions/versioning.html</code> or the online
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">
Package Versioning documentation.</p>
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">Package Versioning documentation.</a></p>

<h3>Attributes</h3>
<p>The extension type supports the following attributes</a>:
</p>
<p>The extension type supports the following attributes:</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -107,8 +105,5 @@ Package Versioning documentation.</p>

<p>Extension object that just species the specification details.</p>



</body>
</html>


+ 4
- 8
manual/Types/extensionset.html View File

@@ -30,8 +30,7 @@ works with extensions as defined by the "Optional Package" specification.
<em>Optional Package Versioning</em> in the documentation bundle for your
Java2 Standard Edition package, in file
<code>guide/extensions/versioning.html</code> or online at
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">
Package Versioning documentation.</p>
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">Package Versioning documentation.</a></p>

<h3>Nested Elements</h3>

@@ -39,13 +38,13 @@ Package Versioning documentation.</p>
<p><a href="extension.html">Extension</a> object to add to set.</p>

<h4>fileset</h4>
<p><a href="../Types/fileset.html">FileSet</a>s all files contained
<p><a href="fileset.html">FileSet</a>s all files contained
contained within set that are jars and implement an extension are added
to extension set.</p>

<h4>LibFileSet</h4>
<p>All files contained contained within set that are jars and implement
an extension are added to extension set. However the extension information
<p>All files contained contained within set that are jars and implement
an extension are added to extension set. However the extension information
may be modified by attributes of libfileset</p>

<h4>Examples</h4>
@@ -76,8 +75,5 @@ Package Versioning documentation.</p>

</pre></blockquote>



</body>
</html>


+ 13
- 16
manual/Types/filelist.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="filelist">FileList</a></h2>
<h2 id="filelist">FileList</h2>

<p>FileLists are explicitly named lists of files. Whereas FileSets
act as filters, returning only those files that exist in the file
@@ -36,7 +36,7 @@ included in the list unchanged).
FileLists can appear inside tasks that support this feature or as stand-alone
types.
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -61,7 +61,7 @@ types.
white space and commas.
</p>
<p><em>Since Apache Ant 1.6.2</em></p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -72,13 +72,13 @@ types.
<td valign="top">The name of the file.</td>
<td valign="top" align="center">Yes</td>
</tr>
</table>
</table>
<h4>Examples</h4>
<blockquote><pre>
&lt;filelist
id=&quot;docfiles&quot;
&lt;filelist
id=&quot;docfiles&quot;
dir=&quot;${doc.src}&quot;
files=&quot;foo.xml,bar.xml&quot;/&gt;
files=&quot;foo.xml,bar.xml&quot;/&gt;
</pre></blockquote>

<p>The files <code>${doc.src}/foo.xml</code> and
@@ -87,24 +87,24 @@ actually exist.
</p>

<blockquote><pre>
&lt;filelist
id=&quot;docfiles&quot;
&lt;filelist
id=&quot;docfiles&quot;
dir=&quot;${doc.src}&quot;
files=&quot;foo.xml
bar.xml&quot;/&gt;
bar.xml&quot;/&gt;
</pre></blockquote>

<p>Same files as the example above.</p>

<blockquote><pre>
&lt;filelist refid=&quot;docfiles&quot;/&gt;
&lt;filelist refid=&quot;docfiles&quot;/&gt;
</pre></blockquote>

<p>Same files as the example above.</p>

<blockquote><pre>
&lt;filelist
id=&quot;docfiles&quot;
&lt;filelist
id=&quot;docfiles&quot;
dir=&quot;${doc.src}&quot;&gt;
&lt;file name="foo.xml"/&gt;
&lt;file name="bar.xml"/&gt;
@@ -113,8 +113,5 @@ actually exist.

<p>Same files as the example above.</p>



</body>
</html>


+ 4
- 7
manual/Types/fileset.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="fileset">FileSet</a></h2>
<h2 id="fileset">FileSet</h2>
<p>A FileSet is a group of files. These files can be found in a
directory tree starting in a base directory and are matched by
patterns taken from a number of <a
@@ -41,7 +41,7 @@ attributes.</p>
If any of the selectors within the FileSet do not select the file, the
file is not considered part of the FileSet. This makes a FileSet
equivalent to an <code>&lt;and&gt;</code> selector container.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -115,7 +115,7 @@ equivalent to an <code>&lt;and&gt;</code> selector container.</p>
</tr>
</table>

<p><a name="symlink"><b>Note</b></a>: All files/directories for which
<p id="symlink"><b>Note</b>: All files/directories for which
the canonical path is different from its path are considered symbolic
links. On Unix systems this usually means the file really is a
symbolic link but it may lead to false results on other
@@ -176,11 +176,8 @@ selector container.</p>
<blockquote><pre>
&lt;fileset dir="src" includes="main/" /&gt;
</pre></blockquote>
<p>Selects all files in <i>src/main</i> (e.g. <i>src/main/Foo.java</i> or
<p>Selects all files in <i>src/main</i> (e.g. <i>src/main/Foo.java</i> or
<i>src/main/application/Bar.java</i>).</p>



</body>
</html>


+ 431
- 454
manual/Types/filterchain.html
File diff suppressed because it is too large
View File


+ 57
- 59
manual/Types/filterset.html View File

@@ -14,8 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
@@ -23,13 +21,13 @@
</head>

<body>
<h2><a name="filterset">FilterSet</a></h2>
<h2 id="filterset">FilterSet</h2>

<p>FilterSets are groups of filters. Filters can be defined as token-value
pairs
or be read in from a file. FilterSets can appear inside tasks that support this
pairs
or be read in from a file. FilterSets can appear inside tasks that support this
feature or at the same level as <code>&lt;target&gt;</code> - i.e., as
children of
children of
<code>&lt;project&gt;</code>.</p>

<p>FilterSets support the <code>id</code> and <code>refid</code>
@@ -40,9 +38,9 @@ filtersets into filtersets to get a set union of the contained
filters.</p>

<p>In addition, FilterSets can specify
<code>begintoken</code> and/or
<code>begintoken</code> and/or
<code>endtoken</code> attributes to define what to match.</p>
<p>Filtersets are used for doing
<p>Filtersets are used for doing
replacements in tasks such as <code>&lt;copy&gt;</code>, etc.</p>

<p>Filters can also by specified by one or more nested propertysets, the
@@ -52,96 +50,96 @@ replacements in tasks such as <code>&lt;copy&gt;</code>, etc.</p>
defined within a filterset will be used.</p>

<p>
<strong>Note: </strong>When a filterset is used in an operation, the files are
<strong>Note: </strong>When a filterset is used in an operation, the files are
processed in text mode and the filters applied line by line. This means that
the copy operations will typically corrupt binary files. When applying filters
you should ensure that the set of files being filtered are all text files.
</p>

<h2>Filterset</h2>
<h3>Filterset</h3>

<table cellSpacing=0 cellPadding=2 border=1>
<table>
<tr>
<td vAlign=top><b>Attribute</b></td>
<td vAlign=top><b>Description</b></td>
<td vAlign=top><b>Default</b></td>
<td vAlign=top align="center"><b>Required</b></td>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top"><b>Default</b></td>
<td valign="top" align="center"><b>Required</b></td>
</tr>
<tr>
<td vAlign=top>begintoken</td>
<td vAlign=top>The string marking the beginning of a token (eg.,
<td valign="top">begintoken</td>
<td valign="top">The string marking the beginning of a token (eg.,
<code>&#64;DATE&#64;</code>).</td>
<td vAlign=top>@</td>
<td vAlign=top align="center">No</td>
<td valign="top">@</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td vAlign=top>endtoken</td>
<td vAlign=top>The string marking the end of a token (eg.,
<td valign="top">endtoken</td>
<td valign="top">The string marking the end of a token (eg.,
<code>&#64;DATE&#64;</code>).</td>
<td vAlign=top>@</td>
<td vAlign=top align="center">No</td>
<td valign="top">@</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td vAlign=top>filtersfile</td>
<td vAlign=top>Specify a single filtersfile.</td>
<td vAlign=top><i>none</i></td>
<td vAlign=top align="center">No</td>
<td valign="top">filtersfile</td>
<td valign="top">Specify a single filtersfile.</td>
<td valign="top"><i>none</i></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td vAlign=top>recurse</td>
<td vAlign=top>Indicates whether the replacement text of tokens
should be searched for more tokens. <b>Since Ant 1.6.3</b></td>
<td vAlign=top><i>true</i></td>
<td vAlign=top align="center">No</td>
<td valign="top">recurse</td>
<td valign="top">Indicates whether the replacement text of tokens
should be searched for more tokens. <em>Since Ant 1.6.3</em></td>
<td valign="top"><i>true</i></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td vAlign=top>onmissingfiltersfile</td>
<td vAlign=top>Indicate behavior when a nonexistent <i>filtersfile</i>
is specified. One of "fail", "warn", "ignore". <b>Since Ant 1.7</b></td>
<td vAlign=top>"fail"</td>
<td vAlign=top align="center">No</td>
<td valign="top">onmissingfiltersfile</td>
<td valign="top">Indicate behavior when a nonexistent <i>filtersfile</i>
is specified. One of "fail", "warn", "ignore". <em>Since Ant 1.7</em></td>
<td valign="top">"fail"</td>
<td valign="top" align="center">No</td>
</tr>
</table>

<h2>Filter</h2>
<table cellSpacing=0 cellPadding=2 border=1>
<h3>Filter</h3>
<table>
<tr>
<td vAlign=top><b>Attribute</b></td>
<td vAlign=top><b>Description</b></td>
<td vAlign=top align="center"><b>Required</b></td>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
</tr>
<tr>
<td vAlign=top>token</td>
<td vAlign=top>The token to replace (eg., <code>&#64;DATE&#64;</code>)</td>
<td vAlign=top align="center">Yes</td>
<td valign="top">token</td>
<td valign="top">The token to replace (eg., <code>&#64;DATE&#64;</code>)</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td vAlign=top>value</td>
<td vAlign=top>The value to replace it with
<td valign="top">value</td>
<td valign="top">The value to replace it with
(eg., <code>Thursday, April 26, 2001</code>).</td>
<td vAlign=top align="center">Yes</td>
<td valign="top" align="center">Yes</td>
</tr>
</table>

<h2>Filtersfile</h2>
<table cellSpacing=0 cellPadding=2 border=1>
<h3>Filtersfile</h3>
<table>
<tr>
<td vAlign=top><b>Attribute</b></td>
<td vAlign=top><b>Description</b></td>
<td vAlign=top align="center"><b>Required</b></td>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
</tr>
<tr>
<td vAlign=top>file</td>
<td vAlign=top>A properties file of
<td valign="top">file</td>
<td valign="top">A properties file of
name-value pairs from which to load the tokens.</td>
<td vAlign=top align="center">Yes</td>
<td valign="top" align="center">Yes</td>
</tr>
</table>

<h4>Examples</h4>

<p>You are copying the <code>version.txt</code> file to the <code>dist</code>
directory from the <code>build</code> directory
directory from the <code>build</code> directory
but wish to replace the token <code>&#64;DATE&#64;</code> with today's date.</p>
<blockquote><pre>
&lt;copy file=&quot;${build.dir}/version.txt&quot; toFile=&quot;${dist.dir}/version.txt&quot;&gt;
@@ -152,7 +150,7 @@ but wish to replace the token <code>&#64;DATE&#64;</code> with today's date.</p>
</pre></blockquote>

<p>You are copying the <code>version.txt</code> file to the <code>dist</code>
directory from the build directory
directory from the build directory
but wish to replace the token <code>%DATE*</code> with today's date.</p>
<blockquote><pre>
&lt;copy file=&quot;${build.dir}/version.txt&quot; toFile=&quot;${dist.dir}/version.txt&quot;&gt;
@@ -186,7 +184,7 @@ but wish to replace the token <code>%DATE*</code> with today's date.</p>
</pre></blockquote>

<p>You are copying the <code>version.txt</code> file to the <code>dist</code>
directory from the <code>build</code> directory
directory from the <code>build</code> directory
but wish to replace the token <code>&#64;project.date&#64;</code> with the property of the same name.</p>
<blockquote><pre>
&lt;copy file=&quot;${build.dir}/version.txt&quot; toFile=&quot;${dist.dir}/version.txt&quot;&gt;


+ 51
- 52
manual/Types/mapper.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="mapper">Mapping File Names</a></h2>
<h2 id="mapper">Mapping File Names</h2>
<p>Some tasks take source files and create target files. Depending on
the task, it may be quite obvious which name a target file will have
(using <a href="../Tasks/javac.html">javac</a>, you know there will be
@@ -40,7 +40,7 @@ that can be parameterized with <code>from</code> and <code>to</code>
attributes - the exact meaning of which is implementation-dependent.</p>
<p>These instances are defined in <code>&lt;mapper&gt;</code> elements
with the following attributes:</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -93,17 +93,16 @@ instead.
<p>The classpath can be specified via a nested
<code>&lt;classpath&gt;</code>, as well - that is,
a <a href="../using.html#path">path</a>-like structure.</p>
<p><b>Since Ant 1.7.0,</b> nested File Mappers can
<p><em>Since Ant 1.7.0</em>, nested File Mappers can
be supplied via either <CODE>&lt;mapper&gt;</CODE> elements or
<a href="../Tasks/typedef.html"><code>&lt;typedef&gt;</code></a>'d
implementations of <CODE>org.apache.tools.ant.util.FileNameMapper</CODE>.
If nested File Mappers are specified by either means, the mapper will be
implicitly configured as a <a href="#composite-mapper">composite mapper</a>.
</p>
<hr>
<h3>The built-in mapper types are:</h3>
<h3>The built-in mapper types</h3>
<p>All built-in mappers are case-sensitive.</p>
<p><b>As of Ant 1.7.0,</b> each of the built-in mapper implementation
<p><em>Since Ant 1.7.0</em>, each of the built-in mapper implementation
types is directly accessible using a specific tagname. This makes it
possible for filename mappers to support attributes in addition to
the generally available <i>to</i> and <i>from</i>.<br>
@@ -114,7 +113,7 @@ implicitly configured as a <a href="#composite-mapper">composite mapper</a>.
<!-- Identity Mapper -->
<!-- -->

<h4><a name="identity-mapper">identity</a></h4>
<h4 id="identity-mapper">identity</h4>
<p>The target file name is identical to the source file name. Both
<code>to</code> and <code>from</code> will be ignored.</p>
<b>Examples:</b>
@@ -122,7 +121,7 @@ implicitly configured as a <a href="#composite-mapper">composite mapper</a>.
&lt;mapper type=&quot;identity&quot;/&gt;
&lt;identitymapper/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -149,7 +148,7 @@ implicitly configured as a <a href="#composite-mapper">composite mapper</a>.
<!-- Flatten Mapper -->
<!-- -->

<h4><a name="flatten-mapper">flatten</a></h4>
<h4 id="flatten-mapper">flatten</h4>
<p>The target file name is identical to the source file name, with all
leading directory information stripped off. Both <code>to</code> and
<code>from</code> will be ignored.</p>
@@ -158,7 +157,7 @@ leading directory information stripped off. Both <code>to</code> and
&lt;mapper type=&quot;flatten&quot;/&gt;
&lt;flattenmapper/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -185,7 +184,7 @@ leading directory information stripped off. Both <code>to</code> and
<!-- Merge Mapper -->
<!-- -->

<h4><a name="merge-mapper">merge</a></h4>
<h4 id="merge-mapper">merge</h4>
<p>The target file name will always be the same, as defined by
<code>to</code> - <code>from</code> will be ignored.</p>
<h5>Examples:</h5>
@@ -193,7 +192,7 @@ leading directory information stripped off. Both <code>to</code> and
&lt;mapper type=&quot;merge&quot; to=&quot;archive.tar&quot;/&gt;
&lt;mergemapper to=&quot;archive.tar&quot;/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -220,7 +219,7 @@ leading directory information stripped off. Both <code>to</code> and
<!-- Glob Mapper -->
<!-- -->

<h4><a name="glob-mapper">glob</a></h4>
<h4 id="glob-mapper">glob</h4>
<p>Both <code>to</code> and <code>from</code> are required and define patterns that may
contain at most one <code>*</code>. For each source file that matches
the <code>from</code> pattern, a target file name will be constructed
@@ -233,7 +232,7 @@ that don't match the <code>from</code> pattern will be ignored.</p>
&lt;mapper type=&quot;glob&quot; from=&quot;*.java&quot; to=&quot;*.java.bak&quot;/&gt;
&lt;globmapper from=&quot;*.java&quot; to=&quot;*.java.bak&quot;/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -259,7 +258,7 @@ that don't match the <code>from</code> pattern will be ignored.</p>
&lt;mapper type=&quot;glob&quot; from=&quot;C*ies&quot; to=&quot;Q*y&quot;/&gt;
&lt;globmapper from=&quot;C*ies&quot; to=&quot;Q*y&quot;/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -284,7 +283,7 @@ that don't match the <code>from</code> pattern will be ignored.</p>
<p>
The globmapper mapper can take the following extra attributes.
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -295,7 +294,7 @@ that don't match the <code>from</code> pattern will be ignored.</p>
<td valign="top">
If this is false, the mapper will ignore case when matching the glob pattern.
This attribute can be true or false, the default is true.
<em>Since Ant 1.6.3.</em>
<em>Since Ant 1.6.3</em>
</td>
<td align="center" valign="top">No</td>
</tr>
@@ -306,7 +305,7 @@ that don't match the <code>from</code> pattern will be ignored.</p>
directory separator characters - \ and /.
This attribute can be true or false, the default is false.
This attribute is useful for cross-platform build files.
<em>Since Ant 1.6.3.</em>
<em>Since Ant 1.6.3</em>
<td align="center" valign="top">No</td>
</tr>
</table>
@@ -344,12 +343,11 @@ that don't match the <code>from</code> pattern will be ignored.</p>
will output "x is f/j.java".
</p>


<!-- -->
<!-- RegExp Mapper -->
<!-- -->

<h4><a name="regexp-mapper">regexp</a></h4>
<h4 id="regexp-mapper">regexp</h4>

<p>Both <code>to</code> and <code>from</code> are required and define
regular expressions. If the source file name (as a whole or in part)
@@ -371,9 +369,9 @@ another dollar-sign in Ant.</p>

<p>The regexp mapper needs a supporting library and an implementation
of <code>org.apache.tools.ant.util.regexp.RegexpMatcher</code> that
hides the specifics of the library. <em>Since Ant 1.8.0</em> Ant
requires Java 1.4 to run, so the implementation based on
the <code>java.util.regex</code> package will always be available.
hides the specifics of the library. <em>Since Ant 1.8.0</em>,
Java 1.4 or later is required, so the implementation based on
the <code>java.util.regex</code> package is always be available.
You can still use the now retired Jakarta ORO or Jakarta Regex instead if your
provide the corresponding jar in your CLASSPATH.</p>

@@ -410,7 +408,7 @@ should be used.</li>
&lt;mapper type=&quot;regexp&quot; from=&quot;^(.*)\.java$$&quot; to=&quot;\1.java.bak&quot;/&gt;
&lt;regexpmapper from=&quot;^(.*)\.java$$&quot; to=&quot;\1.java.bak&quot;/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -436,7 +434,7 @@ should be used.</li>
&lt;mapper type=&quot;regexp&quot; from=&quot;^(.*)/([^/]+)/([^/]*)$$&quot; to=&quot;\1/\2/\2-\3&quot;/&gt;
&lt;regexpmapper from=&quot;^(.*)/([^/]+)/([^/]*)$$&quot; to=&quot;\1/\2/\2-\3&quot;/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -462,7 +460,7 @@ should be used.</li>
&lt;mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/&gt;
&lt;regexpmapper from="^(.*)\.(.*)$$" to="\2.\1"/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -488,7 +486,7 @@ should be used.</li>
&lt;mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/&gt;
&lt;regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -513,7 +511,7 @@ should be used.</li>
<p>
The regexpmapper mapper can take the following extra attributes.
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -524,7 +522,7 @@ should be used.</li>
<td valign="top">
If this is false, the mapper will ignore case when matching the pattern.
This attribute can be true or false, the default is true.
<em>Since Ant 1.6.3.</em>
<em>Since Ant 1.6.3</em>
</td>
<td align="center" valign="top">No</td>
</tr>
@@ -535,7 +533,7 @@ should be used.</li>
as a / for the purposes of matching.
This attribute can be true or false, the default is false.
This attribute is useful for cross-platform build files.
<em>Since Ant 1.6.3.</em>
<em>Since Ant 1.6.3</em>
<td align="center" valign="top">No</td>
</tr>
</table>
@@ -574,7 +572,7 @@ should be used.</li>
<!-- Package Mapper -->
<!-- -->

<h4><a name="package-mapper">package</a></h4>
<h4 id="package-mapper">package</h4>
<p>Sharing the same syntax as the <a href="#glob-mapper">glob mapper</a>,
the package mapper replaces
directory separators found in the matched source pattern with dots in the target
@@ -586,7 +584,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
&lt;mapper type="package" from="*Test.java" to="TEST-*Test.xml"/&gt;
&lt;packagemapper from="*Test.java" to="TEST-*Test.xml"/&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -605,7 +603,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
<!-- Unpackage Mapper -->
<!-- -->

<h4><a name="unpackage-mapper">unpackage (since Ant 1.6.0)</a></h4>
<h4 id="unpackage-mapper">unpackage (<em>since Ant 1.6.0</em>)</h4>
<p>This mapper is the inverse of the <a href="#package-mapper">package</a> mapper.
It replaces the dots in a package name with directory separators. This
is useful for matching XML formatter results against their JUnit test
@@ -618,7 +616,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
&lt;mapper type="unpackage" from="TEST-*Test.xml" to="${test.src.dir}/*Test.java"&gt;
&lt;unpackagemapper from="TEST-*Test.xml" to="${test.src.dir}/*Test.java"&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file name</b></td>
@@ -633,7 +631,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
<!-- Composite Mapper -->
<!-- -->

<h4><a name="composite-mapper">composite (since Ant 1.7.0)</a></h4>
<h4 id="composite-mapper">composite (<em>since Ant 1.7.0</em>)</h4>
<p>This mapper implementation can contain multiple nested mappers.
File mapping is performed by passing the source filename to each nested
<code>&lt;mapper&gt;</code> in turn, returning all results.
@@ -648,7 +646,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
&lt;packagemapper from="*.java" to="*"/&gt;
&lt;/compositemapper&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -669,7 +667,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
<!-- Chained Mapper -->
<!-- -->

<h4><a name="chained-mapper">chained (since Ant 1.7.0)</a></h4>
<h4 id="chained-mapper">chained (<em>since Ant 1.7.0</em>)</h4>
<p>This mapper implementation can contain multiple nested mappers.
File mapping is performed by passing the source filename to the first
nested mapper, its results to the second, and so on. The target filenames
@@ -686,7 +684,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
&lt;/mapper&gt;
&lt;/chainedmapper&gt;
</pre></blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -714,7 +712,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
<!-- Filter Mapper -->
<!-- -->

<h4><a name="filter-mapper">filtermapper (since Ant 1.6.3)</a></h4>
<h4 id="filter-mapper">filtermapper (<em>since Ant 1.6.3</em>)</h4>
<p>
This mapper implementation applies a <a href="filterchain.html">filterchain</a>
to the source file name.
@@ -726,7 +724,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
&lt;/filtermapper&gt;
</pre></blockquote>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -744,7 +742,7 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
&lt;/filtermapper&gt;
</pre></blockquote>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -763,12 +761,13 @@ with <code>&lt;uptodate&gt;</code> and <code>&lt;junit&gt;</code> output.</p>
<!-- Script Mapper -->
<!-- -->

<h4><a name="script-mapper">scriptmapper (since Ant 1.7)</a></h4>
<h4 id="script-mapper">scriptmapper (<em>since Ant 1.7</em>)</h4>
<p>
This mapper executes a script written in <a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a>
or
<a href="https://scripting.dev.java.net">JSR 223</a>
supported language, once per file to map.</p>
<p>
The script can be declared inline or in a specified file.
</p>
<p>
@@ -776,7 +775,7 @@ See the <a href="../Tasks/script.html">Script</a> task for
an explanation of scripts and dependencies.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -807,13 +806,13 @@ an explanation of scripts and dependencies.
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The encoding of the script as a file. <em>since Ant 1.10.2.</em></td>
<td valign="top">The encoding of the script as a file. <em>Since Ant 1.10.2</em></td>
<td valign="top" align="center">No - defaults to default JVM encoding</td>
</tr>
<tr>
<td valign="top">setbeans</td>
<td valign="top">whether to have all properties, references and targets as
global variables in the script. <em>since Ant 1.8.0</em></td>
global variables in the script. <em>Since Ant 1.8.0</em></td>
<td valign="top" align="center">No, default is "true".</td>
</tr>
<tr>
@@ -846,7 +845,7 @@ an explanation of scripts and dependencies.
&lt;/scriptmapper&gt;
</pre></blockquote>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -866,7 +865,7 @@ and the ability to return multiple mappings. Here are the relevant beans and
their methods. The script is called once for every source file, with the
list of mapped names reset after every invocation.

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Script bean</b></td>
<td valign="top"><b>Description</b></td>
@@ -901,7 +900,7 @@ list of mapped names reset after every invocation.
<code>&lt;mapper <b>type</b>&gt;</code> attribute.
</p>

<h4><a name="firstmatch-mapper">firstmatchmapper (since Ant 1.8.0)</a></h4>
<h4 id="firstmatch-mapper">firstmatchmapper (<em>since Ant 1.8.0</em>)</h4>
<p>
This mapper supports an arbitrary number of nested mappers and
returns the results of the first mapper that matches. This is
@@ -915,7 +914,7 @@ list of mapped names reset after every invocation.
&lt;/firstmatchmapper&gt;
</pre></blockquote>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -934,7 +933,7 @@ list of mapped names reset after every invocation.
<code>&lt;mapper <b>type</b>&gt;</code> attribute.
</p>

<h4><a name="cutdirs-mapper">cutdirsmapper (since Ant 1.8.2)</a></h4>
<h4 id="cutdirs-mapper">cutdirsmapper (<em>since Ant 1.8.2</em>)</h4>

<p>This mapper strips a configured number of leading directories from
the source file name.</p>
@@ -944,7 +943,7 @@ list of mapped names reset after every invocation.
&lt;cutdirsmapper dirs="1"/&gt;
</pre></blockquote>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Source file name</b></td>
<td valign="top"><b>Target file names</b></td>
@@ -958,7 +957,7 @@ list of mapped names reset after every invocation.
<p>The cutdirsmapper has no
corresponding <code>&lt;mapper <b>type</b>&gt;</code> attribute.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>


+ 2
- 4
manual/Types/multirootfileset.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="multirootfileset">MultiRootFileSet</a></h2>
<h2 id="multirootfileset">MultiRootFileSet</h2>

<p><em>Since Ant 1.9.4</em></p>

@@ -41,7 +41,7 @@ that share the same patterns and selectors.</p>
<p>MultiRootFileSet supports all attributes and nested elements of
FileSet and DirSet except for the "dir" attribute.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -141,7 +141,6 @@ an <code>&lt;and&gt;</code> selector container.</p>
nested <code>basedir</code> elements that have a
single <code>file</code> attribute.</p>


<h4>Examples</h4>

<blockquote><pre>
@@ -170,4 +169,3 @@ an <code>&lt;and&gt;</code> selector container.</p>

</body>
</html>


+ 12
- 12
manual/Types/namespace.html View File

@@ -14,14 +14,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html><head><link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>XmlNamespaceSupport</title></head>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>XmlNamespaceSupport</title>
</head>
<body>
<h2><a name="namespace">XML Namespace Support</a></h2>
Apache Ant 1.6 introduces support for XML namespaces.
<h2 id="namespace">XML Namespace Support</h2>
Apache Ant 1.6 introduces support for XML namespaces.
<h3>History</h3>
<p>
All releases of Ant prior to Ant 1.6 do not support XML namespaces.
No support basically implies two things here:
@@ -72,7 +74,7 @@
and another time to actually map the namespace to occurrences of
elements from that namespace, by using the 'xmlns' attribute. This
mapping can happen at any level in the build file:
</p><pre> &lt;project name="test" xmlns:my="<a href="http://example.org/tasks">http://example.org/tasks</a>"&gt;
</p><pre> &lt;project name="test" xmlns:my="<a href="http://example.org/tasks">http://example.org/tasks</a>"&gt;
&lt;typedef resource="org/example/tasks.properties" uri="<a href="http://example.org/tasks">http://example.org/tasks</a>"/&gt;
&lt;my:task&gt;
...
@@ -82,7 +84,7 @@
<p>
Use of a namespace prefix is of course optional. Therefore
the example could also look like this:
</p><pre> &lt;project name="test"&gt;
</p><pre> &lt;project name="test"&gt;
&lt;typedef resource="org/example/tasks.properties" uri="<a href="http://example.org/tasks">http://example.org/tasks</a>"/&gt;
&lt;task xmlns="<a href="http://example.org/tasks">http://example.org/tasks</a>"&gt;
...
@@ -104,8 +106,6 @@
&lt;/task&gt;
</pre>


<h3>Namespaces and Nested Elements</h3>

<p>
@@ -132,14 +132,14 @@
From Ant 1.6.2, elements nested inside a namespaced element may also be
in Ant's default namespace. This means that the following is now allowed:
</p>
</p><pre> &lt;typedef resource="org/example/tasks.properties"
<pre> &lt;typedef resource="org/example/tasks.properties"
uri="<a href="http://example.org/tasks">http://example.org/tasks</a>"/&gt;
&lt;my:task xmlns:my="<a href="http://example.org/tasks">http://example.org/tasks</a>"&gt;
&lt;config a="foo" b="bar"/&gt;
...
&lt;/my:task&gt;
</pre>
<h3>Namespaces and Attributes</h3>

<p>


+ 8
- 11
manual/Types/patternset.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="patternset">PatternSet</a></h2>
<h2 id="patternset">PatternSet</h2>
<p><a href="../dirtasks.html#patterns">Patterns</a> can be grouped to
sets and later be referenced by their <code>id</code> attribute. They
are defined via a <code>patternset</code> element, which can appear
@@ -36,7 +36,7 @@ the same level as <code>target</code> &#151; i.e., as children of
<code>target</code>.</p> <p>Patterns can be specified by nested
<code>&lt;include&gt;</code>, or <code>&lt;exclude&gt;</code> elements
or the following attributes.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -71,7 +71,7 @@ or the following attributes.</p>
<h4><code>include</code> and <code>exclude</code></h4>
<p>Each such element defines a single pattern for files to include or
exclude.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -102,7 +102,7 @@ attributes or elements. Using the attribute, you can only specify a
single file of each type, while the nested elements can be specified
more than once - the nested elements also support if/unless attributes
you can use to test the existence of a property.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -169,24 +169,21 @@ that it should be used only if a property is not set.</p>
<p>and</p>
<blockquote><pre>
&lt;patternset&gt;
&lt;includesfile name=&quot;some-file&quot;/&gt;
&lt;includesfile name=&quot;some-file&quot;/&gt;
&lt;patternset/&gt;
</pre></blockquote>
<p>are identical. The include patterns will be read from the file
<code>some-file</code>, one pattern per line.</p>
<blockquote><pre>
&lt;patternset&gt;
&lt;includesfile name=&quot;some-file&quot;/&gt;
&lt;includesfile name=&quot;${some-other-file}&quot;
if=&quot;some-other-file&quot;
/&gt;
&lt;includesfile name=&quot;some-file&quot;/&gt;
&lt;includesfile name=&quot;${some-other-file}&quot;
if=&quot;some-other-file&quot;/&gt;
&lt;patternset/&gt;
</pre></blockquote>
<p>will also read include patterns from the file the property
<code>some-other-file</code> points to, if a property of that name has
been defined.</p>


</body>
</html>


+ 12
- 12
manual/Types/permissions.html View File

@@ -24,26 +24,26 @@

<body>

<h2><a name="permissions">Permissions</a></h2>
<h2 id="permissions">Permissions</h2>
<p>
Permissions represents a set of security permissions granted or revoked to
a specific part code executed in the JVM where Apache Ant is running in.
The actual Permissions are specified via a set of nested permission items either
<code>&lt;grant&gt;</code>ed or <code>&lt;revoke&gt;</code>d.</p>
<p>
In the base situation a <a href="#baseset">base set</a> of permissions granted.
In the base situation a <a href="#baseset">base set</a> of permissions granted.
Extra permissions can be
granted. A granted permission can be overruled by revoking a permission.
The security manager installed by the permissions will throw an
The security manager installed by the permissions will throw an
<code>SecurityException</code> if
the code subject to these permissions try to use an permission that has not been
the code subject to these permissions try to use an permission that has not been
granted or that has been revoked.</p>
<h3>Nested elements</h3>
<h4>grant</h4>
<p>
Indicates a specific permission is always granted. Its attributes indicate which
Indicates a specific permission is always granted. Its attributes indicate which
permissions are granted.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -62,7 +62,7 @@ permissions are granted.</p>
</tr>
<tr>
<td valign="top">actions</td>
<td valign="top">The actions allowed. The actual contents depend on the
<td valign="top">The actions allowed. The actual contents depend on the
Permission class and name.</td>
<td valign="top" align="center">No</td>
</tr>
@@ -77,7 +77,7 @@ Permission class.
<h4>revoke</h4>
<p>
Indicates a specific permission is revoked.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -96,7 +96,7 @@ Indicates a specific permission is revoked.</p>
</tr>
<tr>
<td valign="top">actions</td>
<td valign="top">The actions allowed. The actual contents depend on the
<td valign="top">The actions allowed. The actual contents depend on the
Permission class and name.</td>
<td valign="top" align="center">No</td>
</tr>
@@ -105,14 +105,14 @@ Indicates a specific permission is revoked.</p>
Implied permissions are not resolved and therefore also not revoked.
</p>
<p>
The name can handle the * wildcard at the end of the name, in which case all
The name can handle the * wildcard at the end of the name, in which case all
permissions of the specified class of which the name starts with the specified name
(excluding the *) are revoked. Note that the - wildcard often supported by the
granted properties is not supported.
If the name is left empty all names match, and are revoked.
If the actions are left empty all actions match, and are revoked.
</p>
<h3><a name="baseset">Base set</a></h3>
<h3 id="baseset">Base set</h3>
A permissions set implicitly contains the following permissions:
<blockquote><pre>
&lt;grant class=&quot;java.net.SocketPermission&quot; name=&quot;localhost:1024-&quot; actions=&quot;listen&quot;&gt;
@@ -136,7 +136,7 @@ A permissions set implicitly contains the following permissions:
&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.version&quot; actions=&quot;read&quot;&gt;
&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.vendor&quot; actions=&quot;read&quot;&gt;
&lt;grant class=&quot;java.util.PropertyPermission&quot; name=&quot;java.vm.name&quot; actions=&quot;read&quot;&gt;
</blockquote></pre>
</pre></blockquote>
These permissions can be revoked via <code>&lt;revoke&gt;</code> elements if necessary.

<h3>Examples</h3>


+ 3
- 6
manual/Types/propertyset.html View File

@@ -24,13 +24,13 @@

<body>

<h2><a name="propertyset">PropertySet</a></h2>
<h2 id="propertyset">PropertySet</h2>
<p><em>Since Apache Ant 1.6</em></p>

<p>Groups a set of properties to be used by reference in a task that
supports this.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -59,7 +59,7 @@ supports this.</p>
<p>Selects properties from the current project to be included in the
set.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -136,8 +136,5 @@ changes the names to start with &quot;bar&quot; instead.</p>
<p>If supplied, the nested mapper will be applied
subsequent to any negation of matched properties.</p>



</body>
</html>


+ 5
- 7
manual/Types/redirector.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="redirector">I/O redirection</a></h2>
<h2 id="redirector">I/O redirection</h2>
<p>For many tasks, input and output can be defined in a fairly
straightforward fashion. The <a href="../Tasks/exec.html">exec</a>
task, used to execute an external process, stands as a very
@@ -36,7 +36,7 @@ of redirecting input and output featuring the use of
<a href="./mapper.html">File Mapper</a>s to specify
source (input) and destination (output/error) files. <em>Since Apache Ant 1.6.2</em>
<p>The <code>&lt;redirector&gt;</code> element accepts the following attributes:</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -124,7 +124,7 @@ source (input) and destination (output/error) files. <em>Since Apache Ant 1.6.2
<tr>
<td valign="top">alwayslog</td>
<td valign="top">Always send to the log in addition to
any other destination. <i>Since Ant 1.6.3</i>.
any other destination. <em>Since Ant 1.6.3</em>
</td>
<td align="center" valign="top">No, default is <code>false</code></td>
</tr>
@@ -132,7 +132,7 @@ source (input) and destination (output/error) files. <em>Since Apache Ant 1.6.2
<td valign="top">loginputstring</td>
<td valign="top">Controls the display of <i>inputstring</i>'s value in
log messages. Set to <code>false</code> when sending sensitive data
(e.g. passwords) to external processes. <i>Since Ant 1.6.3</i>.
(e.g. passwords) to external processes. <em>Since Ant 1.6.3</em>
</td>
<td align="center" valign="top">No, default is <code>true</code></td>
</tr>
@@ -142,7 +142,7 @@ source (input) and destination (output/error) files. <em>Since Apache Ant 1.6.2
output into lines - which it will usually do in order to separate
error from normal output. This setting will not prevent binary
output from getting corrupted if you also specify filter chains.
<i>Since Ant 1.9.4</i>.
<em>Since Ant 1.9.4</em>
</td>
<td align="center" valign="top">No, default is <code>false</code></td>
</tr>
@@ -187,7 +187,5 @@ Tasks known to support I/O redirection:
dependent on the supporting task. Any possible points of confusion
should be noted at the task level.</p>


</body>
</html>


+ 7
- 6
manual/Types/regexp.html View File

@@ -24,11 +24,11 @@

<body>

<h2><a name="regexp">Regexp</a></h2>
<h2 id="regexp">Regexp</h2>
<p>
Regexp represents a regular expression.
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -54,7 +54,7 @@ Defines a regular expression for later use with id myregexp.
<p>
Use the regular expression with id myregexp.
</p>
<h3><a name="implementation">Choice of regular expression implementation</a></h3>
<h3 id="implementation">Choice of regular expression implementation</h3>
<p>
Apache Ant comes with
wrappers for
@@ -65,7 +65,7 @@ See <a href="../install.html#librarydependencies">installation dependencies</a>
concerning the supporting libraries.</p>
<p>
The property <code>ant.regexp.regexpimpl</code> governs which regular expression implementation will be chosen.
Possible values for this property are :
Possible values for this property are:</p>
<ul>
<li>
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
@@ -77,20 +77,21 @@ org.apache.tools.ant.util.regexp.JakartaOroRegexp
org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
</li>
</ul>
It can also be another implementation of the interface <code>org.apache.tools.ant.util.regexp.Regexp</code>.
<p>It can also be another implementation of the interface <code>org.apache.tools.ant.util.regexp.Regexp</code>.
If <code>ant.regexp.regexpimpl</code> is not defined, Ant uses Jdk14Regexp as this is always available.</p>
<p>
There are cross-platform issues for matches related to line terminator.
For example if you use $ to anchor your regular expression on the end of a line
the results might be very different depending on both your platform and the regular
expression library you use. It is 'highly recommended' that you test your pattern on
both Unix and Windows platforms before you rely on it.
both Unix and Windows platforms before you rely on it.</p>
<ul>
<li>Jakarta Oro defines a line terminator as '\n' and is consistent with Perl.</li>
<li>Jakarta RegExp uses a system-dependent line terminator.</li>
<li>JDK 1.4 uses '\n', '\r\n', '\u0085', '\u2028', '\u2029' as a default
but is configured in the wrapper to use only '\n' (UNIX_LINE)</li>
</ul>
<p>
<em>We used to recommend that you use Jakarta ORO but since its
development has been retired Java's built-in regex package is likely
the best choice going forward.</em>


+ 121
- 151
manual/Types/resources.html View File

@@ -24,7 +24,7 @@

<body>

<h2><a name="resource">Resources</a></h2>
<h2 id="resource">Resources</h2>
<p>
A file-like entity can be abstracted to the concept of a <i>resource</i>.
In addition to providing access to file-like attributes, a resource
@@ -53,7 +53,7 @@ explicit use beginning in <b>Ant 1.7</b>.
<li><a href="#zipentry">zipentry</a> - an entry in a zip file.</li>
</ul>

<h4><a name="basic">resource</a></h4>
<h4 id="basic">resource</h4>

<p>A basic resource. Other resource types derive from this basic
type; as such all its attributes are available, though in most cases
@@ -62,7 +62,7 @@ implementations are also usable as single-element
<a href="#collection">Resource Collections</a>.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -95,11 +95,11 @@ implementations are also usable as single-element
</tr>
</table>

<h4><a name="file">file</a></h4>
<h4 id="file">file</h4>

<p>Represents a file accessible via local filesystem conventions.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -119,11 +119,11 @@ implementations are also usable as single-element
</tr>
</table>

<h4><a name="javaresource">javaresource</a></h4>
<h4 id="javaresource">javaresource</h4>

<p>Represents a resource loadable via a Java classloader.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -167,13 +167,12 @@ implementations are also usable as single-element
where <b>&lt;classpath&gt;</b> is a <a
href="../using.html#path">path-like structure</a>.</p>


<h4><a name="javaconstant">javaconstant</a></h4>
<p>Loads the value of a java constant. As a specialisation of
<h4 id="javaconstant">javaconstant</h4>
<p>Loads the value of a java constant. As a specialisation of
<a href="#javaresource">javaresource</a> all of its attributes and nested elements are
supported. A constant must be specified as <tt>public static</tt> otherwise it could not be loaded.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -206,15 +205,14 @@ of that constant (<tt>build.xml</tt>).
&lt;javaconstant name=&quot;org.apache.tools.ant.Main.DEFAULT_BUILD_FILENAME&quot;/&gt;
&lt;/copy&gt;</code></pre>


<h4><a name="zipentry">zipentry</a></h4>
<h4 id="zipentry">zipentry</h4>

<p>Represents an entry in a ZIP archive. The archive can be specified
using the archive attribute or a nested single-element resource
collection. <code>zipentry</code> only supports file system resources
as nested elements.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -239,13 +237,13 @@ as nested elements.</p>
</tr>
</table>

<h4><a name="tarentry">tarentry</a></h4>
<h4 id="tarentry">tarentry</h4>

<p>Represents an entry in a TAR archive. The archive can be specified
using the archive attribute or a nested single-element resource
collection.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -264,21 +262,21 @@ collection.</p>
</tr>
</table>

<h4><a name="gzipresource">gzipresource</a></h4>
<h4 id="gzipresource">gzipresource</h4>

<p>This is not a stand-alone resource, but a wrapper around another
resource providing compression of the resource's contents on the fly.
A single element resource collection must be specified as a nested
element.</p>

<h4><a name="bzip2resource">bzip2resource</a></h4>
<h4 id="bzip2resource">bzip2resource</h4>

<p>This is not a stand-alone resource, but a wrapper around another
resource providing compression of the resource's contents on the fly.
A single element resource collection must be specified as a nested
element.</p>

<h4><a name="xzresource">xzresource</a></h4>
<h4 id="xzresource">xzresource</h4>

<p>This is not a stand-alone resource, but a wrapper around another
resource providing compression of the resource's contents on the fly.
@@ -290,11 +288,11 @@ depends on external libraries not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library
Dependencies</a> for more information.</p>

<h4><a name="url">url</a></h4>
<h4 id="url">url</h4>

<p>Represents a URL.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -321,12 +319,12 @@ Dependencies</a> for more information.</p>
</tr>
</table>

<h4><a name="string">string</a></h4>
<h4 id="string">string</h4>

<p>Represents a Java String. It can be written to, but only once, after which
it will be an error to write to again.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -346,14 +344,12 @@ it will be an error to write to again.</p>
self.log("Ant version =${ant.version}");
&lt;/string>
</pre>
</p>

<h4><a name="propertyresource">propertyresource</a></h4>
<h4 id="propertyresource">propertyresource</h4>

<p>Represents an Ant property.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -366,12 +362,13 @@ it will be an error to write to again.</p>
</tr>
</table>

<hr>
<h2><a name="collection">Resource Collections</a></h2>
<hr/>
<h2 id="collection">Resource Collections</h2>
<p>
A Resource Collection is an abstraction of an entity that groups
together a number of <a href="#resource">resources</a>. Several of
Ant's "legacy" datatypes have been modified to behave as Resource Collections:
</p>
<ul>
<li><a href="fileset.html">fileset</a>,
<a href="dirset.html">dirset</a>,
@@ -392,8 +389,7 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
exposes <a href="#propertyresource">property</a> resources
</li>
</ul>
</p>
<p>Strangely, some tasks can even legitimately behave as resource collections:
<p>Strangely, some tasks can even legitimately behave as resource collections:</p>
<ul>
<li><a href="../Tasks/concat.html">concat</a>
exposes a concatenated resource, and adds e.g.
@@ -401,7 +397,6 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
to Ant's resource-related capabilities.
</li>
</ul>
</p>
<h3>The additional built-in resource collections are:</h3>
<ul>
<li><a href="#resources">resources</a> - generic resource collection</li>
@@ -434,7 +429,8 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
<li><a href="#resourcelist">resourcelist</a> - a collection of
resources whose names have been read from another resource.</li>
</ul>
<h4><a name="resources">resources</a></h4>

<h4 id="resources">resources</h4>
<p>A generic resource collection, designed for use with
<a href="../using.html#references">references</a>.
For example, if a third-party Ant task generates a Resource Collection
@@ -445,7 +441,7 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
duplicate resources (contrast with <a href="#union">union</a>).
</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -459,7 +455,7 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
</table>
</blockquote>

<h4><a name="files">files</a></h4>
<h4 id="files">files</h4>
<p>A group of files. These files are matched by <b>absolute</b> patterns
taken from a number of <a href="patternset.html">PatternSets</a>.
These can be specified as nested <code>&lt;patternset&gt;</code>
@@ -483,7 +479,7 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
the file has been included based on pattern-based selection.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -532,17 +528,16 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections:
</tr>
</table>

<p><a name="symlink"><b>Note</b></a>: All files/directories for which
<p id="symlink"><b>Note</b>: All files/directories for which
the canonical path is different from its path are considered symbolic
links. On Unix systems this usually means the file really is a
symbolic link but it may lead to false results on other
platforms.
</p>

<h4><a name="restrict">restrict</a></h4>
<h4 id="restrict">restrict</h4>
<p>Restricts a nested resource collection using resource selectors:
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -555,11 +550,11 @@ platforms.
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
<p>Nested resource selectors are used to "narrow down" the included
resources, combined via a logical <i>AND</i>. These are patterned
after <a href="selectors.html">file selectors</a> but are,
resources, combined via a logical <i>AND</i>. These are patterned
after <a href="selectors.html">file selectors</a> but are,
unsurprisingly, targeted to resources.
Several built-in resource selectors are available in the internal
<a href="antlib.html">antlib</a>
@@ -583,7 +578,7 @@ platforms.
by a majority of nested resource selectors.</li>
<li><a href="selectors.html#modified">modified</a> - select resources which
content has changed.</li>
<li><a href="selectors.html#containsselect">contains</a> - select resources
<li><a href="selectors.html#containsselect">contains</a> - select resources
containing a particular text string.</li>
<li><a href="selectors.html#regexpselect">containsregexp</a> - select
resources whose contents match a particular regular expression.</li>
@@ -595,9 +590,9 @@ platforms.
Select files (resources must be files) if they are writable.</li>
</ul>

<h4><a name="rsel.name">name</a></h4>
<h5 id="rsel.name">name</h5>
<p>Selects resources by name.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -626,17 +621,17 @@ platforms.
resource name or name attribute as a / for the purposes of
matching. This attribute can be true or false, the default is
false.
<em>Since Ant 1.8.0.</em>
<em>Since Ant 1.8.0</em>
<td align="center" valign="top">No</td>
</tr>
</table>

<h4><a name="rsel.exists">exists</a></h4>
<h5 id="rsel.exists">exists</h5>
<p>Selects existing resources.</p>

<h4><a name="rsel.date">date</a></h4>
<h5 id="rsel.date">date</h5>
<p>Selects resources by date.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -675,9 +670,9 @@ platforms.
</tr>
</table>

<h4><a name="rsel.type">type</a></h4>
<h5 id="rsel.type">type</h5>
<p>Selects resources by type (file or directory).</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -685,14 +680,14 @@ platforms.
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of "file", "dir", "any" (since Ant 1.8)</td>
<td valign="top">One of "file", "dir", "any" (<em>since Ant 1.8</em>)</td>
<td align="center" valign="top">Yes</td>
</tr>
</table>

<h4><a name="rsel.size">size</a></h4>
<h5 id="rsel.size">size</h5>
<p>Selects resources by size.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -711,9 +706,9 @@ platforms.
</tr>
</table>

<h4><a name="rsel.instanceof">instanceof</a></h4>
<h5 id="rsel.instanceof">instanceof</h5>
<p>Selects resources by type.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -736,25 +731,25 @@ platforms.
</tr>
</table>

<h4><a name="rsel.and">and</a></h4>
<h5 id="rsel.and">and</h5>
<p>Selects a resource if it is selected by all nested resource selectors.</p>

<h4><a name="rsel.or">or</a></h4>
<h5 id="rsel.or">or</h5>
<p>Selects a resource if it is selected
by at least one nested resource selector.</p>

<h4><a name="rsel.not">not</a></h4>
<h5 id="rsel.not">not</h5>
<p>Negates the selection result of the single
nested resource selector allowed.</p>

<h4><a name="rsel.none">none</a></h4>
<h5 id="rsel.none">none</h5>
<p>Selects a resource if it is selected
by no nested resource selectors.</p>

<h4><a name="rsel.majority">majority</a></h4>
<h5 id="rsel.majority">majority</h5>
<p>Selects a resource if it is selected
by the majority of nested resource selectors.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -768,10 +763,10 @@ platforms.
</tr>
</table>

<h4><a name="rsel.compare">compare</a></h4>
<h5 id="rsel.compare">compare</h5>
<p>Selects a resource based on its comparison to one or more "control"
resources using nested <a href="#rcmp">resource comparators</a>.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -790,15 +785,15 @@ platforms.
<td valign="top">No, default "all"</td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h6>Parameters specified as nested elements</h6>
<p>The resources against which comparisons will be made must be specified
using the nested &lt;control&gt; element, which denotes a
<a href="#resources">resources</a> collection.</p>
<h4>Examples</h4>
<p>Assuming the namespace settings
<h6>Examples</h6>
<p>Assuming the namespace settings</p>
<pre><code> rsel="antlib:org.apache.tools.ant.types.resources.selectors"
rcmp="antlib:org.apache.tools.ant.types.resources.comparators"
</code></pre></p>
</code></pre>
<pre>
&lt;restrict&gt;
&lt;fileset dir="src" includes="a,b,c,d,e,f,g" /&gt;
@@ -858,15 +853,12 @@ platforms.
which are not present. Finally we use the <i>toString:</i> <a href="../using.html#pathshortcut">pathshortcut</a> for
getting them in a readable form: <tt>[echo] These files are missed: ....foo.txt;....bar.txt</tt></p>

</blockquote>

<h4><a name="sort">sort</a></h4>
<h4 id="sort">sort</h4>

<p>Sorts a nested resource collection according to the resources'
natural order, or by one or more nested <a href="#rcmp">resource
comparators</a>:</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -879,7 +871,7 @@ platforms.
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
<p>The sort can be controlled and customized by specifying one or more
resource comparators. Resources can be sorted according to multiple
@@ -888,7 +880,7 @@ platforms.
are available in the internal <a href="antlib.html">antlib</a>
<code>org.apache.tools.ant.types.resources.comparators</code>:
</p>
<h4><a name="rcmp">Resource Comparators:</a></h4>
<h5 id="rcmp">Resource Comparators:</h5>
<ul>
<li><a href="#rcmp.name">name</a> - sort resources by name</li>
<li><a href="#rcmp.exists">exists</a> - sort resources by existence</li>
@@ -900,26 +892,26 @@ platforms.
or that of a single nested resource comparator</li>
</ul>

<h4><a name="rcmp.name">name</a></h4>
<h6 id="rcmp.name">name</h6>
<p>Sort resources by name.</p>

<h4><a name="rcmp.exists">exists</a></h4>
<h6 id="rcmp.exists">exists</h6>
<p>Sort resources by existence.
Not existing is considered "less than" existing.</p>

<h4><a name="rcmp.date">date</a></h4>
<h6 id="rcmp.date">date</h6>
<p>Sort resources by date.</p>

<h4><a name="rcmp.type">type</a></h4>
<h6 id="rcmp.type">type</h6>
<p>Sort resources by type (file or directory).
Because directories contain files, they are considered "greater".</p>

<h4><a name="rcmp.size">size</a></h4>
<h6 id="rcmp.size">size</h6>
<p>Sort resources by size.</p>

<h4><a name="rcmp.content">content</a></h4>
<h6 id="rcmp.content">content</h6>
<p>Sort resources by content.</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -928,16 +920,16 @@ platforms.
<tr>
<td valign="top">binary</td>
<td valign="top">Whether content should be compared in binary mode.
If <i>false<i>, content will be compared without regard to
If <i>false</i>, content will be compared without regard to
platform-specific line-ending conventions.</td>
<td valign="top">No, default <i>true</i></td>
</tr>
</table>

<h4><a name="rcmp.reverse">reverse</a></h4>
<h6 id="rcmp.reverse">reverse</h6>
<p>Reverse the natural sort order, or that of a single nested comparator.</p>

<h4>Examples</h4>
<h5>Examples</h5>
<pre>
&lt;property name=&quot;eol&quot; value=&quot;${line.separator}&quot; /&gt;
&lt;pathconvert property=&quot;sorted&quot; pathsep=&quot;${eol}&quot;&gt;
@@ -948,10 +940,10 @@ platforms.
&lt;/tokens&gt;
&lt;/sort&gt;
&lt;/pathconvert&gt;</pre>
<p>The resource of type string &quot;foo bar etc baz&quot; is split into four tokens by
<p>The resource of type string &quot;foo bar etc baz&quot; is split into four tokens by
the stringtokenizer. These tokens are sorted and there <i>sorted</i> gets the value
of &quot;bar baz etc foo&quot;.</p>
<pre>
&lt;sort&gt;
&lt;fileset dir=&quot;foo&quot; /&gt;
@@ -966,15 +958,12 @@ platforms.
their namespace must be set explicitly.
</p>

</blockquote>

<h4><a name="first">first</a></h4>
<h4 id="first">first</h4>
<p>Includes the first <i>count</i> resources from a nested resource collection.
This can be used in conjunction with the <a href="#sort">sort</a> collection,
for example, to select the first few oldest, largest, etc. resources from a
larger collection.</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -992,17 +981,15 @@ larger collection.</p>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
</blockquote>

<h4><a name="last">last</a></h4>
<h4 id="last">last</h4>
<p>Includes the last <i>count</i> resources from a nested resource collection.
This can be used in conjunction with the <a href="#sort">sort</a> collection,
for example, to select the last few oldest, largest, etc. resources from a
larger collection. <strong>Since Ant 1.7.1</strong>.</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
larger collection. <em>Since Ant 1.7.1</em></p>
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1020,18 +1007,16 @@ larger collection. <strong>Since Ant 1.7.1</strong>.</p>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
</blockquote>

<h4><a name="allbutfirst">allbutfirst</a></h4>
<h4 id="allbutfirst">allbutfirst</h4>
<p>Includes all elements except for the first <i>count</i> resources
from a nested resource collection. This can be used in conjunction
with the <a href="#sort">sort</a> collection, for example, to select
all but the first few oldest, largest, etc. resources from a larger
collection. <strong>Since Ant 1.9.5</strong>.</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
collection. <em>Since Ant 1.9.5</em></p>
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1049,18 +1034,16 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
</blockquote>

<h4><a name="allbutlast">allbutlast</a></h4>
<h4 id="allbutlast">allbutlast</h4>
<p>Includes all elements except for the last <i>count</i> resources
from a nested resource collection. This can be used in conjunction
with the <a href="#sort">sort</a> collection, for example, to select
all but the last few oldest, largest, etc. resources from a larger
collection. <strong>Since Ant 1.9.5</strong>.</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
collection. <em>Since Ant 1.9.5</em></p>
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1078,19 +1061,17 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
</blockquote>

<h4><a name="tokens">tokens</a></h4>
<h4 id="tokens">tokens</h4>
<p>Includes the <a href="#string">string</a> tokens gathered from a nested
resource collection. Uses the same tokenizers supported by the
<a href="filterchain.html#tokenfilter">TokenFilter</a>. Imaginative
use of this resource collection can implement equivalents for such Unix
functions as <code>sort</code>, <code>grep -c</code>, <code>wc</code> and
<code>wc -l</code>.</p>
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1108,14 +1089,14 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<ul>
<li>A single resource collection is required.</li>
<li>One nested tokenizer may be specified. If omitted, a
<a href="filterchain.html#linetokenizer">LineTokenizer</a> will be used.
</li>
</ul>
<h4>Examples</h4>
<h5>Examples</h5>
<pre>&lt;concat&gt;
&lt;union&gt;
&lt;sort&gt;
@@ -1128,10 +1109,8 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
&lt;/concat&gt;
</pre>
<p>Implements Unix <i>sort -u</i> against resource collection <i>input</i>.</p>
</blockquote>

<h4><a name="setlogic">Set operations</a></h4>
<blockquote>
<h4 id="setlogic">Set operations</h4>
<p>The following resource collections implement set operations:</p>
<ul>
<li><a href="#union">union</a></li>
@@ -1139,18 +1118,18 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<li><a href="#difference">difference</a></li>
</ul>

<h4><a name="union">union</a></h4>
<h4 id="union">union</h4>
<p>Union of nested resource collections.</p>

<h4><a name="intersect">intersect</a></h4>
<h4 id="intersect">intersect</h4>
<p>Intersection of nested resource collections.</p>

<h4><a name="difference">difference</a></h4>
<h4 id="difference">difference</h4>
<p>Difference of nested resource collections.</p>

<p>The following attributes apply to all set-operation resource collections:
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1163,8 +1142,8 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Examples</h4>
<h5>Examples</h5>
<pre>
&lt;resources id=&quot;A&quot;&gt;
&lt;string value=&quot;a&quot;/&gt;
@@ -1186,9 +1165,8 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
difference: ${toString:difference} = a;c
&lt;/echo&gt;
</pre>
</blockquote>

<h4><a name="mappedresources">mappedresources</a></h4>
<h4 id="mappedresources">mappedresources</h4>

<p><em>Since Ant 1.8.0</em></p>

@@ -1201,10 +1179,9 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
use <em>mappedresources</em> with tasks that only allow file-system
based resources.</p>

<blockquote>
<h4>Parameters specified as attributes</h4>
<h5>Parameters specified as attributes</h5>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1222,18 +1199,18 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
If true the the collection will use all the mappings for a
given source path. If false the it will only process the first
resource.
<em>since Ant 1.8.1</em>.</td>
<em>since Ant 1.8.1</em></td>
<td align="center">No - defaults to false.</td>
</tr>
</table>

<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>
<p>A single resource collection is required.</p>
<p>A single <a href="mapper.html">mapper</a> can be used to map
names. If no mapper has been given (which doesn't make any sense,
honestly), an identity mapper will be used.</p>

<h4>Examples</h4>
<h5>Examples</h5>

<p>Copies all files from a given directory to a target directory
adding ".bak" as an extension. Note this could be done with a
@@ -1265,10 +1242,9 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
&lt;/chainedmapper&gt;
&lt;/mappedresources&gt;
&lt;/war&gt;
</pre>
</blockquote>
</pre>

<h4><a name="archives">archives</a></h4>
<h4 id="archives">archives</h4>

<p><em>Since Ant 1.8.0</em></p>

@@ -1284,8 +1260,7 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>

<p><em>archives</em> doesn't support any attributes.</p>

<blockquote>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>

<p><code>&lt;archives&gt;</code> has two nested
elements <code>&lt;zips&gt;</code> and
@@ -1296,7 +1271,7 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<p>The nested resources of &lt;zips&gt; are treated as ZIP archives,
the nested resources of &lt;tars&gt; as TAR archives.</p>

<h4>Examples</h4>
<h5>Examples</h5>

<p>Copies all files from all jars that are on the classpath
to <code>${target}</code>.</p>
@@ -1313,9 +1288,8 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
&lt;/archives&gt;
&lt;/copy&gt;
</pre>
</blockquote>

<h4><a name="resourcelist">resourcelist</a></h4>
<h4 id="resourcelist">resourcelist</h4>

<p><em>Since Ant 1.8.0</em></p>

@@ -1335,8 +1309,7 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<p><code>&lt;resourcelist&gt;</code> is a generalization
of <a href="filelist.html"><code>&lt;filelist&gt;</code></a>.</p>

<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1348,10 +1321,8 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
<td valign="top" align="center">No, default is platform default</td>
</tr>
</table>
</blockquote>

<blockquote>
<h4>Parameters specified as nested elements</h4>
<h5>Parameters specified as nested elements</h5>

<p><code>&lt;resourcelist&gt;</code> accepts arbitrary many
resource(collection)s as nested elements.</p>
@@ -1362,7 +1333,7 @@ collection. <strong>Since Ant 1.9.5</strong>.</p>
expanded. Such a nested element corresponds to
a <a href="filterchain.html">filterchain</a>.</p>

<h4>Examples</h4>
<h5>Examples</h5>

<p>The following example copies a file from the first URL of
several alternatives that can actually be reached. It assumes
@@ -1375,7 +1346,7 @@ http://second.best.mirror.example.org/mirror/of/best/
https://yet.another.mirror/
http://the.original.site/
</pre>
<pre>
&lt;copy todir="${target}"&gt;
&lt;first&gt;
@@ -1388,7 +1359,6 @@ http://the.original.site/
&lt;/first&gt;
&lt;/copy&gt;
</pre>
</blockquote>

</body>
</html>

+ 5
- 11
manual/Types/selectors-program.html View File

@@ -169,9 +169,7 @@
<li>verify the work</li>
</ol>



<p>An example test would be:<pre>
<p>An example test would be:</p><pre>
package org.apache.tools.ant.types.selectors;

public class MySelectorTest {
@@ -182,7 +180,6 @@ public class MySelectorTest {
@Test
public void testCase1() {


// Configure the selector
MySelector s = new MySelector();
s.addParam("key1", "value1");
@@ -203,7 +200,7 @@ public class MySelectorTest {
[junit] expected:&lt;FTTTFTTTF...&gt; but was:&lt;TTTTTTTTT...&gt;
[junit] at junit.framework.Assert.assertEquals(Assert.java:81)
[junit] at org.apache.tools.ant.types.selectors.BaseSelectorTest.performTest(BaseSelectorTest.java:194)
</pre></p>
</pre>

<p>Described above the test class should provide a <tt>getInstance()</tt>
method. But that isn't used here. The used <tt>getSelector()</tt> method is
@@ -213,7 +210,6 @@ public class MySelectorTest {
ability to use its own Project object (<tt>getProject()</tt>), for example
for logging.</p>


<h3>Logging</h3>

<p>During development and maybe later you sometimes need the output of information.
@@ -221,7 +217,7 @@ public class MySelectorTest {
BaseSelector it is an Ant <tt>DataType</tt> and therefore a <tt>ProjectComponent</tt>. <br>
That means that you have access to the project object and its logging capability.
<tt>ProjectComponent</tt> itself provides <i>log</i> methods which will do the
access to the project instance. Logging is therefore done simply with:
access to the project instance. Logging is therefore done simply with:</p>
<pre>
log( "message" );
</pre>
@@ -229,16 +225,14 @@ public class MySelectorTest {
<pre>
log( "message" , loglevel );
</pre>
where the <tt>loglevel</tt> is one of the values <ul>
where the <tt>loglevel</tt> is one of the values
<ul>
<li> org.apache.tools.ant.Project.MSG_ERR </li>
<li> org.apache.tools.ant.Project.MSG_WARN </li>
<li> org.apache.tools.ant.Project.MSG_INFO (= default) </li>
<li> org.apache.tools.ant.Project.MSG_VERBOSE </li>
<li> org.apache.tools.ant.Project.MSG_DEBUG </li>
</ul>
</p>

</body>

</html>

+ 157
- 182
manual/Types/selectors.html View File

@@ -46,7 +46,7 @@
<a href="#coreselect"><code>Core Selectors</code></a>.
</p>

<h3><a name="coreselect">Core Selectors</a></h3>
<h3 id="coreselect">Core Selectors</h3>

<p>Core selectors are the ones that come standard
with Ant. They can be used within a fileset and can be contained
@@ -82,12 +82,10 @@
the return value of the configured algorithm is different from that
stored in a cache.</li>
<li><a href="#signedselector"><code>&lt;signedselector&gt;</code></a> - Select files if
they are signed, and optionally if they have a signature of a certain name.
</li>
<li><a href="#scriptselector"><code>&lt;scriptselector&gt;</code></a> -
they are signed, and optionally if they have a signature of a certain name.</li>
<li><a href="#scriptselector"><code>&lt;scriptselector&gt;</code></a> -
Use a BSF or JSR 223 scripting language to create
your own selector
</li>
your own selector</li>
<li><a href="#readable"><code>&lt;readable&gt;</code></a> -
Select files if they are readable.</li>
<li><a href="#writable"><code>&lt;writable&gt;</code></a> -
@@ -100,7 +98,7 @@
Select files if they are owned by a given user.</li>
</ul>

<h4><a name="containsselect">Contains Selector</a></h4>
<h4 id="containsselect">Contains Selector</h4>

<p>The <code>&lt;contains&gt;</code> tag in a FileSet limits
the files defined by that fileset to only those which contain the
@@ -111,7 +109,7 @@
<a href="resources.html#restrict">&lt;restrict&gt;</a>
ResourceCollection).</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -145,7 +143,7 @@
Required in practice if the encoding of the files being
selected is different from the default encoding of the JVM
where Ant is running.
Since Ant 1.9.0
<em>Since Ant 1.9.0</em>
</td>
<td valign="top" align="center">No</td>
</tr>
@@ -162,15 +160,14 @@
<p>Selects all the HTML files that contain the string
<code>script</code>.</p>


<h4><a name="dateselect">Date Selector</a></h4>
<h4 id="dateselect">Date Selector</h4>

<p>The <code>&lt;date&gt;</code> tag in a FileSet will put
a limit on the files specified by the include tag, so that tags
whose last modified date does not meet the date limits specified
by the selector will not end up being selected.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -220,7 +217,7 @@
<td valign="top">The <CODE>SimpleDateFormat</CODE>-compatible pattern
to use when interpreting the <i>datetime</i> attribute using
the current locale.
<i>Since Ant 1.6.2</i>
<em>Since Ant 1.6.2</em>
</td>
<td valign="top" align="center">No</td>
</tr>
@@ -244,8 +241,7 @@
<p>Selects all JAR files which were last modified before midnight
January 1, 2001.</p>


<h4><a name="dependselect">Depend Selector</a></h4>
<h4 id="dependselect">Depend Selector</h4>

<p>The <code>&lt;depend&gt;</code> tag selects files
whose last modified date is later than another, equivalent file in
@@ -259,7 +255,7 @@

<p>The <code>&lt;depend&gt;</code> selector is case-sensitive.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -296,15 +292,14 @@
1.5 release.
</p>


<h4><a name="depthselect">Depth Selector</a></h4>
<h4 id="depthselect">Depth Selector</h4>

<p>The <code>&lt;depth&gt;</code> tag selects files based on
how many directory levels deep they are in relation to the base
directory of the fileset.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -338,8 +333,7 @@
<p>Selects all files in the base directory and one directory below
that.</p>

<h4><a name="differentselect">Different Selector</a></h4>
<h4 id="differentselect">Different Selector</h4>

<p>The <code>&lt;different&gt;</code> selector will select a file
if it is deemed to be 'different' from an equivalent file in
@@ -351,10 +345,10 @@
mapper) the file is selected.
<li>If a file is only present in targetdir (or after applying the
mapper) it is ignored.
<li> Files with different lengths are different.
<li> If <tt>ignoreFileTimes</tt> is turned off, then differing file
<li>Files with different lengths are different.
<li>If <tt>ignoreFileTimes</tt> is turned off, then differing file
timestamps will cause files to be regarded as different.
<li> Unless <tt>ignoreContents</tt> is set to true,
<li>Unless <tt>ignoreContents</tt> is set to true,
a byte-for-byte check is run against the two files.
</ol>

@@ -374,7 +368,7 @@
<code>&lt;mapper&gt;</code> element is specified, the
<code>identity</code> type mapper is used.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -399,7 +393,7 @@
<td valign="top">ignoreContents</td>
<td valign="top">Whether to do a byte per byte compare.
Default is false (contents are compared).
Since Ant 1.6.3
<em>Since Ant 1.6.3</em>
</td>
<td valign="top" align="center">No</td>
</tr>
@@ -427,7 +421,7 @@
and selects those who are different, disregarding file times.
</p>

<h4><a name="filenameselect">Filename Selector</a></h4>
<h4 id="filenameselect">Filename Selector</h4>

<p>The <code>&lt;filename&gt;</code> tag acts like the
<code>&lt;include&gt;</code> and <code>&lt;exclude&gt;</code>
@@ -439,7 +433,7 @@
<p>The <code>&lt;filename&gt;</code> selector is
case-sensitive.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -484,8 +478,7 @@

<p>Selects all the cascading style sheet files.</p>


<h4><a name="presentselect">Present Selector</a></h4>
<h4 id="presentselect">Present Selector</h4>

<p>The <code>&lt;present&gt;</code> tag selects files
that have an equivalent file in another directory tree.</p>
@@ -498,7 +491,7 @@

<p>The <code>&lt;present&gt;</code> selector is case-sensitive.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -543,7 +536,7 @@
1.5 release.
</p>

<h4><a name="regexpselect">Regular Expression Selector</a></h4>
<h4 id="regexpselect">Regular Expression Selector</h4>

<p>The <code>&lt;containsregexp&gt;</code> tag in a FileSet limits
the files defined by that fileset to only those which contents contain a
@@ -554,7 +547,7 @@
<a href="resources.html#restrict">&lt;restrict&gt;</a>
ResourceCollection).</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -569,14 +562,14 @@
<tr>
<td valign="top">casesensitive</td>
<td valign="top">Perform a case sensitive match. Default is
true. <em>since Ant 1.8.2</em></td>
true. <em>Since Ant 1.8.2</em></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">multiline</td>
<td valign="top">
Perform a multi line match.
Default is false. <em>since Ant 1.8.2</em></td>
Default is false. <em>Since Ant 1.8.2</em></td>
<td valign="top" align="center">No</td>
</tr>
<tr>
@@ -585,7 +578,7 @@
This allows '.' to match new lines.
SingleLine is not to be confused with multiline, SingleLine is a perl
regex term, it corresponds to dotall in java regex.
Default is false. <em>since Ant 1.8.2</em></td>
Default is false. <em>Since Ant 1.8.2</em></td>
<td valign="top" align="center">No</td>
</tr>
</table>
@@ -601,15 +594,14 @@
<p>Selects all the text files that match the regular expression
(have a 4,5 or 6 followed by a period and a number from 0 to 9).


<h4><a name="sizeselect">Size Selector</a></h4>
<h4 id="sizeselect">Size Selector</h4>

<p>The <code>&lt;size&gt;</code> tag in a FileSet will put
a limit on the files specified by the include tag, so that tags
which do not meet the size limits specified by the selector will not
end up being selected.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -662,12 +654,12 @@

<p>Selects all JAR files that are larger than 4096 bytes.</p>

<h4><a name="typeselect">Type Selector</a></h4>
<h4 id="typeselect">Type Selector</h4>

<p>The <code>&lt;type&gt;</code> tag selects files of a certain type:
directory or regular.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -708,19 +700,18 @@
&lt;/fileset&gt;
</pre></blockquote>


<h4><a name="modified">Modified Selector</a></h4>
<h4 id="modified">Modified Selector</h4>
<p>The <code>&lt;modified&gt;</code> selector computes a value for a file, compares that
to the value stored in a cache and select the file, if these two values
differ.</p>
<p>Because this selector is highly configurable the order in which the selection is done
is: <ol>
<li> get the absolute path for the file </li>
<li> get the cached value from the configured cache (absolute path as key) </li>
<li> get the new value from the configured algorithm </li>
<li> compare these two values with the configured comparator </li>
<li> update the cache if needed and requested </li>
<li> do the selection according to the comparison result </li>
<li>get the absolute path for the file</li>
<li>get the cached value from the configured cache (absolute path as key)</li>
<li>get the new value from the configured algorithm</li>
<li>compare these two values with the configured comparator</li>
<li>update the cache if needed and requested</li>
<li>do the selection according to the comparison result</li>
</ol>
<p>The comparison, computing of the hashvalue and the store is done by implementation
of special interfaces. Therefore they may provide additional parameters.</p>
@@ -734,178 +725,171 @@
to (<b>attention!</b>) copy the content into a local file for computing the
hashvalue.</p>

<table border="1" cellpadding="2" cellspacing="0">
<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"> algorithm </td>
<td valign="top"> The type of algorithm should be used.
<td valign="top">algorithm</td>
<td valign="top">The type of algorithm should be used.
Acceptable values are (further information see later):
<ul>
<li> hashvalue - HashvalueAlgorithm </li>
<li> digest - DigestAlgorithm </li>
<li> checksum - ChecksumAlgorithm </li>
<li>hashvalue - HashvalueAlgorithm</li>
<li>digest - DigestAlgorithm</li>
<li>checksum - ChecksumAlgorithm</li>
</ul>
</td>
<td valign="top" align="center"> No, defaults to <i>digest</i> </td>
<td valign="top" align="center">No, defaults to <i>digest</i></td>
</tr>
<tr>
<td valign="top"> cache </td>
<td valign="top"> The type of cache should be used.
<td valign="top">cache</td>
<td valign="top">The type of cache should be used.
Acceptable values are (further information see later):
<ul>
<li> propertyfile - PropertyfileCache </li>
<li>propertyfile - PropertyfileCache</li>
</ul>
</td>
<td valign="top" align="center"> No, defaults to <i>propertyfile</i> </td>
<td valign="top" align="center">No, defaults to <i>propertyfile</i></td>
</tr>
<tr>
<td valign="top"> comparator </td>
<td valign="top"> The type of comparator should be used.
<td valign="top">comparator</td>
<td valign="top">The type of comparator should be used.
Acceptable values are (further information see later):
<ul>
<li> equal - EqualComparator </li>
<li> rule - java.text.RuleBasedCollator
<li>equal - EqualComparator</li>
<li>rule - java.text.RuleBasedCollator
<!-- NOTE -->
<i>(see <a href="#ModSelNote">note</a> for restrictions)</i>
</li>
<i>(see <a href="#ModSelNote">note</a> for restrictions)</i></li>
</ul>
</td>
<td valign="top" align="center"> No, defaults to <i>equal</i> </td>
<td valign="top" align="center">No, defaults to <i>equal</i></td>
</tr>
<tr>
<td valign="top"> algorithmclass </td>
<td valign="top"> Classname of custom algorithm implementation. Lower
priority than <i>algorithm</i>. </td>
<td valign="top" align="center"> No </td>
<td valign="top">algorithmclass</td>
<td valign="top">Classname of custom algorithm implementation. Lower
priority than <i>algorithm</i>.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top"> cacheclass </td>
<td valign="top"> Classname of custom cache implementation. Lower
priority than <i>cache</i>. </td>
<td valign="top" align="center"> No </td>
<td valign="top">cacheclass</td>
<td valign="top">Classname of custom cache implementation. Lower
priority than <i>cache</i>.</td>
<td valign="top" align="center"> No</td>
</tr>
<tr>
<td valign="top"> comparatorclass </td>
<td valign="top"> Classname of custom comparator implementation. Lower
priority than <i>comparator</i>. </td>
<td valign="top" align="center"> No </td>
<td valign="top">comparatorclass</td>
<td valign="top">Classname of custom comparator implementation. Lower
priority than <i>comparator</i>.</td>
<td valign="top" align="center"> No</td>
</tr>
<tr>
<td valign="top"> update </td>
<td valign="top"> Should the cache be updated when values differ? (boolean) </td>
<td valign="top" align="center"> No, defaults to <i>true</i> </td>
<td valign="top">update</td>
<td valign="top">Should the cache be updated when values differ? (boolean)</td>
<td valign="top" align="center"> No, defaults to <i>true</i></td>
</tr>
<tr>
<td valign="top"> seldirs </td>
<td valign="top"> Should directories be selected? (boolean) </td>
<td valign="top" align="center"> No, defaults to <i>true</i> </td>
<td valign="top">seldirs</td>
<td valign="top">Should directories be selected? (boolean)</td>
<td valign="top" align="center"> No, defaults to <i>true</i></td>
</tr>
<tr>
<td valign="top"> selres </td>
<td valign="top"> Should Resources without an InputStream, and
therefore without checking, be selected? (boolean) </td>
<td valign="top">selres</td>
<td valign="top">Should Resources without an InputStream, and
therefore without checking, be selected? (boolean)</td>
<td valign="top" align="center"> No, defaults to <i>true</i>. Only relevant
when used as ResourceSelector. </td>
when used as ResourceSelector.</td>
</tr>
<tr>
<td valign="top"> delayupdate </td>
<td valign="top"> If set to <i>true</i>, the storage of the cache will be delayed until the
<td valign="top">delayupdate</td>
<td valign="top">If set to <i>true</i>, the storage of the cache will be delayed until the
next finished BuildEvent; task finished, target finished or build finished,
whichever comes first. This is provided for increased performance. If set
to <i>false</i>, the storage of the cache will happen with each change. This
attribute depends upon the <i>update</i> attribute. (boolean)</td>
<td valign="top" align="center"> No, defaults to <i>true</i> </td>
<td valign="top" align="center"> No, defaults to <i>true</i></td>
</tr>
</table>

<p>These attributes can be set with nested <code>&lt;param/&gt;</code> tags. With <code>&lt;param/&gt;</code>
tags you can set other values too - as long as they are named according to
the following rules: <ul>
<li> <b> algorithm </b>: same as attribute algorithm </li>
<li> <b> cache </b>: same as attribute cache </li>
<li> <b> comparator </b>: same as attribute comparator </li>
<li> <b> algorithmclass </b>: same as attribute algorithmclass </li>
<li> <b> cacheclass </b>: same as attribute cacheclass </li>
<li> <b> comparatorclass </b>: same as attribute comparatorclass </li>
<li> <b> update </b>: same as attribute update </li>
<li> <b> seldirs </b>: same as attribute seldirs </li>
<li> <b> algorithm.* </b>: Value is transferred to the algorithm via its
<i>set</i>XX-methods </li>
<li> <b> cache.* </b>: Value is transferred to the cache via its
<i>set</i>XX-methods </li>
<li> <b> comparator.* </b>: Value is transferred to the comparator via its
<i>set</i>XX-methods </li>
</ul>
<h5>Parameters specified as nested elements</h5>

<table border="1" cellpadding="2" cellspacing="0">
<tr><td colspan="2"><font size="+1"><b> Algorithm options</b></font></td></tr>
<tr>
<p>The <code>&lt;modified&gt;</code> selector supports a nested
<code>&lt;classpath&gt;</code> element that represents a <a href="../using.html#path">
PATH like structure</a> for finding custom interface implementations.</p>

<p>All attributes of a <code>&lt;modified&gt;</code> selector an be set with
nested <code>&lt;param/&gt;</code> tags. Additional values can be set
with <code>&lt;param/&gt;</code> tags according to the rules below.</p>

<h6>algorithm</h6>
Same as algorithm attribute, with the following additional values:
<table>
<tr>
<td valign="top"><b>Name</b></td>
<td valign="top"><b>Description</b></td>
</tr>
<tr>
<td valign="top"> hashvalue </td>
<td valign="top"> Reads the content of a file into a java.lang.String
and use thats hashValue(). No additional configuration required.
</td>
<td valign="top">hashvalue</td>
<td valign="top">Reads the content of a file into a java.lang.String
and use that hashValue(). No additional configuration required.</td>
</tr>
<tr>
<td valign="top"> digest </td>
<td valign="top"> Uses java.security.MessageDigest. This Algorithm supports
<td valign="top">digest</td>
<td valign="top">Uses java.security.MessageDigest. This Algorithm supports
the following attributes:
<ul>
<li><i>algorithm.algorithm</i> (optional): Name of the Digest algorithm
(e.g. 'MD5' or 'SHA', default = <i>MD5</i>) </li>
(e.g. 'MD5' or 'SHA', default = <i>MD5</i>)</li>
<li><i>algorithm.provider</i> (optional): Name of the Digest provider
(default = <i>null</i>) </li>
(default = <i>null</i>)</li>
</ul>
</td>
</tr>
<tr>
<td valign="top"> checksum </td>
<td valign="top"> Uses java.util.zip.Checksum. This Algorithm supports
<td valign="top">checksum</td>
<td valign="top">Uses java.util.zip.Checksum. This Algorithm supports
the following attributes:
<ul>
<li><i>algorithm.algorithm</i> (optional): Name of the algorithm
(e.g. 'CRC' or 'ADLER', default = <i>CRC</i>) </li>
(e.g. 'CRC' or 'ADLER', default = <i>CRC</i>)</li>
</ul>
</td>
</tr>
<tr><td colspan="2"><font size="+1"><b> Cache options </b></font></td></tr>
</table>
<h6>cache</h6>
Same as cache attribute, with the following additional values:
<table>
<tr>
<td valign="top"><b>Name</b></td>
<td valign="top"><b>Description</b></td>
</tr>
<tr>
<td valign="top"> propertyfile </td>
<td valign="top"> Use the java.util.Properties class and its possibility
<td valign="top">propertyfile</td>
<td valign="top">Use the java.util.Properties class and its possibility
to load and store to file.
This Cache implementation supports the following attributes:
<ul>
<li><i>cache.cachefile</i> (optional): Name of the properties-file
(default = <i>cache.properties</i>) </li>
(default = <i>cache.properties</i>)</li>
</ul>
</td>
</tr>
<tr><td colspan="2"><font size="+1"><b> Comparator options</b></font></td></tr>
<tr>
<td valign="top"> equal </td>
<td valign="top"> Very simple object comparison. </td>
</tr>
<tr>
<td valign="top"> rule </td>
<td valign="top"> Uses <i>java.text.RuleBasedCollator</i> for Object
comparison.
<!-- NOTE -->
<i>(see <a href="#ModSelNote">note</a> for restrictions)</i>
</td>
</tr>
</table>

<p>The <code>&lt;modified&gt;</code> selector supports a nested
<code>&lt;classpath&gt;</code> element that represents a <a href="../using.html#path">
PATH like structure</a> for finding custom interface implementations. </p>

<h6>comparator</h6>
Same as comparator attribute.
<h6>algorithmclass</h6>
Same as algorithmclass attribute.
<h6>comparatorclass</h6>
Same as comparatorclass attribute.
<h6>cacheclass</h6>
Same as cacheclass attribute.
<h6>update</h6>
Same as update attribute.
<h6>seldirs</h6>
Same as comparatorclass attribute.

<h5>Examples</h5>
<p>Here are some examples of how to use the Modified Selector:</p>

<blockquote><pre>
@@ -981,12 +965,12 @@
<p>Uses <tt>com.mycompany.MyCache</tt> from a jar outside of Ants own classpath
as cache implementation</p>

<h4><a name="ModSelNote">Note on RuleBasedCollator</a></h4>
<h4 id="ModSelNote">Note on RuleBasedCollator</h4>
<p>The RuleBasedCollator needs a format for its work, but its needed while
instantiation. There is a problem in the initialization algorithm for this
case. Therefore you should not use this (or tell me the workaround :-).</p>

<h4><a name="signedselector">Signed Selector</a></h4>
<h4 id="signedselector">Signed Selector</h4>

<p>
The <code>&lt;signedselector&gt;</code> tag selects signed files and optionally
@@ -995,7 +979,7 @@
<p>
This selector has been added in Apache Ant 1.7.
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1003,12 +987,12 @@
</tr>
<tr>
<td valign="top">name</td>
<td valign="top"> The signature name to check for.</td>
<td valign="top">The signature name to check for.</td>
<td valign="top" align="center">no</td>
</tr>
</table>

<h4><a name="readable">Readable Selector</a></h4>
<h4 id="readable">Readable Selector</h4>

<p>The <code>&lt;readable&gt;</code> selector selects only files
that are readable. Ant only invokes
@@ -1016,15 +1000,15 @@
but the Java VM cannot detect this state, this selector will
still select the file.</p>

<h4><a name="writable">Writable Selector</a></h4>
<h4 id="writable">Writable Selector</h4>

<p>The <code>&lt;writable&gt;</code> selector selects only files
that are writable. Ant only invokes
<code>java.io.File#canWrite</code> so if a file is unwritable
<code>java.io.File#canWrite</code> so if a file is nonwritable
but the Java VM cannot detect this state, this selector will
still select the file.</p>

<h4><a name="executable">Executable Selector</a></h4>
<h4 id="executable">Executable Selector</h4>

<p>The <code>&lt;executable&gt;</code> selector selects only files
that are executable. Ant only invokes
@@ -1034,7 +1018,7 @@

<p><em>Since Ant 1.10.0</em></p>

<h4><a name="symlink">Symlink Selector</a></h4>
<h4 id="symlink">Symlink Selector</h4>

<p>The <code>&lt;symlink&gt;</code> selector selects only files
that are symbolic links. Ant only invokes
@@ -1044,7 +1028,7 @@

<p><em>Since Ant 1.10.0</em></p>

<h4><a name="ownedBy">OwnedBy Selector</a></h4>
<h4 id="ownedBy">OwnedBy Selector</h4>

<p>The <code>&lt;ownedBy&gt;</code> selector selects only files
that are owned by the given user. Ant only invokes
@@ -1054,7 +1038,7 @@

<p><em>Since Ant 1.10.0</em></p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1067,7 +1051,7 @@
</tr>
</table>

<h4><a name="scriptselector">Script Selector</a></h4>
<h4 id="scriptselector">Script Selector</h4>

<p>
The <code>&lt;scriptselector&gt;</code> element enables you
@@ -1082,7 +1066,7 @@
<p>
This selector was added in Apache Ant 1.7.
</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1109,7 +1093,7 @@
</tr>
<tr>
<td valign="top">encoding</td>
<td valign="top">The encoding of the script as a file. <em>since Ant 1.10.2.</em></td>
<td valign="top">The encoding of the script as a file. <em>since Ant 1.10.2</em></td>
<td valign="top" align="center">No - defaults to default JVM encoding</td>
</tr>
<tr>
@@ -1152,7 +1136,7 @@
The following beans are configured for every script, alongside
the classic set of project, properties, and targets.

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Bean</b></td>
<td valign="top"><b>Description</b></td>
@@ -1185,7 +1169,7 @@
attributes. Only the <code>selected</code> flag is writable, the rest
are read only via their getter methods.

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1232,7 +1216,7 @@
</pre>
Select files whose filename length is even.

<h3><a name="selectcontainers">Selector Containers</a></h3>
<h3 id="selectcontainers">Selector Containers</h3>

<p>To create more complex selections, a variety of selectors that
contain other selectors are available for your use. They combine the
@@ -1283,7 +1267,7 @@ Select files whose filename length is even.
<li><code>&lt;size&gt;</code></li>
</ul>

<h4><a name="andselect">And Selector</a></h4>
<h4 id="andselect">And Selector</h4>

<p>The <code>&lt;and&gt;</code> tag selects files that are
selected by all of the elements it contains. It returns as
@@ -1306,15 +1290,14 @@ Select files whose filename length is even.
since the last millennium.
</p>


<h4><a name="majorityselect">Majority Selector</a></h4>
<h4 id="majorityselect">Majority Selector</h4>

<p>The <code>&lt;majority&gt;</code> tag selects files provided
that a majority of the contained elements also select it. Ties are
dealt with as specified by the <code>allowtie</code> attribute.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1330,7 +1313,6 @@ Select files whose filename length is even.
</tr>
</table>


<p>Here is an example of how to use the Majority Selector:</p>

<blockquote><pre>
@@ -1348,8 +1330,7 @@ Select files whose filename length is even.
match case exactly).
</p>


<h4><a name="noneselect">None Selector</a></h4>
<h4 id="noneselect">None Selector</h4>

<p>The <code>&lt;none&gt;</code> tag selects files that are
not selected by any of the elements it contains. It returns as
@@ -1374,8 +1355,7 @@ Select files whose filename length is even.
class files in the dest directory.
</p>


<h4><a name="notselect">Not Selector</a></h4>
<h4 id="notselect">Not Selector</h4>

<p>The <code>&lt;not&gt;</code> tag reverses the meaning of the
single selector it contains.
@@ -1395,8 +1375,7 @@ Select files whose filename length is even.
string "test".
</p>


<h4><a name="orselect">Or Selector</a></h4>
<h4 id="orselect">Or Selector</h4>

<p>The <code>&lt;or&gt;</code> tag selects files that are
selected by any one of the elements it contains. It returns as
@@ -1421,8 +1400,7 @@ Select files whose filename length is even.
image files below it.
</p>


<h4><a name="selectorselect">Selector Reference</a></h4>
<h4 id="selectorselect">Selector Reference</h4>

<p>The <code>&lt;selector&gt;</code> tag is used to create selectors
that can be reused through references. It is the only selector which can
@@ -1440,7 +1418,7 @@ Select files whose filename length is even.
<code>&lt;exclude&gt;</code> tags within a
<code>&lt;patternset&gt;</code>.</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1519,7 +1497,7 @@ Select files whose filename length is even.
<p>A fileset that conditionally contains Java source files and Test
source and class files.</p>

<h3><a name="customselect">Custom Selectors</a></h3>
<h3 id="customselect">Custom Selectors</h3>

<p>You can write your own selectors and use them within the selector
containers by specifying them within the <code>&lt;custom&gt;</code> tag.</p>
@@ -1535,7 +1513,7 @@ Select files whose filename length is even.
the <code>&lt;custom&gt;</code> tag.
</p>

<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -1614,8 +1592,5 @@ Select files whose filename length is even.
<p>For more details concerning writing your own selectors, consult
<a href="selectors-program.html">Programming Selectors in Ant</a>.</p>


</body>

</html>

+ 8
- 10
manual/Types/tarfileset.html View File

@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
@@ -22,7 +21,7 @@
<title>TarFileSet Type</title>
</head>
<body>
<h2><a name="fileset">TarFileSet</a></h2>
<h2 id="fileset">TarFileSet</h2>

<p><em>TarFileSet</em> has been added as a stand-alone type in Apache Ant
1.7.</p>
@@ -54,7 +53,7 @@ style="font-style: italic;">refid</span> attribute. This is also true
for tarfileset which has been added in Ant 1.7.<br>
</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tbody>
<tr>
<td valign="top"><b>Attribute</b></td>
@@ -63,13 +62,13 @@ for tarfileset which has been added in Ant 1.7.<br>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">all files in the fileset are prefixed with that
<td valign="top">all files in the fileset are prefixed with that
path in the archive.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">fullpath</td>
<td valign="top">the file described by the fileset is placed at
<td valign="top">the file described by the fileset is placed at
that exact location in the archive.</td>
<td align="center" valign="top">No</td>
</tr>
@@ -82,15 +81,15 @@ in the archive.</td>
</tr>
<tr>
<td valign="top">filemode</td>
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
plain files. Default is 644.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">dirmode</td>
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
directories. Default is 755.</td>
<td align="center" valign="top">No</td>
</tr>
@@ -177,6 +176,5 @@ some-dir and discards the rest of the archive. File timestamps will
be compared between the archive's entries and files inside the target
directory, no files get overwritten unless they are out-of-date.</p>


</body>
</html>

+ 29
- 32
manual/Types/xmlcatalog.html View File

@@ -24,16 +24,16 @@

<body>

<h2><a name="XMLCatalog">XMLCatalog</a></h2>
<h2 id="XMLCatalog">XMLCatalog</h2>

<p>An XMLCatalog is a catalog of public resources such as DTDs or
entities that are referenced in an XML document. Catalogs are
typically used to make web references to resources point to a locally
cached copy of the resource.</p>

<p>This allows the XML Parser, XSLT Processor or other consumer of XML
<p>This allows the XML Parser, XSLT Processor or other consumer of XML
documents
to efficiently allow a local substitution for a resource available on the
to efficiently allow a local substitution for a resource available on the
web.
</p>
<p><b>Note:</b> This task <em>uses, but does not depend on</em> external
@@ -49,30 +49,30 @@ the <code>org.xml.sax.EntityResolver</code> and <code>
javax.xml.transform.URIResolver</code> interfaces as defined
in the <a href="https://jaxp.dev.java.net/">Java API for XML
Processing (JAXP) Specification</a>.</p>
<p>For example, in a <code>web.xml</code> file, the DTD is referenced as:
<p>For example, in a <code>web.xml</code> file, the DTD is referenced as:</p>
<pre>
&lt;!DOCTYPE web-app PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN&quot;
&quot;http://java.sun.com/j2ee/dtds/web-app_2_2.dtd&quot;&gt;
</pre>
The XML processor, without XMLCatalog support, would need to retrieve the
<p>
The XML processor, without XMLCatalog support, would need to retrieve the
DTD from
the URL specified whenever validation of the document was required.
</p>
<p>This can be very time consuming during the build process,
especially where network throughput is limited. Alternatively, you
can do the following:
can do the following:</p>
<ol>
<li>Copy <code>web-app_2_2.dtd</code> onto your local disk somewhere (either in the
filesystem or even embedded inside a jar or zip file on the classpath).</li>
<li>Create an <code>&lt;xmlcatalog&gt;</code> with a <code>&lt;dtd&gt;</code>
<li>Create an <code>&lt;xmlcatalog&gt;</code> with a <code>&lt;dtd&gt;</code>
element whose <code>location</code> attribute points to the file.</li>
<li>Success! The XML processor will now use the local copy instead of calling out
to the internet.</li>
</ol>
</p>
<p>XMLCatalogs can appear inside tasks
that support this feature or at the same level as <code>target</code>
- i.e., as children of <code>project</code> for reuse across different
- i.e., as children of <code>project</code> for reuse across different
tasks,
e.g. XML Validation and XSLT Transformation. The XML Validate task
uses XMLCatalogs for entity resolution. The XSLT Transformation
@@ -101,7 +101,7 @@ href="http://oasis-open.org/committees/entity/background/9401.html">
plain text format</a> or <a
href="http://www.oasis-open.org/committees/entity/spec-2001-08-06.html">
XML format</a>. If the xml-commons resolver library is not found in the
classpath, external catalog files, specified in <code>catalogpath</code>,
classpath, external catalog files, specified in <code>catalogpath</code>,
will be ignored and a warning
will be logged. In this case, however, processing of inline entries will
proceed normally.</p>
@@ -109,10 +109,10 @@ proceed normally.</p>
<code>&lt;entity&gt;</code> elements may be specified inline; these
roughly correspond to OASIS catalog entry types <code>PUBLIC</code> and
<code>URI</code> respectively. By contrast, external catalog files
may use any of the entry types defined in the
may use any of the entry types defined in the
<a href="http://oasis-open.org/committees/entity/spec-2001-08-06.html">
+OASIS specification</a>.</p>
<h3><a name="ResolverAlgorithm">Entity/DTD/URI Resolution Algorithm</a></h3>
<h3 id="ResolverAlgorithm">Entity/DTD/URI Resolution Algorithm</h3>

When an entity, DTD, or URI is looked up by the XML processor, the
XMLCatalog searches its list of entries to see if any match. That is,
@@ -142,7 +142,6 @@ contains <code>foo/bar/blat.dtd</code> it will resolve an entity whose
will <em>not</em> resolve an entity whose <code>location</code> is
<code>blat.dtd</code>.


<h4>3a. Apache xml-commons resolver lookup</h4>

<p>What happens next depends on whether the resolver library from
@@ -169,7 +168,7 @@ configuration, further resolution failures may or may not result in
fatal (i.e. build-ending) errors.</p>

<h3>XMLCatalog attributes</h3>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -177,14 +176,14 @@ fatal (i.e. build-ending) errors.</p>
</tr>
<tr>
<td valign="top">id</td>
<td valign="top">a unique name for an XMLCatalog, used for referencing
<td valign="top">a unique name for an XMLCatalog, used for referencing
the
XMLCatalog's contents from another XMLCatalog</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top">the <code>id</code> of another XMLCatalog whose
<td valign="top">the <code>id</code> of another XMLCatalog whose
contents
you would like to be used for this XMLCatalog</td>
<td valign="top" align="center">No</td>
@@ -195,7 +194,7 @@ contents
<h4>dtd/entity</h4>
<p>The <code>dtd</code> and <code>entity</code> elements used to specify
XMLCatalogs are identical in their structure</p>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
@@ -203,17 +202,17 @@ XMLCatalogs are identical in their structure</p>
</tr>
<tr>
<td valign="top">publicId</td>
<td valign="top">The public identifier used when defining a dtd or
<td valign="top">The public identifier used when defining a dtd or
entity,
e.g. <code>&quot;-//Sun Microsystems, Inc.//DTD Web Application
e.g. <code>&quot;-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN&quot;</code>
</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">location</td>
<td valign="top">The location of the local replacement to be used for
the public identifier specified. This may be specified as a file name,
<td valign="top">The location of the local replacement to be used for
the public identifier specified. This may be specified as a file name,
resource name found on the classpath, or a URL. Relative paths will
be resolved according to the base, which by default is the Ant project
basedir.
@@ -239,12 +238,12 @@ resolver library from xml-commons is not available in the classpath, all
<code>catalogpaths</code> will be ignored and a warning will be logged.
</p>
<h3>Examples</h3>
<p>Set up an XMLCatalog with a single dtd referenced locally in a user's
home
<p>Set up an XMLCatalog with a single dtd referenced locally in a user's
home
directory:</p>
<blockquote><pre>
&lt;xmlcatalog&gt;
&lt;dtd
&lt;dtd
publicId=&quot;-//OASIS//DTD DocBook XML V4.1.2//EN&quot;
location=&quot;/home/dion/downloads/docbook/docbookx.dtd&quot;/&gt;
&lt;/xmlcatalog&gt;
@@ -254,10 +253,10 @@ filesystem (relative to the Ant project basedir) or in the classpath:
</p>
<blockquote><pre>
&lt;xmlcatalog id=&quot;commonDTDs&quot;&gt;
&lt;dtd
&lt;dtd
publicId=&quot;-//OASIS//DTD DocBook XML V4.1.2//EN&quot;
location=&quot;docbook/docbookx.dtd&quot;/&gt;
&lt;dtd
&lt;dtd
publicId=&quot;-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN&quot;
location=&quot;web-app_2_2.dtd&quot;/&gt;
&lt;/xmlcatalog&gt;
@@ -269,19 +268,19 @@ formats:</p>

<blockquote><pre>
&lt;xmlcatalog id=&quot;allcatalogs&quot;&gt;
&lt;dtd
&lt;dtd
publicId=&quot;-//ArielPartners//DTD XML Article V1.0//EN&quot;
location=&quot;com/arielpartners/knowledgebase/dtd/article.dtd&quot;/&gt;
&lt;entity
&lt;entity
publicId=&quot;LargeLogo&quot;
location=&quot;com/arielpartners/images/ariel-logo-large.gif&quot;/&gt;
&lt;xmlcatalog refid="commonDTDs"/&gt;
&lt;catalogpath&gt;
&lt;pathelement location="/etc/sgml/catalog"/&gt;
&lt;fileset
&lt;fileset
dir=&quot;/anetwork/drive&quot;
includes=&quot;**/catalog&quot;/&gt;
&lt;fileset
&lt;fileset
dir=&quot;/my/catalogs&quot;
includes=&quot;**/catalog.xml&quot;/&gt;
&lt;/catalogpath&gt;
@@ -300,7 +299,5 @@ formats:</p>
&lt;/xslt&gt;
</pre></blockquote>



</body>
</html>

+ 18
- 16
manual/Types/zipfileset.html View File

@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
@@ -22,7 +21,7 @@
<title>ZipFileSet Type</title>
</head>
<body>
<h2><a name="fileset">ZipFileSet</a></h2>
<h2 id="fileset">ZipFileSet</h2>

<p>A <code>&lt;zipfileset&gt;</code> is a special form of a <code>&lt;<a
href="fileset.html">fileset</a>&gt;</code> which can behave in 2
@@ -31,7 +30,7 @@ different ways : <br>
<ul>
<li>When the <span style="font-style: italic;">src</span> attribute
is used - or a nested resource collection has been specified
(<em>since Apache Ant 1.7</em>), the zipfileset is populated with
(<em>since Apache Ant 1.7</em>), the zipfileset is populated with
zip entries found in the file <span style="font-style:
italic;">src</span>.<br>
</li>
@@ -46,12 +45,12 @@ is used, the zipfileset is populated with filesystem files found under <span
don't contain entries with leading slashes so you shouldn't use
include/exclude patterns that start with slashes either.</p>

<p>Since Ant 1.6, a zipfileset can be defined with the <span
<p><em>Since Ant 1.6</em>, a zipfileset can be defined with the <span
style="font-style: italic;">id </span>attribute and referred to with
the <span style="font-style: italic;">refid</span> attribute.<br>
</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<table>
<tbody>
<tr>
<td valign="top"><b>Attribute</b></td>
@@ -60,13 +59,13 @@ the <span style="font-style: italic;">refid</span> attribute.<br>
</tr>
<tr>
<td valign="top">prefix</td>
<td valign="top">all files in the fileset are prefixed with that
<td valign="top">all files in the fileset are prefixed with that
path in the archive.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">fullpath</td>
<td valign="top">the file described by the fileset is placed at
<td valign="top">the file described by the fileset is placed at
that exact location in the archive.</td>
<td align="center" valign="top">No</td>
</tr>
@@ -79,16 +78,16 @@ in the archive.</td>
</tr>
<tr>
<td valign="top">filemode</td>
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
plain files. Default is 644. <em>since Ant 1.5.2</em>.</td>
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
plain files. Default is 644. <em>Since Ant 1.5.2</em></td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">dirmode</td>
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
directories. Default is 755. <em>since Ant 1.5.2</em>.</td>
<td valign="top">A 3 digit octal string, specify the user, group
and other modes in the standard Unix fashion. Only applies to
directories. Default is 755. <em>Since Ant 1.5.2</em></td>
<td align="center" valign="top">No</td>
</tr>
<tr>
@@ -132,17 +131,20 @@ single element resource collection</h4>

<h4>Examples</h4>
<blockquote>
<pre> &lt;zip destfile="${dist}/manual.zip"&gt;<br> &lt;zipfileset dir="htdocs/manual" prefix="docs/user-guide"/&gt;<br> &lt;zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/&gt;<br> &lt;zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/&gt;<br> &lt;/zip&gt;<br></pre>
<pre> &lt;zip destfile="${dist}/manual.zip"&gt;
&lt;zipfileset dir="htdocs/manual" prefix="docs/user-guide"/&gt;
&lt;zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/&gt;
&lt;zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/&gt;
&lt;/zip&gt;</pre>
<p>zips all files in the <code>htdocs/manual</code> directory into
the <code>docs/user-guide</code> directory in the archive, adds the
file <code>ChangeLog27.txt</code> in the current directory as <code>docs/ChangeLog.txt</code>,
and includes all the html files in <code>examples.zip</code> under <code>docs/examples</code>.
The archive might end up containing the files:</p>
<code> docs/user-guide/html/index.html<br>
<code>docs/user-guide/html/index.html<br>
docs/ChangeLog.txt<br>
docs/examples/index.html<br>
</code></blockquote>


</body>
</html>

+ 9
- 0
manual/stylesheets/style.css View File

@@ -52,6 +52,15 @@ h5 + p, h6 + p {
margin-bottom: .5rem;
}

h1 > a, h2 > a, h3 > a, h4 > a, h5 > a, h6 > a {
color: white;
}

h1 > a:visited, h2 > a:visited, h3 > a:visited, h4 > a:visited, h5 > a:visited, h6 > a:visited,
h1 > a:hover, h2 > a:hover, h3 > a:hover, h4 > a:hover, h5 > a:hover, h6 > a:hover {
color: lightskyblue;
}

td {
background-color: #eeeeee;
color: black;


Loading…
Cancel
Save