@@ -330,7 +330,7 @@ targets so specified, in the order specified.</p> | |||||
corresponding Ant tasks set the dir attribute explicitly.</p> | corresponding Ant tasks set the dir attribute explicitly.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="subproject/subbuild.xml" target="compile"/> | <ant antfile="subproject/subbuild.xml" target="compile"/> | ||||
<ant dir="subproject"/> | <ant dir="subproject"/> | ||||
@@ -343,66 +343,66 @@ targets so specified, in the order specified.</p> | |||||
<ant inheritAll="false" antfile="subproject/subbuild.xml"> | <ant inheritAll="false" antfile="subproject/subbuild.xml"> | ||||
<property name="output.type" value="html"/> | <property name="output.type" value="html"/> | ||||
</ant> | </ant> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>These lines invoke the same build file:</p> | <p>These lines invoke the same build file:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="sub1/sub2/build.xml" /> | <ant antfile="sub1/sub2/build.xml" /> | ||||
<ant antfile="sub2/build.xml" dir="sub1" /> | <ant antfile="sub2/build.xml" dir="sub1" /> | ||||
<ant antfile="build.xml" dir="sub1/sub2" /> | <ant antfile="build.xml" dir="sub1/sub2" /> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The build file of the calling project defines some | <p>The build file of the calling project defines some | ||||
<code><path></code> elements like this:</p> | <code><path></code> elements like this:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<path id="path1"> | <path id="path1"> | ||||
... | ... | ||||
</path> | </path> | ||||
<path id="path2"> | <path id="path2"> | ||||
... | ... | ||||
</path> | </path> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>and the called build file (<code>subbuild.xml</code>) also defines | <p>and the called build file (<code>subbuild.xml</code>) also defines | ||||
a <code><path></code> with the id <code>path1</code>, but | a <code><path></code> with the id <code>path1</code>, but | ||||
<code>path2</code> is not defined:</p> | <code>path2</code> is not defined:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="subbuild.xml" inheritrefs="true"/> | <ant antfile="subbuild.xml" inheritrefs="true"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will not override <code>subbuild</code>'s definition of | <p>will not override <code>subbuild</code>'s definition of | ||||
<code>path1</code>, but make the parent's definition of | <code>path1</code>, but make the parent's definition of | ||||
<code>path2</code> available in the subbuild.</p> | <code>path2</code> available in the subbuild.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="subbuild.xml"/> | <ant antfile="subbuild.xml"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>as well as</p> | <p>as well as</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="subbuild.xml" inheritrefs="false"/> | <ant antfile="subbuild.xml" inheritrefs="false"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will neither override <code>path1</code> nor copy | <p>will neither override <code>path1</code> nor copy | ||||
<code>path2</code>.</p> | <code>path2</code>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="subbuild.xml" inheritrefs="false"> | <ant antfile="subbuild.xml" inheritrefs="false"> | ||||
<reference refid="path1"/> | <reference refid="path1"/> | ||||
</ant> | </ant> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will override <code>subbuild</code>'s definition of | <p>will override <code>subbuild</code>'s definition of | ||||
<code>path1</code>.</p> | <code>path1</code>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<ant antfile="subbuild.xml" inheritrefs="false"> | <ant antfile="subbuild.xml" inheritrefs="false"> | ||||
<reference refid="path1" torefid="path2"/> | <reference refid="path1" torefid="path2"/> | ||||
</ant> | </ant> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will copy the parent's definition of <code>path1</code> into the | <p>will copy the parent's definition of <code>path1</code> into the | ||||
new project using the id <code>path2</code>.</p> | new project using the id <code>path2</code>.</p> | ||||
@@ -173,7 +173,7 @@ targets so specified, in the order specified.</p> | |||||
<p><em>since Ant 1.6.3</em>.</p> | <p><em>since Ant 1.6.3</em>.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<target name="default"> | <target name="default"> | ||||
<antcall target="doSomethingElse"> | <antcall target="doSomethingElse"> | ||||
<param name="param1" value="value"/> | <param name="param1" value="value"/> | ||||
@@ -183,14 +183,14 @@ targets so specified, in the order specified.</p> | |||||
<target name="doSomethingElse"> | <target name="doSomethingElse"> | ||||
<echo message="param1=${param1}"/> | <echo message="param1=${param1}"/> | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p> | <p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<antcall ... > | <antcall ... > | ||||
<reference refid="path1" torefid="path2"/> | <reference refid="path1" torefid="path2"/> | ||||
</antcall> | </antcall> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will copy the parent's definition of <code>path1</code> into the | <p>will copy the parent's definition of <code>path1</code> into the | ||||
new project using the id <code>path2</code>.</p> | new project using the id <code>path2</code>.</p> | ||||
@@ -186,11 +186,11 @@ VM via nested <code><jvmarg></code> attributes, for example:</p> | |||||
href="../using.html#arg">Command line arguments</a>.</p> | href="../using.html#arg">Command line arguments</a>.</p> | ||||
<h3>Example</h3> | <h3>Example</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<antlr | <antlr | ||||
target="etc/java.g" | target="etc/java.g" | ||||
outputdirectory="build/src"/> | outputdirectory="build/src"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
This invokes ANTLR on grammar file etc/java.g, writing the generated | This invokes ANTLR on grammar file etc/java.g, writing the generated | ||||
files to build/src. | files to build/src. | ||||
@@ -68,9 +68,7 @@ element of this task - see the example below. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<antstructure output="project.dtd" /> | |||||
</pre></blockquote> | |||||
<pre><antstructure output="project.dtd"/></pre> | |||||
<p><b>Emitting your own structure instead of a DTD</b></p> | <p><b>Emitting your own structure instead of a DTD</b></p> | ||||
@@ -60,34 +60,33 @@ Stores the Apache Ant version (when used as task) or checks for a specific Ant v | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<antversion property="antversion"/> | <antversion property="antversion"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Stores the current Ant version in the property <i>antversion</i>.</p> | <p>Stores the current Ant version in the property <i>antversion</i>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<antversion property="antversion" atleast="1.6"/> | <antversion property="antversion" atleast="1.6"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Stores the Ant version in the property <i>antversion</i> if the current Ant version is 1.6.0 | <p>Stores the Ant version in the property <i>antversion</i> if the current Ant version is 1.6.0 | ||||
or higher. Otherwise the property remains unset.</p> | or higher. Otherwise the property remains unset.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<antversion property="ant-is-exact-7" exactly="1.7.0"/> | <antversion property="ant-is-exact-7" exactly="1.7.0"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Sets the property <i>ant-is-exact-7</i> if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.0 | <p>Sets the property <i>ant-is-exact-7</i> if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.0 | ||||
would match.</p> | would match.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<condition property="Ant17isOnline"> | <condition property="Ant17isOnline"> | ||||
<and> | <and> | ||||
<antversion exactly="1.7.0"/> | <antversion exactly="1.7.0"/> | ||||
<http url="http://ant.apache.org"/> | <http url="http://ant.apache.org"/> | ||||
</and> | </and> | ||||
</condition> | </condition> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Sets <i>Ant17isOnline</i> if Ant 1.7.0 is running and can get a non-error-response from | <p>Sets <i>Ant17isOnline</i> if Ant 1.7.0 is running and can get a non-error-response from | ||||
the Ant homepage.</p> | the Ant homepage.</p> | ||||
@@ -399,7 +399,7 @@ files for each sourcefile. | |||||
of executions (with <i>maxparallel</i> > 0) and null will be used | of executions (with <i>maxparallel</i> > 0) and null will be used | ||||
a source file just like it is in the case of <code>exec</code>.</p> | a source file just like it is in the case of <code>exec</code>.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<apply executable="ls"> | <apply executable="ls"> | ||||
<arg value="-l"/> | <arg value="-l"/> | ||||
<fileset dir="/tmp"> | <fileset dir="/tmp"> | ||||
@@ -409,25 +409,25 @@ files for each sourcefile. | |||||
</fileset> | </fileset> | ||||
<fileset refid="other.files"/> | <fileset refid="other.files"/> | ||||
</apply> | </apply> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>invokes <code>ls -l</code>, adding the absolute filenames of all | <p>invokes <code>ls -l</code>, adding the absolute filenames of all | ||||
files below <code>/tmp</code> not ending in <code>.txt</code> and all | files below <code>/tmp</code> not ending in <code>.txt</code> and all | ||||
files of the FileSet with <code>id</code> <code>other.files</code> to | files of the FileSet with <code>id</code> <code>other.files</code> to | ||||
the command line.</p> | the command line.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<apply executable="somecommand" parallel="false"> | <apply executable="somecommand" parallel="false"> | ||||
<arg value="arg1"/> | <arg value="arg1"/> | ||||
<srcfile/> | <srcfile/> | ||||
<arg value="arg2"/> | <arg value="arg2"/> | ||||
<fileset dir="/tmp"/> | <fileset dir="/tmp"/> | ||||
</apply> | </apply> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each | <p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each | ||||
file in <code>/tmp</code> replacing SOURCEFILENAME with the absolute | file in <code>/tmp</code> replacing SOURCEFILENAME with the absolute | ||||
filename of each file in turn. If <code>parallel</code> had been set | filename of each file in turn. If <code>parallel</code> had been set | ||||
to true, SOURCEFILENAME would be replaced with the absolute filenames | to true, SOURCEFILENAME would be replaced with the absolute filenames | ||||
of all files separated by spaces.</p> | of all files separated by spaces.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<apply executable="cc" dest="src/C" parallel="false"> | <apply executable="cc" dest="src/C" parallel="false"> | ||||
<arg value="-c"/> | <arg value="-c"/> | ||||
<arg value="-o"/> | <arg value="-o"/> | ||||
@@ -436,13 +436,13 @@ of all files separated by spaces.</p> | |||||
<fileset dir="src/C" includes="*.c"/> | <fileset dir="src/C" includes="*.c"/> | ||||
<mapper type="glob" from="*.c" to="*.o"/> | <mapper type="glob" from="*.c" to="*.o"/> | ||||
</apply> | </apply> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each | <p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each | ||||
<code>.c</code> file that is newer than the corresponding | <code>.c</code> file that is newer than the corresponding | ||||
<code>.o</code>, replacing TARGETFILE with the absolute filename of | <code>.o</code>, replacing TARGETFILE with the absolute filename of | ||||
the <code>.o</code> and SOURCEFILE with the absolute name of the | the <code>.o</code> and SOURCEFILE with the absolute name of the | ||||
<code>.c</code> file.</p> | <code>.c</code> file.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper id="out" type="glob" | <mapper id="out" type="glob" | ||||
from="src${file.separator}*.file" | from="src${file.separator}*.file" | ||||
to="dest${file.separator}*.out"/> | to="dest${file.separator}*.out"/> | ||||
@@ -454,7 +454,7 @@ the <code>.o</code> and SOURCEFILE with the absolute name of the | |||||
<outputmapper refid="out"/> | <outputmapper refid="out"/> | ||||
</redirector> | </redirector> | ||||
</apply> | </apply> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Applies the fictitious "processfile" executable to all | Applies the fictitious "processfile" executable to all | ||||
files matching <code>*.file</code> in the <code>src</code> directory. | files matching <code>*.file</code> in the <code>src</code> directory. | ||||
The <code>out</code> <code><mapper></code> has been set up to map | The <code>out</code> <code><mapper></code> has been set up to map | ||||
@@ -464,7 +464,7 @@ task. A reference to <code>out</code> is then used as an | |||||
<code><outputmapper></code> nested in a <code><redirector></code>, which in turn is | <code><outputmapper></code> nested in a <code><redirector></code>, which in turn is | ||||
nested beneath this <code><apply></code> instance. This allows us to perform | nested beneath this <code><apply></code> instance. This allows us to perform | ||||
dependency checking against output files--the target files in this case. | dependency checking against output files--the target files in this case. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<apply executable="ls" parallel="true" | <apply executable="ls" parallel="true" | ||||
force="true" dest="${basedir}" append="true" type="both"> | force="true" dest="${basedir}" append="true" type="both"> | ||||
<path> | <path> | ||||
@@ -472,11 +472,11 @@ dependency checking against output files--the target files in this case. | |||||
</path> | </path> | ||||
<identitymapper/> | <identitymapper/> | ||||
</apply> | </apply> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Applies the "ls" executable to all directories in the PATH, effectively | Applies the "ls" executable to all directories in the PATH, effectively | ||||
listing all executables that are available on the PATH. | listing all executables that are available on the PATH. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<apply executable="jsmin" addsourcefile="false"> | <apply executable="jsmin" addsourcefile="false"> | ||||
<!-- Collect the JS-files --> | <!-- Collect the JS-files --> | ||||
<fileset dir="src" includes="*.js"/> | <fileset dir="src" includes="*.js"/> | ||||
@@ -488,7 +488,7 @@ listing all executables that are available on the PATH. | |||||
<outputmapper id="out" type="glob" from="*.js" to="dest/*.js"/> | <outputmapper id="out" type="glob" from="*.js" to="dest/*.js"/> | ||||
</redirector> | </redirector> | ||||
</apply> | </apply> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Conversion of the command <code>jsmin < src/a.js > dest/a.js</code> but for | Conversion of the command <code>jsmin < src/a.js > dest/a.js</code> but for | ||||
all files in the src-directory. Because the filename itself should not be passed | all files in the src-directory. Because the filename itself should not be passed | ||||
to the <code>jsmin</code> program, the <code>addsourcefile</code> is set to | to the <code>jsmin</code> program, the <code>addsourcefile</code> is set to | ||||
@@ -136,21 +136,15 @@ directory tree), so you'll have to experiment a little.</p--> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></pre> | <pre><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></pre> | ||||
</blockquote> | |||||
<p>makes the "run.bat" file read-only and hidden.</p> | <p>makes the "run.bat" file read-only and hidden.</p> | ||||
<blockquote> | |||||
<pre><attrib readonly="false"> | |||||
<pre><attrib readonly="false"> | |||||
<fileset dir="${meta.inf}" includes="**/*.xml"/> | <fileset dir="${meta.inf}" includes="**/*.xml"/> | ||||
</attrib> | </attrib> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p> | <p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<attrib readonly="true" archive="true"> | <attrib readonly="true" archive="true"> | ||||
<fileset dir="shared/sources1"> | <fileset dir="shared/sources1"> | ||||
<exclude name="**/trial/**"/> | <exclude name="**/trial/**"/> | ||||
@@ -158,7 +152,7 @@ directory tree), so you'll have to experiment a little.</p--> | |||||
<fileset refid="other.shared.sources"/> | <fileset refid="other.shared.sources"/> | ||||
</attrib> | </attrib> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all files below <code>shared/sources1</code> (except those below any | <p>makes all files below <code>shared/sources1</code> (except those below any | ||||
directory named trial) read-only and archived. In addition all files belonging | directory named trial) read-only and archived. In addition all files belonging | ||||
to a FileSet with <code>id</code> <code>other.shared.sources</code> get the | to a FileSet with <code>id</code> <code>other.shared.sources</code> get the | ||||
@@ -115,41 +115,41 @@ href="../using.html#path">path-like structure</a> and can also be set via a nest | |||||
href="../using.html#path">path-like structure</a> and can also be set via a nested | href="../using.html#path">path-like structure</a> and can also be set via a nested | ||||
<code><filepath></code> element.</p> | <code><filepath></code> element.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<available classname="org.whatever.Myclass" property="Myclass.present"/> | <available classname="org.whatever.Myclass" property="Myclass.present"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>sets the <code>Myclass.present</code> property to the value "true" | <p>sets the <code>Myclass.present</code> property to the value "true" | ||||
if the class <code>org.whatever.Myclass</code> is found in Ant's classpath.</p> | if the class <code>org.whatever.Myclass</code> is found in Ant's classpath.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | <property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | ||||
<available file="${jaxp.jar}" property="jaxp.jar.present"/> | <available file="${jaxp.jar}" property="jaxp.jar.present"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>sets the <code>jaxp.jar.present</code> property to the value "true" | <p>sets the <code>jaxp.jar.present</code> property to the value "true" | ||||
if the file <code>./lib/jaxp11/jaxp.jar</code> is found.</p> | if the file <code>./lib/jaxp11/jaxp.jar</code> is found.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<available file="/usr/local/lib" type="dir" | <available file="/usr/local/lib" type="dir" | ||||
property="local.lib.present"/> | property="local.lib.present"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>sets the <code>local.lib.present</code> property to the value "true" | <p>sets the <code>local.lib.present</code> property to the value "true" | ||||
if the directory <code>/usr/local/lib</code> is found.</p> | if the directory <code>/usr/local/lib</code> is found.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
...in project ... | ...in project ... | ||||
<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | <property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | ||||
<path id="jaxp" location="${jaxp.jar}"/> | <path id="jaxp" location="${jaxp.jar}"/> | ||||
...in target ... | ...in target ... | ||||
<available classname="javax.xml.transform.Transformer" | <available classname="javax.xml.transform.Transformer" | ||||
classpathref="jaxp" property="jaxp11.present"/> | classpathref="jaxp" property="jaxp11.present"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>sets the <code>jaxp11.present</code> property to the value "true" | <p>sets the <code>jaxp11.present</code> property to the value "true" | ||||
if the class <code>javax.xml.transform.Transformer</code> is found in the classpath referenced by <code>jaxp</code> (in this case, <code>./lib/jaxp11/jaxp.jar</code>). | if the class <code>javax.xml.transform.Transformer</code> is found in the classpath referenced by <code>jaxp</code> (in this case, <code>./lib/jaxp11/jaxp.jar</code>). | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<available property="have.extras" resource="extratasks.properties"> | <available property="have.extras" resource="extratasks.properties"> | ||||
<classpath> | <classpath> | ||||
<pathelement location="/usr/local/ant/extra.jar" /> | <pathelement location="/usr/local/ant/extra.jar" /> | ||||
</classpath> | </classpath> | ||||
</available> | </available> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>sets the <code>have.extras</code> property to the value "true" | <p>sets the <code>have.extras</code> property to the value "true" | ||||
if the resource-file <code>extratasks.properties</code> is found. | if the resource-file <code>extratasks.properties</code> is found. | ||||
</p> | </p> | ||||
@@ -64,23 +64,23 @@ the basename will be the simple file name, without any directory elements. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<basename property="jar.filename" file="${lib.jarfile}"/> | <basename property="jar.filename" file="${lib.jarfile}"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
will set <code>jar.filename</code> to | will set <code>jar.filename</code> to | ||||
<code>myjar.jar</code>, if <code>lib.jarfile</code> is defined as either a | <code>myjar.jar</code>, if <code>lib.jarfile</code> is defined as either a | ||||
full-path filename (eg., <code>/usr/local/lib/myjar.jar</code>), | full-path filename (eg., <code>/usr/local/lib/myjar.jar</code>), | ||||
a relative-path filename (eg., <code>lib/myjar.jar</code>), | a relative-path filename (eg., <code>lib/myjar.jar</code>), | ||||
or a simple filename (eg., <code>myjar.jar</code>). | or a simple filename (eg., <code>myjar.jar</code>). | ||||
<blockquote><pre> | |||||
<pre> | |||||
<basename property="cmdname" file="D:/usr/local/foo.exe" | <basename property="cmdname" file="D:/usr/local/foo.exe" | ||||
suffix=".exe"/> | suffix=".exe"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
will set <code>cmdname</code> to <code>foo</code>. | will set <code>cmdname</code> to <code>foo</code>. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property environment="env"/> | <property environment="env"/> | ||||
<basename property="temp.dirname" file="${env.TEMP}"/> | <basename property="temp.dirname" file="${env.TEMP}"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
will set <code>temp.dirname</code> to the last directory element of | will set <code>temp.dirname</code> to the last directory element of | ||||
the path defined for the <code>TEMP</code> environment variable. | the path defined for the <code>TEMP</code> environment variable. | ||||
@@ -44,12 +44,10 @@ target dependencies but only in your context. | |||||
target which will be the bridge between the target to bind and the extension | target which will be the bridge between the target to bind and the extension | ||||
point. For instance: | point. For instance: | ||||
</p> | </p> | ||||
<blockquote><pre><bindtargets targets="jar,javadoc" extensionPoint="dist" /></pre></blockquote> | |||||
<pre><bindtargets targets="jar,javadoc" extensionPoint="dist" /></pre> | |||||
is quite equivalent to: | is quite equivalent to: | ||||
<blockquote><pre><target name="bind-to-dist" depends="jar,javadoc" extensionOf="dist" /></pre></blockquote> | |||||
<p> | |||||
This task basically avoid the creation of a target. | |||||
</p> | |||||
<pre><target name="bind-to-dist" depends="jar,javadoc" extensionOf="dist" /></pre> | |||||
<p>This task basically avoid the creation of a target.</p> | |||||
<p>The bindtargets task may only be used as a top-level task. This means that | <p>The bindtargets task may only be used as a top-level task. This means that | ||||
it may not be used in a target. This is making the target dependency graph static | it may not be used in a target. This is making the target dependency graph static | ||||
@@ -84,9 +82,9 @@ and predictable as soon as every build file is loaded.</p> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<bindtargets targets="build-jar,build-src-jar" extensionPoint="dist" /> | |||||
</pre></blockquote> | |||||
<pre> | |||||
<bindtargets targets="build-jar,build-src-jar" extensionPoint="dist"/> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -53,16 +53,16 @@ the number format.) | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<buildnumber/> | <buildnumber/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Read, increment, and write a build number to the default file, | <p>Read, increment, and write a build number to the default file, | ||||
<code>build.number</code>.</p> | <code>build.number</code>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<buildnumber file="mybuild.number"/> | <buildnumber file="mybuild.number"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Read, increment, and write a build number to the file | <p>Read, increment, and write a build number to the file | ||||
<code>mybuild.number</code>.</p> | <code>mybuild.number</code>.</p> | ||||
@@ -118,34 +118,34 @@ element to specify the files to be included in the archive. | |||||
</p> | </p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<cab cabfile="${dist}/manual.cab" | <cab cabfile="${dist}/manual.cab" | ||||
basedir="htdocs/manual"/> | basedir="htdocs/manual"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>cabs all files in the htdocs/manual directory into a file called | <p>cabs all files in the htdocs/manual directory into a file called | ||||
manual.cab in the ${dist} directory.</p> | manual.cab in the ${dist} directory.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<cab cabfile="${dist}/manual.cab" | <cab cabfile="${dist}/manual.cab" | ||||
basedir="htdocs/manual" | basedir="htdocs/manual" | ||||
excludes="mydocs/**, **/todo.html"/> | excludes="mydocs/**, **/todo.html"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>cabs all files in the htdocs/manual directory into a file called | <p>cabs all files in the htdocs/manual directory into a file called | ||||
manual.cab in the ${dist} directory. Files in the directory mydocs, | manual.cab in the ${dist} directory. Files in the directory mydocs, | ||||
or files with the name todo.html are excluded.</p> | or files with the name todo.html are excluded.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<cab cabfile="${dist}/manual.cab" | <cab cabfile="${dist}/manual.cab" | ||||
basedir="htdocs/manual" | basedir="htdocs/manual" | ||||
includes="api/**/*.html" | includes="api/**/*.html" | ||||
excludes="**/todo.html" | excludes="**/todo.html" | ||||
verbose="yes"/> | verbose="yes"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Cab all files in the htdocs/manual directory into a file called | <p>Cab all files in the htdocs/manual directory into a file called | ||||
manual.cab in the ${dist} directory. Only html files under the | manual.cab in the ${dist} directory. Only html files under the | ||||
directory api are archived, and files with the name todo.html are | directory api are archived, and files with the name todo.html are | ||||
excluded. Output from the cabarc tool is displayed in the build | excluded. Output from the cabarc tool is displayed in the build | ||||
output.</p> | output.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<cab cabfile="${dist}/manual.cab" | <cab cabfile="${dist}/manual.cab" | ||||
verbose="yes"> | verbose="yes"> | ||||
<fileset | <fileset | ||||
@@ -153,7 +153,7 @@ output.</p> | |||||
includes="api/**/*.html" | includes="api/**/*.html" | ||||
excludes="**/todo.html"/> | excludes="**/todo.html"/> | ||||
</cab> | </cab> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>is equivalent to the example above.</p> | <p>is equivalent to the example above.</p> | ||||
</body> | </body> | ||||
@@ -68,11 +68,11 @@ Task to checkin a file | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre><ccmcheckin file="c:/wa/com/foo/MyFile.java" | <pre><ccmcheckin file="c:/wa/com/foo/MyFile.java" | ||||
comment="mycomment"/> | comment="mycomment"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Checks in the file <i>c:/wa/com/foo/MyFile.java</i>. | <p>Checks in the file <i>c:/wa/com/foo/MyFile.java</i>. | ||||
Comment attribute <i>mycomment</i> is added as a task comment. The task | Comment attribute <i>mycomment</i> is added as a task comment. The task | ||||
used is the one set as the default.</p> | used is the one set as the default.</p> | ||||
@@ -114,22 +114,19 @@ Task to perform a Checkout command to Continuus | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre><ccmcheckout file="c:/wa/com/foo/MyFile.java" | |||||
comment="mycomment"/> | |||||
</pre> | |||||
</blockquote> | |||||
<pre><ccmcheckout file="c:/wa/com/foo/MyFile.java" | |||||
comment="mycomment"/></pre> | |||||
<p>Check out the file <i>c:/wa/com/foo/MyFile.java</i>. | <p>Check out the file <i>c:/wa/com/foo/MyFile.java</i>. | ||||
Comment attribute <i>mycomment</i> is added as a task comment | Comment attribute <i>mycomment</i> is added as a task comment | ||||
The used task is the one set as the default.</p> | The used task is the one set as the default.</p> | ||||
<blockquote> | |||||
<pre><ccmcheckout comment="mycomment"> | |||||
<pre><ccmcheckout comment="mycomment"> | |||||
<fileset dir="lib" > | <fileset dir="lib" > | ||||
<include name="**/*.jar"/> | <include name="**/*.jar"/> | ||||
</fileset> | </fileset> | ||||
</ccmcheckout > | |||||
</pre> | |||||
</blockquote> | |||||
</ccmcheckout ></pre> | |||||
<p>Check out all the files in the <i>lib</i> directory having the <i>.jar</i> extension. | <p>Check out all the files in the <i>lib</i> directory having the <i>.jar</i> extension. | ||||
Comment attribute <i>mycomment</i> is added as a task comment | Comment attribute <i>mycomment</i> is added as a task comment | ||||
@@ -162,10 +159,9 @@ Task to perform a check in default task command to Continuus | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre><ccmcheckintask comment="blahblah/> | |||||
</pre> | |||||
</blockquote> | |||||
<pre><ccmcheckintask comment="blahblah/></pre> | |||||
<p>Does a Checkin default task on all the checked out files in the current task.</p> | <p>Does a Checkin default task on all the checked out files in the current task.</p> | ||||
<hr/> | <hr/> | ||||
<h2 id="ccmreconfigure">CCMReconfigure</h2> | <h2 id="ccmreconfigure">CCMReconfigure</h2> | ||||
@@ -200,11 +196,11 @@ Task to perform an reconfigure command to Continuus. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre><ccmreconfigure ccmproject="ANTCCM_TEST#BMO_1" | |||||
<pre><ccmreconfigure ccmproject="ANTCCM_TEST#BMO_1" | |||||
verbose="true"/> | verbose="true"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a Continuus <i>reconfigure</i> on the project <i>ANTCCM_TEST#BMO_1</i>. | <p>Does a Continuus <i>reconfigure</i> on the project <i>ANTCCM_TEST#BMO_1</i>. | ||||
</p> | </p> | ||||
<hr/> | <hr/> | ||||
@@ -255,11 +251,11 @@ Create a Continuus task. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre><ccmcreatetask resolver="${user.name}" | |||||
<pre><ccmcreatetask resolver="${user.name}" | |||||
release="ANTCCM_TEST" comment="blahblah"/> | release="ANTCCM_TEST" comment="blahblah"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Creates a task for the release <i>ANTCCM_TEST</i> with the | <p>Creates a task for the release <i>ANTCCM_TEST</i> with the | ||||
current user as the resolver for this task.</p> | current user as the resolver for this task.</p> | ||||
@@ -202,48 +202,48 @@ or set the <tt>fileext</tt> attribute. The names of common hashing algorithms ca | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<p><b>Example 1</b></p> | <p><b>Example 1</b></p> | ||||
<blockquote><pre><checksum file="foo.bar"/></pre></blockquote> | |||||
<pre><checksum file="foo.bar"/></pre> | |||||
Generates a MD5 checksum for foo.bar and stores the checksum in the destination file | Generates a MD5 checksum for foo.bar and stores the checksum in the destination file | ||||
foo.bar.MD5. foo.bar.MD5 is overwritten only if foo.bar is newer than itself. | foo.bar.MD5. foo.bar.MD5 is overwritten only if foo.bar is newer than itself. | ||||
<p><b>Example 2</b></p> | <p><b>Example 2</b></p> | ||||
<blockquote><pre><checksum file="foo.bar" forceOverwrite="yes"/></pre></blockquote> | |||||
<pre><checksum file="foo.bar" forceOverwrite="yes"/></pre> | |||||
Generates a MD5 checksum for foo.bar and stores the checksum in foo.bar.MD5. | Generates a MD5 checksum for foo.bar and stores the checksum in foo.bar.MD5. | ||||
If foo.bar.MD5 already exists, it is overwritten. | If foo.bar.MD5 already exists, it is overwritten. | ||||
<p><b>Example 3</b></p> | <p><b>Example 3</b></p> | ||||
<blockquote><pre><checksum file="foo.bar" property="foobarMD5"/></pre></blockquote> | |||||
<pre><checksum file="foo.bar" property="foobarMD5"/></pre> | |||||
Generates a MD5 checksum for foo.bar and stores it in the Project Property foobarMD5. | Generates a MD5 checksum for foo.bar and stores it in the Project Property foobarMD5. | ||||
<p><b>Example 4</b></p> | <p><b>Example 4</b></p> | ||||
<blockquote><pre><checksum file="foo.bar" verifyProperty="isMD5ok"/></pre></blockquote> | |||||
<pre><checksum file="foo.bar" verifyProperty="isMD5ok"/></pre> | |||||
Generates a MD5 checksum for foo.bar, compares it against foo.bar.MD5 and sets | Generates a MD5 checksum for foo.bar, compares it against foo.bar.MD5 and sets | ||||
isMD5ok to either true or false, depending upon the result. | isMD5ok to either true or false, depending upon the result. | ||||
<p><b>Example 5</b></p> | <p><b>Example 5</b></p> | ||||
<blockquote><pre><checksum file="foo.bar" algorithm="SHA-512" fileext="asc"/></pre></blockquote> | |||||
<pre><checksum file="foo.bar" algorithm="SHA-512" fileext="asc"/></pre> | |||||
Generates a SHA-512 checksum for foo.bar and stores the checksum in the destination file | Generates a SHA-512 checksum for foo.bar and stores the checksum in the destination file | ||||
foo.bar.asc. foo.bar.asc is overwritten only if foo.bar is newer than itself. | foo.bar.asc. foo.bar.asc is overwritten only if foo.bar is newer than itself. | ||||
<p><b>Example 6</b></p> | <p><b>Example 6</b></p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<checksum file="foo.bar" property="${md5}" verifyProperty="isEqual"/> | <checksum file="foo.bar" property="${md5}" verifyProperty="isEqual"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Generates a MD5 checksum for foo.bar, compares it against the value of the property | Generates a MD5 checksum for foo.bar, compares it against the value of the property | ||||
md5, and sets isEqual to either true or false, depending upon the result. | md5, and sets isEqual to either true or false, depending upon the result. | ||||
<p><b>Example 7</b></p> | <p><b>Example 7</b></p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<checksum> | <checksum> | ||||
<fileset dir="."> | <fileset dir="."> | ||||
<include name="foo*"/> | <include name="foo*"/> | ||||
</fileset> | </fileset> | ||||
</checksum> | </checksum> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Works just like Example 1, but generates a .MD5 file for every file that begins with the name foo. | Works just like Example 1, but generates a .MD5 file for every file that begins with the name foo. | ||||
<p><b>Example 8</b></p> | <p><b>Example 8</b></p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<condition property="isChecksumEqual"> | <condition property="isChecksumEqual"> | ||||
<checksum> | <checksum> | ||||
<fileset dir="."> | <fileset dir="."> | ||||
@@ -251,7 +251,7 @@ Works just like Example 1, but generates a .MD5 file for every file that begins | |||||
</fileset> | </fileset> | ||||
</checksum> | </checksum> | ||||
</condition> | </condition> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Works like Example 4, but only sets isChecksumEqual to true, if the | Works like Example 4, but only sets isChecksumEqual to true, if the | ||||
checksum matches - it will never be set to false. This example | checksum matches - it will never be set to false. This example | ||||
demonstrates use with the Condition task. | demonstrates use with the Condition task. | ||||
@@ -127,22 +127,22 @@ could use as initial value for these experiments.</p> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<chgrp file="${dist}/start.sh" group="coders"/> | <chgrp file="${dist}/start.sh" group="coders"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes the "start.sh" file belong to the coders group on a | <p>makes the "start.sh" file belong to the coders group on a | ||||
UNIX system.</p> | UNIX system.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chgrp group="coders"> | <chgrp group="coders"> | ||||
<fileset dir="${dist}/bin" includes="**/*.sh"/> | <fileset dir="${dist}/bin" includes="**/*.sh"/> | ||||
</chgrp> | </chgrp> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all ".sh" files below <code>${dist}/bin</code> | <p>makes all ".sh" files below <code>${dist}/bin</code> | ||||
belong to the coders group on a UNIX system.</p> | belong to the coders group on a UNIX system.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chgrp group="coders"> | <chgrp group="coders"> | ||||
<fileset dir="shared/sources1"> | <fileset dir="shared/sources1"> | ||||
@@ -151,14 +151,14 @@ belong to the coders group on a UNIX system.</p> | |||||
<fileset refid="other.shared.sources"/> | <fileset refid="other.shared.sources"/> | ||||
</chgrp> | </chgrp> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all files below <code>shared/sources1</code> (except those | <p>makes all files below <code>shared/sources1</code> (except those | ||||
below any directory named trial) belong to the coders group on a UNIX | below any directory named trial) belong to the coders group on a UNIX | ||||
system. In addition all files belonging to a FileSet | system. In addition all files belonging to a FileSet | ||||
with <code>id</code> <code>other.shared.sources</code> get the same | with <code>id</code> <code>other.shared.sources</code> get the same | ||||
group.</p> | group.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chgrp group="webdev" type="file"> | <chgrp group="webdev" type="file"> | ||||
<fileset dir="/web"> | <fileset dir="/web"> | ||||
@@ -170,7 +170,6 @@ group.</p> | |||||
</dirset> | </dirset> | ||||
</chmod> | </chmod> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to | <p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to | ||||
group webdev. Directories beginning with <code>test_</code> also will belong | group webdev. Directories beginning with <code>test_</code> also will belong | ||||
@@ -155,25 +155,23 @@ could use as initial value for these experiments.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<chmod file="${dist}/start.sh" perm="ugo+rx"/> | <chmod file="${dist}/start.sh" perm="ugo+rx"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>makes the "start.sh" file readable and executable for anyone on a | <p>makes the "start.sh" file readable and executable for anyone on a | ||||
UNIX system.</p> | UNIX system.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<chmod file="${dist}/start.sh" perm="700"/> | <chmod file="${dist}/start.sh" perm="700"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>makes the "start.sh" file readable, writable and executable only for the owner on a | <p>makes the "start.sh" file readable, writable and executable only for the owner on a | ||||
UNIX system.</p> | UNIX system.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chmod dir="${dist}/bin" perm="ugo+rx" | <chmod dir="${dist}/bin" perm="ugo+rx" | ||||
includes="**/*.sh"/> | includes="**/*.sh"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all ".sh" files below <code>${dist}/bin</code> | <p>makes all ".sh" files below <code>${dist}/bin</code> | ||||
readable and executable for anyone on a UNIX system.</p> | readable and executable for anyone on a UNIX system.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chmod perm="g+w"> | <chmod perm="g+w"> | ||||
<fileset dir="shared/sources1"> | <fileset dir="shared/sources1"> | ||||
@@ -182,14 +180,11 @@ readable and executable for anyone on a UNIX system.</p> | |||||
<fileset refid="other.shared.sources"/> | <fileset refid="other.shared.sources"/> | ||||
</chmod> | </chmod> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all files below <code>shared/sources1</code> (except those | <p>makes all files below <code>shared/sources1</code> (except those | ||||
below any directory named trial) writable for members of the same | below any directory named trial) writable for members of the same | ||||
group on a UNIX system. In addition all files belonging to a FileSet | group on a UNIX system. In addition all files belonging to a FileSet | ||||
with <code>id</code> <code>other.shared.sources</code> get the same | with <code>id</code> <code>other.shared.sources</code> get the same | ||||
permissions.</p> | permissions.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chmod perm="go-rwx" type="file"> | <chmod perm="go-rwx" type="file"> | ||||
<fileset dir="/web"> | <fileset dir="/web"> | ||||
@@ -201,14 +196,11 @@ permissions.</p> | |||||
</dirset> | </dirset> | ||||
</chmod> | </chmod> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>keeps non-owners from touching cgi scripts, files with a <code>.old</code> | <p>keeps non-owners from touching cgi scripts, files with a <code>.old</code> | ||||
extension or directories beginning with <code>private_</code>. A directory | extension or directories beginning with <code>private_</code>. A directory | ||||
ending in <code>.old</code> or a file beginning with private_ would remain | ending in <code>.old</code> or a file beginning with private_ would remain | ||||
unaffected.</p> | unaffected.</p> | ||||
<h3>Note on maxparallel attribute</h3> | <h3>Note on maxparallel attribute</h3> | ||||
<p> | <p> | ||||
Some shells have a limit of the number of characters that | Some shells have a limit of the number of characters that | ||||
@@ -126,22 +126,20 @@ could use as initial value for these experiments.</p> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<chown file="${dist}/start.sh" owner="coderjoe"/> | <chown file="${dist}/start.sh" owner="coderjoe"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes the "start.sh" file belong to coderjoe on a | <p>makes the "start.sh" file belong to coderjoe on a | ||||
UNIX system.</p> | UNIX system.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chown owner="coderjoe"> | <chown owner="coderjoe"> | ||||
<fileset dir="${dist}/bin" includes="**/*.sh"/> | <fileset dir="${dist}/bin" includes="**/*.sh"/> | ||||
</chown> | </chown> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all ".sh" files below <code>${dist}/bin</code> | <p>makes all ".sh" files below <code>${dist}/bin</code> | ||||
belong to coderjoe on a UNIX system.</p> | belong to coderjoe on a UNIX system.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chown owner="coderjoe"> | <chown owner="coderjoe"> | ||||
<fileset dir="shared/sources1"> | <fileset dir="shared/sources1"> | ||||
@@ -150,14 +148,12 @@ belong to coderjoe on a UNIX system.</p> | |||||
<fileset refid="other.shared.sources"/> | <fileset refid="other.shared.sources"/> | ||||
</chown> | </chown> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes all files below <code>shared/sources1</code> (except those | <p>makes all files below <code>shared/sources1</code> (except those | ||||
below any directory named trial) belong to coderjoe on a UNIX | below any directory named trial) belong to coderjoe on a UNIX | ||||
system. In addition all files belonging to a FileSet | system. In addition all files belonging to a FileSet | ||||
with <code>id</code> <code>other.shared.sources</code> get the same | with <code>id</code> <code>other.shared.sources</code> get the same | ||||
owner.</p> | owner.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<chown owner="webadmin" type="file"> | <chown owner="webadmin" type="file"> | ||||
<fileset dir="/web"> | <fileset dir="/web"> | ||||
@@ -169,8 +165,6 @@ owner.</p> | |||||
</dirset> | </dirset> | ||||
</chmod> | </chmod> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>makes cgi scripts, files with a <code>.old</code> extension or | <p>makes cgi scripts, files with a <code>.old</code> extension or | ||||
directories beginning with <code>private_</code> belong to the user named | directories beginning with <code>private_</code> belong to the user named | ||||
webadmin. A directory ending in <code>.old</code> or a file beginning with | webadmin. A directory ending in <code>.old</code> or a file beginning with | ||||
@@ -121,14 +121,14 @@ Task to perform a "cleartool checkin" command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<cccheckin viewpath="c:/views/viewdir/afile" | <cccheckin viewpath="c:/views/viewdir/afile" | ||||
commentfile="acomment.txt" | commentfile="acomment.txt" | ||||
nowarn="true" | nowarn="true" | ||||
identical="true"/> | identical="true"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>checkin</i> on the file <i>c:/views/viewdir/afile</i>. | <p>Does a ClearCase <i>checkin</i> on the file <i>c:/views/viewdir/afile</i>. | ||||
Comment text from the file <i>acomment.txt</i> is added to ClearCase as a comment. | Comment text from the file <i>acomment.txt</i> is added to ClearCase as a comment. | ||||
All warning messages are suppressed. The file is checked in even if it is | All warning messages are suppressed. The file is checked in even if it is | ||||
@@ -204,7 +204,7 @@ Task to perform a "cleartool checkout" command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<cccheckout viewpath="c:/views/viewdir/afile" | <cccheckout viewpath="c:/views/viewdir/afile" | ||||
reserved="true" | reserved="true" | ||||
@@ -212,7 +212,7 @@ Task to perform a "cleartool checkout" command to ClearCase. | |||||
nowarn="true" | nowarn="true" | ||||
comment="Some comment text"/> | comment="Some comment text"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>checkout</i> on the file <i>c:/views/viewdir/afile</i>. | <p>Does a ClearCase <i>checkout</i> on the file <i>c:/views/viewdir/afile</i>. | ||||
It is checked out as <i>reserved</i> on branch called <i>abranch</i>. All | It is checked out as <i>reserved</i> on branch called <i>abranch</i>. All | ||||
warning messages are suppressed. A <i>Some comment text</i> is added to | warning messages are suppressed. A <i>Some comment text</i> is added to | ||||
@@ -248,12 +248,12 @@ Task to perform a UnCheckout command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccuncheckout viewpath="c:/views/viewdir/afile" | <ccuncheckout viewpath="c:/views/viewdir/afile" | ||||
keepcopy="true"/> | keepcopy="true"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>uncheckout</i> on the file <i>c:/views/viewdir/afile</i>. | <p>Does a ClearCase <i>uncheckout</i> on the file <i>c:/views/viewdir/afile</i>. | ||||
A copy of the file called <i>c:/views/viewdir/afile.keep</i> is kept.</p> | A copy of the file called <i>c:/views/viewdir/afile.keep</i> is kept.</p> | ||||
<hr/> | <hr/> | ||||
@@ -315,7 +315,7 @@ Task to perform an "cleartool update" command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccupdate viewpath="c:/views/viewdir" | <ccupdate viewpath="c:/views/viewdir" | ||||
graphical="false" | graphical="false" | ||||
@@ -324,7 +324,7 @@ Task to perform an "cleartool update" command to ClearCase. | |||||
currenttime="true" | currenttime="true" | ||||
rename="false"/> | rename="false"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>update</i> on the snapshot view directory <i>c:/views/viewdir</i>. | <p>Does a ClearCase <i>update</i> on the snapshot view directory <i>c:/views/viewdir</i>. | ||||
A graphical dialog will be displayed. The output will be logged to | A graphical dialog will be displayed. The output will be logged to | ||||
<i>log.log</i> and it will overwrite any hijacked files. The modified | <i>log.log</i> and it will overwrite any hijacked files. The modified | ||||
@@ -393,13 +393,13 @@ Task to perform a "mklbtype" command to ClearCase. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccmklbtype typename="VERSION_1" | <ccmklbtype typename="VERSION_1" | ||||
ordinary="true" | ordinary="true" | ||||
comment="Development version 1"/> | comment="Development version 1"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>mklbtype</i> to create a label type named <i>VERSION_1</i>. | <p>Does a ClearCase <i>mklbtype</i> to create a label type named <i>VERSION_1</i>. | ||||
It is created as <i>ordinary</i> so it is available only to the current VOB. | It is created as <i>ordinary</i> so it is available only to the current VOB. | ||||
The text <i>Development version 1</i> is added as a comment.</p> | The text <i>Development version 1</i> is added as a comment.</p> | ||||
@@ -462,7 +462,7 @@ Task to perform a "mklabel" command to ClearCase. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccmklabel viewpath="c:/views/viewdir/afile" | <ccmklabel viewpath="c:/views/viewdir/afile" | ||||
comment="Some comment text" | comment="Some comment text" | ||||
@@ -470,7 +470,7 @@ Task to perform a "mklabel" command to ClearCase. | |||||
version="\main\2" | version="\main\2" | ||||
typename="VERSION_1"/> | typename="VERSION_1"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>mklabel</i> on the file <i>c:/views/viewdir/afile</i> under | <p>Does a ClearCase <i>mklabel</i> on the file <i>c:/views/viewdir/afile</i> under | ||||
the main branch for version 2 (<i>\main\2</i>). Text <i>Some comment text</i> is added | the main branch for version 2 (<i>\main\2</i>). Text <i>Some comment text</i> is added | ||||
as a comment. It will <i>recurse</i> all subdirectories. | as a comment. It will <i>recurse</i> all subdirectories. | ||||
@@ -561,14 +561,14 @@ Task to perform a "rmtype" command to ClearCase. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccrmtype typekind="lbtype" | <ccrmtype typekind="lbtype" | ||||
typename="VERSION_1" | typename="VERSION_1" | ||||
commentfile="acomment.txt" | commentfile="acomment.txt" | ||||
rmall="true"/> | rmall="true"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>rmtype</i> to remove a label type (<i>lbtype</i>) named <i>VERSION_1</i>. | <p>Does a ClearCase <i>rmtype</i> to remove a label type (<i>lbtype</i>) named <i>VERSION_1</i>. | ||||
Comment text from the file <i>acomment.txt</i> is added as a comment. All instances of the type | Comment text from the file <i>acomment.txt</i> is added as a comment. All instances of the type | ||||
are removed, including the type object itself.</p> | are removed, including the type object itself.</p> | ||||
@@ -627,12 +627,12 @@ Task to perform a "cleartool lock" command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<cclock | <cclock | ||||
objsel="stream:Application_Integration@\MyProject_PVOB"/> | objsel="stream:Application_Integration@\MyProject_PVOB"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>lock</i> on the object <i>stream:Application_Integration@\MyProject_PVOB</i>.</p> | <p>Does a ClearCase <i>lock</i> on the object <i>stream:Application_Integration@\MyProject_PVOB</i>.</p> | ||||
<hr> | <hr> | ||||
<h2 id="ccunlock">CCUnlock</h2> | <h2 id="ccunlock">CCUnlock</h2> | ||||
@@ -674,12 +674,12 @@ Task to perform a "cleartool unlock" command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccunlock | <ccunlock | ||||
objsel="stream:Application_Integration@\MyProject_PVOB"/> | objsel="stream:Application_Integration@\MyProject_PVOB"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>unlock</i> on the object <i>stream:Application_Integration@\MyProject_PVOB</i>.</p> | <p>Does a ClearCase <i>unlock</i> on the object <i>stream:Application_Integration@\MyProject_PVOB</i>.</p> | ||||
<hr> | <hr> | ||||
<h2 id="ccmkbl">CCMkbl</h2> | <h2 id="ccmkbl">CCMkbl</h2> | ||||
@@ -736,7 +736,7 @@ Task to perform a "cleartool mkbl" command to ClearCase. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccmkbl | <ccmkbl | ||||
baselinerootname="Application_Baseline_AUTO" | baselinerootname="Application_Baseline_AUTO" | ||||
@@ -744,7 +744,7 @@ Task to perform a "cleartool mkbl" command to ClearCase. | |||||
full="no" | full="no" | ||||
viewpath="v:\ApplicationCC"/> | viewpath="v:\ApplicationCC"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>mkbl</i> on the Integration view at <i>v:\ApplicationCC</i> | <p>Does a ClearCase <i>mkbl</i> on the Integration view at <i>v:\ApplicationCC</i> | ||||
even if it is <i>identical</i> to a previous baseline. The new baseline with be | even if it is <i>identical</i> to a previous baseline. The new baseline with be | ||||
incremental and named "Application_Baseline_AUTO".</p> | incremental and named "Application_Baseline_AUTO".</p> | ||||
@@ -807,13 +807,13 @@ Task to perform a "cleartool mkattr" command to ClearCase.<br> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccmkattr viewpath="c:/views/viewdir/afile" | <ccmkattr viewpath="c:/views/viewdir/afile" | ||||
typename="BugFix" | typename="BugFix" | ||||
typevalue="34445"/> | typevalue="34445"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>mkattr</i> on the file <i>c:/views/viewdir/afile</i> and | <p>Does a ClearCase <i>mkattr</i> on the file <i>c:/views/viewdir/afile</i> and | ||||
attaches the attribute <i>BugFix</i> with a value of <i>34445</i> to it.</p> | attaches the attribute <i>BugFix</i> with a value of <i>34445</i> to it.</p> | ||||
<hr/> | <hr/> | ||||
@@ -854,13 +854,13 @@ Task to perform a "cleartool mkdir" command to ClearCase.<br> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccmkdir viewpath="c:/views/viewdir/adir" | <ccmkdir viewpath="c:/views/viewdir/adir" | ||||
nocheckout="true" | nocheckout="true" | ||||
comment="Some comment text"/> | comment="Some comment text"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>mkdir</i> on the dir <i>c:/views/viewdir/adir</i> and | <p>Does a ClearCase <i>mkdir</i> on the dir <i>c:/views/viewdir/adir</i> and | ||||
does not automatically check it out.</p> | does not automatically check it out.</p> | ||||
<hr/> | <hr/> | ||||
@@ -927,14 +927,14 @@ Task to perform a "cleartool mkelem" command to ClearCase.<br> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<ccmkelem viewpath="c:/views/viewdir/afile" | <ccmkelem viewpath="c:/views/viewdir/afile" | ||||
eltype="text_file" | eltype="text_file" | ||||
checkin="true" | checkin="true" | ||||
comment="Some comment text"/> | comment="Some comment text"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a ClearCase <i>mkelem</i> on the file <i>c:/views/viewdir/afile</i> with | <p>Does a ClearCase <i>mkelem</i> on the file <i>c:/views/viewdir/afile</i> with | ||||
element type <i>text_file</i>. It also checks in the file after creation.</p> | element type <i>text_file</i>. It also checks in the file after creation.</p> | ||||
@@ -335,10 +335,10 @@ that is "true","yes", or "on"</p> | |||||
<td valign="top" align="center">Yes</td> | <td valign="top" align="center">Yes</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<istrue value="${someproperty}"/> | <istrue value="${someproperty}"/> | ||||
<istrue value="false"/> | <istrue value="false"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="isfalse">isfalse</h4> | <h4 id="isfalse">isfalse</h4> | ||||
<p>Tests whether a string is not true, the negation of <istrue> | <p>Tests whether a string is not true, the negation of <istrue> | ||||
@@ -355,10 +355,10 @@ that is "true","yes", or "on"</p> | |||||
<td valign="top" align="center">Yes</td> | <td valign="top" align="center">Yes</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<isfalse value="${someproperty}"/> | <isfalse value="${someproperty}"/> | ||||
<isfalse value="false"/> | <isfalse value="false"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="isreference">isreference</h4> | <h4 id="isreference">isreference</h4> | ||||
<p>Test whether a given reference has been defined in this project and | <p>Test whether a given reference has been defined in this project and | ||||
@@ -449,11 +449,11 @@ that is "true","yes", or "on"</p> | |||||
<p> | <p> | ||||
Example usage: | Example usage: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<isfileselected file="a.xml"> | <isfileselected file="a.xml"> | ||||
<date datetime="06/28/2000 2:02 pm" when="equal"/> | <date datetime="06/28/2000 2:02 pm" when="equal"/> | ||||
</isfileselected> | </isfileselected> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="typefound">typefound</h4> | <h4 id="typefound">typefound</h4> | ||||
@@ -486,10 +486,10 @@ tasks, datatypes, scriptdefs, macrodefs and presetdefs.</p> | |||||
<p> | <p> | ||||
Example usages: | Example usages: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<typefound name="junit"/> | <typefound name="junit"/> | ||||
<typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/> | <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="scriptcondition">scriptcondition</h4> | <h4 id="scriptcondition">scriptcondition</h4> | ||||
@@ -578,12 +578,12 @@ Alternatively, <code>self.value</code> can be used to set the evaluation result. | |||||
<p> | <p> | ||||
Example: | Example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<scriptcondition language="javascript" | <scriptcondition language="javascript" | ||||
value="true"> | value="true"> | ||||
self.setValue(false); | self.setValue(false); | ||||
</scriptcondition> | </scriptcondition> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Sets the default value of the condition to true, then in the script, | Sets the default value of the condition to true, then in the script, | ||||
sets the value to false. This condition always evaluates to "false" | sets the value to false. This condition always evaluates to "false" | ||||
@@ -618,18 +618,18 @@ attempting to set the appropriate property/feature/</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<parsersupports feature="http://xml.org/sax/features/namespaces"/> | <parsersupports feature="http://xml.org/sax/features/namespaces"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Check for namespace support. All SAX2 parsers should have this. | Check for namespace support. All SAX2 parsers should have this. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<or> | <or> | ||||
<parsersupports | <parsersupports | ||||
feature="http://apache.org/xml/features/validation/schema"/> | feature="http://apache.org/xml/features/validation/schema"/> | ||||
<parsersupports | <parsersupports | ||||
feature="http://java.sun.com/xml/jaxp/properties/schemaSource"/> | feature="http://java.sun.com/xml/jaxp/properties/schemaSource"/> | ||||
</or> | </or> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Check for XML Schema support. | Check for XML Schema support. | ||||
@@ -691,21 +691,21 @@ not reachable on other ports (i.e. port 80), because of firewalls. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<condition property="offline"> | <condition property="offline"> | ||||
<isreachable url="http://ibiblio.org/maven/" /> | <isreachable url="http://ibiblio.org/maven/" /> | ||||
</condition> | </condition> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Probe for the maven repository being reachable. | Probe for the maven repository being reachable. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<condition property="offline"> | <condition property="offline"> | ||||
<isreachable host="ibiblio.org" timeout="10" /> | <isreachable host="ibiblio.org" timeout="10" /> | ||||
</condition> | </condition> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Probe for the maven repository being reachable using the hostname, ten second timeout.. | Probe for the maven repository being reachable using the hostname, ten second timeout.. | ||||
@@ -717,14 +717,14 @@ Probe for the maven repository being reachable using the hostname, ten second ti | |||||
<em>Since Ant 1.6.3</em> | <em>Since Ant 1.6.3</em> | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<length string=" foo " trim="true" length="3" /> | <length string=" foo " trim="true" length="3" /> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Verify a string is of a certain length.</p> | <p>Verify a string is of a certain length.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<length file="foo" when="greater" length="0" /> | <length file="foo" when="greater" length="0" /> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Verify that file <i>foo</i> is not empty.</p> | <p>Verify that file <i>foo</i> is not empty.</p> | ||||
<h4 id="isfailure">isfailure</h4> | <h4 id="isfailure">isfailure</h4> | ||||
@@ -753,9 +753,9 @@ Probe for the maven repository being reachable using the hostname, ten second ti | |||||
<em>Since Ant 1.7</em> | <em>Since Ant 1.7</em> | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<resourcecount refid="myresourcecollection" when="greater" count="0" /> | <resourcecount refid="myresourcecollection" when="greater" count="0" /> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Verify that a resource collection is not empty.</p> | <p>Verify that a resource collection is not empty.</p> | ||||
<h4 id="resourcesmatch">resourcesmatch</h4> | <h4 id="resourcesmatch">resourcesmatch</h4> | ||||
@@ -870,9 +870,9 @@ must match. <em>Since Ant 1.7</em> | |||||
There is also a nested <classpath> element, which can be used to specify | There is also a nested <classpath> element, which can be used to specify | ||||
a classpath. | a classpath. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<hasmethod classname="java.util.ArrayList" method="trimToSize" /> | <hasmethod classname="java.util.ArrayList" method="trimToSize" /> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Looks for the method trimToSize in the ArrayList class.</p> | <p>Looks for the method trimToSize in the ArrayList class.</p> | ||||
@@ -934,29 +934,29 @@ must match. <em>Since Ant 1.7</em> | |||||
<p> | <p> | ||||
An example: | An example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<condition property="legal-password"> | <condition property="legal-password"> | ||||
<matches pattern="[1-9]" string="${user-input}"/> | <matches pattern="[1-9]" string="${user-input}"/> | ||||
</condition> | </condition> | ||||
<fail message="Your password should at least contain one number" | <fail message="Your password should at least contain one number" | ||||
unless="legal-password"/> | unless="legal-password"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The following example sets the property "ok" if | The following example sets the property "ok" if | ||||
the property "input" is three characters long, starting | the property "input" is three characters long, starting | ||||
with 'a' and ending with 'b'. | with 'a' and ending with 'b'. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<condition property="ok"> | <condition property="ok"> | ||||
<matches string="${input}" pattern="^a.b$"/> | <matches string="${input}" pattern="^a.b$"/> | ||||
</condition> | </condition> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The following defines a reference regular expression for | The following defines a reference regular expression for | ||||
matching dates and then uses antunit to check if the | matching dates and then uses antunit to check if the | ||||
property "today" is in the correct format: | property "today" is in the correct format: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<regexp id="date.pattern" pattern="^[0123]\d-[01]\d-[12]\d\d\d$"/> | <regexp id="date.pattern" pattern="^[0123]\d-[01]\d-[12]\d\d\d$"/> | ||||
<au:assertTrue xmlns:au="antlib:org.apache.ant.antunit"> | <au:assertTrue xmlns:au="antlib:org.apache.ant.antunit"> | ||||
@@ -964,12 +964,12 @@ must match. <em>Since Ant 1.7</em> | |||||
<regexp refid="date.pattern"/> | <regexp refid="date.pattern"/> | ||||
</matches> | </matches> | ||||
</au:assertTrue> | </au:assertTrue> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The following example shows the use of the singleline and the casesensitive | The following example shows the use of the singleline and the casesensitive | ||||
flags. | flags. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<au:assertTrue> | <au:assertTrue> | ||||
<matches string="AB${line.separator}C" pattern="^ab.*C$" | <matches string="AB${line.separator}C" pattern="^ab.*C$" | ||||
casesensitive="false" | casesensitive="false" | ||||
@@ -980,7 +980,7 @@ must match. <em>Since Ant 1.7</em> | |||||
casesensitive="false" | casesensitive="false" | ||||
singleline="false"/> | singleline="false"/> | ||||
</au:assertFalse> | </au:assertFalse> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="antversion">antversion</h4> | <h4 id="antversion">antversion</h4> | ||||
<p>This condition is identical to the <a | <p>This condition is identical to the <a | ||||
@@ -1022,9 +1022,9 @@ is redundant and will be ignored.</p> | |||||
<p> | <p> | ||||
An example: | An example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<hasfreespace partition="c:" needed="100M"/> | <hasfreespace partition="c:" needed="100M"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="islastmodified">islastmodified</h4> | <h4 id="islastmodified">islastmodified</h4> | ||||
@@ -1070,11 +1070,11 @@ is redundant and will be ignored.</p> | |||||
<p> | <p> | ||||
An example: | An example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-before"> | <islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-before"> | ||||
<file file="${file}"/> | <file file="${file}"/> | ||||
</islastmodified> | </islastmodified> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="resourceexists">resourceexists</h4> | <h4 id="resourceexists">resourceexists</h4> | ||||
@@ -1085,11 +1085,11 @@ is redundant and will be ignored.</p> | |||||
<p> | <p> | ||||
An example: | An example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<resourceexists> | <resourceexists> | ||||
<file file="${file}"/> | <file file="${file}"/> | ||||
</resourceexists> | </resourceexists> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="javaversion">javaversion</h4> | <h4 id="javaversion">javaversion</h4> | ||||
@@ -1122,9 +1122,9 @@ is redundant and will be ignored.</p> | |||||
An example: | An example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<javaversion atleast="9"/> | <javaversion atleast="9"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will evaluate to true if the current JVM is Java 9 or above.</p> | <p>will evaluate to true if the current JVM is Java 9 or above.</p> | ||||
@@ -62,10 +62,8 @@ does not exist.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<p><code><copyfile src="test.java" dest="subdir/test.java"/></code></p> | |||||
<p><code><copyfile src="${src}/index.html" dest="${dist}/help/index.html"/></code></p> | |||||
</blockquote> | |||||
<pre> <copyfile src="test.java" dest="subdir/test.java"/> | |||||
<copyfile src="${src}/index.html" dest="${dist}/help/index.html"/></pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -132,7 +132,7 @@ Multiple <code><targetfilelist></code> filelists may be specified. | |||||
</p> | </p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> <pre> | |||||
<pre> | |||||
<dependset> | <dependset> | ||||
<srcfilelist | <srcfilelist | ||||
dir = "${dtd.dir}" | dir = "${dtd.dir}" | ||||
@@ -147,7 +147,6 @@ Multiple <code><targetfilelist></code> filelists may be specified. | |||||
dir = "${output.dir}" | dir = "${output.dir}" | ||||
includes = "**/*.html"/> | includes = "**/*.html"/> | ||||
</dependset></pre> | </dependset></pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
In this example derived HTML files in the ${output.dir} directory | In this example derived HTML files in the ${output.dir} directory | ||||
@@ -97,46 +97,36 @@ shortcuts that use <tt>propertyset</tt>s internally. | |||||
<p><em>since Ant 1.6</em>.</p> | <p><em>since Ant 1.6</em>.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<echoproperties/> | |||||
</pre></blockquote> | |||||
<pre><echoproperties/></pre> | |||||
<p>Report the current properties to the log.</p> | <p>Report the current properties to the log.</p> | ||||
<blockquote><pre> | |||||
<echoproperties destfile="my.properties"/> | |||||
</pre></blockquote> | |||||
<pre><echoproperties destfile="my.properties"/></pre> | |||||
<p>Report the current properties to the file "my.properties", and will | <p>Report the current properties to the file "my.properties", and will | ||||
fail the build if the file could not be created or written to.</p> | fail the build if the file could not be created or written to.</p> | ||||
<blockquote><pre> | |||||
<echoproperties destfile="my.properties" failonerror="false"/> | |||||
</pre></blockquote> | |||||
<pre><echoproperties destfile="my.properties" failonerror="false"/></pre> | |||||
<p>Report the current properties to the file "my.properties", and will | <p>Report the current properties to the file "my.properties", and will | ||||
log a message if the file could not be created or written to, but will still | log a message if the file could not be created or written to, but will still | ||||
allow the build to continue.</p> | allow the build to continue.</p> | ||||
<blockquote><pre> | |||||
<echoproperties prefix="java."/> | |||||
</pre></blockquote> | |||||
<pre><echoproperties prefix="java."/></pre> | |||||
<p>List all properties beginning with "java."</p> | <p>List all properties beginning with "java."</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<echoproperties> | <echoproperties> | ||||
<propertyset> | <propertyset> | ||||
<propertyref prefix="java."/> | <propertyref prefix="java."/> | ||||
</propertyset> | </propertyset> | ||||
</echoproperties> | </echoproperties> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>This again lists all properties beginning with "java." using a nested | <p>This again lists all properties beginning with "java." using a nested | ||||
<tt></propertyset></tt> which is an equivalent but longer way.</p> | <tt></propertyset></tt> which is an equivalent but longer way.</p> | ||||
<blockquote><pre> | |||||
<echoproperties regex=".*ant.*"/> | |||||
</pre></blockquote> | |||||
<pre><echoproperties regex=".*ant.*"/></pre> | |||||
<p>Lists all properties that contain "ant" in their names. | <p>Lists all properties that contain "ant" in their names. | ||||
The equivalent snippet with <tt></propertyset></tt> is:</p> | The equivalent snippet with <tt></propertyset></tt> is:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<echoproperties> | <echoproperties> | ||||
<propertyset> | <propertyset> | ||||
<propertyref regex=".*ant.*"/> | <propertyref regex=".*ant.*"/> | ||||
</propertyset> | </propertyset> | ||||
</echoproperties> | </echoproperties> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -60,7 +60,6 @@ types listed in the environment variable PATHEXT. That is only used by the shell | |||||
One normally needs to execute the command shell executable <code>cmd</code> | One normally needs to execute the command shell executable <code>cmd</code> | ||||
using the <code>/c</code> switch. | using the <code>/c</code> switch. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<target name="help"> | <target name="help"> | ||||
<exec executable="cmd"> | <exec executable="cmd"> | ||||
@@ -69,7 +68,7 @@ types listed in the environment variable PATHEXT. That is only used by the shell | |||||
<arg value="-p"/> | <arg value="-p"/> | ||||
</exec> | </exec> | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>A common problem is not having the executable on the PATH. In case you get an error | <p>A common problem is not having the executable on the PATH. In case you get an error | ||||
message <tt>Cannot run program "...":CreateProcess error=2. The system cannot find | message <tt>Cannot run program "...":CreateProcess error=2. The system cannot find | ||||
@@ -79,7 +78,6 @@ to the PATH (<tt>set PATH=%PATH%;dirOfProgram</tt>) or specify the absolute path | |||||
<tt>executable</tt> attribute in your buildfile. | <tt>executable</tt> attribute in your buildfile. | ||||
</p> | </p> | ||||
<h4>Cygwin Users</h4> | <h4>Cygwin Users</h4> | ||||
<p>The <code><exec></code> task will not understand paths such as /bin/sh | <p>The <code><exec></code> task will not understand paths such as /bin/sh | ||||
for the executable parameter. This is because the Java VM in which Ant is | for the executable parameter. This is because the Java VM in which Ant is | ||||
@@ -116,27 +114,20 @@ set to <code>true</code> instead as this task will follow the VM's | |||||
interpretation of exit codes.</p> | interpretation of exit codes.</p> | ||||
<h4>RedHat S/390 Users</h4> | <h4>RedHat S/390 Users</h4> | ||||
<p>It has been <a | <p>It has been <a | ||||
href="http://listserv.uark.edu/scripts/wa.exe?A1=ind0404&L=vmesa-l#33">reported | href="http://listserv.uark.edu/scripts/wa.exe?A1=ind0404&L=vmesa-l#33">reported | ||||
on the VMESA-LISTSERV</a> that shell scripts invoked via the Ant Exec | on the VMESA-LISTSERV</a> that shell scripts invoked via the Ant Exec | ||||
task must have their interpreter specified, i.e., the scripts must | task must have their interpreter specified, i.e., the scripts must | ||||
start with something like:</p> | start with something like:</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
#!/bin/bash | #!/bin/bash | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>or the task will fail as follows:</p> | <p>or the task will fail as follows:</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
[exec] Warning: UNIXProcess.forkAndExec native error: Exec format error | [exec] Warning: UNIXProcess.forkAndExec native error: Exec format error | ||||
[exec] Result: 255 | [exec] Result: 255 | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<h4 id="background">Running Ant as a background process on Unix(-like) systems</h4> | <h4 id="background">Running Ant as a background process on Unix(-like) systems</h4> | ||||
@@ -318,12 +309,11 @@ start with something like:</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<exec dir="${src}" executable="cmd.exe" os="Windows 2000" output="dir.txt"> | <exec dir="${src}" executable="cmd.exe" os="Windows 2000" output="dir.txt"> | ||||
<arg line="/c dir"/> | <arg line="/c dir"/> | ||||
</exec></pre> | </exec></pre> | ||||
</blockquote> | |||||
<h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
<h4>arg</h4> | <h4>arg</h4> | ||||
<p>Command line arguments should be specified as nested | <p>Command line arguments should be specified as nested | ||||
@@ -398,34 +388,31 @@ it is not on the path. Any time you see such an error from any Ant task, it is | |||||
usually not an Ant bug, but some configuration problem on your machine. | usually not an Ant bug, but some configuration problem on your machine. | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<exec executable="emacs"> | <exec executable="emacs"> | ||||
<env key="DISPLAY" value=":1.0"/> | <env key="DISPLAY" value=":1.0"/> | ||||
</exec> | </exec> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>starts <code>emacs</code> on display 1 of the X Window System.</p> | <p>starts <code>emacs</code> on display 1 of the X Window System.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property environment="env"/> | <property environment="env"/> | ||||
<exec ... > | <exec ... > | ||||
<env key="PATH" path="${env.PATH}:${basedir}/bin"/> | <env key="PATH" path="${env.PATH}:${basedir}/bin"/> | ||||
</exec> | </exec> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>adds <code>${basedir}/bin</code> to the <code>PATH</code> of the | <p>adds <code>${basedir}/bin</code> to the <code>PATH</code> of the | ||||
system command.</p> | system command.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property name="browser" location="C:/Program Files/Internet Explorer/iexplore.exe"/> | <property name="browser" location="C:/Program Files/Internet Explorer/iexplore.exe"/> | ||||
<property name="file" location="ant/docs/manual/index.html"/> | <property name="file" location="ant/docs/manual/index.html"/> | ||||
<exec executable="${browser}" spawn="true"> | <exec executable="${browser}" spawn="true"> | ||||
<arg value="${file}"/> | <arg value="${file}"/> | ||||
</exec> | </exec> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Starts the <i>${browser}</i> with the specified <i>${file}</i> and end the | <p>Starts the <i>${browser}</i> with the specified <i>${file}</i> and end the | ||||
Ant process. The browser will remain.</p> | Ant process. The browser will remain.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<exec executable="cat"> | <exec executable="cat"> | ||||
<redirector outputproperty="redirector.out" | <redirector outputproperty="redirector.out" | ||||
errorproperty="redirector.err" | errorproperty="redirector.err" | ||||
@@ -437,7 +424,7 @@ Ant process. The browser will remain.</p> | |||||
<errormapper type="merge" to="redirector.err"/> | <errormapper type="merge" to="redirector.err"/> | ||||
</redirector> | </redirector> | ||||
</exec> | </exec> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Sends the string "blah before blah" to the "cat" executable, | Sends the string "blah before blah" to the "cat" executable, | ||||
using an <a href="../Types/filterchain.html"><inputfilterchain></a> | using an <a href="../Types/filterchain.html"><inputfilterchain></a> | ||||
@@ -102,13 +102,12 @@ with "<code>\,</code>".</p> | |||||
<p>The following two examples are identical:</p> | <p>The following two examples are identical:</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<genkey alias="apache-group" storepass="secret" | <genkey alias="apache-group" storepass="secret" | ||||
dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/> | dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<genkey alias="apache-group" storepass="secret" > | <genkey alias="apache-group" storepass="secret" > | ||||
<dname> | <dname> | ||||
<param name="CN" value="Ant Group"/> | <param name="CN" value="Ant Group"/> | ||||
@@ -117,7 +116,6 @@ with "<code>\,</code>".</p> | |||||
<param name="C" value="US"/> | <param name="C" value="US"/> | ||||
</dname> | </dname> | ||||
</genkey></pre> | </genkey></pre> | ||||
</blockquote> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -219,38 +219,38 @@ nested inside the Draw object.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<image destdir="samples/low" overwrite="yes"> | <image destdir="samples/low" overwrite="yes"> | ||||
<fileset dir="samples/full"> | <fileset dir="samples/full"> | ||||
<include name="**/*.jpg"/> | <include name="**/*.jpg"/> | ||||
</fileset> | </fileset> | ||||
<scale width="160" height="160" proportions="fit"/> | <scale width="160" height="160" proportions="fit"/> | ||||
</image> | </image> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Create thumbnails of my images and make sure they all fit within the 160x160 size whether the | <p>Create thumbnails of my images and make sure they all fit within the 160x160 size whether the | ||||
image is portrait or landscape.</p> | image is portrait or landscape.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<image srcdir="src" includes="*.png"> | <image srcdir="src" includes="*.png"> | ||||
<scale proportions="width" width="40"/> | <scale proportions="width" width="40"/> | ||||
</image> | </image> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Creates a thumbnail for all PNG-files in <i>src</i> in the size of 40 pixel keeping the proportions | <p>Creates a thumbnail for all PNG-files in <i>src</i> in the size of 40 pixel keeping the proportions | ||||
and stores the <i>src</i>.</p> | and stores the <i>src</i>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<image srcdir="src" destdir="dest" includes="*.png"> | <image srcdir="src" destdir="dest" includes="*.png"> | ||||
<scale proportions="width" width="40"/> | <scale proportions="width" width="40"/> | ||||
</image> | </image> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Same as above but stores the result in <i>dest</i>.</p> | <p>Same as above but stores the result in <i>dest</i>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<image srcdir="src" destdir="dest" includes="*.png"> | <image srcdir="src" destdir="dest" includes="*.png"> | ||||
<scale proportions="width" width="40"/> | <scale proportions="width" width="40"/> | ||||
<globmapper from="*" to="scaled-*"/> | <globmapper from="*" to="scaled-*"/> | ||||
</image> | </image> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Same as above but stores the resulting file names will be prefixed | <p>Same as above but stores the resulting file names will be prefixed | ||||
by "scaled-".</p> | by "scaled-".</p> | ||||
@@ -440,39 +440,38 @@ depend on your manifest:</p> | |||||
nested <provider> elements may be used. | nested <provider> elements may be used. | ||||
</p> | </p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<h4>Simple</h4> | <h4>Simple</h4> | ||||
<blockquote><pre> <jar destfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre></blockquote> | |||||
<pre> <jar destfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | |||||
<p>jars all files in the <code>${build}/classes</code> directory into a file | <p>jars all files in the <code>${build}/classes</code> directory into a file | ||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p> | called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p> | ||||
<h4>With filters</h4> | <h4>With filters</h4> | ||||
<blockquote><pre> <jar destfile="${dist}/lib/app.jar" | |||||
<pre> <jar destfile="${dist}/lib/app.jar" | |||||
basedir="${build}/classes" | basedir="${build}/classes" | ||||
excludes="**/Test.class"/></pre></blockquote> | |||||
excludes="**/Test.class"/></pre> | |||||
<p>jars all files in the <code>${build}/classes</code> directory into a file | <p>jars all files in the <code>${build}/classes</code> directory into a file | ||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files | called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files | ||||
with the name <code>Test.class</code> are excluded.</p> | with the name <code>Test.class</code> are excluded.</p> | ||||
<blockquote><pre> <jar destfile="${dist}/lib/app.jar" | |||||
<pre> <jar destfile="${dist}/lib/app.jar" | |||||
basedir="${build}/classes" | basedir="${build}/classes" | ||||
includes="mypackage/test/**" | includes="mypackage/test/**" | ||||
excludes="**/Test.class"/></pre></blockquote> | |||||
excludes="**/Test.class"/></pre> | |||||
<p>jars all files in the <code>${build}/classes</code> directory into a file | <p>jars all files in the <code>${build}/classes</code> directory into a file | ||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only | called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only | ||||
files under the directory <code>mypackage/test</code> are used, and files with | files under the directory <code>mypackage/test</code> are used, and files with | ||||
the name <code>Test.class</code> are excluded.</p> | the name <code>Test.class</code> are excluded.</p> | ||||
<h4>Multiple filesets</h4> | <h4>Multiple filesets</h4> | ||||
<blockquote><pre> <jar destfile="${dist}/lib/app.jar"> | |||||
<pre> <jar destfile="${dist}/lib/app.jar"> | |||||
<fileset dir="${build}/classes" | <fileset dir="${build}/classes" | ||||
excludes="**/Test.class"/> | excludes="**/Test.class"/> | ||||
<fileset dir="${src}/resources"/> | <fileset dir="${src}/resources"/> | ||||
</jar></pre></blockquote> | |||||
</jar></pre> | |||||
<p>jars all files in the <code>${build}/classes</code> directory and also | <p>jars all files in the <code>${build}/classes</code> directory and also | ||||
in the <code>${src}/resources</code> directory together into a file | in the <code>${src}/resources</code> directory together into a file | ||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. | called <code>app.jar</code> in the <code>${dist}/lib</code> directory. | ||||
@@ -484,20 +483,20 @@ by Java).</p> | |||||
<h4>Merging archives</h4> | <h4>Merging archives</h4> | ||||
<blockquote><pre> <jar destfile="build/main/checksites.jar"> | |||||
<pre> <jar destfile="build/main/checksites.jar"> | |||||
<fileset dir="build/main/classes"/> | <fileset dir="build/main/classes"/> | ||||
<zipfileset includes="**/*.class" src="lib/main/some.jar"/> | <zipfileset includes="**/*.class" src="lib/main/some.jar"/> | ||||
<manifest> | <manifest> | ||||
<attribute name="Main-Class" | <attribute name="Main-Class" | ||||
value="com.acme.checksites.Main"/> | value="com.acme.checksites.Main"/> | ||||
</manifest> | </manifest> | ||||
</jar></pre></blockquote> | |||||
</jar></pre> | |||||
<p> | <p> | ||||
Creates an executable jar file with a main class "com.acme.checksites.Main", and | Creates an executable jar file with a main class "com.acme.checksites.Main", and | ||||
embeds all the classes from the jar <code>lib/main/some.jar</code>. | embeds all the classes from the jar <code>lib/main/some.jar</code>. | ||||
</p> | </p> | ||||
<blockquote><pre> <jar destfile="build/main/checksites.jar"> | |||||
<pre> <jar destfile="build/main/checksites.jar"> | |||||
<fileset dir="build/main/classes"/> | <fileset dir="build/main/classes"/> | ||||
<restrict> | <restrict> | ||||
<name name="**/*.class"/> | <name name="**/*.class"/> | ||||
@@ -511,14 +510,14 @@ by Java).</p> | |||||
<attribute name="Main-Class" | <attribute name="Main-Class" | ||||
value="com.acme.checksites.Main"/> | value="com.acme.checksites.Main"/> | ||||
</manifest> | </manifest> | ||||
</jar></pre></blockquote> | |||||
</jar></pre> | |||||
<p> | <p> | ||||
Creates an executable jar file with a main class "com.acme.checksites.Main", and | Creates an executable jar file with a main class "com.acme.checksites.Main", and | ||||
embeds all the classes from all the jars in <code>lib/main</code>. | embeds all the classes from all the jars in <code>lib/main</code>. | ||||
</p> | </p> | ||||
<h4>Inline manifest</h4> | <h4>Inline manifest</h4> | ||||
<blockquote><pre> <jar destfile="test.jar" basedir="."> | |||||
<pre> <jar destfile="test.jar" basedir="."> | |||||
<include name="build"/> | <include name="build"/> | ||||
<manifest> | <manifest> | ||||
<!-- If this is an Applet or Web Start application, include | <!-- If this is an Applet or Web Start application, include | ||||
@@ -536,14 +535,14 @@ by Java).</p> | |||||
<attribute name="Sealed" value="false"/> | <attribute name="Sealed" value="false"/> | ||||
</section> | </section> | ||||
</manifest> | </manifest> | ||||
</jar></pre></blockquote> | |||||
</jar></pre> | |||||
<p> | <p> | ||||
This is an example of an inline manifest specification including the version of the build | This is an example of an inline manifest specification including the version of the build | ||||
program (Implementation-Version). Note that the Built-By attribute will take the value of the Ant | program (Implementation-Version). Note that the Built-By attribute will take the value of the Ant | ||||
property ${user.name}. The manifest produced by the above would look like this: | property ${user.name}. The manifest produced by the above would look like this: | ||||
</p> | </p> | ||||
<blockquote><pre>Manifest-Version: 1.0 | |||||
<pre>Manifest-Version: 1.0 | |||||
Permissions: sandbox | Permissions: sandbox | ||||
Codebase: example.com | Codebase: example.com | ||||
Built-By: conor | Built-By: conor | ||||
@@ -553,7 +552,7 @@ Implementation-Version: 1.0.0beta2 | |||||
Created-By: Apache Ant 1.9.2 | Created-By: Apache Ant 1.9.2 | ||||
Name: common/MyClass.class | Name: common/MyClass.class | ||||
Sealed: false</pre></blockquote> | |||||
Sealed: false</pre> | |||||
<h4>Service Provider</h4> | <h4>Service Provider</h4> | ||||
@@ -561,20 +560,18 @@ Sealed: false</pre></blockquote> | |||||
The following shows how to create a jar file specifying a service | The following shows how to create a jar file specifying a service | ||||
with an implementation of the JDK 6 scripting interface: | with an implementation of the JDK 6 scripting interface: | ||||
</p> | </p> | ||||
<blockquote><pre><jar destfile="pinky.jar"> | |||||
<pre><jar destfile="pinky.jar"> | |||||
<fileset dir="build/classes"/> | <fileset dir="build/classes"/> | ||||
<service type="javax.script.ScriptEngineFactory" | <service type="javax.script.ScriptEngineFactory" | ||||
provider="org.acme.PinkyLanguage"/> | provider="org.acme.PinkyLanguage"/> | ||||
</jar> | </jar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The following shows how to create a jar file specifying a service | The following shows how to create a jar file specifying a service | ||||
with two implementations of the JDK 6 scripting interface: | with two implementations of the JDK 6 scripting interface: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<jar destfile="pinkyandbrain.jar"> | <jar destfile="pinkyandbrain.jar"> | ||||
<fileset dir="classes"/> | <fileset dir="classes"/> | ||||
<service type="javax.script.ScriptEngineFactory"> | <service type="javax.script.ScriptEngineFactory"> | ||||
@@ -582,8 +579,7 @@ Sealed: false</pre></blockquote> | |||||
<provider classname="org.acme.BrainLanguage"/> | <provider classname="org.acme.BrainLanguage"/> | ||||
</service> | </service> | ||||
</jar> | </jar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4> | <h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4> | ||||
<p> | <p> | ||||
@@ -601,7 +597,7 @@ Sealed: false</pre></blockquote> | |||||
<code>${java.classes}</code> and the Java 9 classes are compiled into | <code>${java.classes}</code> and the Java 9 classes are compiled into | ||||
<code>${java9.classes}</code>. | <code>${java9.classes}</code>. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<jar destfile="mrjar.jar"> | <jar destfile="mrjar.jar"> | ||||
<manifest> | <manifest> | ||||
<!-- special mf-entry according to the spec --> | <!-- special mf-entry according to the spec --> | ||||
@@ -613,7 +609,7 @@ Sealed: false</pre></blockquote> | |||||
<!-- ... per release classes, require Java 9+ for loadable via standard ClassLoader --> | <!-- ... per release classes, require Java 9+ for loadable via standard ClassLoader --> | ||||
<zipfileset prefix="META-INF/versions/9/" dir="${java9.classes}"/> | <zipfileset prefix="META-INF/versions/9/" dir="${java9.classes}"/> | ||||
</jar> | </jar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -914,7 +914,7 @@ while all others are <code>false</code>.</p> | |||||
to be given to the runtime system of the javac executable, so it needs | to be given to the runtime system of the javac executable, so it needs | ||||
to be prepended with a "-J". For example: | to be prepended with a "-J". For example: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property name="patched.javac.jar" | <property name="patched.javac.jar" | ||||
location="${my.patched.compiler}/dist/lib/javac.jar"/> | location="${my.patched.compiler}/dist/lib/javac.jar"/> | ||||
@@ -927,7 +927,7 @@ while all others are <code>false</code>.</p> | |||||
<patched.javac srcdir="src/java" destdir="build/classes" | <patched.javac srcdir="src/java" destdir="build/classes" | ||||
debug="yes"/> | debug="yes"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3>Note on package-info.java</h3> | <h3>Note on package-info.java</h3> | ||||
<p> | <p> | ||||
@@ -189,13 +189,13 @@ | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Example</h3> | <h3>Example</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<javacc | <javacc | ||||
target="src/Parser.jj" | target="src/Parser.jj" | ||||
outputdirectory="build/src" | outputdirectory="build/src" | ||||
javacchome="c:/program files/JavaCC" | javacchome="c:/program files/JavaCC" | ||||
static="true"/> | static="true"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
This invokes JavaCC on grammar file src/Parser.jj, writing the generated | This invokes JavaCC on grammar file src/Parser.jj, writing the generated | ||||
files to build/src. The grammar option STATIC is set to true when | files to build/src. The grammar option STATIC is set to true when | ||||
@@ -117,7 +117,6 @@ to ignore (requires JDepend 2.5 or above).</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<jdepend classpathref="base.path"> | <jdepend classpathref="base.path"> | ||||
<classespath> | <classespath> | ||||
@@ -125,13 +124,12 @@ to ignore (requires JDepend 2.5 or above).</p> | |||||
</classespath> | </classespath> | ||||
</jdepend> | </jdepend> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>This invokes JDepend on the <code>build</code> directory, writing | <p>This invokes JDepend on the <code>build</code> directory, writing | ||||
the output on the standard output. The classpath is defined using a | the output on the standard output. The classpath is defined using a | ||||
classpath reference.</p> | classpath reference.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml"> | <jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml"> | ||||
<sourcespath> | <sourcespath> | ||||
@@ -143,14 +141,12 @@ classpath reference.</p> | |||||
</classpath> | </classpath> | ||||
</jdepend> | </jdepend> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>This invokes JDepend in a separate VM on the <code>src</code> and | <p>This invokes JDepend in a separate VM on the <code>src</code> and | ||||
<code>testsrc</code> directories, writing the output to the | <code>testsrc</code> directories, writing the output to the | ||||
<code><docs/jdepend.xml></code> file in xml format. The | <code><docs/jdepend.xml></code> file in xml format. The | ||||
classpath is defined using nested elements.</p> | classpath is defined using nested elements.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<jdepend classpathref="base.path"> | <jdepend classpathref="base.path"> | ||||
<exclude name="java.*> | <exclude name="java.*> | ||||
@@ -160,7 +156,6 @@ classpath is defined using nested elements.</p> | |||||
</classespath> | </classespath> | ||||
</jdepend> | </jdepend> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>This invokes JDepend with the build directory as the base for class | <p>This invokes JDepend with the build directory as the base for class | ||||
files to analyze, and will ignore all classes in the java.* and | files to analyze, and will ignore all classes in the java.* and | ||||
@@ -44,56 +44,42 @@ generated BNF documentation file.</p> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Attribute</b></td> | |||||
<td valign="top"><b>Description</b></td> | |||||
<td align="center" valign="top"><b>Required</b></td> | |||||
<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> | ||||
<tr> | <tr> | ||||
<td valign="top">target</td> | |||||
<td valign="top">The javacc grammar file to process.</td> | |||||
<td align="center" valign="top">Yes</td> | |||||
<td valign="top">target</td> | |||||
<td valign="top">The javacc grammar file to process.</td> | |||||
<td align="center" valign="top">Yes</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">javacchome</td> | |||||
<td valign="top">The directory containing the JavaCC distribution.</td> | |||||
<td align="center" valign="top">Yes</td> | |||||
<td valign="top">javacchome</td> | |||||
<td valign="top">The directory containing the JavaCC distribution.</td> | |||||
<td align="center" valign="top">Yes</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">outputfile</td> | |||||
<td valign="top">The file to write the generated BNF documentation file to. If not set, | |||||
the file is written with the same name as the JavaCC grammar file but with a the suffix .html or .txt</td> | |||||
<td align="center" valign="top">No</td> | |||||
<td valign="top">outputfile</td> | |||||
<td valign="top">The file to write the generated BNF documentation file to. If not set, | |||||
the file is written with the same name as the JavaCC grammar file but with a the suffix .html or .txt</td> | |||||
<td align="center" valign="top">No</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">text</td> | |||||
<td valign="top">Sets the TEXT BNF documentation option. This is a boolean | |||||
option.</td> | |||||
<td align="center" valign="top">No</td> | |||||
<td valign="top">text</td> | |||||
<td valign="top">Sets the TEXT BNF documentation option. This is a boolean option.</td> | |||||
<td align="center" valign="top">No</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">onetable</td> | |||||
<td valign="top">Sets the ONE_TABLE BNF documentation option. This is a boolean option.</td> | |||||
<td align="center" valign="top">No</td> | |||||
<td valign="top">onetable</td> | |||||
<td valign="top">Sets the ONE_TABLE BNF documentation option. This is a boolean option.</td> | |||||
<td align="center" valign="top">No</td> | |||||
</tr> | </tr> | ||||
<tr> | |||||
<tr> | |||||
<td valign="top">maxmemory</td> | <td valign="top">maxmemory</td> | ||||
<td valign="top">Max amount of memory to allocate to the forked | <td valign="top">Max amount of memory to allocate to the forked | ||||
VM. <em>since Ant 1.8.3</em></td> | VM. <em>since Ant 1.8.3</em></td> | ||||
@@ -101,15 +87,13 @@ option.</td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3> | |||||
Example</h3> | |||||
<h3>Example</h3> | |||||
<blockquote> | |||||
<pre><jjdoc | <pre><jjdoc | ||||
target="src/Parser.jj" | target="src/Parser.jj" | ||||
outputfile="doc/ParserBNF.html" | outputfile="doc/ParserBNF.html" | ||||
javacchome="c:/program files/JavaCC"/></pre> | javacchome="c:/program files/JavaCC"/></pre> | ||||
</blockquote> | |||||
This invokes JJDoc on grammar file src/Parser.jj, writing the generated | This invokes JJDoc on grammar file src/Parser.jj, writing the generated | ||||
BNF documentation file, ParserBNF.html, file to doc. | BNF documentation file, ParserBNF.html, file to doc. | ||||
@@ -194,17 +194,14 @@ option.</td> | |||||
<h3>Example</h3> | <h3>Example</h3> | ||||
<blockquote> | |||||
<pre><jjtree | <pre><jjtree | ||||
target="src/Parser.jjt" | target="src/Parser.jjt" | ||||
outputdirectory="build/src" | outputdirectory="build/src" | ||||
javacchome="c:/program files/JavaCC" | javacchome="c:/program files/JavaCC" | ||||
nodeusesparser="true"/></pre> | nodeusesparser="true"/></pre> | ||||
</blockquote> | |||||
This invokes JJTree on grammar file src/Parser.jjt, writing the generated | This invokes JJTree on grammar file src/Parser.jjt, writing the generated | ||||
grammar file, Parser.jj, file to build/src. The grammar option NODE_USES_PARSER | grammar file, Parser.jj, file to build/src. The grammar option NODE_USES_PARSER | ||||
is set to true when invoking JJTree. | is set to true when invoking JJTree. | ||||
<br> | |||||
<h3>Comparison output locations between command line JJTree and different Ant taskdef versions</h3> | <h3>Comparison output locations between command line JJTree and different Ant taskdef versions</h3> | ||||
@@ -181,20 +181,18 @@ a nested <factory> can be used to specify factory settings.</p> | |||||
<h3>Example of report</h3> | <h3>Example of report</h3> | ||||
<blockquote> | |||||
<pre><junitreport todir="./reports"> | |||||
<pre><junitreport todir="./reports"> | |||||
<fileset dir="./reports"> | <fileset dir="./reports"> | ||||
<include name="TEST-*.xml"/> | <include name="TEST-*.xml"/> | ||||
</fileset> | </fileset> | ||||
<report format="frames" todir="./report/html"/> | <report format="frames" todir="./report/html"/> | ||||
</junitreport> | |||||
</pre> | |||||
</blockquote> | |||||
</junitreport></pre> | |||||
<p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and | <p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and | ||||
generate the default framed report in the directory <tt>report/html</tt>.</p> | generate the default framed report in the directory <tt>report/html</tt>.</p> | ||||
<h3>Example of report with xsl params</h3> | <h3>Example of report with xsl params</h3> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<junitreport todir="${outputdir}"> | <junitreport todir="${outputdir}"> | ||||
<fileset dir="${jrdir}"> | <fileset dir="${jrdir}"> | ||||
<include name="TEST-*.xml"/> | <include name="TEST-*.xml"/> | ||||
@@ -205,9 +203,8 @@ generate the default framed report in the directory <tt>report/html</tt>.</p> | |||||
<param name="key1" expression="value1"/> | <param name="key1" expression="value1"/> | ||||
<param name="key2" expression="value2"/> | <param name="key2" expression="value2"/> | ||||
</report> | </report> | ||||
</junitreport> | |||||
</pre> | |||||
</blockquote> | |||||
</junitreport></pre> | |||||
<p>This example requires a file called <tt>junitreport/junit-frames.xsl</tt>. | <p>This example requires a file called <tt>junitreport/junit-frames.xsl</tt>. | ||||
The XSL parameters key1 and key2 will be passed to the XSL transformation.</p> | The XSL parameters key1 and key2 will be passed to the XSL transformation.</p> | ||||
@@ -243,7 +243,6 @@ | |||||
The following example defined a task called testing and | The following example defined a task called testing and | ||||
runs it. | runs it. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class=code> | <pre class=code> | ||||
<macrodef name="testing"> | <macrodef name="testing"> | ||||
<attribute name="v" default="NOT SET"/> | <attribute name="v" default="NOT SET"/> | ||||
@@ -260,7 +259,6 @@ | |||||
</some-tasks> | </some-tasks> | ||||
</testing> | </testing> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following fragment defines a task called <code><call-cc></code> which | The following fragment defines a task called <code><call-cc></code> which | ||||
take the attributes "target", "link" and "target.dir" and the | take the attributes "target", "link" and "target.dir" and the | ||||
@@ -268,7 +266,6 @@ | |||||
uses the <code><cc></code> task from the | uses the <code><cc></code> task from the | ||||
<a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> project. | <a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> project. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<macrodef name="call-cc"> | <macrodef name="call-cc"> | ||||
<attribute name="target"/> | <attribute name="target"/> | ||||
@@ -286,11 +283,9 @@ | |||||
</sequential> | </sequential> | ||||
</macrodef> | </macrodef> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
This then can be used as follows: | This then can be used as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<call-cc target="unittests" link="executable" | <call-cc target="unittests" link="executable" | ||||
target.dir="${build.bin.dir}"> | target.dir="${build.bin.dir}"> | ||||
@@ -303,13 +298,11 @@ | |||||
</cc-elements> | </cc-elements> | ||||
</call-cc> | </call-cc> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following fragment shows <call-cc>, but this time | The following fragment shows <call-cc>, but this time | ||||
using an implicit element and with the link and target.dir arguments | using an implicit element and with the link and target.dir arguments | ||||
having default values. | having default values. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<macrodef name="call-cc"> | <macrodef name="call-cc"> | ||||
<attribute name="target"/> | <attribute name="target"/> | ||||
@@ -327,12 +320,10 @@ | |||||
</sequential> | </sequential> | ||||
</macrodef> | </macrodef> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
This then can be used as follows, note that <cc-elements> | This then can be used as follows, note that <cc-elements> | ||||
is not specified. | is not specified. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<call-cc target="unittests"> | <call-cc target="unittests"> | ||||
<includepath location="${gen.dir}"/> | <includepath location="${gen.dir}"/> | ||||
@@ -342,11 +333,9 @@ | |||||
<linker refid="linker-libs"/> | <linker refid="linker-libs"/> | ||||
</call-cc> | </call-cc> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following shows the use of the <code>text</code> element. | The following shows the use of the <code>text</code> element. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<macrodef name="echotest"> | <macrodef name="echotest"> | ||||
<text name="text"/> | <text name="text"/> | ||||
@@ -358,7 +347,6 @@ | |||||
Hello world | Hello world | ||||
</echotest> | </echotest> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following uses a prior defined attribute for setting the | The following uses a prior defined attribute for setting the | ||||
default value of another. The output would be | default value of another. The output would be | ||||
@@ -367,7 +355,6 @@ | |||||
because while processing the <i>two</i>-line the value for | because while processing the <i>two</i>-line the value for | ||||
<i>one</i> is not set. | <i>one</i> is not set. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<macrodef name="test"> | <macrodef name="test"> | ||||
<attribute name="one"/> <b>*1</b> | <attribute name="one"/> <b>*1</b> | ||||
@@ -378,7 +365,6 @@ | |||||
</macrodef> | </macrodef> | ||||
<test one="test"/> | <test one="test"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -309,18 +309,18 @@ the <code><message></code> element.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mail from="me" | <mail from="me" | ||||
tolist="you" | tolist="you" | ||||
subject="Results of nightly build" | subject="Results of nightly build" | ||||
files="build.log"/> | files="build.log"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Sends an email from <i>me</i> to <i>you</i> with a subject of | <p>Sends an email from <i>me</i> to <i>you</i> with a subject of | ||||
<i>Results of nightly build</i> and includes the contents of the file | <i>Results of nightly build</i> and includes the contents of the file | ||||
<i>build.log</i> in the body of the message.</p> | <i>build.log</i> in the body of the message.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mail mailhost="smtp.myisp.com" mailport="1025" subject="Test build"> | <mail mailhost="smtp.myisp.com" mailport="1025" subject="Test build"> | ||||
<from address="config@myisp.com"/> | <from address="config@myisp.com"/> | ||||
<replyto address="me@myisp.com"/> | <replyto address="me@myisp.com"/> | ||||
@@ -332,7 +332,7 @@ the <code><message></code> element.</p> | |||||
</fileset> | </fileset> | ||||
</attachments> | </attachments> | ||||
</mail> | </mail> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Sends an eMail from <i>config@myisp.com</i> to <i>all@xyz.com</i> with a subject of | <p>Sends an eMail from <i>config@myisp.com</i> to <i>all@xyz.com</i> with a subject of | ||||
<i>Test Build</i>. Replies to this email will go to <i>me@myisp.com</i>. | <i>Test Build</i>. Replies to this email will go to <i>me@myisp.com</i>. | ||||
@@ -341,7 +341,7 @@ task will attempt to use JavaMail and fall back to UU encoding or no encoding in | |||||
that order depending on what support classes are available. <code>${buildname}</code> | that order depending on what support classes are available. <code>${buildname}</code> | ||||
will be replaced with the <code>buildname</code> property's value.</p> | will be replaced with the <code>buildname</code> property's value.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property name="line2" value="some_international_message"/> | <property name="line2" value="some_international_message"/> | ||||
<echo message="${line2}"/> | <echo message="${line2}"/> | ||||
@@ -350,7 +350,7 @@ will be replaced with the <code>buildname</code> property's value.</p> | |||||
<to address="all@xyz.com"/> | <to address="all@xyz.com"/> | ||||
<message>some international text:${line2}</message> | <message>some international text:${line2}</message> | ||||
</mail> | </mail> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Sends an eMail from <i>me@myisp.com</i> to <i>all@xyz.com</i> with a subject of | <p>Sends an eMail from <i>me@myisp.com</i> to <i>all@xyz.com</i> with a subject of | ||||
<i>Test Build</i>, the message body being coded in UTF-8 | <i>Test Build</i>, the message body being coded in UTF-8 | ||||
@@ -96,20 +96,18 @@ defined in-place, or refer to a path defined elsewhere using the | |||||
This classpath must not be empty, and is required.</p> | This classpath must not be empty, and is required.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<div id="example1"> | |||||
<blockquote><pre> | |||||
<pre> | |||||
<manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
jarfile="build/acme.jar"> | jarfile="build/acme.jar"> | ||||
<classpath refid="classpath" /> | <classpath refid="classpath" /> | ||||
</manifestclasspath> | </manifestclasspath> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Assuming a path of id "classpath" was already defined, convert this | <p>Assuming a path of id "classpath" was already defined, convert this | ||||
path relatively to the build/ directory that will contain acme.jar, which | path relatively to the build/ directory that will contain acme.jar, which | ||||
can later be created with <code><jar></code> with a nested | can later be created with <code><jar></code> with a nested | ||||
<code><manifest></code> element that lists an | <code><manifest></code> element that lists an | ||||
<code><attribute name="Class-Path" value="${jar.classpath}"/></code>. | <code><attribute name="Class-Path" value="${jar.classpath}"/></code>. | ||||
</p> | </p> | ||||
</div> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -324,16 +324,14 @@ for more information.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<p><code><netrexxc srcDir="/source/project" | |||||
<pre><netrexxc srcDir="/source/project" | |||||
includes="vnr/util/*" | includes="vnr/util/*" | ||||
destDir="/source/project/build" | destDir="/source/project/build" | ||||
classpath="/source/project2/proj.jar" | classpath="/source/project2/proj.jar" | ||||
comments="true" | comments="true" | ||||
crossref="false" replace="true" | crossref="false" replace="true" | ||||
keep="true"/></code> | |||||
</p> | |||||
</blockquote> | |||||
keep="true"/></pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -63,20 +63,20 @@ resource collection</h4> | |||||
<p>The specified resource will be used as src. <em>Since Apache Ant 1.7</em></p> | <p>The specified resource will be used as src. <em>Since Apache Ant 1.7</em></p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<gzip src="test.tar" destfile="test.tar.gz"/> | <gzip src="test.tar" destfile="test.tar.gz"/> | ||||
</pre></blockquote> | |||||
<blockquote><pre> | |||||
</pre> | |||||
<pre> | |||||
<bzip2 src="test.tar" destfile="test.tar.bz2"/> | <bzip2 src="test.tar" destfile="test.tar.bz2"/> | ||||
</pre></blockquote> | |||||
<blockquote><pre> | |||||
</pre> | |||||
<pre> | |||||
<xz src="test.tar" destfile="test.tar.xz"/> | <xz src="test.tar" destfile="test.tar.xz"/> | ||||
</pre></blockquote> | |||||
<blockquote><pre> | |||||
</pre> | |||||
<pre> | |||||
<gzip destfile="archive.tar.gz"> | <gzip destfile="archive.tar.gz"> | ||||
<url url="http://example.org/archive.tar"/> | <url url="http://example.org/archive.tar"/> | ||||
</gzip> | </gzip> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>downloads <i>http://example.org/archive.tar</i> and compresses it | <p>downloads <i>http://example.org/archive.tar</i> and compresses it | ||||
to <i>archive.tar.gz</i> in the project's basedir on the fly.</p> | to <i>archive.tar.gz</i> in the project's basedir on the fly.</p> | ||||
@@ -71,7 +71,6 @@ | |||||
srcdir and destdir | srcdir and destdir | ||||
attributes set. It also has a src element to source files from a generated | attributes set. It also has a src element to source files from a generated | ||||
directory. | directory. | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<presetdef name="my.javac"> | <presetdef name="my.javac"> | ||||
<javac debug="${debug}" deprecation="${deprecation}" | <javac debug="${debug}" deprecation="${deprecation}" | ||||
@@ -80,24 +79,18 @@ | |||||
</javac> | </javac> | ||||
</presetdef> | </presetdef> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
This can be used as a normal javac task - example: | This can be used as a normal javac task - example: | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<my.javac/> | <my.javac/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
The attributes specified in the preset task may be overridden - i.e. | The attributes specified in the preset task may be overridden - i.e. | ||||
they may be seen as optional attributes - example: | they may be seen as optional attributes - example: | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<my.javac srcdir="${test.src}" deprecation="no"/> | <my.javac srcdir="${test.src}" deprecation="no"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
One may put a presetdef definition in an antlib. | One may put a presetdef definition in an antlib. | ||||
For example suppose the jar file antgoodies.jar has | For example suppose the jar file antgoodies.jar has | ||||
the antlib.xml as follows: | the antlib.xml as follows: | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<antlib> | <antlib> | ||||
<taskdef resource="com/acme/antgoodies/tasks.properties"/> | <taskdef resource="com/acme/antgoodies/tasks.properties"/> | ||||
@@ -108,9 +101,7 @@ | |||||
</presetdef> | </presetdef> | ||||
</antlib> | </antlib> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
One may then use this in a build file as follows: | One may then use this in a build file as follows: | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<project default="example" xmlns:antgoodies="antlib:com.acme.antgoodies"> | <project default="example" xmlns:antgoodies="antlib:com.acme.antgoodies"> | ||||
<target name="example"> | <target name="example"> | ||||
@@ -121,12 +112,10 @@ | |||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following is an example of evaluation of properties when the | The following is an example of evaluation of properties when the | ||||
definition is used: | definition is used: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
<target name="defineandcall"> | <target name="defineandcall"> | ||||
<presetdef name="showmessage"> | <presetdef name="showmessage"> | ||||
@@ -143,11 +132,9 @@ | |||||
<showmessage/> | <showmessage/> | ||||
</target> | </target> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The command ant defineandcall results in the output: | The command ant defineandcall results in the output: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre class="code"> | <pre class="code"> | ||||
defineandcall: | defineandcall: | ||||
[showmessage] message is '${message}' | [showmessage] message is '${message}' | ||||
@@ -156,14 +143,13 @@ defineandcall: | |||||
called: | called: | ||||
[showmessage] message is 'Message 2' | [showmessage] message is 'Message 2' | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
It is possible to use a trick to evaluate properties when the definition is | It is possible to use a trick to evaluate properties when the definition is | ||||
<em>made</em> rather than used. This can be useful if you do not expect some | <em>made</em> rather than used. This can be useful if you do not expect some | ||||
properties to be available in child builds run with | properties to be available in child builds run with | ||||
<code><ant ... inheritall="false"></code>: | <code><ant ... inheritall="false"></code>: | ||||
</p> | </p> | ||||
<blockquote><pre class="code"> | |||||
<pre class="code"> | |||||
<macrodef name="showmessage-presetdef"> | <macrodef name="showmessage-presetdef"> | ||||
<attribute name="messageval"/> | <attribute name="messageval"/> | ||||
<presetdef name="showmessage"> | <presetdef name="showmessage"> | ||||
@@ -171,7 +157,7 @@ properties to be available in child builds run with | |||||
</presetdef> | </presetdef> | ||||
</macrodef> | </macrodef> | ||||
<showmessage-presetdef messageval="${message}"/> | <showmessage-presetdef messageval="${message}"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -191,7 +191,7 @@ The slashes conform to the expectations of the Properties class. The file will | |||||
The layout and comment of the original file is preserved. New properties are added at the end of the file. Existing properties are overwritten in place. | The layout and comment of the original file is preserved. New properties are added at the end of the file. Existing properties are overwritten in place. | ||||
</p> | </p> | ||||
<blockquote><pre><propertyfile | |||||
<pre><propertyfile | |||||
file="my.properties" | file="my.properties" | ||||
comment="My properties"> | comment="My properties"> | ||||
<entry key="akey" value="avalue"/> | <entry key="akey" value="avalue"/> | ||||
@@ -200,10 +200,10 @@ The layout and comment of the original file is preserved. New properties are add | |||||
<entry key="formated.int" type="int" default="0013" operation="+" pattern="0000"/> | <entry key="formated.int" type="int" default="0013" operation="+" pattern="0000"/> | ||||
<entry key="formated.date" type="date" value="now" pattern="DDD HH:mm"/> | <entry key="formated.date" type="date" value="now" pattern="DDD HH:mm"/> | ||||
</propertyfile> | </propertyfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
To produce dates relative from today :</p> | To produce dates relative from today :</p> | ||||
<blockquote><pre><propertyfile | |||||
<pre><propertyfile | |||||
file="my.properties" | file="my.properties" | ||||
comment="My properties"> | comment="My properties"> | ||||
<entry key="formated.date-1" | <entry key="formated.date-1" | ||||
@@ -213,21 +213,21 @@ To produce dates relative from today :</p> | |||||
type="date" default="now" pattern="DDD" | type="date" default="now" pattern="DDD" | ||||
operation="+" value="1"/> | operation="+" value="1"/> | ||||
</propertyfile> | </propertyfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Concatenation of strings :</p> | Concatenation of strings :</p> | ||||
<blockquote><pre><propertyfile | |||||
<pre><propertyfile | |||||
file="my.properties" | file="my.properties" | ||||
comment="My properties"> | comment="My properties"> | ||||
<entry key="progress" default="" operation="+" value="."/> | <entry key="progress" default="" operation="+" value="."/> | ||||
</propertyfile> | </propertyfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Each time called, a "." will be appended to "progress" | <p>Each time called, a "." will be appended to "progress" | ||||
</p> | </p> | ||||
<p>Pumps the project version to the next minor version (increase minor and set path=0):</p> | <p>Pumps the project version to the next minor version (increase minor and set path=0):</p> | ||||
<blockquote><pre><target name="nextMinorVersion"> | |||||
<pre><target name="nextMinorVersion"> | |||||
<property | <property | ||||
name="header" | name="header" | ||||
value="##Generated file - do not modify!"/> | value="##Generated file - do not modify!"/> | ||||
@@ -238,7 +238,7 @@ Concatenation of strings :</p> | |||||
<entry key="product.build.date" type="date" value="now" /> | <entry key="product.build.date" type="date" value="now" /> | ||||
</propertyfile> | </propertyfile> | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
After running this target the version changed e.g. from 3.2.2 to 3.3.0. | After running this target the version changed e.g. from 3.2.2 to 3.3.0. | ||||
</body> | </body> | ||||
@@ -105,16 +105,14 @@ supports most attributes of <code><fileset></code> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<p><code><renameext srcDir="/source/project1" | |||||
<pre><renameext srcDir="/source/project1" | |||||
includes="**" | includes="**" | ||||
excludes="**/samples/*" | excludes="**/samples/*" | ||||
fromExtension=".java.keep" | fromExtension=".java.keep" | ||||
toExtension=".java" | toExtension=".java" | ||||
replace="true"/> | replace="true"/> | ||||
</code> | |||||
</p> | |||||
</blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -159,30 +159,30 @@ them.</p> | |||||
<tr> | <tr> | ||||
<td valign="top">expandProperties</td> | <td valign="top">expandProperties</td> | ||||
<td valign="top">Whether to expand properties in the nested text. | <td valign="top">Whether to expand properties in the nested text. | ||||
<em>since Ant 1.8.0</em>.</td> | |||||
<em>Since Ant 1.8.0</em>.</td> | |||||
<td align="center">No, defaults to true.</td> | <td align="center">No, defaults to true.</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<replace dir="${src}" value="wombat"> | <replace dir="${src}" value="wombat"> | ||||
<include name="**/*.html"/> | <include name="**/*.html"/> | ||||
<replacetoken><![CDATA[multi line | <replacetoken><![CDATA[multi line | ||||
token]]></replacetoken> | token]]></replacetoken> | ||||
</replace> | </replace> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>replaces occurrences of the string "multi | <p>replaces occurrences of the string "multi | ||||
line<i>\n</i>token" with the string "wombat", in all | line<i>\n</i>token" with the string "wombat", in all | ||||
HTML files in the directory <code>${src}</code>.Where <i>\n</i> is | HTML files in the directory <code>${src}</code>.Where <i>\n</i> is | ||||
the platform specific line separator.</p> | the platform specific line separator.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<replace file="${src}/index.html"> | <replace file="${src}/index.html"> | ||||
<replacetoken><![CDATA[two line | <replacetoken><![CDATA[two line | ||||
token]]></replacetoken> | token]]></replacetoken> | ||||
<replacevalue><![CDATA[two line | <replacevalue><![CDATA[two line | ||||
token]]></replacevalue> | token]]></replacevalue> | ||||
</replace> | </replace> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4>replacefilter</h4> | <h4>replacefilter</h4> | ||||
<p>In addition to allowing for multiple replacements, optional nested <code><replacefilter></code> elements allow replacement values to be extracted from a property file. The name of this file is specified using the <code><replace></code> attribute <i>propertyFile</i>. | <p>In addition to allowing for multiple replacements, optional nested <code><replacefilter></code> elements allow replacement values to be extracted from a property file. The name of this file is specified using the <code><replace></code> attribute <i>propertyFile</i>. | ||||
</p> | </p> | ||||
@@ -213,7 +213,7 @@ token]]></replacevalue> | |||||
<p>If neither <i>value</i> nor <i>property</i> is used, the value provided using the <code><replace></code> attribute <i>value</i> and/or the <code><replacevalue></code> element is used. If no value was specified using either of these options, the token is replaced with an empty string. | <p>If neither <i>value</i> nor <i>property</i> is used, the value provided using the <code><replace></code> attribute <i>value</i> and/or the <code><replacevalue></code> element is used. If no value was specified using either of these options, the token is replaced with an empty string. | ||||
</p> | </p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<replace | <replace | ||||
file="configure.sh" | file="configure.sh" | ||||
value="defaultvalue" | value="defaultvalue" | ||||
@@ -231,7 +231,7 @@ token]]></replacevalue> | |||||
<replacevalue>value4</replacevalue> | <replacevalue>value4</replacevalue> | ||||
</replacefilter> | </replacefilter> | ||||
</replace> | </replace> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>In file <code>configure.sh</code>, replace all instances of "@token1@" with "defaultvalue", all instances of "@token2@" with "value2", and all instances of "@token3@" with the value of the property "property.key", as it appears in property file <code>src/name.properties</code>.</p> | <p>In file <code>configure.sh</code>, replace all instances of "@token1@" with "defaultvalue", all instances of "@token2@" with "value2", and all instances of "@token3@" with the value of the property "property.key", as it appears in property file <code>src/name.properties</code>.</p> | ||||
<p><strong>Note</strong>: It is possible to use either the <i>token</i>/<code><replacetoken></code> and <i>value</i>/<code><replacevalue></code> attributes/elements, the nested replacefilter elements, or both in the same operation.</p> | <p><strong>Note</strong>: It is possible to use either the <i>token</i>/<code><replacetoken></code> and <i>value</i>/<code><replacevalue></code> attributes/elements, the nested replacefilter elements, or both in the same operation.</p> | ||||
@@ -115,23 +115,22 @@ value, in the file <code>${src}/build.properties</code></p> | |||||
<p>This task supports a nested <i><a href="../Types/regexp.html">Regexp</a></i> element to specify | <p>This task supports a nested <i><a href="../Types/regexp.html">Regexp</a></i> element to specify | ||||
the regular expression. You can use this element to refer to a previously | the regular expression. You can use this element to refer to a previously | ||||
defined regular expression datatype instance.</p> | defined regular expression datatype instance.</p> | ||||
<blockquote> | |||||
<regexp id="id" pattern="alpha(.+)beta"/><br> | <regexp id="id" pattern="alpha(.+)beta"/><br> | ||||
<regexp refid="id"/> | <regexp refid="id"/> | ||||
</blockquote> | |||||
<p>This task supports a nested <i>Substitution</i> element to specify | <p>This task supports a nested <i>Substitution</i> element to specify | ||||
the substitution pattern. You can use this element to refer to a previously | the substitution pattern. You can use this element to refer to a previously | ||||
defined substitution pattern datatype instance.</p> | defined substitution pattern datatype instance.</p> | ||||
<blockquote> | |||||
<substitution id="id" expression="beta\1alpha"/><br> | <substitution id="id" expression="beta\1alpha"/><br> | ||||
<substitution refid="id"/> | <substitution refid="id"/> | ||||
</blockquote> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<replaceregexp byline="true"> | <replaceregexp byline="true"> | ||||
<regexp pattern="OldProperty=(.*)"/> | <regexp pattern="OldProperty=(.*)"/> | ||||
<substitution expression="NewProperty=\1"/> | <substitution expression="NewProperty=\1"/> | ||||
@@ -139,62 +138,54 @@ value, in the file <code>${src}/build.properties</code></p> | |||||
<include name="*.properties"/> | <include name="*.properties"/> | ||||
</fileset> | </fileset> | ||||
</replaceregexp> | </replaceregexp> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>replaces occurrences of the property name "OldProperty" | <p>replaces occurrences of the property name "OldProperty" | ||||
with "NewProperty" in a properties file, preserving the existing | with "NewProperty" in a properties file, preserving the existing | ||||
value, in all files ending in <code>.properties</code> in the current directory</p> | value, in all files ending in <code>.properties</code> in the current directory</p> | ||||
<br> | |||||
<blockquote> | |||||
<pre><replaceregexp match="\s+" replace=" " flags="g" byline="true"> | <pre><replaceregexp match="\s+" replace=" " flags="g" byline="true"> | ||||
<fileset dir="${html.dir}" includes="**/*.html"/> | <fileset dir="${html.dir}" includes="**/*.html"/> | ||||
</replaceregexp> | </replaceregexp> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>replaces all whitespaces (blanks, tabs, etc) by one blank remaining the | <p>replaces all whitespaces (blanks, tabs, etc) by one blank remaining the | ||||
line separator. So with input</p> | line separator. So with input</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<html> <body> | <html> <body> | ||||
<<TAB>><h1> T E S T </h1> <<TAB>> | <<TAB>><h1> T E S T </h1> <<TAB>> | ||||
<<TAB>> </body></html> | <<TAB>> </body></html> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>would converted to</p> | <p>would converted to</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<html> <body> | <html> <body> | ||||
<h1> T E S T </h1> </body></html> | <h1> T E S T </h1> </body></html> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<br><!-- small distance from code of the previous example --> | <br><!-- small distance from code of the previous example --> | ||||
<blockquote> | |||||
<pre><replaceregexp match="\\n" replace="${line.separator}" flags="g" byline="true"> | <pre><replaceregexp match="\\n" replace="${line.separator}" flags="g" byline="true"> | ||||
<fileset dir="${dir}"/> | <fileset dir="${dir}"/> | ||||
</replaceregexp> | </replaceregexp> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>replaces all <tt>\n</tt> markers (beware the quoting of the backslash) by a line break. | <p>replaces all <tt>\n</tt> markers (beware the quoting of the backslash) by a line break. | ||||
So with input</p> | So with input</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
one\ntwo\nthree | one\ntwo\nthree | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>would converted to</p> | <p>would converted to</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
one | one | ||||
two | two | ||||
three | three | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Beware that inserting line breaks could break file syntax. For example in xml:</p> | <p>Beware that inserting line breaks could break file syntax. For example in xml:</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<root> | <root> | ||||
<text>line breaks \n should work in text</text> | <text>line breaks \n should work in text</text> | ||||
<attribute value="but breaks \n attributes" /> | <attribute value="but breaks \n attributes" /> | ||||
</root> | </root> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -100,14 +100,14 @@ this is "true" by default | |||||
<h3>Example</h3> | <h3>Example</h3> | ||||
A simple example of connecting to a server and running a command. | A simple example of connecting to a server and running a command. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<rexec userid="bob" password="badpass" server="localhost" command="ls"/> | <rexec userid="bob" password="badpass" server="localhost" command="ls"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
The task can be used with other ports as well: | The task can be used with other ports as well: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<rexec port="80" userid="bob" password="badpass" server="localhost" command="ls"/> | <rexec port="80" userid="bob" password="badpass" server="localhost" command="ls"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -162,7 +162,7 @@ different location values.</p> | |||||
</p> | </p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
The following snippet shows use of five different languages: | The following snippet shows use of five different languages: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<property name="message" value="Hello world"/> | <property name="message" value="Hello world"/> | ||||
<script language="groovy"> | <script language="groovy"> | ||||
@@ -185,7 +185,6 @@ The following snippet shows use of five different languages: | |||||
print "message is %s" % message | print "message is %s" % message | ||||
</script> | </script> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
Note that for the <i>jython</i> example, the script contents <b>must</b> | Note that for the <i>jython</i> example, the script contents <b>must</b> | ||||
start on the first column. | start on the first column. | ||||
@@ -196,28 +195,26 @@ print "message is %s" % message | |||||
<p> | <p> | ||||
The following script shows a little more complicated jruby example: | The following script shows a little more complicated jruby example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<script language="ruby"> | <script language="ruby"> | ||||
xmlfiles = Dir.new(".").entries.delete_if { |i| ! (i =~ /\.xml$/) } | xmlfiles = Dir.new(".").entries.delete_if { |i| ! (i =~ /\.xml$/) } | ||||
xmlfiles.sort.each { |i| $self.log(i) } | xmlfiles.sort.each { |i| $self.log(i) } | ||||
</script> | </script> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The same example in groovy is: | The same example in groovy is: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<script language="groovy"> | <script language="groovy"> | ||||
xmlfiles = new java.io.File(".").listFiles().findAll{ it =~ "\.xml$"} | xmlfiles = new java.io.File(".").listFiles().findAll{ it =~ "\.xml$"} | ||||
xmlfiles.sort().each { self.log(it.toString())} | xmlfiles.sort().each { self.log(it.toString())} | ||||
</script> | </script> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following example shows the use of classpath to specify the location | The following example shows the use of classpath to specify the location | ||||
of the beanshell jar file. | of the beanshell jar file. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<script language="beanshell" setbeans="true"> | <script language="beanshell" setbeans="true"> | ||||
<classpath> | <classpath> | ||||
<fileset dir="${user.home}/lang/beanshell" includes="*.jar" /> | <fileset dir="${user.home}/lang/beanshell" includes="*.jar" /> | ||||
@@ -225,12 +222,11 @@ print "message is %s" % message | |||||
System.out.println("Hello world"); | System.out.println("Hello world"); | ||||
</script> | </script> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
The following script uses javascript to create a number of | The following script uses javascript to create a number of | ||||
echo tasks and execute them. | echo tasks and execute them. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<project name="squares" default="main" basedir="."> | <project name="squares" default="main" basedir="."> | ||||
<target name="main"> | <target name="main"> | ||||
@@ -248,9 +244,9 @@ print "message is %s" % message | |||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>generates</p> | <p>generates</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
main: | main: | ||||
1 | 1 | ||||
4 | 4 | ||||
@@ -264,11 +260,11 @@ main: | |||||
100 | 100 | ||||
BUILD SUCCESSFUL | BUILD SUCCESSFUL | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Now a more complex example using the Java API and the Ant API. The goal is to list the | <p>Now a more complex example using the Java API and the Ant API. The goal is to list the | ||||
filesizes of all files a <code><fileset/></code> caught.</p> | filesizes of all files a <code><fileset/></code> caught.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<?xml version="1.0" encoding="ISO-8859-1"?> | <?xml version="1.0" encoding="ISO-8859-1"?> | ||||
<project name="<font color=blue>MyProject</font>" basedir="." default="main"> | <project name="<font color=blue>MyProject</font>" basedir="." default="main"> | ||||
@@ -316,7 +312,7 @@ filesizes of all files a <code><fileset/></code> caught.</p> | |||||
]]></script> | ]]></script> | ||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>We want to use the Java API. Because we don't want always typing the package signature | <p>We want to use the Java API. Because we don't want always typing the package signature | ||||
we do an import. Rhino knows two different methods for import statements: one for packages | we do an import. Rhino knows two different methods for import statements: one for packages | ||||
and one for a single class. By default only the <i>java</i> packages are available, so | and one for a single class. By default only the <i>java</i> packages are available, so | ||||
@@ -343,7 +339,7 @@ appropriate logging before and after invoking execute(). | |||||
task. This task will add filesets and paths to a referenced | task. This task will add filesets and paths to a referenced | ||||
path. If the path does not exist, it will be created. | path. If the path does not exist, it will be created. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<!-- | <!-- | ||||
Define addtopath task | Define addtopath task | ||||
--> | --> | ||||
@@ -372,14 +368,14 @@ appropriate logging before and after invoking execute(). | |||||
} | } | ||||
project.addTaskDefinition("addtopath", AddToPath.class); | project.addTaskDefinition("addtopath", AddToPath.class); | ||||
</script> | </script> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
An example of using this task to create a path | An example of using this task to create a path | ||||
from a list of directories (using antcontrib's | from a list of directories (using antcontrib's | ||||
<a href="http://ant-contrib.sourceforge.net/tasks/tasks/for.html"> | <a href="http://ant-contrib.sourceforge.net/tasks/tasks/for.html"> | ||||
<for></a> task) follows: | <for></a> task) follows: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<path id="main.path"> | <path id="main.path"> | ||||
<fileset dir="build/classes"/> | <fileset dir="build/classes"/> | ||||
</path> | </path> | ||||
@@ -392,7 +388,7 @@ appropriate logging before and after invoking execute(). | |||||
</addtopath> | </addtopath> | ||||
</sequential> | </sequential> | ||||
</ac:for> | </ac:for> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -282,8 +282,8 @@ error. For example in the above script, removing the closing curly bracket | |||||
would result in this error | would result in this error | ||||
</p> | </p> | ||||
<p><code>build.xml:15: SyntaxError: missing } in compound | |||||
statement (scriptdef <code><scripttest2></code>; line 10)</code></p> | |||||
<pre>build.xml:15: SyntaxError: missing } in compound | |||||
statement (scriptdef <code><scripttest2></code>; line 10)</pre> | |||||
<p> | <p> | ||||
Script errors are only detected when a script task is actually executed. | Script errors are only detected when a script task is actually executed. | ||||
@@ -91,18 +91,18 @@ | |||||
<p><a href="../Types/resources.html#collection">Resource | <p><a href="../Types/resources.html#collection">Resource | ||||
Collection</a>s are used to select groups of resources.</p> | Collection</a>s are used to select groups of resources.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<setpermissions mode="755"> | <setpermissions mode="755"> | ||||
<file file="${dist}/start.sh"/> | <file file="${dist}/start.sh"/> | ||||
</setpermissions> | </setpermissions> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>makes the "start.sh" file readable and executable for | <p>makes the "start.sh" file readable and executable for | ||||
anyone and in addition writable by the owner.</p> | anyone and in addition writable by the owner.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE"> | <setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE"> | ||||
<file file="${dist}/start.sh"/> | <file file="${dist}/start.sh"/> | ||||
</setpermissions> | </setpermissions> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>makes the "start.sh" file readable and executable for | <p>makes the "start.sh" file readable and executable for | ||||
anyone and in addition writable by the owner.</p> | anyone and in addition writable by the owner.</p> | ||||
</body> | </body> | ||||
@@ -223,15 +223,15 @@ block</td> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<p>For instructions on generating a code signing certificate, see the <a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/keytool.html">keytool documentation</a> and/or instructions from your certificate authority.</p> | <p>For instructions on generating a code signing certificate, see the <a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/keytool.html">keytool documentation</a> and/or instructions from your certificate authority.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<signjar jar="${dist}/lib/ant.jar" | <signjar jar="${dist}/lib/ant.jar" | ||||
alias="apache-group" storepass="secret"/> | alias="apache-group" storepass="secret"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
signs the ant.jar with alias "apache-group" accessing the | signs the ant.jar with alias "apache-group" accessing the | ||||
keystore and private key via "secret" password. | keystore and private key via "secret" password. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<signjar destDir="signed" | <signjar destDir="signed" | ||||
alias="testonly" keystore="testkeystore" | alias="testonly" keystore="testkeystore" | ||||
storepass="apacheant" | storepass="apacheant" | ||||
@@ -241,14 +241,13 @@ alias="apache-group" storepass="secret"/> | |||||
</path> | </path> | ||||
<flattenmapper /> | <flattenmapper /> | ||||
</signjar> | </signjar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Sign all JAR files matching the dist/**/*.jar pattern, copying them to the | Sign all JAR files matching the dist/**/*.jar pattern, copying them to the | ||||
directory "signed" afterwards. The flatten mapper means that they will | directory "signed" afterwards. The flatten mapper means that they will | ||||
all be copied to this directory, not to subdirectories. | all be copied to this directory, not to subdirectories. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<signjar | <signjar | ||||
alias="testonly" keystore="testkeystore" | alias="testonly" keystore="testkeystore" | ||||
storepass="apacheant" | storepass="apacheant" | ||||
@@ -258,12 +257,12 @@ all be copied to this directory, not to subdirectories. | |||||
<fileset dir="dist" includes="**/*.jar" /> | <fileset dir="dist" includes="**/*.jar" /> | ||||
</path> | </path> | ||||
</signjar> | </signjar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Sign all the JAR files in dist/**/*.jar <i>in-situ</i>. Lazy signing is used, | Sign all the JAR files in dist/**/*.jar <i>in-situ</i>. Lazy signing is used, | ||||
so the files will only be signed if they are not already signed. | so the files will only be signed if they are not already signed. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<signjar | <signjar | ||||
alias="testonly" keystore="testkeystore" | alias="testonly" keystore="testkeystore" | ||||
storepass="apacheant" | storepass="apacheant" | ||||
@@ -273,7 +272,7 @@ so the files will only be signed if they are not already signed. | |||||
<fileset dir="dist" includes="**/*.jar" /> | <fileset dir="dist" includes="**/*.jar" /> | ||||
</path> | </path> | ||||
</signjar> | </signjar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Sign all the JAR files in dist/**/*.jar using the digest algorithm SHA1 and the | Sign all the JAR files in dist/**/*.jar using the digest algorithm SHA1 and the | ||||
signature algorithm MD5withRSA. This is especially useful when you want to use | signature algorithm MD5withRSA. This is especially useful when you want to use | ||||
@@ -84,7 +84,7 @@ will be logged. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<target name="fun" if="fun" unless="fun.done"> | <target name="fun" if="fun" unless="fun.done"> | ||||
<sound> | <sound> | ||||
@@ -94,7 +94,6 @@ will be logged. | |||||
<property name="fun.done" value="true"/> | <property name="fun.done" value="true"/> | ||||
</target> | </target> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
plays the <code>bell.wav</code> sound-file if the build succeeded, or | plays the <code>bell.wav</code> sound-file if the build succeeded, or | ||||
the <code>ohno.wav</code> sound-file if the build failed, three times, | the <code>ohno.wav</code> sound-file if the build failed, three times, | ||||
if the <code>fun</code> property is set to <code>true</code>. | if the <code>fun</code> property is set to <code>true</code>. | ||||
@@ -103,7 +102,6 @@ is a dependency of an "initialization" target that other | |||||
targets depend on, the | targets depend on, the | ||||
<code>fun.done</code> property prevents the target from being executed | <code>fun.done</code> property prevents the target from being executed | ||||
more than once. | more than once. | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<target name="fun" if="fun" unless="fun.done"> | <target name="fun" if="fun" unless="fun.done"> | ||||
<sound> | <sound> | ||||
@@ -113,7 +111,6 @@ more than once. | |||||
<property name="fun.done" value="true"/> | <property name="fun.done" value="true"/> | ||||
</target> | </target> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
randomly selects a sound-file to play when the build succeeds or fails. | randomly selects a sound-file to play when the build succeeds or fails. | ||||
</body> | </body> | ||||
@@ -105,7 +105,6 @@ the build exactly what is going on. | |||||
<td valign="top">User to authenticate to the proxy as.</td> | <td valign="top">User to authenticate to the proxy as.</td> | ||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
<td valign="top" align="center">None</td> | <td valign="top" align="center">None</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">password</td> | <td valign="top">password</td> | ||||
@@ -113,23 +112,20 @@ the build exactly what is going on. | |||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
<td valign="top" align="center">None</td> | <td valign="top" align="center">None</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<splash/> | |||||
</pre></blockquote> | |||||
<pre><splash/></pre> | |||||
<p>Splash <code>images/ant_logo_large.gif</code> from the classpath.</p> | <p>Splash <code>images/ant_logo_large.gif</code> from the classpath.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<splash imageurl="http://jakarta.apache.org/images/jakarta-logo.gif" | <splash imageurl="http://jakarta.apache.org/images/jakarta-logo.gif" | ||||
useproxy="true" | useproxy="true" | ||||
showduration="5000"/> | showduration="5000"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Splashes the jakarta logo, for an initial period of 5 seconds.</p> | <p>Splashes the jakarta logo, for an initial period of 5 seconds.</p> | ||||
<p>Splash with controlled progress and nondefault text</p> | <p>Splash with controlled progress and nondefault text</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<target name="test_new_features"> | <target name="test_new_features"> | ||||
<echo>New features</echo> | <echo>New features</echo> | ||||
<splash progressRegExp="Progress: (.*)%" showduration="0" displayText="Test text"/> | <splash progressRegExp="Progress: (.*)%" showduration="0" displayText="Test text"/> | ||||
@@ -145,7 +141,7 @@ the build exactly what is going on. | |||||
<echo>Progress: 100%</echo> | <echo>Progress: 100%</echo> | ||||
<sleep seconds="3"/> | <sleep seconds="3"/> | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -352,19 +352,19 @@ href="../using.html#path">PATH like structure</a> and can also be set via a nest | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
password="pass" | password="pass" | ||||
src="data.sql"/> | src="data.sql"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Connects to the database given in <i>url</i> as the sa user using the | <p>Connects to the database given in <i>url</i> as the sa user using the | ||||
org.database.jdbcDriver and executes the SQL statements contained within | org.database.jdbcDriver and executes the SQL statements contained within | ||||
the file data.sql</p> | the file data.sql</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -372,14 +372,14 @@ the file data.sql</p> | |||||
src="data.sql"> | src="data.sql"> | ||||
<connectionProperty name="internal_logon" value="SYSDBA"> | <connectionProperty name="internal_logon" value="SYSDBA"> | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Connects to the database given in <i>url</i> as the sa user using | <p>Connects to the database given in <i>url</i> as the sa user using | ||||
the org.database.jdbcDriver and executes the SQL statements contained | the org.database.jdbcDriver and executes the SQL statements contained | ||||
within the file data.sql. Also sets the | within the file data.sql. Also sets the | ||||
property <i>internal_logon</i> to the value <i>SYSDBA</i>.</p> | property <i>internal_logon</i> to the value <i>SYSDBA</i>.</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -390,7 +390,7 @@ values(1,2,3,4); | |||||
truncate table some_other_table; | truncate table some_other_table; | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Connects to the database given in <i>url</i> as the sa | <p>Connects to the database given in <i>url</i> as the sa | ||||
user using the org.database.jdbcDriver and executes the two SQL statements | user using the org.database.jdbcDriver and executes the two SQL statements | ||||
@@ -402,7 +402,7 @@ truncate table some_other_table; | |||||
need to escape <code><</code>, <code>></code> <code>&</code> | need to escape <code><</code>, <code>></code> <code>&</code> | ||||
or other special characters. For example:</p> | or other special characters. For example:</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -411,12 +411,12 @@ or other special characters. For example:</p> | |||||
update some_table set column1 = column1 + 1 where column2 < 42; | update some_table set column1 = column1 + 1 where column2 < 42; | ||||
]]></sql> | ]]></sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
The following command turns property expansion in nested text on (it is off purely for backwards | The following command turns property expansion in nested text on (it is off purely for backwards | ||||
compatibility), then creates a new user in the HSQLDB database using Ant properties. | compatibility), then creates a new user in the HSQLDB database using Ant properties. | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.hsqldb.jdbcDriver"; | driver="org.hsqldb.jdbcDriver"; | ||||
url="jdbc:hsqldb:file:${database.dir}" | url="jdbc:hsqldb:file:${database.dir}" | ||||
userid="sa" | userid="sa" | ||||
@@ -426,14 +426,14 @@ compatibility), then creates a new user in the HSQLDB database using Ant propert | |||||
CREATE USER ${newuser} PASSWORD ${newpassword} | CREATE USER ${newuser} PASSWORD ${newpassword} | ||||
</transaction> | </transaction> | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The following connects to the database given in url as the sa user using | <p>The following connects to the database given in url as the sa user using | ||||
the org.database.jdbcDriver and executes the SQL statements contained within | the org.database.jdbcDriver and executes the SQL statements contained within | ||||
the files data1.sql, data2.sql and data3.sql and then executes the truncate | the files data1.sql, data2.sql and data3.sql and then executes the truncate | ||||
operation on <i>some_other_table</i>.</p> | operation on <i>some_other_table</i>.</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -445,14 +445,14 @@ operation on <i>some_other_table</i>.</p> | |||||
truncate table some_other_table; | truncate table some_other_table; | ||||
</transaction> | </transaction> | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The following example does the same as (and may execute additional | <p>The following example does the same as (and may execute additional | ||||
SQL files if there are more files matching the pattern | SQL files if there are more files matching the pattern | ||||
<code>data*.sql</code>) but doesn't guarantee that data1.sql will be | <code>data*.sql</code>) but doesn't guarantee that data1.sql will be | ||||
run before <code>data2.sql</code>.</p> | run before <code>data2.sql</code>.</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -466,14 +466,14 @@ run before <code>data2.sql</code>.</p> | |||||
truncate table some_other_table; | truncate table some_other_table; | ||||
</transaction> | </transaction> | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The following connects to the database given in url as the sa user using the | <p>The following connects to the database given in url as the sa user using the | ||||
org.database.jdbcDriver and executes the SQL statements contained within the | org.database.jdbcDriver and executes the SQL statements contained within the | ||||
file data.sql, with output piped to outputfile.txt, searching /some/jdbc.jar | file data.sql, with output piped to outputfile.txt, searching /some/jdbc.jar | ||||
as well as the system classpath for the driver class.</p> | as well as the system classpath for the driver class.</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -485,12 +485,12 @@ as well as the system classpath for the driver class.</p> | |||||
<pathelement location="/some/jdbc.jar"/> | <pathelement location="/some/jdbc.jar"/> | ||||
</classpath> | </classpath> | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The following will only execute if the RDBMS is "oracle" and the version | <p>The following will only execute if the RDBMS is "oracle" and the version | ||||
starts with "8.1."</p> | starts with "8.1."</p> | ||||
<blockquote><pre><sql | |||||
<pre><sql | |||||
driver="org.database.jdbcDriver" | driver="org.database.jdbcDriver" | ||||
url="jdbc:database-url" | url="jdbc:database-url" | ||||
userid="sa" | userid="sa" | ||||
@@ -504,7 +504,7 @@ values(1,2,3,4); | |||||
truncate table some_other_table; | truncate table some_other_table; | ||||
</sql> | </sql> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -137,23 +137,23 @@ defaults to false.</p> | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<sync todir="site"> | <sync todir="site"> | ||||
<fileset dir="generated-site"/> | <fileset dir="generated-site"/> | ||||
</sync> | </sync> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>overwrites all files in <em>site</em> with newer files from | <p>overwrites all files in <em>site</em> with newer files from | ||||
<em>generated-site</em>, deletes files from <em>site</em> that are not | <em>generated-site</em>, deletes files from <em>site</em> that are not | ||||
present in <em>generated-site</em>.</p> | present in <em>generated-site</em>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<sync todir="site"> | <sync todir="site"> | ||||
<fileset dir="generated-site"/> | <fileset dir="generated-site"/> | ||||
<preserveintarget> | <preserveintarget> | ||||
<include name="**/CVS/**"/> | <include name="**/CVS/**"/> | ||||
</preserveintarget> | </preserveintarget> | ||||
</sync> | </sync> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>overwrites all files in <em>site</em> with newer files from | <p>overwrites all files in <em>site</em> with newer files from | ||||
<em>generated-site</em>, deletes files from <em>site</em> that are not | <em>generated-site</em>, deletes files from <em>site</em> that are not | ||||
present in <em>generated-site</em> but keeps all files in any | present in <em>generated-site</em> but keeps all files in any | ||||
@@ -101,16 +101,16 @@ A simple example of connecting to a server and running a command. This assumes | |||||
a prompt of "ogin:" for the userid, and a prompt of "assword:" | a prompt of "ogin:" for the userid, and a prompt of "assword:" | ||||
for the password. | for the password. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<telnet userid="bob" password="badpass" server="localhost"> | <telnet userid="bob" password="badpass" server="localhost"> | ||||
<read>/home/bob</read> | <read>/home/bob</read> | ||||
<write>ls</write> | <write>ls</write> | ||||
<read string="/home/bob"/> | <read string="/home/bob"/> | ||||
</telnet> | </telnet> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This task can be rewritten as: | This task can be rewritten as: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<telnet server="localhost"> | <telnet server="localhost"> | ||||
<read>ogin:</read> | <read>ogin:</read> | ||||
<write>bob</write> | <write>bob</write> | ||||
@@ -120,28 +120,28 @@ This task can be rewritten as: | |||||
<write>ls</write> | <write>ls</write> | ||||
<read>/home/bob</read> | <read>/home/bob</read> | ||||
</telnet> | </telnet> | ||||
</pre></blockquote> | |||||
</pre> | |||||
A timeout can be specified at the <code><telnet></code> level or at the <code><read></code> level. | A timeout can be specified at the <code><telnet></code> level or at the <code><read></code> level. | ||||
This will connect, issue a sleep command that is suppressed from displaying and wait | This will connect, issue a sleep command that is suppressed from displaying and wait | ||||
10 seconds before quitting. | 10 seconds before quitting. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<telnet userid="bob" password="badpass" server="localhost" timeout="20"> | <telnet userid="bob" password="badpass" server="localhost" timeout="20"> | ||||
<read>/home/bob</read> | <read>/home/bob</read> | ||||
<write echo="false">sleep 15</write> | <write echo="false">sleep 15</write> | ||||
<read timeout="10">/home/bob</read> | <read timeout="10">/home/bob</read> | ||||
</telnet> | </telnet> | ||||
</pre></blockquote> | |||||
</pre> | |||||
The task can be used with other ports as well: | The task can be used with other ports as well: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<telnet port="80" server="localhost" timeout="20"> | <telnet port="80" server="localhost" timeout="20"> | ||||
<read/> | <read/> | ||||
<write>GET / http/0.9</write> | <write>GET / http/0.9</write> | ||||
<write/> | <write/> | ||||
<read timeout="10">&lt;/HTML&gt;</read> | <read timeout="10">&lt;/HTML&gt;</read> | ||||
</telnet> | </telnet> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
To use this task against the WinNT telnet service, you need to configure the service to use | To use this task against the WinNT telnet service, you need to configure the service to use | ||||
classic authentication rather than NTLM negotiated authentication. | classic authentication rather than NTLM negotiated authentication. | ||||
@@ -66,32 +66,22 @@ resource collection</h4> | |||||
<p>The specified resource will be used as src.</p> | <p>The specified resource will be used as src.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<gunzip src="test.tar.gz"/> | |||||
</pre></blockquote> | |||||
<pre><gunzip src="test.tar.gz"/></pre> | |||||
<p>expands <i>test.tar.gz</i> to <i>test.tar</i></p> | <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p> | ||||
<blockquote><pre> | |||||
<bunzip2 src="test.tar.bz2"/> | |||||
</pre></blockquote> | |||||
<pre><bunzip2 src="test.tar.bz2"/></pre> | |||||
<p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p> | <p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p> | ||||
<blockquote><pre> | |||||
<unxz src="test.tar.xz"/> | |||||
</pre></blockquote> | |||||
<pre><unxz src="test.tar.xz"/></pre> | |||||
<p>expands <i>test.tar.xz</i> to <i>test.tar</i></p> | <p>expands <i>test.tar.xz</i> to <i>test.tar</i></p> | ||||
<blockquote><pre> | |||||
<gunzip src="test.tar.gz" dest="test2.tar"/> | |||||
</pre></blockquote> | |||||
<pre><gunzip src="test.tar.gz" dest="test2.tar"/></pre> | |||||
<p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p> | <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p> | ||||
<blockquote><pre> | |||||
<gunzip src="test.tar.gz" dest="subdir"/> | |||||
</pre></blockquote> | |||||
<pre><gunzip src="test.tar.gz" dest="subdir"/></pre> | |||||
<p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming | <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming | ||||
subdir is a directory).</p> | subdir is a directory).</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<gunzip dest="."> | <gunzip dest="."> | ||||
<url url="http://example.org/archive.tar.gz"/> | <url url="http://example.org/archive.tar.gz"/> | ||||
</gunzip> | </gunzip> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>downloads <i>http://example.org/archive.tar.gz</i> and expands it | <p>downloads <i>http://example.org/archive.tar.gz</i> and expands it | ||||
to <i>archive.tar</i> in the project's basedir on the fly.</p> | to <i>archive.tar</i> in the project's basedir on the fly.</p> | ||||
@@ -100,9 +90,7 @@ to <i>archive.tar</i> in the project's basedir on the fly.</p> | |||||
<pre> | <pre> | ||||
<gunzip src="some-archive.gz" dest="some-dest-dir"/> | <gunzip src="some-archive.gz" dest="some-dest-dir"/> | ||||
</pre> | </pre> | ||||
is identical to | is identical to | ||||
<pre> | <pre> | ||||
<copy todir="some-dest-dir"> | <copy todir="some-dest-dir"> | ||||
<gzipresource> | <gzipresource> | ||||
@@ -126,12 +126,11 @@ supported | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<verifyjar jar="${dist}/lib/ant.jar" | <verifyjar jar="${dist}/lib/ant.jar" | ||||
alias="apache-group" storepass="secret"/> | alias="apache-group" storepass="secret"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
verifies the ant.jar with alias "apache-group" accessing the | verifies the ant.jar with alias "apache-group" accessing the | ||||
keystore and private key via "secret" password. | keystore and private key via "secret" password. | ||||
@@ -198,7 +198,7 @@ label only one will be used in the order version, date, label.</p> | |||||
</table> | </table> | ||||
<p>Note that only one of version, date or label should be specified</p> | <p>Note that only one of version, date or label should be specified</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vssget localPath="C:\mysrc\myproject" | <vssget localPath="C:\mysrc\myproject" | ||||
recursive="true" | recursive="true" | ||||
@@ -207,7 +207,7 @@ label only one will be used in the order version, date, label.</p> | |||||
vsspath="$/source/aProject" | vsspath="$/source/aProject" | ||||
writable="true"/> | writable="true"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a get on the VSS-Project <i>$/source/myproject</i> using the username | <p>Does a get on the VSS-Project <i>$/source/myproject</i> using the username | ||||
<i>me</i> and the password <i>mypassword</i>. It will recursively get the files | <i>me</i> and the password <i>mypassword</i>. It will recursively get the files | ||||
which are labeled <i>Release1</i> and write them to the local directory | which are labeled <i>Release1</i> and write them to the local directory | ||||
@@ -282,24 +282,24 @@ project.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vsslabel vsspath="$/source/aProject" | <vsslabel vsspath="$/source/aProject" | ||||
login="me,mypassword" | login="me,mypassword" | ||||
label="Release1"/> | label="Release1"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Labels the current version of the VSS project <i>$/source/aProject</i> with | <p>Labels the current version of the VSS project <i>$/source/aProject</i> with | ||||
the label <i>Release1</i> using the username <i>me</i> and the password | the label <i>Release1</i> using the username <i>me</i> and the password | ||||
<i>mypassword</i>. | <i>mypassword</i>. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vsslabel vsspath="$/source/aProject/myfile.txt" | <vsslabel vsspath="$/source/aProject/myfile.txt" | ||||
version="4" | version="4" | ||||
label="1.03.004"/> | label="1.03.004"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Labels version 4 of the VSS file <i>$/source/aProject/myfile.txt</i> with the | <p>Labels version 4 of the VSS file <i>$/source/aProject/myfile.txt</i> with the | ||||
label <i>1.03.004</i>. If this version already has a label, the operation (and | label <i>1.03.004</i>. If this version already has a label, the operation (and | ||||
the build) will fail. | the build) will fail. | ||||
@@ -414,25 +414,25 @@ Task to perform HISTORY commands to Microsoft Visual SourceSafe. | |||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vsshistory vsspath="$/myProject" recursive="true" | <vsshistory vsspath="$/myProject" recursive="true" | ||||
fromLabel="Release1" | fromLabel="Release1" | ||||
toLabel="Release2"/> | toLabel="Release2"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Shows all changes between "Release1" and "Release2".</p> | <p>Shows all changes between "Release1" and "Release2".</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vsshistory vsspath="$/myProject" recursive="true" | <vsshistory vsspath="$/myProject" recursive="true" | ||||
fromDate="01.01.2001" | fromDate="01.01.2001" | ||||
toDate="31.03.2001"/> | toDate="31.03.2001"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Shows all changes between January 1st 2001 and March 31st 2001 (in Germany, date must be specified according to your locale).</p> | <p>Shows all changes between January 1st 2001 and March 31st 2001 (in Germany, date must be specified according to your locale).</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<tstamp> | <tstamp> | ||||
<format property="to.tstamp" pattern="M-d-yy;h:mma"/> | <format property="to.tstamp" pattern="M-d-yy;h:mma"/> | ||||
@@ -443,7 +443,7 @@ Task to perform HISTORY commands to Microsoft Visual SourceSafe. | |||||
dateFormat="M-d-yy;h:mma" | dateFormat="M-d-yy;h:mma" | ||||
toDate="${to.tstamp}"/> | toDate="${to.tstamp}"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Shows all changes in the 14 days before today.</p> | <p>Shows all changes in the 14 days before today.</p> | ||||
<hr> | <hr> | ||||
@@ -517,13 +517,13 @@ Task to perform CHECKIN commands to Microsoft Visual SourceSafe. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vsscheckin vsspath="$/test/test*" | <vsscheckin vsspath="$/test/test*" | ||||
localpath="D:\build\" | localpath="D:\build\" | ||||
comment="Modified by automatic build"/> | comment="Modified by automatic build"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Checks in the file(s) named <i>test*</i> in the project <i>$/test</i> using | <p>Checks in the file(s) named <i>test*</i> in the project <i>$/test</i> using | ||||
the local directory <i>D:\build</i>.</p> | the local directory <i>D:\build</i>.</p> | ||||
<hr> | <hr> | ||||
@@ -621,14 +621,14 @@ label only one will be used in the order version, date, label.</p> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vsscheckout vsspath="$/test" | <vsscheckout vsspath="$/test" | ||||
localpath="D:\build" | localpath="D:\build" | ||||
recursive="true" | recursive="true" | ||||
login="me,mypass"/> | login="me,mypass"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Does a recursive checkout of the project <i>$/test</i> to the directory D:\build. | <p>Does a recursive checkout of the project <i>$/test</i> to the directory D:\build. | ||||
</p> | </p> | ||||
<hr> | <hr> | ||||
@@ -697,12 +697,12 @@ Task to perform ADD commands to Microsoft Visual SourceSafe. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<vssadd localpath="D:\build\build.00012.zip" | <vssadd localpath="D:\build\build.00012.zip" | ||||
comment="Added by automatic build"/> | comment="Added by automatic build"/> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Add the file named build.00012.zip into the project current working | <p>Add the file named build.00012.zip into the project current working | ||||
directory (see vsscp).</p> | directory (see vsscp).</p> | ||||
<hr> | <hr> | ||||
@@ -753,11 +753,9 @@ directory (see vsscp).</p> | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | |||||
<vsscp vsspath="$/Projects/ant"/> | |||||
</pre> | |||||
</blockquote> | |||||
<pre><vsscp vsspath="$/Projects/ant"/></pre> | |||||
<p>Sets the current VSS project to <i>$/Projects/ant</i>.</p> | <p>Sets the current VSS project to <i>$/Projects/ant</i>.</p> | ||||
<hr> | <hr> | ||||
@@ -811,11 +809,9 @@ directory (see vsscp).</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre> | |||||
<vsscreate vsspath="$/existingProject/newProject"/> | |||||
</pre> | |||||
</blockquote> | |||||
<pre><vsscreate vsspath="$/existingProject/newProject"/></pre> | |||||
<p>Creates the VSS-Project <i>$/existingProject/newProject</i>.</p> | <p>Creates the VSS-Project <i>$/existingProject/newProject</i>.</p> | ||||
</body> | </body> | ||||
@@ -102,27 +102,27 @@ true within the specified time.</p> | |||||
<a href="conditions.html">here</a> for the full list.</p> | <a href="conditions.html">here</a> for the full list.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<waitfor maxwait="30" maxwaitunit="second"> | <waitfor maxwait="30" maxwaitunit="second"> | ||||
<available file="errors.log"/> | <available file="errors.log"/> | ||||
</waitfor> | </waitfor> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>waits up to 30 seconds for a file called errors.log to appear.</p> | <p>waits up to 30 seconds for a file called errors.log to appear.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<waitfor maxwait="3" maxwaitunit="minute" checkevery="500"> | <waitfor maxwait="3" maxwaitunit="minute" checkevery="500"> | ||||
<http url="http://localhost/myapp/index.html"/> | <http url="http://localhost/myapp/index.html"/> | ||||
</waitfor> | </waitfor> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost | <p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost | ||||
to serve up the specified URL.</p> | to serve up the specified URL.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<waitfor maxwait="10" maxwaitunit="second"> | <waitfor maxwait="10" maxwaitunit="second"> | ||||
<and> | <and> | ||||
<socket server="dbserver" port="1521"/> | <socket server="dbserver" port="1521"/> | ||||
<http url="http://webserver/mypage.html"/> | <http url="http://webserver/mypage.html"/> | ||||
</and> | </and> | ||||
</waitfor> | </waitfor> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>waits up to 10 seconds for a server on the dbserver machine to begin listening | <p>waits up to 10 seconds for a server on the dbserver machine to begin listening | ||||
on port 1521 and for the http://webserver/mypage.html web page | on port 1521 and for the http://webserver/mypage.html web page | ||||
to become available.</p> | to become available.</p> | ||||
@@ -31,9 +31,9 @@ | |||||
The named property is set if the item can be found. | The named property is set if the item can be found. | ||||
For example: | For example: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<whichresource resource="/log4j.properties" property="log4j.url" > | <whichresource resource="/log4j.properties" property="log4j.url" > | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -91,7 +91,7 @@ | |||||
<p> | <p> | ||||
The following shows using a classpath reference. | The following shows using a classpath reference. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<path id="bsf.classpath"> | <path id="bsf.classpath"> | ||||
<fileset dir="${user.home}/lang/bsf" includes="*.jar"/> | <fileset dir="${user.home}/lang/bsf" includes="*.jar"/> | ||||
</path> | </path> | ||||
@@ -99,11 +99,11 @@ | |||||
class="org.apache.bsf.BSFManager" | class="org.apache.bsf.BSFManager" | ||||
classpathref="bsf.classpath"/> | classpathref="bsf.classpath"/> | ||||
<echo>${bsf.class.location}</echo> | <echo>${bsf.class.location}</echo> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The following shows using a nested classpath. | The following shows using a nested classpath. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<whichresource | <whichresource | ||||
property="ant-contrib.antlib.location" | property="ant-contrib.antlib.location" | ||||
resource="net/sf/antcontrib/antlib.xml"> | resource="net/sf/antcontrib/antlib.xml"> | ||||
@@ -112,6 +112,6 @@ | |||||
</classpath> | </classpath> | ||||
</whichresource> | </whichresource> | ||||
<echo>${ant-contrib.antlib.location}</echo> | <echo>${ant-contrib.antlib.location}</echo> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -25,7 +25,6 @@ | |||||
<body> | <body> | ||||
<h2 id="antlib">Antlib</h2> | <h2 id="antlib">Antlib</h2> | ||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p> | <p> | ||||
An antlib file is an xml file with a root element of "antlib". | An antlib file is an xml file with a root element of "antlib". | ||||
@@ -53,8 +52,7 @@ | |||||
A group of tasks and types may be defined together in an antlib | A group of tasks and types may be defined together in an antlib | ||||
file. For example the file <i>sample.xml</i> contains the following: | file. For example the file <i>sample.xml</i> contains the following: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||||
<antlib> | <antlib> | ||||
<typedef name="if" classname="org.acme.ant.If"/> | <typedef name="if" classname="org.acme.ant.If"/> | ||||
@@ -70,17 +68,14 @@ | |||||
</sequential> | </sequential> | ||||
</macrodef> | </macrodef> | ||||
</antlib> | </antlib> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
It defines two types or tasks, <i>if</i> and <i>scriptpathmapper</i>. | It defines two types or tasks, <i>if</i> and <i>scriptpathmapper</i>. | ||||
This antlib file may be used in a build script as follows: | This antlib file may be used in a build script as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<typedef file="sample.xml"/> | <typedef file="sample.xml"/> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The other attributes of <code><typedef></code> may be used as well. | The other attributes of <code><typedef></code> may be used as well. | ||||
For example, assuming that the <i>sample.xml</i> is in a jar | For example, assuming that the <i>sample.xml</i> is in a jar | ||||
@@ -88,25 +83,20 @@ | |||||
following build fragment will define the <i>if</i> and <i>scriptpathmapper</i> | following build fragment will define the <i>if</i> and <i>scriptpathmapper</i> | ||||
tasks/types and place them in the namespace uri <i>samples:/acme.org</i>. | tasks/types and place them in the namespace uri <i>samples:/acme.org</i>. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<typedef resource="org/acme/ant/sample.xml" | <typedef resource="org/acme/ant/sample.xml" | ||||
uri="samples:/acme.org"/> | uri="samples:/acme.org"/> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The definitions may then be used as follows: | The definitions may then be used as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<sample:if valuetrue="${props}" xmlns:sample="samples:/acme.org"> | <sample:if valuetrue="${props}" xmlns:sample="samples:/acme.org"> | ||||
<sample:scriptpathmapper language="beanshell"> | <sample:scriptpathmapper language="beanshell"> | ||||
some bean shell | some bean shell | ||||
</sample:scriptpathmapper> | </sample:scriptpathmapper> | ||||
</sample:if> | </sample:if> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<h3 id="antlibnamespace">Antlib namespace</h3> | <h3 id="antlibnamespace">Antlib namespace</h3> | ||||
<p> | <p> | ||||
@@ -125,8 +115,7 @@ | |||||
defined, the following build file will automatically load the antcontrib | defined, the following build file will automatically load the antcontrib | ||||
definitions at location <i>HERE</i>: | definitions at location <i>HERE</i>: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<project default="deletetest" xmlns:antcontrib="antlib:net.sf.antcontrib"> | <project default="deletetest" xmlns:antcontrib="antlib:net.sf.antcontrib"> | ||||
<macrodef name="showdir"> | <macrodef name="showdir"> | ||||
<attribute name="dir"/> | <attribute name="dir"/> | ||||
@@ -148,22 +137,18 @@ | |||||
<showdir dir="a"/> | <showdir dir="a"/> | ||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
The requirement that the resource is in the default classpath | The requirement that the resource is in the default classpath | ||||
may be removed in future versions of Ant. | may be removed in future versions of Ant. | ||||
</p> | </p> | ||||
<h3 id="loadFromInside">Load antlib from inside of the buildfile</h3> | <h3 id="loadFromInside">Load antlib from inside of the buildfile</h3> | ||||
<p> | <p> | ||||
If you want to separate the antlib from your local Ant installation, e.g. because you | 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 | 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><taskdef></tt>. | that Ant could find that jar. The best solution is loading the antlib with <tt><taskdef></tt>. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<project xmlns:<font color="green">antcontrib</font>="<font color="red">antlib:net.sf.antcontrib</font>"> | <project xmlns:<font color="green">antcontrib</font>="<font color="red">antlib:net.sf.antcontrib</font>"> | ||||
<taskdef uri="<font color="red">antlib:net.sf.antcontrib</font>" | <taskdef uri="<font color="red">antlib:net.sf.antcontrib</font>" | ||||
resource="net/sf/antcontrib/antlib.xml" | resource="net/sf/antcontrib/antlib.xml" | ||||
@@ -178,9 +163,7 @@ | |||||
</antcontrib:for> | </antcontrib:for> | ||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<h3 id="currentnamespace">Current namespace</h3> | <h3 id="currentnamespace">Current namespace</h3> | ||||
<p> | <p> | ||||
Definitions defined in antlibs may be used in antlibs. However | Definitions defined in antlibs may be used in antlibs. However | ||||
@@ -192,8 +175,7 @@ | |||||
type <code><isallowed></code> and a macro | type <code><isallowed></code> and a macro | ||||
<code><ifallowed></code> that makes use of the task and type: | <code><ifallowed></code> that makes use of the task and type: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<antlib xmlns:current="ant:current"> | <antlib xmlns:current="ant:current"> | ||||
<taskdef name="if" classname="org.acme.ant.If"/> | <taskdef name="if" classname="org.acme.ant.If"/> | ||||
<typedef name="isallowed" classname="org.acme.ant.Isallowed"/> | <typedef name="isallowed" classname="org.acme.ant.Isallowed"/> | ||||
@@ -210,10 +192,7 @@ | |||||
</sequential> | </sequential> | ||||
</macrodef> | </macrodef> | ||||
</antlib> | </antlib> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<h3>Other examples and comments</h3> | <h3>Other examples and comments</h3> | ||||
<p> | <p> | ||||
Antlibs may make use of other antlibs. | Antlibs may make use of other antlibs. | ||||
@@ -226,8 +205,7 @@ | |||||
following antlib may be used to define defaults for various | following antlib may be used to define defaults for various | ||||
tasks: | tasks: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<antlib xmlns:antcontrib="antlib:net.sf.antcontrib"> | <antlib xmlns:antcontrib="antlib:net.sf.antcontrib"> | ||||
<presetdef name="javac"> | <presetdef name="javac"> | ||||
<javac deprecation="${deprecation}" | <javac deprecation="${deprecation}" | ||||
@@ -240,21 +218,18 @@ | |||||
<antcontrib:shellscript shell="bash"/> | <antcontrib:shellscript shell="bash"/> | ||||
</presetdef> | </presetdef> | ||||
</antlib> | </antlib> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
This may be used as follows: | This may be used as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<project xmlns:local="localpresets"> | <project xmlns:local="localpresets"> | ||||
<typedef file="localpresets.xml" uri="localpresets"/> | <typedef file="localpresets.xml" uri="localpresets"/> | ||||
<local:shellscript> | <local:shellscript> | ||||
echo "hello world" | echo "hello world" | ||||
</local:shellscript> | </local:shellscript> | ||||
</project> | </project> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -85,28 +85,28 @@ relative location of the classfile in the fileset. So, the file | |||||
<code>org.apache.tools.ant.Project</code>.</p> | <code>org.apache.tools.ant.Project</code>.</p> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<classfileset id="reqdClasses" dir="${classes.dir}"> | <classfileset id="reqdClasses" dir="${classes.dir}"> | ||||
<root classname="org.apache.tools.ant.Project"/> | <root classname="org.apache.tools.ant.Project"/> | ||||
</classfileset> | </classfileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>This example creates a fileset containing all the class files upon which the | <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 | <code>org.apache.tools.ant.Project</code> class depends. This fileset could | ||||
then be used to create a jar. | then be used to create a jar. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<jar destfile="minimal.jar"> | <jar destfile="minimal.jar"> | ||||
<fileset refid="reqdClasses"/> | <fileset refid="reqdClasses"/> | ||||
</jar> | </jar> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<blockquote><pre> | |||||
<pre> | |||||
<classfileset id="reqdClasses" dir="${classes.dir}"> | <classfileset id="reqdClasses" dir="${classes.dir}"> | ||||
<rootfileset dir="${classes.dir}" includes="org/apache/tools/ant/Project*.class"/> | <rootfileset dir="${classes.dir}" includes="org/apache/tools/ant/Project*.class"/> | ||||
</classfileset> | </classfileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>This example constructs the classfileset using all the class with names starting with Project | <p>This example constructs the classfileset using all the class with names starting with Project | ||||
in the org.apache.tools.ant package</p> | in the org.apache.tools.ant package</p> | ||||
@@ -64,8 +64,7 @@ | |||||
For example a custom condition that returns true if a | For example a custom condition that returns true if a | ||||
string is all upper case could be written as: | string is all upper case could be written as: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
package com.mydomain; | package com.mydomain; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
@@ -87,31 +86,25 @@ public class AllUpperCaseCondition implements Condition { | |||||
return value.toUpperCase().equals(value); | return value.toUpperCase().equals(value); | ||||
} | } | ||||
} | } | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Adding the condition to the system is achieved as follows: | Adding the condition to the system is achieved as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<typedef | <typedef | ||||
name="alluppercase" | name="alluppercase" | ||||
classname="com.mydomain.AllUpperCaseCondition" | classname="com.mydomain.AllUpperCaseCondition" | ||||
classpath="${mydomain.classes}"/> | classpath="${mydomain.classes}"/> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
This condition can now be used wherever a Core Ant condition | This condition can now be used wherever a Core Ant condition | ||||
is used. | is used. | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<condition property="allupper"> | <condition property="allupper"> | ||||
<alluppercase value="THIS IS ALL UPPER CASE"/> | <alluppercase value="THIS IS ALL UPPER CASE"/> | ||||
</condition> | </condition> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<h3 id="customselectors">Custom Selectors</h3> | <h3 id="customselectors">Custom Selectors</h3> | ||||
<p> | <p> | ||||
Custom selectors are datatypes that implement | Custom selectors are datatypes that implement | ||||
@@ -128,8 +121,7 @@ public class AllUpperCaseCondition implements Condition { | |||||
An example of a custom selection that selects filenames ending | An example of a custom selection that selects filenames ending | ||||
in ".java" would be: | in ".java" would be: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
package com.mydomain; | package com.mydomain; | ||||
import java.io.File; | import java.io.File; | ||||
import org.apache.tools.ant.types.selectors.FileSelector; | import org.apache.tools.ant.types.selectors.FileSelector; | ||||
@@ -138,34 +130,28 @@ public class JavaSelector implements FileSelector { | |||||
return filename.toLowerCase().endsWith(".java"); | return filename.toLowerCase().endsWith(".java"); | ||||
} | } | ||||
} | } | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Adding the selector to the system is achieved as follows: | Adding the selector to the system is achieved as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<typedef | <typedef | ||||
name="javaselector" | name="javaselector" | ||||
classname="com.mydomain.JavaSelector" | classname="com.mydomain.JavaSelector" | ||||
classpath="${mydomain.classes}"/> | classpath="${mydomain.classes}"/> | ||||
</pre> | |||||
</blockquote> | |||||
<p> | |||||
</pre> | |||||
<p> | |||||
This selector can now be used wherever a Core Ant selector | This selector can now be used wherever a Core Ant selector | ||||
is used, for example: | is used, for example: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<copy todir="to"> | <copy todir="to"> | ||||
<fileset dir="src"> | <fileset dir="src"> | ||||
<javaselector/> | <javaselector/> | ||||
</fileset> | </fileset> | ||||
</copy> | </copy> | ||||
</pre> | |||||
</blockquote> | |||||
<p> | |||||
</pre> | |||||
<p> | |||||
One may use | One may use | ||||
<code>org.apache.tools.ant.types.selectors.BaseSelector</code>, | <code>org.apache.tools.ant.types.selectors.BaseSelector</code>, | ||||
a convenience class that provides reasonable default | a convenience class that provides reasonable default | ||||
@@ -197,8 +183,7 @@ public class JavaSelector implements FileSelector { | |||||
if a certain number of contained selectors select, one could write | if a certain number of contained selectors select, one could write | ||||
a selector as follows: | a selector as follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
public class MatchNumberSelectors extends BaseSelectorContainer { | public class MatchNumberSelectors extends BaseSelectorContainer { | ||||
private int number = -1; | private int number = -1; | ||||
public void setNumber(int number) { | public void setNumber(int number) { | ||||
@@ -221,13 +206,11 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||||
return numberSelected == number; | return numberSelected == number; | ||||
} | } | ||||
} | } | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
To define and use this selector one could do: | To define and use this selector one could do: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<typedef name="numberselected" | <typedef name="numberselected" | ||||
classname="com.mydomain.MatchNumberSelectors"/> | classname="com.mydomain.MatchNumberSelectors"/> | ||||
... | ... | ||||
@@ -238,8 +221,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||||
<javaselector/> | <javaselector/> | ||||
</numberselected> | </numberselected> | ||||
</fileset> | </fileset> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
<i>The custom selector</i> | <i>The custom selector</i> | ||||
</p> | </p> | ||||
@@ -250,7 +232,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||||
<p>You can write your own selectors and use them within the selector | <p>You can write your own selectors and use them within the selector | ||||
containers by specifying them within the <code><custom></code> tag.</p> | containers by specifying them within the <code><custom></code> tag.</p> | ||||
<p>To create a new Custom Selector, you have to create a class that | |||||
<p>To create a new Custom Selector, you have to create a class that | |||||
implements | implements | ||||
<code>org.apache.tools.ant.types.selectors.ExtendFileSelector</code>. | <code>org.apache.tools.ant.types.selectors.ExtendFileSelector</code>. | ||||
The easiest way to do that is through the convenience base class | The easiest way to do that is through the convenience base class | ||||
@@ -305,15 +287,13 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||||
<p>Here is how you use <code><custom></code> to | <p>Here is how you use <code><custom></code> to | ||||
use your class as a selector: | use your class as a selector: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${mydir}" includes="**/*"> | <fileset dir="${mydir}" includes="**/*"> | ||||
<custom classname="com.mydomain.MySelector"> | <custom classname="com.mydomain.MySelector"> | ||||
<param name="myattribute" value="myvalue"/> | <param name="myattribute" value="myvalue"/> | ||||
</custom> | </custom> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The core selectors that can also be used as custom selectors | <p>The core selectors that can also be used as custom selectors | ||||
are</p> | are</p> | ||||
@@ -337,15 +317,13 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||||
<p>Here is the example from the Depth Selector section rewritten | <p>Here is the example from the Depth Selector section rewritten | ||||
to use the selector through <code><custom></code>.</p> | to use the selector through <code><custom></code>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${doc.path}" includes="**/*"> | <fileset dir="${doc.path}" includes="**/*"> | ||||
<custom classname="org.apache.tools.ant.types.selectors.DepthSelector"> | <custom classname="org.apache.tools.ant.types.selectors.DepthSelector"> | ||||
<param name="max" value="1"/> | <param name="max" value="1"/> | ||||
</custom> | </custom> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all files in the base directory and one directory below | <p>Selects all files in the base directory and one directory below | ||||
that.</p> | that.</p> | ||||
@@ -363,8 +341,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||||
For example a filterreader that removes every second character | For example a filterreader that removes every second character | ||||
could be: | could be: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
public class RemoveOddCharacters implements ChainableReader { | public class RemoveOddCharacters implements ChainableReader { | ||||
public Reader chain(Reader reader) { | public Reader chain(Reader reader) { | ||||
return new BaseFilterReader(reader) { | return new BaseFilterReader(reader) { | ||||
@@ -384,8 +361,7 @@ public class RemoveOddCharacters implements ChainableReader { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
For line oriented filters it may be easier to extend | For line oriented filters it may be easier to extend | ||||
<code>ChainableFilterReader</code> an inner class of | <code>ChainableFilterReader</code> an inner class of | ||||
@@ -394,8 +370,7 @@ public class RemoveOddCharacters implements ChainableReader { | |||||
<p> | <p> | ||||
For example a filter that appends the line number could be | For example a filter that appends the line number could be | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
public class AddLineNumber extends ChainableReaderFilter { | public class AddLineNumber extends ChainableReaderFilter { | ||||
private void lineNumber = 0; | private void lineNumber = 0; | ||||
public String filter(String string) { | public String filter(String string) { | ||||
@@ -403,8 +378,7 @@ public class AddLineNumber extends ChainableReaderFilter { | |||||
return "" + lineNumber + "\t" + string; | return "" + lineNumber + "\t" + string; | ||||
} | } | ||||
} | } | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -98,9 +98,8 @@ equivalent to an <code><and></code> selector container.</p> | |||||
Specify what happens if the base directory does not exist. | Specify what happens if the base directory does not exist. | ||||
If true a build error will happen, if false, the dirset | If true a build error will happen, if false, the dirset | ||||
will be ignored/empty. | will be ignored/empty. | ||||
Defaults to true. | |||||
<em>Since Apache Ant 1.7.1 (default is true for backward compatibility | |||||
reasons.)</em> | |||||
Defaults to true (for backward compatibility reasons). | |||||
<em>Since Apache Ant 1.7.1</em> | |||||
</td> | </td> | ||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
</tr> | </tr> | ||||
@@ -108,43 +107,43 @@ equivalent to an <code><and></code> selector container.</p> | |||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<dirset dir="${build.dir}"> | <dirset dir="${build.dir}"> | ||||
<include name="apps/**/classes"/> | <include name="apps/**/classes"/> | ||||
<exclude name="apps/**/*Test*"/> | <exclude name="apps/**/*Test*"/> | ||||
</dirset> | </dirset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups all directories named <code>classes</code> found under the | <p>Groups all directories named <code>classes</code> found under the | ||||
<code>apps</code> subdirectory of <code>${build.dir}</code>, except those | <code>apps</code> subdirectory of <code>${build.dir}</code>, except those | ||||
that have the text <code>Test</code> in their name.</p> | that have the text <code>Test</code> in their name.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<dirset dir="${build.dir}"> | <dirset dir="${build.dir}"> | ||||
<patternset id="non.test.classes"> | <patternset id="non.test.classes"> | ||||
<include name="apps/**/classes"/> | <include name="apps/**/classes"/> | ||||
<exclude name="apps/**/*Test*"/> | <exclude name="apps/**/*Test*"/> | ||||
</patternset> | </patternset> | ||||
</dirset> | </dirset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups the same directories as the above example, but also establishes | <p>Groups the same directories as the above example, but also establishes | ||||
a PatternSet that can be referenced in other | a PatternSet that can be referenced in other | ||||
<code><dirset></code> elements, rooted at a different directory.</p> | <code><dirset></code> elements, rooted at a different directory.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<dirset dir="${debug_build.dir}"> | <dirset dir="${debug_build.dir}"> | ||||
<patternset refid="non.test.classes"/> | <patternset refid="non.test.classes"/> | ||||
</dirset> | </dirset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups all directories in directory <code>${debug_build.dir}</code>, | <p>Groups all directories in directory <code>${debug_build.dir}</code>, | ||||
using the same patterns as the above example.</p> | using the same patterns as the above example.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<dirset id="dirset" dir="${workingdir}"> | <dirset id="dirset" dir="${workingdir}"> | ||||
<present targetdir="${workingdir}"> | <present targetdir="${workingdir}"> | ||||
<mapper type="glob" from="*" to="*/${markerfile}" /> | <mapper type="glob" from="*" to="*/${markerfile}" /> | ||||
</present> | </present> | ||||
</dirset> | </dirset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all directories somewhere under <code>${workingdir}</code> | <p>Selects all directories somewhere under <code>${workingdir}</code> | ||||
which contain a <code>${markerfile}</code>.</p> | which contain a <code>${markerfile}</code>.</p> | ||||
@@ -83,7 +83,7 @@ Java2 Standard Edition package, in file | |||||
</table> | </table> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<extension id="e1" | <extension id="e1" | ||||
extensionName="MyExtensions" | extensionName="MyExtensions" | ||||
specificationVersion="1.0" | specificationVersion="1.0" | ||||
@@ -92,18 +92,18 @@ Java2 Standard Edition package, in file | |||||
implementationVendor="Apache" | implementationVendor="Apache" | ||||
implementationVersion="2.0" | implementationVersion="2.0" | ||||
implementationURL="http://somewhere.com/myExt.jar"/> | implementationURL="http://somewhere.com/myExt.jar"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Fully specific extension object.</p> | |||||
<p>Fully specified extension object.</p> | |||||
<blockquote><pre> | |||||
<pre> | |||||
<extension id="e1" | <extension id="e1" | ||||
extensionName="MyExtensions" | extensionName="MyExtensions" | ||||
specificationVersion="1.0" | specificationVersion="1.0" | ||||
specificationVendor="Peter Donald"/> | specificationVendor="Peter Donald"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Extension object that just species the specification details.</p> | |||||
<p>Extension object that just specifies the specification details.</p> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -48,7 +48,7 @@ Java2 Standard Edition package, in file | |||||
may be modified by attributes of libfileset</p> | may be modified by attributes of libfileset</p> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<extension id="e1" | <extension id="e1" | ||||
extensionName="MyExtensions" | extensionName="MyExtensions" | ||||
specificationVersion="1.0" | specificationVersion="1.0" | ||||
@@ -72,8 +72,7 @@ Java2 Standard Edition package, in file | |||||
<libfileset refid="lfs"/> | <libfileset refid="lfs"/> | ||||
<extension refid="e1"/> | <extension refid="e1"/> | ||||
</extensionSet> | </extensionSet> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -74,42 +74,42 @@ types. | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filelist | <filelist | ||||
id="docfiles" | id="docfiles" | ||||
dir="${doc.src}" | dir="${doc.src}" | ||||
files="foo.xml,bar.xml"/> | files="foo.xml,bar.xml"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The files <code>${doc.src}/foo.xml</code> and | <p>The files <code>${doc.src}/foo.xml</code> and | ||||
<code>${doc.src}/bar.xml</code>. Note that these files may not (yet) | <code>${doc.src}/bar.xml</code>. Note that these files may not (yet) | ||||
actually exist. | actually exist. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filelist | <filelist | ||||
id="docfiles" | id="docfiles" | ||||
dir="${doc.src}" | dir="${doc.src}" | ||||
files="foo.xml | files="foo.xml | ||||
bar.xml"/> | bar.xml"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Same files as the example above.</p> | <p>Same files as the example above.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filelist refid="docfiles"/> | <filelist refid="docfiles"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Same files as the example above.</p> | <p>Same files as the example above.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filelist | <filelist | ||||
id="docfiles" | id="docfiles" | ||||
dir="${doc.src}"> | dir="${doc.src}"> | ||||
<file name="foo.xml"/> | <file name="foo.xml"/> | ||||
<file name="bar.xml"/> | <file name="bar.xml"/> | ||||
</filelist> | </filelist> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Same files as the example above.</p> | <p>Same files as the example above.</p> | ||||
@@ -122,60 +122,60 @@ symbolic link but it may lead to false results on other | |||||
platforms.</p> | platforms.</p> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${server.src}" casesensitive="yes"> | <fileset dir="${server.src}" casesensitive="yes"> | ||||
<include name="**/*.java"/> | <include name="**/*.java"/> | ||||
<exclude name="**/*Test*"/> | <exclude name="**/*Test*"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups all files in directory <code>${server.src}</code> that are Java | <p>Groups all files in directory <code>${server.src}</code> that are Java | ||||
source files and don't have the text <code>Test</code> in their | source files and don't have the text <code>Test</code> in their | ||||
name.</p> | name.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${server.src}" casesensitive="yes"> | <fileset dir="${server.src}" casesensitive="yes"> | ||||
<patternset id="non.test.sources"> | <patternset id="non.test.sources"> | ||||
<include name="**/*.java"/> | <include name="**/*.java"/> | ||||
<exclude name="**/*Test*"/> | <exclude name="**/*Test*"/> | ||||
</patternset> | </patternset> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups the same files as the above example, but also establishes | <p>Groups the same files as the above example, but also establishes | ||||
a PatternSet that can be referenced in other | a PatternSet that can be referenced in other | ||||
<code><fileset></code> elements, rooted at a different directory.</p> | <code><fileset></code> elements, rooted at a different directory.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${client.src}" > | <fileset dir="${client.src}" > | ||||
<patternset refid="non.test.sources"/> | <patternset refid="non.test.sources"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups all files in directory <code>${client.src}</code>, using the | <p>Groups all files in directory <code>${client.src}</code>, using the | ||||
same patterns as the above example.</p> | same patterns as the above example.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${server.src}" casesensitive="yes"> | <fileset dir="${server.src}" casesensitive="yes"> | ||||
<filename name="**/*.java"/> | <filename name="**/*.java"/> | ||||
<filename name="**/*Test*" negate="true"/> | <filename name="**/*Test*" negate="true"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups the same files as the top example, but using the | <p>Groups the same files as the top example, but using the | ||||
<code><filename></code> selector.</p> | <code><filename></code> selector.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${server.src}" casesensitive="yes"> | <fileset dir="${server.src}" casesensitive="yes"> | ||||
<filename name="**/*.java"/> | <filename name="**/*.java"/> | ||||
<not> | <not> | ||||
<filename name="**/*Test*"/> | <filename name="**/*Test*"/> | ||||
</not> | </not> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups the same files as the previous example using a combination of the | <p>Groups the same files as the previous example using a combination of the | ||||
<code><filename></code> selector and the <code><not></code> | <code><filename></code> selector and the <code><not></code> | ||||
selector container.</p> | selector container.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="src" includes="main/" /> | <fileset dir="src" includes="main/" /> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<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> | <i>src/main/application/Bar.java</i>).</p> | ||||
@@ -56,7 +56,7 @@ FilterReaders can be easily plugged in as nested elements of | |||||
<code><filterchain></code> by using <code><filterreader></code> elements. | <code><filterchain></code> by using <code><filterreader></code> elements. | ||||
<p> | <p> | ||||
Example: | Example: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy file="${src.file}" tofile="${dest.file}"> | <copy file="${src.file}" tofile="${dest.file}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="your.extension.of.java.io.FilterReader"> | <filterreader classname="your.extension.of.java.io.FilterReader"> | ||||
@@ -71,21 +71,21 @@ Example: | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Ant provides some built-in filter readers. These filter readers | Ant provides some built-in filter readers. These filter readers | ||||
can also be declared using a syntax similar to the above syntax. | can also be declared using a syntax similar to the above syntax. | ||||
However, they can be declared using some simpler syntax also.<p> | However, they can be declared using some simpler syntax also.<p> | ||||
Example: | Example: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="src.file.head"> | <loadfile srcfile="${src.file}" property="src.file.head"> | ||||
<filterchain> | <filterchain> | ||||
<headfilter lines="15"/> | <headfilter lines="15"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
is equivalent to: | is equivalent to: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="src.file.head"> | <loadfile srcfile="${src.file}" property="src.file.head"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | ||||
@@ -93,7 +93,7 @@ is equivalent to: | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
The following built-in tasks support nested <code><filterchain></code> elements.<br> | The following built-in tasks support nested <code><filterchain></code> elements.<br> | ||||
<a href="../Tasks/concat.html">Concat</a>,<br> | <a href="../Tasks/concat.html">Concat</a>,<br> | ||||
@@ -188,18 +188,18 @@ distribution. | |||||
This loads the basic constants defined in a Java class as Ant properties. | This loads the basic constants defined in a Java class as Ant properties. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadproperties srcfile="foo.class" encoding="ISO-8859-1"> | <loadproperties srcfile="foo.class" encoding="ISO-8859-1"> | ||||
<filterchain> | <filterchain> | ||||
<classconstants/> | <classconstants/> | ||||
</filterchain> | </filterchain> | ||||
</loadproperties> | </loadproperties> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This loads the constants from a Java class file as Ant properties, | This loads the constants from a Java class file as Ant properties, | ||||
prepending the names with a prefix. | prepending the names with a prefix. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadproperties srcfile="build/classes/org/acme/bar.class" | <loadproperties srcfile="build/classes/org/acme/bar.class" | ||||
encoding="ISO-8859-1"> | encoding="ISO-8859-1"> | ||||
<filterchain> | <filterchain> | ||||
@@ -207,7 +207,7 @@ prepending the names with a prefix. | |||||
<prefixlines prefix="ini."/> | <prefixlines prefix="ini."/> | ||||
</filterchain> | </filterchain> | ||||
</loadproperties> | </loadproperties> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="escapeunicode">EscapeUnicode</h3> | <h3 id="escapeunicode">EscapeUnicode</h3> | ||||
<p> | <p> | ||||
This filter converts its input by changing all non US-ASCII characters | This filter converts its input by changing all non US-ASCII characters | ||||
@@ -218,34 +218,34 @@ into their equivalent unicode escape backslash u plus 4 digits.</p> | |||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
This loads the basic constants defined in a Java class as Ant properties. | This loads the basic constants defined in a Java class as Ant properties. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadproperties srcfile="non_ascii_property.properties"> | <loadproperties srcfile="non_ascii_property.properties"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.EscapeUnicode"/> | <filterreader classname="org.apache.tools.ant.filters.EscapeUnicode"/> | ||||
</filterchain> | </filterchain> | ||||
</loadproperties> | </loadproperties> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadproperties srcfile="non_ascii_property.properties"> | <loadproperties srcfile="non_ascii_property.properties"> | ||||
<filterchain> | <filterchain> | ||||
<escapeunicode/> | <escapeunicode/> | ||||
</filterchain> | </filterchain> | ||||
</loadproperties> | </loadproperties> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="expandproperties">ExpandProperties</h3> | <h3 id="expandproperties">ExpandProperties</h3> | ||||
<p> | <p> | ||||
If the data contains data that represents Ant | If the data contains data that represents Ant | ||||
properties (of the form ${...}), that is substituted | properties (of the form ${...}), that is substituted | ||||
with the property's actual value. | with the property's actual value. | ||||
<p> | |||||
</p> | |||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
This results in the property modifiedmessage holding the value | This results in the property modifiedmessage holding the value | ||||
"All these moments will be lost in time, like teardrops in the rain" | "All these moments will be lost in time, like teardrops in the rain" | ||||
<blockquote><pre> | |||||
<pre> | |||||
<echo | <echo | ||||
message="All these moments will be lost in time, like teardrops in the ${weather}" | message="All these moments will be lost in time, like teardrops in the ${weather}" | ||||
file="loadfile1.tmp" | file="loadfile1.tmp" | ||||
@@ -256,10 +256,10 @@ This results in the property modifiedmessage holding the value | |||||
<filterreader classname="org.apache.tools.ant.filters.ExpandProperties"/> | <filterreader classname="org.apache.tools.ant.filters.ExpandProperties"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<echo | <echo | ||||
message="All these moments will be lost in time, like teardrops in the ${weather}" | message="All these moments will be lost in time, like teardrops in the ${weather}" | ||||
file="loadfile1.tmp" | file="loadfile1.tmp" | ||||
@@ -270,12 +270,12 @@ Convenience method: | |||||
<expandproperties/> | <expandproperties/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p><em>Since Ant 1.8.3</em>, a nested | <p><em>Since Ant 1.8.3</em>, a nested | ||||
<a href="propertyset.html">PropertySet</a> can be specified: | |||||
<a href="propertyset.html">PropertySet</a> can be specified:</p> | |||||
<blockquote><pre> | |||||
<pre> | |||||
<property name="weather" value="rain"/> | <property name="weather" value="rain"/> | ||||
<loadfile property="modifiedmessage" srcFile="loadfile1.tmp"> | <loadfile property="modifiedmessage" srcFile="loadfile1.tmp"> | ||||
<filterchain> | <filterchain> | ||||
@@ -286,7 +286,7 @@ Convenience method: | |||||
</expandproperties> | </expandproperties> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="headfilter">HeadFilter</h3> | <h3 id="headfilter">HeadFilter</h3> | ||||
@@ -316,7 +316,7 @@ This filter reads the first few lines from the data supplied to it. | |||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
This stores the first 15 lines of the supplied data in the property src.file.head | This stores the first 15 lines of the supplied data in the property src.file.head | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="src.file.head"> | <loadfile srcfile="${src.file}" property="src.file.head"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | ||||
@@ -324,26 +324,26 @@ This stores the first 15 lines of the supplied data in the property src.file.hea | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="src.file.head"> | <loadfile srcfile="${src.file}" property="src.file.head"> | ||||
<filterchain> | <filterchain> | ||||
<headfilter lines="15"/> | <headfilter lines="15"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This stores the first 15 lines, skipping the first 2 lines, of the supplied data | This stores the first 15 lines, skipping the first 2 lines, of the supplied data | ||||
in the property src.file.head. (Means: lines 3-17) | in the property src.file.head. (Means: lines 3-17) | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="src.file.head"> | <loadfile srcfile="${src.file}" property="src.file.head"> | ||||
<filterchain> | <filterchain> | ||||
<headfilter lines="15" skip="2"/> | <headfilter lines="15" skip="2"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
See the testcases for more examples (<i>src\etc\testcases\filters\head-tail.xml</i> in the | See the testcases for more examples (<i>src\etc\testcases\filters\head-tail.xml</i> in the | ||||
source distribution). | source distribution). | ||||
@@ -376,36 +376,36 @@ strings. | |||||
This will include only those lines that contain <code>foo</code> and | This will include only those lines that contain <code>foo</code> and | ||||
<code>bar</code>. | <code>bar</code>. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.LineContains"> | <filterreader classname="org.apache.tools.ant.filters.LineContains"> | ||||
<param type="contains" value="foo"/> | <param type="contains" value="foo"/> | ||||
<param type="contains" value="bar"/> | <param type="contains" value="bar"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<linecontains> | <linecontains> | ||||
<contains value="foo"/> | <contains value="foo"/> | ||||
<contains value="bar"/> | <contains value="bar"/> | ||||
</linecontains> | </linecontains> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Negation: | Negation: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.LineContains"> | <filterreader classname="org.apache.tools.ant.filters.LineContains"> | ||||
<param type="negate" value="true"/> | <param type="negate" value="true"/> | ||||
<param type="contains" value="foo"/> | <param type="contains" value="foo"/> | ||||
<param type="contains" value="bar"/> | <param type="contains" value="bar"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<i>or</i> | <i>or</i> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<linecontains negate="true"> | <linecontains negate="true"> | ||||
<contains value="foo"/> | <contains value="foo"/> | ||||
<contains value="bar"/> | <contains value="bar"/> | ||||
</linecontains> | </linecontains> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="linecontainsregexp">LineContainsRegExp</h3> | <h3 id="linecontainsregexp">LineContainsRegExp</h3> | ||||
@@ -447,32 +447,32 @@ the choice of regular expression implementation. | |||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
This will fetch all those lines that contain the pattern <code>foo</code> | This will fetch all those lines that contain the pattern <code>foo</code> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp"> | <filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp"> | ||||
<param type="regexp" value="foo*"/> | <param type="regexp" value="foo*"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<linecontainsregexp> | <linecontainsregexp> | ||||
<regexp pattern="foo*"/> | <regexp pattern="foo*"/> | ||||
</linecontainsregexp> | </linecontainsregexp> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Negation: | Negation: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp"> | <filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp"> | ||||
<param type="negate" value="true"/> | <param type="negate" value="true"/> | ||||
<param type="regexp" value="foo*"/> | <param type="regexp" value="foo*"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<i>or</i> | <i>or</i> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<linecontainsregexp negate="true"> | <linecontainsregexp negate="true"> | ||||
<regexp pattern="foo*"/> | <regexp pattern="foo*"/> | ||||
</linecontainsregexp> | </linecontainsregexp> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="prefixlines">PrefixLines</h3> | <h3 id="prefixlines">PrefixLines</h3> | ||||
@@ -494,16 +494,16 @@ Attaches a prefix to every line. | |||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
This will attach the prefix <code>Foo</code> to all lines. | This will attach the prefix <code>Foo</code> to all lines. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.PrefixLines"> | <filterreader classname="org.apache.tools.ant.filters.PrefixLines"> | ||||
<param name="prefix" value="Foo"/> | <param name="prefix" value="Foo"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<prefixlines prefix="Foo"/> | <prefixlines prefix="Foo"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="suffixlines">SuffixLines</h3> | <h3 id="suffixlines">SuffixLines</h3> | ||||
@@ -527,16 +527,16 @@ Attaches a suffix to every line. | |||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
This will attach the suffix <code>Foo</code> to all lines. | This will attach the suffix <code>Foo</code> to all lines. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.SuffixLines"> | <filterreader classname="org.apache.tools.ant.filters.SuffixLines"> | ||||
<param name="suffix" value="Foo"/> | <param name="suffix" value="Foo"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<suffixlines suffix="Foo"/> | <suffixlines suffix="Foo"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="replacetokens">ReplaceTokens</h3> | <h3 id="replacetokens">ReplaceTokens</h3> | ||||
@@ -598,7 +598,7 @@ user defined values. | |||||
This replaces occurrences of the string @DATE@ in the data | This replaces occurrences of the string @DATE@ in the data | ||||
with today's date and stores it in the property ${src.file.replaced}. | with today's date and stores it in the property ${src.file.replaced}. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tstamp/> | <tstamp/> | ||||
<!-- just for explaining the use of the properties --> | <!-- just for explaining the use of the properties --> | ||||
<property name="src.file" value="orders.csv"/> | <property name="src.file" value="orders.csv"/> | ||||
@@ -615,10 +615,10 @@ with today's date and stores it in the property ${src.file.replaced}. | |||||
<!-- just for explaining the use of the properties --> | <!-- just for explaining the use of the properties --> | ||||
<echo message="${orders.replaced}"/> | <echo message="${orders.replaced}"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tstamp/> | <tstamp/> | ||||
<loadfile srcfile="${src.file}" property="${src.file.replaced}"> | <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | ||||
<filterchain> | <filterchain> | ||||
@@ -627,11 +627,11 @@ Convenience method: | |||||
</replacetokens> | </replacetokens> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This replaces occurrences of the string {{DATE}} in the data | This replaces occurrences of the string {{DATE}} in the data | ||||
with today's date and stores it in the property ${src.file.replaced}. | with today's date and stores it in the property ${src.file.replaced}. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.replaced}"> | <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens"> | <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens"> | ||||
@@ -640,10 +640,10 @@ with today's date and stores it in the property ${src.file.replaced}. | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tstamp/> | <tstamp/> | ||||
<loadfile srcfile="${src.file}" property="${src.file.replaced}"> | <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | ||||
<filterchain> | <filterchain> | ||||
@@ -652,10 +652,10 @@ Convenience method: | |||||
</replacetokens> | </replacetokens> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This will treat each properties file entry in sample.properties as a token/key pair : | This will treat each properties file entry in sample.properties as a token/key pair : | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.replaced}"> | <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens"> | <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens"> | ||||
@@ -663,10 +663,10 @@ This will treat each properties file entry in sample.properties as a token/key p | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This reads the properties from an Ant resource referenced by its id: | This reads the properties from an Ant resource referenced by its id: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<string id="embedded-properties"> | <string id="embedded-properties"> | ||||
foo=bar | foo=bar | ||||
baz=xyzzy | baz=xyzzy | ||||
@@ -676,7 +676,7 @@ baz=xyzzy | |||||
<replacetokens propertiesResource="${ant.refid:embedded-properties}"/> | <replacetokens propertiesResource="${ant.refid:embedded-properties}"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="stripjavacomments">StripJavaComments</h3> | <h3 id="stripjavacomments">StripJavaComments</h3> | ||||
@@ -686,22 +686,22 @@ take in any parameters. | |||||
<p> | <p> | ||||
<h4>Example:</h4> | <h4>Example:</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> | <loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/> | <filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> | <loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> | ||||
<filterchain> | <filterchain> | ||||
<stripjavacomments/> | <stripjavacomments/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="striplinebreaks">StripLineBreaks</h3> | <h3 id="striplinebreaks">StripLineBreaks</h3> | ||||
@@ -725,26 +725,26 @@ from the data supplied to it. | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
This strips the '\r' and '\n' characters. | This strips the '\r' and '\n' characters. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.contents}"> | <loadfile srcfile="${src.file}" property="${src.file.contents}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/> | <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.contents}"> | <loadfile srcfile="${src.file}" property="${src.file.contents}"> | ||||
<filterchain> | <filterchain> | ||||
<striplinebreaks/> | <striplinebreaks/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This treats the '(' and ')' characters as line break characters and | This treats the '(' and ')' characters as line break characters and | ||||
strips them. | strips them. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.contents}"> | <loadfile srcfile="${src.file}" property="${src.file.contents}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> | <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> | ||||
@@ -752,7 +752,7 @@ strips them. | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="striplinecomments">StripLineComments</h3> | <h3 id="striplinecomments">StripLineComments</h3> | ||||
@@ -776,7 +776,7 @@ that represent comments as specified by the user. | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
This removes all lines that begin with #, --, REM, rem and // | This removes all lines that begin with #, --, REM, rem and // | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterreader classname="org.apache.tools.ant.filters.StripLineComments"> | <filterreader classname="org.apache.tools.ant.filters.StripLineComments"> | ||||
<param type="comment" value="#"/> | <param type="comment" value="#"/> | ||||
<param type="comment" value="--"/> | <param type="comment" value="--"/> | ||||
@@ -784,10 +784,10 @@ This removes all lines that begin with #, --, REM, rem and // | |||||
<param type="comment" value="rem "/> | <param type="comment" value="rem "/> | ||||
<param type="comment" value="//"/> | <param type="comment" value="//"/> | ||||
</filterreader> | </filterreader> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<striplinecomments> | <striplinecomments> | ||||
<comment value="#"/> | <comment value="#"/> | ||||
<comment value="--"/> | <comment value="--"/> | ||||
@@ -795,7 +795,7 @@ Convenience method: | |||||
<comment value="rem "/> | <comment value="rem "/> | ||||
<comment value="//"/> | <comment value="//"/> | ||||
</striplinecomments> | </striplinecomments> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="tabstospaces">TabsToSpaces</h3> | <h3 id="tabstospaces">TabsToSpaces</h3> | ||||
@@ -817,22 +817,22 @@ This filter replaces tabs with spaces | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
This replaces tabs in ${src.file} with spaces. | This replaces tabs in ${src.file} with spaces. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.notab}"> | <loadfile srcfile="${src.file}" property="${src.file.notab}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.TabsToSpaces"/> | <filterreader classname="org.apache.tools.ant.filters.TabsToSpaces"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.notab}"> | <loadfile srcfile="${src.file}" property="${src.file.notab}"> | ||||
<filterchain> | <filterchain> | ||||
<tabstospaces/> | <tabstospaces/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="tailfilter">TailFilter</h3> | <h3 id="tailfilter">TailFilter</h3> | ||||
@@ -931,7 +931,7 @@ This graphic shows the dependencies: | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
This stores the last 15 lines of the supplied data in the property ${src.file.tail} | This stores the last 15 lines of the supplied data in the property ${src.file.tail} | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.tail}"> | <loadfile srcfile="${src.file}" property="${src.file.tail}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.TailFilter"> | <filterreader classname="org.apache.tools.ant.filters.TailFilter"> | ||||
@@ -939,20 +939,20 @@ This stores the last 15 lines of the supplied data in the property ${src.file.ta | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.tail}"> | <loadfile srcfile="${src.file}" property="${src.file.tail}"> | ||||
<filterchain> | <filterchain> | ||||
<tailfilter lines="15"/> | <tailfilter lines="15"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This stores the last 5 lines of the first 15 lines of the supplied | This stores the last 5 lines of the first 15 lines of the supplied | ||||
data in the property ${src.file.mid} | data in the property ${src.file.mid} | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.mid}"> | <loadfile srcfile="${src.file}" property="${src.file.mid}"> | ||||
<filterchain> | <filterchain> | ||||
<filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | ||||
@@ -963,28 +963,28 @@ data in the property ${src.file.mid} | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Convenience method: | Convenience method: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="${src.file.mid}"> | <loadfile srcfile="${src.file}" property="${src.file.mid}"> | ||||
<filterchain> | <filterchain> | ||||
<headfilter lines="15"/> | <headfilter lines="15"/> | ||||
<tailfilter lines="5"/> | <tailfilter lines="5"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This stores the last 10 lines, skipping the last 2 lines, of the supplied data | This stores the last 10 lines, skipping the last 2 lines, of the supplied data | ||||
in the property src.file.head. (Means: if supplied data contains 60 lines, | in the property src.file.head. (Means: if supplied data contains 60 lines, | ||||
lines 49-58 are extracted) | lines 49-58 are extracted) | ||||
<blockquote><pre> | |||||
<pre> | |||||
<loadfile srcfile="${src.file}" property="src.file.head"> | <loadfile srcfile="${src.file}" property="src.file.head"> | ||||
<filterchain> | <filterchain> | ||||
<tailfilter lines="10" skip="2"/> | <tailfilter lines="10" skip="2"/> | ||||
</filterchain> | </filterchain> | ||||
</loadfile> | </loadfile> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="deletecharacters">DeleteCharacters</h3> | <h3 id="deletecharacters">DeleteCharacters</h3> | ||||
@@ -1011,9 +1011,9 @@ lines 49-58 are extracted) | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
Delete tabs and returns from the data. | Delete tabs and returns from the data. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<deletecharacters chars="\t\r"/> | <deletecharacters chars="\t\r"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="concatfilter">ConcatFilter</h3> | <h3 id="concatfilter">ConcatFilter</h3> | ||||
<p>This filter prepends or appends the content file to the filtered files.</p> | <p>This filter prepends or appends the content file to the filtered files.</p> | ||||
@@ -1044,18 +1044,18 @@ Delete tabs and returns from the data. | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
Do nothing: | Do nothing: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterchain> | <filterchain> | ||||
<concatfilter/> | <concatfilter/> | ||||
</filterchain> | </filterchain> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Adds a license text before each java source: | Adds a license text before each java source: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterchain> | <filterchain> | ||||
<concatfilter prepend="apache-license-java.txt"/> | <concatfilter prepend="apache-license-java.txt"/> | ||||
</filterchain> | </filterchain> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="sortfilter">SortFilter</h3> | <h3 id="sortfilter">SortFilter</h3> | ||||
<p><em>since Ant 1.8.0</em></p> | <p><em>since Ant 1.8.0</em></p> | ||||
@@ -1094,14 +1094,14 @@ Adds a license text before each java source: | |||||
<h4>Examples:</h4> | <h4>Examples:</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy todir="build"> | <copy todir="build"> | ||||
<fileset dir="input" includes="*.txt"/> | <fileset dir="input" includes="*.txt"/> | ||||
<filterchain> | <filterchain> | ||||
<sortfilter/> | <sortfilter/> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Sort all files <code>*.txt</code> from <i>src</i> location | Sort all files <code>*.txt</code> from <i>src</i> location | ||||
@@ -1110,21 +1110,21 @@ ascendant order comparing the lines via the | |||||
<code>String.compareTo(Object o)</code> method. | <code>String.compareTo(Object o)</code> method. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy todir="build"> | <copy todir="build"> | ||||
<fileset dir="input" includes="*.txt"/> | <fileset dir="input" includes="*.txt"/> | ||||
<filterchain> | <filterchain> | ||||
<sortfilter reverse="true"/> | <sortfilter reverse="true"/> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Sort all files <code>*.txt</code> from <i>src</i> location into reverse | Sort all files <code>*.txt</code> from <i>src</i> location into reverse | ||||
order and copy them into <i>build</i> location. | order and copy them into <i>build</i> location. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy todir="build"> | <copy todir="build"> | ||||
<fileset dir="input" includes="*.txt"/> | <fileset dir="input" includes="*.txt"/> | ||||
<filterchain> | <filterchain> | ||||
@@ -1133,7 +1133,7 @@ order and copy them into <i>build</i> location. | |||||
</filterreader> | </filterreader> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Sort all files <code>*.txt</code> from <i>src</i> location using as | Sort all files <code>*.txt</code> from <i>src</i> location using as | ||||
@@ -1157,7 +1157,7 @@ implement <code>java.util.Comparator</code> interface, for example: | |||||
<p>The example above is equivalent to:</p> | <p>The example above is equivalent to:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<componentdef name="evenfirst" | <componentdef name="evenfirst" | ||||
classname="org.apache.tools.ant.filters.EvenFirstCmp"/> | classname="org.apache.tools.ant.filters.EvenFirstCmp"/> | ||||
<copy todir="build"> | <copy todir="build"> | ||||
@@ -1168,7 +1168,7 @@ implement <code>java.util.Comparator</code> interface, for example: | |||||
</sortfilter> | </sortfilter> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h3 id="tokenfilter">TokenFilter</h3> | <h3 id="tokenfilter">TokenFilter</h3> | ||||
This filter tokenizes the inputstream into strings and passes these | This filter tokenizes the inputstream into strings and passes these | ||||
@@ -1274,17 +1274,17 @@ This is the default tokenizer. | |||||
<h5>Examples:</h5> | <h5>Examples:</h5> | ||||
Convert input current line endings to unix style line endings. | Convert input current line endings to unix style line endings. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter delimoutput="\n"/> | <tokenfilter delimoutput="\n"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Remove blank lines. | Remove blank lines. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<ignoreblank/> | <ignoreblank/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="filetokenizer">FileTokenizer</h4> | <h4 id="filetokenizer">FileTokenizer</h4> | ||||
This tokenizer treats <b>all</b> the input as a token. So be | This tokenizer treats <b>all</b> the input as a token. So be | ||||
@@ -1292,14 +1292,14 @@ careful not to use this on very large input. | |||||
<h5>Examples:</h5> | <h5>Examples:</h5> | ||||
Replace the first occurrence of package with //package. | Replace the first occurrence of package with //package. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<filetokenizer/> | <filetokenizer/> | ||||
<replaceregex pattern="([\n\r]+[ \t]*|^[ \t]*)package" | <replaceregex pattern="([\n\r]+[ \t]*|^[ \t]*)package" | ||||
flags="s" | flags="s" | ||||
replace="\1//package"/> | replace="\1//package"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="stringtokenizer">StringTokenizer</h4> | <h4 id="stringtokenizer">StringTokenizer</h4> | ||||
This tokenizer is based on java.util.StringTokenizer. | This tokenizer is based on java.util.StringTokenizer. | ||||
@@ -1353,13 +1353,13 @@ attribute is used). | |||||
Surround each non space token with a "[]". | Surround each non space token with a "[]". | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<stringtokenizer/> | <stringtokenizer/> | ||||
<replaceregex pattern="(.+)" replace="[\1]"/> | <replaceregex pattern="(.+)" replace="[\1]"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="replacestring">ReplaceString</h4> | <h4 id="replacestring">ReplaceString</h4> | ||||
This is a simple filter to replace strings. | This is a simple filter to replace strings. | ||||
@@ -1389,11 +1389,11 @@ This filter may be used directly within a filterchain. | |||||
Replace "sun" with "moon". | Replace "sun" with "moon". | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<replacestring from="sun" to="moon"/> | <replacestring from="sun" to="moon"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="containsstring">ContainsString</h4> | <h4 id="containsstring">ContainsString</h4> | ||||
This is a simple filter to filter tokens that contains | This is a simple filter to filter tokens that contains | ||||
@@ -1416,12 +1416,12 @@ a specified string. | |||||
Include only lines that contain "foo"; | Include only lines that contain "foo"; | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<containsstring contains="foo"/> | <containsstring contains="foo"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="replaceregex">ReplaceRegex</h4> | <h4 id="replaceregex">ReplaceRegex</h4> | ||||
This string filter replaces regular expressions. | This string filter replaces regular expressions. | ||||
@@ -1461,12 +1461,12 @@ for an explanation of regex flags.</td> | |||||
Replace all occurrences of "hello" with "world", ignoring case. | Replace all occurrences of "hello" with "world", ignoring case. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<replaceregex pattern="hello" replace="world" flags="gi"/> | <replaceregex pattern="hello" replace="world" flags="gi"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="containsregex">ContainsRegex</h4> | <h4 id="containsregex">ContainsRegex</h4> | ||||
This filters strings that match regular expressions. | This filters strings that match regular expressions. | ||||
@@ -1509,23 +1509,23 @@ for an explanation of regex flags.</td> | |||||
Filter lines that contain "hello" or "world", ignoring case. | Filter lines that contain "hello" or "world", ignoring case. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<containsregex pattern="(hello|world)" flags="i"/> | <containsregex pattern="(hello|world)" flags="i"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
This example replaces lines like "SUITE(TestSuite, bits);" with | This example replaces lines like "SUITE(TestSuite, bits);" with | ||||
"void register_bits();" and removes other lines. | "void register_bits();" and removes other lines. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<containsregex | <containsregex | ||||
pattern="^ *SUITE\(.*,\s*(.*)\s*\).*" | pattern="^ *SUITE\(.*,\s*(.*)\s*\).*" | ||||
replace="void register_\1();"/> | replace="void register_\1();"/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="trim">Trim</h4> | <h4 id="trim">Trim</h4> | ||||
This filter trims whitespace from the start and end of | This filter trims whitespace from the start and end of | ||||
@@ -1557,14 +1557,14 @@ This filter deletes specified characters from tokens. | |||||
Delete tabs from lines, trim the lines and removes empty lines. | Delete tabs from lines, trim the lines and removes empty lines. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<deletecharacters chars="\t"/> | <deletecharacters chars="\t"/> | ||||
<trim/> | <trim/> | ||||
<ignoreblank/> | <ignoreblank/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="uniqfilter">UniqFilter</h4> | <h4 id="uniqfilter">UniqFilter</h4> | ||||
@@ -1576,11 +1576,11 @@ Delete tabs from lines, trim the lines and removes empty lines. | |||||
<h5>Example:</h5> | <h5>Example:</h5> | ||||
This suppresses duplicate lines. | This suppresses duplicate lines. | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<uniqfilter/> | <uniqfilter/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="native2asciifilter">Native2AsciiFilter</h4> | <h4 id="native2asciifilter">Native2AsciiFilter</h4> | ||||
@@ -1609,11 +1609,11 @@ This suppresses duplicate lines. | |||||
<h5>Example:</h5> | <h5>Example:</h5> | ||||
<p>This replaces all non-ASCII characters by their Unicode-escapes.</p> | <p>This replaces all non-ASCII characters by their Unicode-escapes.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<native2asciifilter/> | <native2asciifilter/> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="scriptfilter">ScriptFilter</h4> | <h4 id="scriptfilter">ScriptFilter</h4> | ||||
<p> | <p> | ||||
@@ -1694,18 +1694,17 @@ Must be a supported Apache BSF or JSR 223 language</td> | |||||
<h5>Examples:</h5> | <h5>Examples:</h5> | ||||
Convert to uppercase: | Convert to uppercase: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<tokenfilter> | <tokenfilter> | ||||
<scriptfilter language="javascript"> | <scriptfilter language="javascript"> | ||||
self.setToken(self.getToken().toUpperCase()); | self.setToken(self.getToken().toUpperCase()); | ||||
</scriptfilter> | </scriptfilter> | ||||
</tokenfilter> | </tokenfilter> | ||||
</pre></blockquote> | |||||
</pre> | |||||
Remove lines containing the string "bad" while | Remove lines containing the string "bad" while | ||||
copying text files: | copying text files: | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<copy todir="dist"> | <copy todir="dist"> | ||||
<fileset dir="src" includes="**/*.txt"/> | <fileset dir="src" includes="**/*.txt"/> | ||||
<filterchain> | <filterchain> | ||||
@@ -1716,8 +1715,7 @@ copying text files: | |||||
</scriptfilter> | </scriptfilter> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<h4 id="custom">Custom tokenizers and string filters</h4> | <h4 id="custom">Custom tokenizers and string filters</h4> | ||||
@@ -1727,7 +1725,7 @@ and org.apache.tools.ant.util.Tokenizer respectly. | |||||
They are defined in the build file using <code><typedef/></code>. For | They are defined in the build file using <code><typedef/></code>. For | ||||
example a string filter that capitalizes words may be declared as: | example a string filter that capitalizes words may be declared as: | ||||
<blockquote><pre> | |||||
<pre> | |||||
package my.customant; | package my.customant; | ||||
import org.apache.tools.ant.filters.TokenFilter; | import org.apache.tools.ant.filters.TokenFilter; | ||||
@@ -1741,10 +1739,10 @@ public class Capitalize | |||||
token.substring(1); | token.substring(1); | ||||
} | } | ||||
} | } | ||||
</pre></blockquote> | |||||
</pre> | |||||
This may be used as follows: | This may be used as follows: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<typedef name="capitalize" classname="my.customant.Capitalize" | <typedef name="capitalize" classname="my.customant.Capitalize" | ||||
classpath="my.customant.path"/> | classpath="my.customant.path"/> | ||||
<copy file="input" tofile="output"> | <copy file="input" tofile="output"> | ||||
@@ -1755,6 +1753,7 @@ This may be used as follows: | |||||
</tokenfilter> | </tokenfilter> | ||||
</filterchain> | </filterchain> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body></html> | |||||
</body> | |||||
</html> |
@@ -141,27 +141,27 @@ you should ensure that the set of files being filtered are all text files. | |||||
<p>You are copying the <code>version.txt</code> file to the <code>dist</code> | <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>@DATE@</code> with today's date.</p> | but wish to replace the token <code>@DATE@</code> with today's date.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | <copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | ||||
<filterset> | <filterset> | ||||
<filter token="DATE" value="${TODAY}"/> | <filter token="DATE" value="${TODAY}"/> | ||||
</filterset> | </filterset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>You are copying the <code>version.txt</code> file to the <code>dist</code> | <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> | but wish to replace the token <code>%DATE*</code> with today's date.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | <copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | ||||
<filterset begintoken="%" endtoken="*"> | <filterset begintoken="%" endtoken="*"> | ||||
<filter token="DATE" value="${TODAY}"/> | <filter token="DATE" value="${TODAY}"/> | ||||
</filterset> | </filterset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Copy all the docs but change all dates and appropriate notices as stored in a file.</p> | <p>Copy all the docs but change all dates and appropriate notices as stored in a file.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy toDir="${dist.dir}/docs"> | <copy toDir="${dist.dir}/docs"> | ||||
<fileset dir="${build.dir}/docs"> | <fileset dir="${build.dir}/docs"> | ||||
<include name="**/*.html"> | <include name="**/*.html"> | ||||
@@ -170,10 +170,10 @@ but wish to replace the token <code>%DATE*</code> with today's date.</p> | |||||
<filtersfile file="${user.dir}/dist.properties"/> | <filtersfile file="${user.dir}/dist.properties"/> | ||||
</filterset> | </filterset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Define a FilterSet and reference it later.</p> | <p>Define a FilterSet and reference it later.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filterset id="myFilterSet" begintoken="%" endtoken="*"> | <filterset id="myFilterSet" begintoken="%" endtoken="*"> | ||||
<filter token="DATE" value="${TODAY}"/> | <filter token="DATE" value="${TODAY}"/> | ||||
</filterset> | </filterset> | ||||
@@ -181,12 +181,12 @@ but wish to replace the token <code>%DATE*</code> with today's date.</p> | |||||
<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | <copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | ||||
<filterset refid="myFilterSet"/> | <filterset refid="myFilterSet"/> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>You are copying the <code>version.txt</code> file to the <code>dist</code> | <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>@project.date@</code> with the property of the same name.</p> | but wish to replace the token <code>@project.date@</code> with the property of the same name.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | <copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | ||||
<filterset> | <filterset> | ||||
<propertyset> | <propertyset> | ||||
@@ -194,5 +194,6 @@ but wish to replace the token <code>@project.date@</code> with the prope | |||||
</propertyset> | </propertyset> | ||||
</filterset> | </filterset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</body></html> | |||||
</pre> | |||||
</body> | |||||
</html> |
@@ -117,10 +117,10 @@ implicitly configured as a <a href="#composite-mapper">composite mapper</a>. | |||||
<p>The target file name is identical to the source file name. Both | <p>The target file name is identical to the source file name. Both | ||||
<code>to</code> and <code>from</code> will be ignored.</p> | <code>to</code> and <code>from</code> will be ignored.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="identity"/> | <mapper type="identity"/> | ||||
<identitymapper/> | <identitymapper/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -153,10 +153,10 @@ implicitly configured as a <a href="#composite-mapper">composite mapper</a>. | |||||
leading directory information stripped off. Both <code>to</code> and | leading directory information stripped off. Both <code>to</code> and | ||||
<code>from</code> will be ignored.</p> | <code>from</code> will be ignored.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="flatten"/> | <mapper type="flatten"/> | ||||
<flattenmapper/> | <flattenmapper/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -188,10 +188,10 @@ leading directory information stripped off. Both <code>to</code> and | |||||
<p>The target file name will always be the same, as defined by | <p>The target file name will always be the same, as defined by | ||||
<code>to</code> - <code>from</code> will be ignored.</p> | <code>to</code> - <code>from</code> will be ignored.</p> | ||||
<h5>Examples:</h5> | <h5>Examples:</h5> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="merge" to="archive.tar"/> | <mapper type="merge" to="archive.tar"/> | ||||
<mergemapper to="archive.tar"/> | <mergemapper to="archive.tar"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -228,10 +228,10 @@ the <code>to</code> pattern with the text that matches the | |||||
<code>*</code> in the <code>from</code> pattern. Source file names | <code>*</code> in the <code>from</code> pattern. Source file names | ||||
that don't match the <code>from</code> pattern will be ignored.</p> | that don't match the <code>from</code> pattern will be ignored.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="glob" from="*.java" to="*.java.bak"/> | <mapper type="glob" from="*.java" to="*.java.bak"/> | ||||
<globmapper from="*.java" to="*.java.bak"/> | <globmapper from="*.java" to="*.java.bak"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -254,10 +254,10 @@ that don't match the <code>from</code> pattern will be ignored.</p> | |||||
<td valign="top">ignored</td> | <td valign="top">ignored</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="glob" from="C*ies" to="Q*y"/> | <mapper type="glob" from="C*ies" to="Q*y"/> | ||||
<globmapper from="C*ies" to="Q*y"/> | <globmapper from="C*ies" to="Q*y"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -404,10 +404,10 @@ should be used.</li> | |||||
</ul> | </ul> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/> | <mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/> | ||||
<regexpmapper from="^(.*)\.java$$" to="\1.java.bak"/> | <regexpmapper from="^(.*)\.java$$" to="\1.java.bak"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -430,10 +430,10 @@ should be used.</li> | |||||
<td valign="top">ignored</td> | <td valign="top">ignored</td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="regexp" from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/> | <mapper type="regexp" from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/> | ||||
<regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/> | <regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -456,10 +456,10 @@ should be used.</li> | |||||
<td valign="top"><code>Classes/dir/dir2/dir2-A.properties</code></td> | <td valign="top"><code>Classes/dir/dir2/dir2-A.properties</code></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/> | <mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/> | ||||
<regexpmapper from="^(.*)\.(.*)$$" to="\2.\1"/> | <regexpmapper from="^(.*)\.(.*)$$" to="\2.\1"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -482,10 +482,10 @@ should be used.</li> | |||||
<td valign="top"><code>properties.Classes/dir/dir2/A</code></td> | <td valign="top"><code>properties.Classes/dir/dir2/A</code></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/> | <mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/> | ||||
<regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/> | <regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -580,10 +580,10 @@ pattern placeholder. This mapper is particularly useful in combination | |||||
with <code><uptodate></code> and <code><junit></code> output.</p> | with <code><uptodate></code> and <code><junit></code> output.</p> | ||||
<p>The to and from attributes are both required.</p> | <p>The to and from attributes are both required.</p> | ||||
<b>Example:</b> | <b>Example:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="package" from="*Test.java" to="TEST-*Test.xml"/> | <mapper type="package" from="*Test.java" to="TEST-*Test.xml"/> | ||||
<packagemapper from="*Test.java" to="TEST-*Test.xml"/> | <packagemapper from="*Test.java" to="TEST-*Test.xml"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -612,10 +612,10 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
</p> | </p> | ||||
<p>The to and from attributes are both required.</p> | <p>The to and from attributes are both required.</p> | ||||
<b>Example:</b> | <b>Example:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<mapper type="unpackage" from="TEST-*Test.xml" to="${test.src.dir}/*Test.java"> | <mapper type="unpackage" from="TEST-*Test.xml" to="${test.src.dir}/*Test.java"> | ||||
<unpackagemapper from="TEST-*Test.xml" to="${test.src.dir}/*Test.java"> | <unpackagemapper from="TEST-*Test.xml" to="${test.src.dir}/*Test.java"> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -640,12 +640,12 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
same as the order of the nested mappers; prior to Ant 1.8.0 the | same as the order of the nested mappers; prior to Ant 1.8.0 the | ||||
order has been undefined.</p> | order has been undefined.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<compositemapper> | <compositemapper> | ||||
<identitymapper/> | <identitymapper/> | ||||
<packagemapper from="*.java" to="*"/> | <packagemapper from="*.java" to="*"/> | ||||
</compositemapper> | </compositemapper> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -674,7 +674,7 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
generated by the last nested mapper comprise the ultimate results of the | generated by the last nested mapper comprise the ultimate results of the | ||||
mapping operation. The <i>to</i> and <i>from</i> attributes are ignored.</p> | mapping operation. The <i>to</i> and <i>from</i> attributes are ignored.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<chainedmapper> | <chainedmapper> | ||||
<flattenmapper/> | <flattenmapper/> | ||||
<globmapper from="*" to="new/path/*"/> | <globmapper from="*" to="new/path/*"/> | ||||
@@ -683,7 +683,7 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
<globmapper from="*" to="*2"/> | <globmapper from="*" to="*2"/> | ||||
</mapper> | </mapper> | ||||
</chainedmapper> | </chainedmapper> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Source file name</b></td> | <td valign="top"><b>Source file name</b></td> | ||||
@@ -718,11 +718,11 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
to the source file name. | to the source file name. | ||||
</p> | </p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filtermapper> | <filtermapper> | ||||
<replacestring from="\" to="/"/> | <replacestring from="\" to="/"/> | ||||
</filtermapper> | </filtermapper> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -734,13 +734,13 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||||
<td valign="top"><code>foo/bar/A.java</code></td> | <td valign="top"><code>foo/bar/A.java</code></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<filtermapper> | <filtermapper> | ||||
<scriptfilter language="beanshell"> | <scriptfilter language="beanshell"> | ||||
self.setToken(self.getToken().toUpperCase()); | self.setToken(self.getToken().toUpperCase()); | ||||
</scriptfilter> | </scriptfilter> | ||||
</filtermapper> | </filtermapper> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -838,12 +838,12 @@ an explanation of scripts and dependencies. | |||||
<p> | <p> | ||||
<b>Example:</b> | <b>Example:</b> | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<scriptmapper language="javascript"> | <scriptmapper language="javascript"> | ||||
self.addMappedName(source.toUpperCase()); | self.addMappedName(source.toUpperCase()); | ||||
self.addMappedName(source.toLowerCase()); | self.addMappedName(source.toLowerCase()); | ||||
</scriptmapper> | </scriptmapper> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -907,12 +907,12 @@ list of mapped names reset after every invocation. | |||||
different from <a href="#composite-mapper">composite mapper</a> | different from <a href="#composite-mapper">composite mapper</a> | ||||
which collects the results of all matching children.</p> | which collects the results of all matching children.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<firstmatchmapper> | <firstmatchmapper> | ||||
<globmapper from="*.txt" to="*.bak"/> | <globmapper from="*.txt" to="*.bak"/> | ||||
<globmapper from="*A.*" to="*B.*"/> | <globmapper from="*A.*" to="*B.*"/> | ||||
</firstmatchmapper> | </firstmatchmapper> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -939,9 +939,9 @@ list of mapped names reset after every invocation. | |||||
the source file name.</p> | the source file name.</p> | ||||
<b>Examples:</b> | <b>Examples:</b> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<cutdirsmapper dirs="1"/> | <cutdirsmapper dirs="1"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -143,25 +143,25 @@ an <code><and></code> selector container.</p> | |||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<multirootfileset basedirs="${build.dir},${other.project.dir}"> | <multirootfileset basedirs="${build.dir},${other.project.dir}"> | ||||
<include name="apps/**/classes"/> | <include name="apps/**/classes"/> | ||||
<exclude name="apps/**/*Test*"/> | <exclude name="apps/**/*Test*"/> | ||||
</multirootfileset> | </multirootfileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Groups all files inside <code>classes</code> found under the | <p>Groups all files inside <code>classes</code> found under the | ||||
<code>apps</code> subdirectory of <code>${build.dir}</code> or | <code>apps</code> subdirectory of <code>${build.dir}</code> or | ||||
<code>${other.project.dir}</code>, except those that have the text | <code>${other.project.dir}</code>, except those that have the text | ||||
<code>Test</code> in their name.</p> | <code>Test</code> in their name.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<multirootfileset> | <multirootfileset> | ||||
<basedir file="${build.dir}"/> | <basedir file="${build.dir}"/> | ||||
<basedir file="${other.project.dir}" | <basedir file="${other.project.dir}" | ||||
<include name="apps/**/classes"/> | <include name="apps/**/classes"/> | ||||
<exclude name="apps/**/*Test*"/> | <exclude name="apps/**/*Test*"/> | ||||
</multirootfileset> | </multirootfileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Is equivalent to the first example but used | <p>Is equivalent to the first example but used | ||||
nested <code>basedir</code> elements. The nested elements and | nested <code>basedir</code> elements. The nested elements and | ||||
the <code>basedirs</code> attribute can be used at the same time and | the <code>basedirs</code> attribute can be used at the same time and | ||||
@@ -133,12 +133,12 @@ patterns to the parent patternset.</p> | |||||
<p>A nested patternset can be inverted using the <code><invert></code> | <p>A nested patternset can be inverted using the <code><invert></code> | ||||
element. <em>Since Apache Ant 1.7.1</em></p> | element. <em>Since Apache Ant 1.7.1</em></p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<patternset id="non.test.sources"> | <patternset id="non.test.sources"> | ||||
<include name="**/*.java"/> | <include name="**/*.java"/> | ||||
<exclude name="**/*Test*"/> | <exclude name="**/*Test*"/> | ||||
</patternset> | </patternset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Builds a set of patterns that matches all <code>.java</code> files | <p>Builds a set of patterns that matches all <code>.java</code> files | ||||
that do not contain the text <code>Test</code> in their name. This set | that do not contain the text <code>Test</code> in their name. This set | ||||
can be <a href="../using.html#references">referred</a> to via | can be <a href="../using.html#references">referred</a> to via | ||||
@@ -153,34 +153,34 @@ attribute to hold a single pattern.</p> | |||||
specify that the element should only be used if a property is set, or | specify that the element should only be used if a property is set, or | ||||
that it should be used only if a property is not set.</p> | that it should be used only if a property is not set.</p> | ||||
<p>For example</p> | <p>For example</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<patternset id="sources"> | <patternset id="sources"> | ||||
<include name="std/**/*.java"/> | <include name="std/**/*.java"/> | ||||
<include name="prof/**/*.java" if="professional"/> | <include name="prof/**/*.java" if="professional"/> | ||||
<exclude name="**/*Test*"/> | <exclude name="**/*Test*"/> | ||||
</patternset> | </patternset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will only include the files in the sub-directory <em>prof</em> if the property | <p>will only include the files in the sub-directory <em>prof</em> if the property | ||||
<em>professional</em> is set to some value.</p> | <em>professional</em> is set to some value.</p> | ||||
<p>The two sets</p> | <p>The two sets</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<patternset includesfile="some-file"/> | <patternset includesfile="some-file"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>and</p> | <p>and</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<patternset> | <patternset> | ||||
<includesfile name="some-file"/> | <includesfile name="some-file"/> | ||||
<patternset/> | <patternset/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>are identical. The include patterns will be read from the file | <p>are identical. The include patterns will be read from the file | ||||
<code>some-file</code>, one pattern per line.</p> | <code>some-file</code>, one pattern per line.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<patternset> | <patternset> | ||||
<includesfile name="some-file"/> | <includesfile name="some-file"/> | ||||
<includesfile name="${some-other-file}" | <includesfile name="${some-other-file}" | ||||
if="some-other-file"/> | if="some-other-file"/> | ||||
<patternset/> | <patternset/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>will also read include patterns from the file the property | <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 | <code>some-other-file</code> points to, if a property of that name has | ||||
been defined.</p> | been defined.</p> | ||||
@@ -114,7 +114,7 @@ If the actions are left empty all actions match, and are revoked. | |||||
</p> | </p> | ||||
<h3 id="baseset">Base set</h3> | <h3 id="baseset">Base set</h3> | ||||
A permissions set implicitly contains the following permissions: | A permissions set implicitly contains the following permissions: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<grant class="java.net.SocketPermission" name="localhost:1024-" actions="listen"> | <grant class="java.net.SocketPermission" name="localhost:1024-" actions="listen"> | ||||
<grant class="java.util.PropertyPermission" name="java.version" actions="read"> | <grant class="java.util.PropertyPermission" name="java.version" actions="read"> | ||||
<grant class="java.util.PropertyPermission" name="java.vendor" actions="read"> | <grant class="java.util.PropertyPermission" name="java.vendor" actions="read"> | ||||
@@ -136,25 +136,25 @@ A permissions set implicitly contains the following permissions: | |||||
<grant class="java.util.PropertyPermission" name="java.vm.version" actions="read"> | <grant class="java.util.PropertyPermission" name="java.vm.version" actions="read"> | ||||
<grant class="java.util.PropertyPermission" name="java.vm.vendor" actions="read"> | <grant class="java.util.PropertyPermission" name="java.vm.vendor" actions="read"> | ||||
<grant class="java.util.PropertyPermission" name="java.vm.name" actions="read"> | <grant class="java.util.PropertyPermission" name="java.vm.name" actions="read"> | ||||
</pre></blockquote> | |||||
</pre> | |||||
These permissions can be revoked via <code><revoke></code> elements if necessary. | These permissions can be revoked via <code><revoke></code> elements if necessary. | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<permissions> | <permissions> | ||||
<grant class="java.security.AllPermission"/> | <grant class="java.security.AllPermission"/> | ||||
<revoke class="java.util.PropertyPermission"/> | <revoke class="java.util.PropertyPermission"/> | ||||
</permissions> | </permissions> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Grants all permissions to the code except for those handling Properties. | Grants all permissions to the code except for those handling Properties. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<permissions> | <permissions> | ||||
<grant class="java.net.SocketPermission" name="foo.bar.com" action="connect"/> | <grant class="java.net.SocketPermission" name="foo.bar.com" action="connect"/> | ||||
<grant class="java.util.PropertyPermission" name="user.home" action="read,write"/> | <grant class="java.util.PropertyPermission" name="user.home" action="read,write"/> | ||||
</permissions> | </permissions> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
Grants the base set of permissions with the addition of a SocketPermission to connect | Grants the base set of permissions with the addition of a SocketPermission to connect | ||||
to foo.bar.com and the permission to read and write the user.home system property. | to foo.bar.com and the permission to read and write the user.home system property. | ||||
@@ -56,8 +56,7 @@ supports this.</p> | |||||
<h4>propertyref</h4> | <h4>propertyref</h4> | ||||
<p>Selects properties from the current project to be included in the | |||||
set.</p> | |||||
<p>Selects properties from the current project to be included in the set.</p> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
@@ -100,7 +99,7 @@ set.</p> | |||||
<p>For example:</p> | <p>For example:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<propertyset id="properties-starting-with-foo"> | <propertyset id="properties-starting-with-foo"> | ||||
<propertyref prefix="foo"/> | <propertyref prefix="foo"/> | ||||
</propertyset> | </propertyset> | ||||
@@ -111,7 +110,7 @@ set.</p> | |||||
<propertyset refid="properties-starting-with-foo"/> | <propertyset refid="properties-starting-with-foo"/> | ||||
<propertyset refid="properties-starting-with-bar"/> | <propertyset refid="properties-starting-with-bar"/> | ||||
</propertyset> | </propertyset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>collects all properties whose name starts with either | <p>collects all properties whose name starts with either | ||||
"foo" or "bar" in the set named | "foo" or "bar" in the set named | ||||
@@ -123,12 +122,12 @@ set.</p> | |||||
specified. The mapper is used to change the names of the property | specified. The mapper is used to change the names of the property | ||||
keys, for example: | keys, for example: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<propertyset id="properties-starting-with-foo"> | <propertyset id="properties-starting-with-foo"> | ||||
<propertyref prefix="foo"/> | <propertyref prefix="foo"/> | ||||
<mapper type="glob" from="foo*" to="bar*"/> | <mapper type="glob" from="foo*" to="bar*"/> | ||||
</propertyset> | </propertyset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>collects all properties whose name starts with "foo", but | <p>collects all properties whose name starts with "foo", but | ||||
changes the names to start with "bar" instead.</p> | changes the names to start with "bar" instead.</p> | ||||
@@ -42,15 +42,11 @@ Regexp represents a regular expression. | |||||
</table> | </table> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote><pre> | |||||
<regexp id="myregexp" pattern="alpha(.+)beta"/><br> | |||||
</pre></blockquote> | |||||
<pre><regexp id="myregexp" pattern="alpha(.+)beta"/></pre> | |||||
<p> | <p> | ||||
Defines a regular expression for later use with id myregexp. | Defines a regular expression for later use with id myregexp. | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<regexp refid="myregexp"/><br> | |||||
</pre></blockquote> | |||||
<pre><regexp refid="myregexp"/></pre> | |||||
<p> | <p> | ||||
Use the regular expression with id myregexp. | Use the regular expression with id myregexp. | ||||
</p> | </p> | ||||
@@ -67,15 +63,9 @@ See <a href="../install.html#librarydependencies">installation dependencies</a> | |||||
The property <code>ant.regexp.regexpimpl</code> governs which regular expression implementation will be chosen. | The property <code>ant.regexp.regexpimpl</code> governs which regular expression implementation will be chosen. | ||||
Possible values for this property are:</p> | Possible values for this property are:</p> | ||||
<ul> | <ul> | ||||
<li> | |||||
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp | |||||
</li> | |||||
<li> | |||||
org.apache.tools.ant.util.regexp.JakartaOroRegexp | |||||
</li> | |||||
<li> | |||||
org.apache.tools.ant.util.regexp.JakartaRegexpRegexp | |||||
</li> | |||||
<li>org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp</li> | |||||
<li>org.apache.tools.ant.util.regexp.JakartaOroRegexp</li> | |||||
<li>org.apache.tools.ant.util.regexp.JakartaRegexpRegexp</li> | |||||
</ul> | </ul> | ||||
<p>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> | If <code>ant.regexp.regexpimpl</code> is not defined, Ant uses Jdk14Regexp as this is always available.</p> | ||||
@@ -440,7 +440,6 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections: | |||||
preserving the order of nested collections as well as | preserving the order of nested collections as well as | ||||
duplicate resources (contrast with <a href="#union">union</a>). | duplicate resources (contrast with <a href="#union">union</a>). | ||||
</p> | </p> | ||||
<blockquote> | |||||
<table> | <table> | ||||
<tr> | <tr> | ||||
<td valign="top"><b>Attribute</b></td> | <td valign="top"><b>Attribute</b></td> | ||||
@@ -453,7 +452,6 @@ Ant's "legacy" datatypes have been modified to behave as Resource Collections: | |||||
<td valign="top" align="center">No, default <i>false</i></td> | <td valign="top" align="center">No, default <i>false</i></td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
</blockquote> | |||||
<h4 id="files">files</h4> | <h4 id="files">files</h4> | ||||
<p>A group of files. These files are matched by <b>absolute</b> patterns | <p>A group of files. These files are matched by <b>absolute</b> patterns | ||||
@@ -151,11 +151,11 @@ | |||||
<p>Here is an example of how to use the Contains Selector:</p> | <p>Here is an example of how to use the Contains Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${doc.path}" includes="**/*.html"> | <fileset dir="${doc.path}" includes="**/*.html"> | ||||
<contains text="script" casesensitive="no"/> | <contains text="script" casesensitive="no"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the HTML files that contain the string | <p>Selects all the HTML files that contain the string | ||||
<code>script</code>.</p> | <code>script</code>.</p> | ||||
@@ -232,11 +232,11 @@ | |||||
<p>Here is an example of how to use the Date Selector:</p> | <p>Here is an example of how to use the Date Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${jar.path}" includes="**/*.jar"> | <fileset dir="${jar.path}" includes="**/*.jar"> | ||||
<date datetime="01/01/2001 12:00 AM" when="before"/> | <date datetime="01/01/2001 12:00 AM" when="before"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all JAR files which were last modified before midnight | <p>Selects all JAR files which were last modified before midnight | ||||
January 1, 2001.</p> | January 1, 2001.</p> | ||||
@@ -282,11 +282,11 @@ | |||||
<p>Here is an example of how to use the Depend Selector:</p> | <p>Here is an example of how to use the Depend Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | <fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | ||||
<depend targetdir="${ant.1.4.1}/src/main"/> | <depend targetdir="${ant.1.4.1}/src/main"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the Java source files which were modified in the | <p>Selects all the Java source files which were modified in the | ||||
1.5 release. | 1.5 release. | ||||
@@ -324,11 +324,11 @@ | |||||
<p>Here is an example of how to use the Depth Selector:</p> | <p>Here is an example of how to use the Depth Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${doc.path}" includes="**/*"> | <fileset dir="${doc.path}" includes="**/*"> | ||||
<depth max="1"/> | <depth max="1"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all files in the base directory and one directory below | <p>Selects all files in the base directory and one directory below | ||||
that.</p> | that.</p> | ||||
@@ -410,12 +410,12 @@ | |||||
<p>Here is an example of how to use the Different Selector:</p> | <p>Here is an example of how to use the Different Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | <fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | ||||
<different targetdir="${ant.1.4.1}/src/main" | <different targetdir="${ant.1.4.1}/src/main" | ||||
ignoreFileTimes="true"/> | ignoreFileTimes="true"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Compares all the Java source files between the 1.4.1 and the 1.5 release | <p>Compares all the Java source files between the 1.4.1 and the 1.5 release | ||||
and selects those who are different, disregarding file times. | and selects those who are different, disregarding file times. | ||||
@@ -470,11 +470,11 @@ | |||||
<p>Here is an example of how to use the Filename Selector:</p> | <p>Here is an example of how to use the Filename Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${doc.path}" includes="**/*"> | <fileset dir="${doc.path}" includes="**/*"> | ||||
<filename name="**/*.css"/> | <filename name="**/*.css"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the cascading style sheet files.</p> | <p>Selects all the cascading style sheet files.</p> | ||||
@@ -526,11 +526,11 @@ | |||||
<p>Here is an example of how to use the Present Selector:</p> | <p>Here is an example of how to use the Present Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | <fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | ||||
<present present="srconly" targetdir="${ant.1.4.1}/src/main"/> | <present present="srconly" targetdir="${ant.1.4.1}/src/main"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the Java source files which are new in the | <p>Selects all the Java source files which are new in the | ||||
1.5 release. | 1.5 release. | ||||
@@ -585,11 +585,11 @@ | |||||
<p>Here is an example of how to use the regular expression Selector:</p> | <p>Here is an example of how to use the regular expression Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${doc.path}" includes="*.txt"> | <fileset dir="${doc.path}" includes="*.txt"> | ||||
<containsregexp expression="[4-6]\.[0-9]"/> | <containsregexp expression="[4-6]\.[0-9]"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the text files that match the regular expression | <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). | (have a 4,5 or 6 followed by a period and a number from 0 to 9). | ||||
@@ -643,14 +643,14 @@ | |||||
<p>Here is an example of how to use the Size Selector:</p> | <p>Here is an example of how to use the Size Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${jar.path}"> | <fileset dir="${jar.path}"> | ||||
<patternset> | <patternset> | ||||
<include name="**/*.jar"/> | <include name="**/*.jar"/> | ||||
</patternset> | </patternset> | ||||
<size value="4" units="Ki" when="more"/> | <size value="4" units="Ki" when="more"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all JAR files that are larger than 4096 bytes.</p> | <p>Selects all JAR files that are larger than 4096 bytes.</p> | ||||
@@ -681,24 +681,24 @@ | |||||
<p>Here is an example of how to use the Type Selector to select only | <p>Here is an example of how to use the Type Selector to select only | ||||
directories in <code>${src}</code></p> | directories in <code>${src}</code></p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${src}"> | <fileset dir="${src}"> | ||||
<type type="dir"/> | <type type="dir"/> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>The Type Selector is often used in conjunction with other selectors. | <p>The Type Selector is often used in conjunction with other selectors. | ||||
For example, to select files that also exist in a <code>template</code> | For example, to select files that also exist in a <code>template</code> | ||||
directory, but avoid selecting empty directories, use: | directory, but avoid selecting empty directories, use: | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${src}"> | <fileset dir="${src}"> | ||||
<and> | <and> | ||||
<present targetdir="template"/> | <present targetdir="template"/> | ||||
<type type="file"/> | <type type="file"/> | ||||
</and> | </and> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<h4 id="modified">Modified Selector</h4> | <h4 id="modified">Modified Selector</h4> | ||||
<p>The <code><modified></code> selector computes a value for a file, compares that | <p>The <code><modified></code> selector computes a value for a file, compares that | ||||
@@ -892,18 +892,18 @@ | |||||
<h5>Examples</h5> | <h5>Examples</h5> | ||||
<p>Here are some examples of how to use the Modified Selector:</p> | <p>Here are some examples of how to use the Modified Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy todir="dest"> | <copy todir="dest"> | ||||
<fileset dir="src"> | <fileset dir="src"> | ||||
<modified/> | <modified/> | ||||
</fileset> | </fileset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>This will copy all files from <i>src</i> to <i>dest</i> which content has changed. | <p>This will copy all files from <i>src</i> to <i>dest</i> which content has changed. | ||||
Using an updating PropertyfileCache with cache.properties and | Using an updating PropertyfileCache with cache.properties and | ||||
MD5-DigestAlgorithm.</p> | MD5-DigestAlgorithm.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy todir="dest"> | <copy todir="dest"> | ||||
<fileset dir="src"> | <fileset dir="src"> | ||||
<modified update="true" | <modified update="true" | ||||
@@ -916,11 +916,11 @@ | |||||
</modified> | </modified> | ||||
</fileset> | </fileset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>This is the same example rewritten as CoreSelector with setting the all the values | <p>This is the same example rewritten as CoreSelector with setting the all the values | ||||
(same as defaults are).</p> | (same as defaults are).</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<copy todir="dest"> | <copy todir="dest"> | ||||
<fileset dir="src"> | <fileset dir="src"> | ||||
<custom class="org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector"> | <custom class="org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector"> | ||||
@@ -934,10 +934,10 @@ | |||||
</custom> | </custom> | ||||
</fileset> | </fileset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>And this is the same rewritten as CustomSelector.</p> | <p>And this is the same rewritten as CustomSelector.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<target name="generate-and-upload-site"> | <target name="generate-and-upload-site"> | ||||
<echo> generate the site using forrest </echo> | <echo> generate the site using forrest </echo> | ||||
<antcall target="site"/> | <antcall target="site"/> | ||||
@@ -949,19 +949,19 @@ | |||||
</fileset> | </fileset> | ||||
</ftp> | </ftp> | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>A useful scenario for this selector inside a build environment | <p>A useful scenario for this selector inside a build environment | ||||
for homepage generation (e.g. with <a href="http://xml.apache.org/forrest/"> | for homepage generation (e.g. with <a href="http://xml.apache.org/forrest/"> | ||||
Apache Forrest</a>). Here all <b>changed</b> files are uploaded to the server. The | Apache Forrest</a>). Here all <b>changed</b> files are uploaded to the server. The | ||||
CacheSelector saves therefore much upload time.</p> | CacheSelector saves therefore much upload time.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<modified cacheclassname="com.mycompany.MyCache"> | <modified cacheclassname="com.mycompany.MyCache"> | ||||
<classpath> | <classpath> | ||||
<pathelement location="lib/mycompany-antutil.jar"/> | <pathelement location="lib/mycompany-antutil.jar"/> | ||||
</classpath> | </classpath> | ||||
</modified> | </modified> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Uses <tt>com.mycompany.MyCache</tt> from a jar outside of Ants own classpath | <p>Uses <tt>com.mycompany.MyCache</tt> from a jar outside of Ants own classpath | ||||
as cache implementation</p> | as cache implementation</p> | ||||
@@ -1277,14 +1277,14 @@ Select files whose filename length is even. | |||||
<p>Here is an example of how to use the And Selector:</p> | <p>Here is an example of how to use the And Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${dist}" includes="**/*.jar"> | <fileset dir="${dist}" includes="**/*.jar"> | ||||
<and> | <and> | ||||
<size value="4" units="Ki" when="more"/> | <size value="4" units="Ki" when="more"/> | ||||
<date datetime="01/01/2001 12:00 AM" when="before"/> | <date datetime="01/01/2001 12:00 AM" when="before"/> | ||||
</and> | </and> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the JAR file larger than 4096 bytes which haven't been update | <p>Selects all the JAR file larger than 4096 bytes which haven't been update | ||||
since the last millennium. | since the last millennium. | ||||
@@ -1315,7 +1315,7 @@ Select files whose filename length is even. | |||||
<p>Here is an example of how to use the Majority Selector:</p> | <p>Here is an example of how to use the Majority Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${docs}" includes="**/*.html"> | <fileset dir="${docs}" includes="**/*.html"> | ||||
<majority> | <majority> | ||||
<contains text="project" casesensitive="false"/> | <contains text="project" casesensitive="false"/> | ||||
@@ -1323,7 +1323,7 @@ Select files whose filename length is even. | |||||
<contains text="IntrospectionHelper" casesensitive="true"/> | <contains text="IntrospectionHelper" casesensitive="true"/> | ||||
</majority> | </majority> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the HTML files which contain at least two of the three | <p>Selects all the HTML files which contain at least two of the three | ||||
phrases "project", "taskdef", and "IntrospectionHelper" (this last phrase must | phrases "project", "taskdef", and "IntrospectionHelper" (this last phrase must | ||||
@@ -1340,7 +1340,7 @@ Select files whose filename length is even. | |||||
<p>Here is an example of how to use the None Selector:</p> | <p>Here is an example of how to use the None Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${src}" includes="**/*.java"> | <fileset dir="${src}" includes="**/*.java"> | ||||
<none> | <none> | ||||
<present targetdir="${dest}"/> | <present targetdir="${dest}"/> | ||||
@@ -1349,7 +1349,7 @@ Select files whose filename length is even. | |||||
</present> | </present> | ||||
</none> | </none> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects only Java files which do not have equivalent java or | <p>Selects only Java files which do not have equivalent java or | ||||
class files in the dest directory. | class files in the dest directory. | ||||
@@ -1363,13 +1363,13 @@ Select files whose filename length is even. | |||||
<p>Here is an example of how to use the Not Selector:</p> | <p>Here is an example of how to use the Not Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${src}" includes="**/*.java"> | <fileset dir="${src}" includes="**/*.java"> | ||||
<not> | <not> | ||||
<contains text="test"/> | <contains text="test"/> | ||||
</not> | </not> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the files in the src directory that do not contain the | <p>Selects all the files in the src directory that do not contain the | ||||
string "test". | string "test". | ||||
@@ -1385,7 +1385,7 @@ Select files whose filename length is even. | |||||
<p>Here is an example of how to use the Or Selector:</p> | <p>Here is an example of how to use the Or Selector:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${basedir}"> | <fileset dir="${basedir}"> | ||||
<or> | <or> | ||||
<depth max="0"/> | <depth max="0"/> | ||||
@@ -1394,7 +1394,7 @@ Select files whose filename length is even. | |||||
<filename name="*.jpg"/> | <filename name="*.jpg"/> | ||||
</or> | </or> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all the files in the top directory along with all the | <p>Selects all the files in the top directory along with all the | ||||
image files below it. | image files below it. | ||||
@@ -1442,7 +1442,7 @@ Select files whose filename length is even. | |||||
<p>Here is an example of how to use the Selector Reference:</p> | <p>Here is an example of how to use the Selector Reference:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<project default="all" basedir="./ant"> | <project default="all" basedir="./ant"> | ||||
<selector id="completed"> | <selector id="completed"> | ||||
@@ -1465,7 +1465,7 @@ Select files whose filename length is even. | |||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Zips up all the Java files which have an up-to-date equivalent | <p>Zips up all the Java files which have an up-to-date equivalent | ||||
class file and javadoc file associated with them. | class file and javadoc file associated with them. | ||||
@@ -1474,7 +1474,7 @@ Select files whose filename length is even. | |||||
<p>And an example of selecting files conditionally, based on whether | <p>And an example of selecting files conditionally, based on whether | ||||
properties are set:</p> | properties are set:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${working.copy}"> | <fileset dir="${working.copy}"> | ||||
<or> | <or> | ||||
<selector if="include.tests"> | <selector if="include.tests"> | ||||
@@ -1492,7 +1492,7 @@ Select files whose filename length is even. | |||||
</selector> | </selector> | ||||
</or> | </or> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>A fileset that conditionally contains Java source files and Test | <p>A fileset that conditionally contains Java source files and Test | ||||
source and class files.</p> | source and class files.</p> | ||||
@@ -1550,13 +1550,13 @@ Select files whose filename length is even. | |||||
use your class as a selector: | use your class as a selector: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${mydir}" includes="**/*"> | <fileset dir="${mydir}" includes="**/*"> | ||||
<custom classname="com.mydomain.MySelector"> | <custom classname="com.mydomain.MySelector"> | ||||
<param name="myattribute" value="myvalue"/> | <param name="myattribute" value="myvalue"/> | ||||
</custom> | </custom> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>A number of core selectors can also be used as custom selectors | <p>A number of core selectors can also be used as custom selectors | ||||
by specifying their attributes using <code><param></code> elements. These | by specifying their attributes using <code><param></code> elements. These | ||||
@@ -1578,13 +1578,13 @@ Select files whose filename length is even. | |||||
<p>Here is the example from the Depth Selector section rewritten | <p>Here is the example from the Depth Selector section rewritten | ||||
to use the selector through <code><custom></code>.</p> | to use the selector through <code><custom></code>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<fileset dir="${doc.path}" includes="**/*"> | <fileset dir="${doc.path}" includes="**/*"> | ||||
<custom classname="org.apache.tools.ant.types.selectors.DepthSelector"> | <custom classname="org.apache.tools.ant.types.selectors.DepthSelector"> | ||||
<param name="max" value="1"/> | <param name="max" value="1"/> | ||||
</custom> | </custom> | ||||
</fileset> | </fileset> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Selects all files in the base directory and one directory below | <p>Selects all files in the base directory and one directory below | ||||
that.</p> | that.</p> | ||||
@@ -159,7 +159,7 @@ resource collection</h4> | |||||
<p>The specified resource will be used as src.</p> | <p>The specified resource will be used as src.</p> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<copy todir="some-dir"> | <copy todir="some-dir"> | ||||
<tarfileset includes="lib/**"> | <tarfileset includes="lib/**"> | ||||
@@ -168,7 +168,7 @@ resource collection</h4> | |||||
</bzip2resource> | </bzip2resource> | ||||
</tarfileset> | </tarfileset> | ||||
</copy> | </copy> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>downloads the archive some-archive.tar.bz2, uncompresses and | <p>downloads the archive some-archive.tar.bz2, uncompresses and | ||||
extracts it on the fly, copies the contents of the lib directory into | extracts it on the fly, copies the contents of the lib directory into | ||||
@@ -241,17 +241,17 @@ resolver library from xml-commons is not available in the classpath, all | |||||
<p>Set up an XMLCatalog with a single dtd referenced locally in a user's | <p>Set up an XMLCatalog with a single dtd referenced locally in a user's | ||||
home | home | ||||
directory:</p> | directory:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<xmlcatalog> | <xmlcatalog> | ||||
<dtd | <dtd | ||||
publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" | publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" | ||||
location="/home/dion/downloads/docbook/docbookx.dtd"/> | location="/home/dion/downloads/docbook/docbookx.dtd"/> | ||||
</xmlcatalog> | </xmlcatalog> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Set up an XMLCatalog with a multiple dtds to be found either in the | <p>Set up an XMLCatalog with a multiple dtds to be found either in the | ||||
filesystem (relative to the Ant project basedir) or in the classpath: | filesystem (relative to the Ant project basedir) or in the classpath: | ||||
</p> | </p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<xmlcatalog id="commonDTDs"> | <xmlcatalog id="commonDTDs"> | ||||
<dtd | <dtd | ||||
publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" | publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" | ||||
@@ -260,13 +260,13 @@ filesystem (relative to the Ant project basedir) or in the classpath: | |||||
publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" | publicId="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" | ||||
location="web-app_2_2.dtd"/> | location="web-app_2_2.dtd"/> | ||||
</xmlcatalog> | </xmlcatalog> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Set up an XMLCatalog with a combination of DTDs and entities as | <p>Set up an XMLCatalog with a combination of DTDs and entities as | ||||
well as a nested XMLCatalog and external catalog files in both | well as a nested XMLCatalog and external catalog files in both | ||||
formats:</p> | formats:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<xmlcatalog id="allcatalogs"> | <xmlcatalog id="allcatalogs"> | ||||
<dtd | <dtd | ||||
publicId="-//ArielPartners//DTD XML Article V1.0//EN" | publicId="-//ArielPartners//DTD XML Article V1.0//EN" | ||||
@@ -286,9 +286,9 @@ formats:</p> | |||||
</catalogpath> | </catalogpath> | ||||
</xmlcatalog> | </xmlcatalog> | ||||
</xmlcatalog> | </xmlcatalog> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>To reference the above XMLCatalog in an <code>xslt</code> task:<p> | <p>To reference the above XMLCatalog in an <code>xslt</code> task:<p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<xslt basedir="${source.doc}" | <xslt basedir="${source.doc}" | ||||
destdir="${dest.xdocs}" | destdir="${dest.xdocs}" | ||||
extension=".xml" | extension=".xml" | ||||
@@ -297,7 +297,7 @@ formats:</p> | |||||
force="true"> | force="true"> | ||||
<xmlcatalog refid="allcatalogs"/> | <xmlcatalog refid="allcatalogs"/> | ||||
</xslt> | </xslt> | ||||
</pre></blockquote> | |||||
</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -130,21 +130,19 @@ single element resource collection</h4> | |||||
<p>The specified resource will be used as src.</p> | <p>The specified resource will be used as src.</p> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote> | |||||
<pre> <zip destfile="${dist}/manual.zip"> | |||||
<pre> <zip destfile="${dist}/manual.zip"> | |||||
<zipfileset dir="htdocs/manual" prefix="docs/user-guide"/> | <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/> | ||||
<zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/> | <zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/> | ||||
<zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/> | <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/> | ||||
</zip></pre> | </zip></pre> | ||||
<p>zips all files in the <code>htdocs/manual</code> directory into | |||||
<p>zips all files in the <code>htdocs/manual</code> directory into | |||||
the <code>docs/user-guide</code> directory in the archive, adds the | 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>, | 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>. | 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> | The archive might end up containing the files:</p> | ||||
<code>docs/user-guide/html/index.html<br> | |||||
docs/ChangeLog.txt<br> | |||||
docs/examples/index.html<br> | |||||
</code></blockquote> | |||||
<pre>docs/user-guide/html/index.html | |||||
docs/ChangeLog.txt | |||||
docs/examples/index.html</pre> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -275,7 +275,6 @@ If your task needs to nest an arbitrary type that has been defined | |||||
org.apache.tools.ant.taskdefs.condition.Condition, one may | org.apache.tools.ant.taskdefs.condition.Condition, one may | ||||
have a class: | have a class: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
public class MyTask extends Task { | public class MyTask extends Task { | ||||
private List conditions = new ArrayList(); | private List conditions = new ArrayList(); | ||||
@@ -287,25 +286,21 @@ public class MyTask extends Task { | |||||
} | } | ||||
} | } | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p> | <p> | ||||
One may define and use this class like this: | One may define and use this class like this: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
<taskdef name="mytask" classname="MyTask" classpath="classes"/> | <taskdef name="mytask" classname="MyTask" classpath="classes"/> | ||||
<typedef name="condition.equals" | <typedef name="condition.equals" | ||||
classname="org.apache.tools.ant.taskdefs.conditions.Equals"/> | classname="org.apache.tools.ant.taskdefs.conditions.Equals"/> | ||||
<mytask> | <mytask> | ||||
<condition.equals arg1="${debug}" arg2="true"/> | <condition.equals arg1="${debug}" arg2="true"/> | ||||
</mytask> | </mytask> | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
A more complicated example follows: | A more complicated example follows: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre> | |||||
<pre> | |||||
public class Sample { | public class Sample { | ||||
public static class MyFileSelector implements FileSelector { | public static class MyFileSelector implements FileSelector { | ||||
public void setAttrA(int a) {} | public void setAttrA(int a) {} | ||||
@@ -334,14 +329,13 @@ public class Sample { | |||||
public void setCount(int c) {} | public void setCount(int c) {} | ||||
} | } | ||||
} | } | ||||
</pre> | |||||
</blockquote> | |||||
</pre> | |||||
<p> | <p> | ||||
This class defines a number of static classes that implement/extend | This class defines a number of static classes that implement/extend | ||||
Path, MyFileSelector and MyInterface. These may be defined and used | Path, MyFileSelector and MyInterface. These may be defined and used | ||||
as follows: | as follows: | ||||
</p> | </p> | ||||
<pre> | |||||
<pre> | |||||
<typedef name="myfileselector" classname="Sample$MyFileSelector" | <typedef name="myfileselector" classname="Sample$MyFileSelector" | ||||
classpath="classes" loaderref="classes"/> | classpath="classes" loaderref="classes"/> | ||||
<typedef name="buildpath" classname="Sample$BuildPath" | <typedef name="buildpath" classname="Sample$BuildPath" | ||||
@@ -358,7 +352,7 @@ public class Sample { | |||||
</myfileselector> | </myfileselector> | ||||
</fileset> | </fileset> | ||||
</copy> | </copy> | ||||
</pre> | |||||
</pre> | |||||
<h3 id="taskcontainer">TaskContainer</h3> | <h3 id="taskcontainer">TaskContainer</h3> | ||||
@@ -382,7 +376,7 @@ invoke <code>perform</code> on these instances instead of | |||||
<p>Let's write our own task, which prints a message on the | <p>Let's write our own task, which prints a message on the | ||||
<code>System.out</code> stream. | <code>System.out</code> stream. | ||||
The task has one attribute, called <code>message</code>.</p> | The task has one attribute, called <code>message</code>.</p> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
package com.mydomain; | package com.mydomain; | ||||
@@ -403,7 +397,7 @@ public class MyVeryOwnTask extends Task { | |||||
} | } | ||||
} | } | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>It's really this simple ;-)</p> | <p>It's really this simple ;-)</p> | ||||
<p>Adding your task to the system is rather simple too:</p> | <p>Adding your task to the system is rather simple too:</p> | ||||
<ol> | <ol> | ||||
@@ -415,7 +409,7 @@ public class MyVeryOwnTask extends Task { | |||||
</ol> | </ol> | ||||
<h3>Example</h3> | <h3>Example</h3> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||||
@@ -427,7 +421,6 @@ public class MyVeryOwnTask extends Task { | |||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<h3>Example 2</h3> | <h3>Example 2</h3> | ||||
To use a task directly from the buildfile which created it, place the | To use a task directly from the buildfile which created it, place the | ||||
@@ -435,7 +428,7 @@ To use a task directly from the buildfile which created it, place the | |||||
<i>after the compilation</i>. Use the <code>classpath</code> attribute of | <i>after the compilation</i>. Use the <code>classpath</code> attribute of | ||||
<code><taskdef></code> to point to where the code has just been | <code><taskdef></code> to point to where the code has just been | ||||
compiled. | compiled. | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||||
@@ -457,7 +450,6 @@ compiled. | |||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>Another way to add a task (more permanently), is to add the task name and | <p>Another way to add a task (more permanently), is to add the task name and | ||||
implementing class name to the <code>default.properties</code> file in the | implementing class name to the <code>default.properties</code> file in the | ||||
@@ -502,9 +494,9 @@ listener, of course).</p> | |||||
<p>If you wish to attach a listener from the command line you may use the | <p>If you wish to attach a listener from the command line you may use the | ||||
<code>-listener</code> option. For example:</p> | <code>-listener</code> option. For example:</p> | ||||
<blockquote> | |||||
<pre>ant -listener org.apache.tools.ant.XmlLogger</pre> | |||||
</blockquote> | |||||
<pre>ant -listener org.apache.tools.ant.XmlLogger</pre> | |||||
<p>will run Ant with a listener that generates an XML representation of the build progress. This | <p>will run Ant with a listener that generates an XML representation of the build progress. This | ||||
listener is included with Ant, as is the default listener, which generates the logging to standard output.</p> | listener is included with Ant, as is the default listener, which generates the logging to standard output.</p> | ||||
@@ -528,7 +520,6 @@ When starting your build provide your adapter class and the log library to the | |||||
build classpath and activate your logger via <code>-listener</code> option as | build classpath and activate your logger via <code>-listener</code> option as | ||||
described above. | described above. | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
public class MyLogAdapter implements BuildListener { | public class MyLogAdapter implements BuildListener { | ||||
@@ -555,7 +546,6 @@ public class MyLogAdapter implements BuildListener { | |||||
// implement all methods in that way | // implement all methods in that way | ||||
} | } | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<hr> | <hr> | ||||
<h2 id="integration">Source code integration</h2> | <h2 id="integration">Source code integration</h2> | ||||
@@ -28,11 +28,10 @@ | |||||
<p><em>Since Ant 1.9.1</em>, it is possible to add if and unless attributes on all tasks and nested elements using special namespaces.</p> | <p><em>Since Ant 1.9.1</em>, it is possible to add if and unless attributes on all tasks and nested elements using special namespaces.</p> | ||||
<p>In order to use this feature you need to add the following namespace declarations</p> | <p>In order to use this feature you need to add the following namespace declarations</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
xmlns:if="ant:if" | xmlns:if="ant:if" | ||||
xmlns:unless="ant:unless" | xmlns:unless="ant:unless" | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>The if and unless namespaces support the following 3 conditions:</p> | <p>The if and unless namespaces support the following 3 conditions:</p> | ||||
<ul> | <ul> | ||||
@@ -40,8 +39,6 @@ | |||||
<li>blank</li>true if the value of the attribute is null or empty | <li>blank</li>true if the value of the attribute is null or empty | ||||
<li>set</li>true if the specified property is set | <li>set</li>true if the specified property is set | ||||
</ul> | </ul> | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<project name="tryit" | <project name="tryit" | ||||
xmlns:if="ant:if" | xmlns:if="ant:if" | ||||
@@ -58,7 +55,6 @@ | |||||
<echo unless:set="onmac">not running on MacOS</echo> | <echo unless:set="onmac">not running on MacOS</echo> | ||||
</project> | </project> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -418,9 +418,7 @@ the optional Ant tasks need. | |||||
To do so, change to the <code>ANT_HOME</code> directory and execute the command: | To do so, change to the <code>ANT_HOME</code> directory and execute the command: | ||||
</p> | </p> | ||||
<blockquote> | |||||
<pre>ant -f fetch.xml -Ddest=<i>[option]</i></pre> | |||||
</blockquote> | |||||
<pre>ant -f fetch.xml -Ddest=<i>[option]</i></pre> | |||||
<p> | <p> | ||||
where option is one of the following, as described above: | where option is one of the following, as described above: | ||||
@@ -528,21 +526,15 @@ laptop, you have to change these settings as you roam. To set <code>ANT_OPTS</co | |||||
<p> | <p> | ||||
For csh/tcsh: | For csh/tcsh: | ||||
</p> | </p> | ||||
<pre> | |||||
setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080" | |||||
</pre> | |||||
<pre>setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"</pre> | |||||
<p> | <p> | ||||
For bash: | For bash: | ||||
</p> | </p> | ||||
<pre> | |||||
export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080" | |||||
</pre> | |||||
<pre>export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"</pre> | |||||
<p> | <p> | ||||
For Windows, set the environment variable in the appropriate dialog box and open a new console or, by hand | For Windows, set the environment variable in the appropriate dialog box and open a new console or, by hand | ||||
</p> | </p> | ||||
<pre> | |||||
set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 | |||||
</pre> | |||||
<pre>set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080</pre> | |||||
</blockquote> | </blockquote> | ||||
</li> | </li> | ||||
@@ -757,9 +749,9 @@ reasons why the <a href="Tasks/chmod.html">chmod</a> task might fail (like when | |||||
different user than the one who installed Ant initially). In this case you can set the Ant | different user than the one who installed Ant initially). In this case you can set the Ant | ||||
property <code>chmod.fail</code> to false when starting the build like in | property <code>chmod.fail</code> to false when starting the build like in | ||||
</p> | </p> | ||||
<blockquote> | |||||
<p><code>sh build.sh install -Dchmod.fail=false</code></p> | |||||
</blockquote> | |||||
<pre>sh build.sh install -Dchmod.fail=false</pre> | |||||
<p> | <p> | ||||
and any error to change permission will not result in a build failure. | and any error to change permission will not result in a build failure. | ||||
</p> | </p> | ||||
@@ -134,15 +134,13 @@ listeners and loggers.</p> | |||||
<h3 id="DefaultLogger">DefaultLogger</h3> | <h3 id="DefaultLogger">DefaultLogger</h3> | ||||
<p>Simply run Ant normally, or:</p> | <p>Simply run Ant normally, or:</p> | ||||
<blockquote> | |||||
<p><code>ant -logger org.apache.tools.ant.DefaultLogger</code></p> | |||||
</blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.DefaultLogger</pre> | |||||
<h3 id="NoBannerLogger">NoBannerLogger</h3> | <h3 id="NoBannerLogger">NoBannerLogger</h3> | ||||
<p>Removes output of empty target output.</p> | <p>Removes output of empty target output.</p> | ||||
<blockquote> | |||||
<p><code>ant -logger org.apache.tools.ant.NoBannerLogger</code></p> | |||||
</blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.NoBannerLogger</pre> | |||||
<h3 id="MailLogger">MailLogger</h3> | <h3 id="MailLogger">MailLogger</h3> | ||||
<p>The MailLogger captures all output logged through DefaultLogger (standard Ant | <p>The MailLogger captures all output logged through DefaultLogger (standard Ant | ||||
@@ -280,9 +278,7 @@ control for turning off success or failure messages individually.</p> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
<blockquote> | |||||
<p><code>ant -logger org.apache.tools.ant.listener.MailLogger</code></p> | |||||
</blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.listener.MailLogger</pre> | |||||
<h3 id="AnsiColorLogger">AnsiColorLogger</h3> | <h3 id="AnsiColorLogger">AnsiColorLogger</h3> | ||||
@@ -353,9 +349,7 @@ Background is one of the following: | |||||
46 -> Cyan | 46 -> Cyan | ||||
47 -> White</pre> | 47 -> White</pre> | ||||
<blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.listener.AnsiColorLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.AnsiColorLogger</pre> | ||||
</blockquote> | |||||
<h3 id="Log4jListener">Log4jListener</h3> | <h3 id="Log4jListener">Log4jListener</h3> | ||||
<p><b>Deprecated:</b> Apache Log4j (1) is not developed any more. Last | <p><b>Deprecated:</b> Apache Log4j (1) is not developed any more. Last | ||||
@@ -374,24 +368,19 @@ INFO or ERROR depending on whether the build failed during that stage. Message | |||||
events are logged according to their Ant logging level, mapping directly to a | events are logged according to their Ant logging level, mapping directly to a | ||||
corresponding Log4j level.</p> | corresponding Log4j level.</p> | ||||
<blockquote> | |||||
<pre>ant -listener org.apache.tools.ant.listener.Log4jListener</pre> | <pre>ant -listener org.apache.tools.ant.listener.Log4jListener</pre> | ||||
</blockquote> | |||||
<p>To use Log4j you will need the Log4j JAR file and a 'log4j.properties' | <p>To use Log4j you will need the Log4j JAR file and a 'log4j.properties' | ||||
configuration file. Both should be placed somewhere in your Ant | configuration file. Both should be placed somewhere in your Ant | ||||
classpath. If the log4j.properties is in your project root folder you can | classpath. If the log4j.properties is in your project root folder you can | ||||
add this with <i>-lib</i> option:</p> | add this with <i>-lib</i> option:</p> | ||||
<blockquote> | |||||
<pre>ant -listener org.apache.tools.ant.listener.Log4jListener -lib .</pre> | <pre>ant -listener org.apache.tools.ant.listener.Log4jListener -lib .</pre> | ||||
</blockquote> | |||||
<p>If, for example, you wanted to capture the same information output to the | <p>If, for example, you wanted to capture the same information output to the | ||||
console by the DefaultLogger and send it to a file named 'build.log', you | console by the DefaultLogger and send it to a file named 'build.log', you | ||||
could use the following configuration:</p> | could use the following configuration:</p> | ||||
<blockquote> | |||||
<pre>log4j.rootLogger=ERROR, LogFile | <pre>log4j.rootLogger=ERROR, LogFile | ||||
log4j.logger.org.apache.tools.ant.Project=INFO | log4j.logger.org.apache.tools.ant.Project=INFO | ||||
log4j.logger.org.apache.tools.ant.Target=INFO | log4j.logger.org.apache.tools.ant.Target=INFO | ||||
@@ -403,7 +392,6 @@ log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout | |||||
log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n | log4j.appender.LogFile.layout.ConversionPattern=[%6r] %8c{1} : %m%n | ||||
log4j.appender.LogFile.file=build.log | log4j.appender.LogFile.file=build.log | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<p>For more information about configuring Log4J see <a href="http://logging.apache.org/log4j/docs/documentation.html">its | <p>For more information about configuring Log4J see <a href="http://logging.apache.org/log4j/docs/documentation.html">its | ||||
documentation page</a>.</p> | documentation page</a>.</p> | ||||
@@ -421,7 +409,6 @@ For using the bridge with Ant you have to add | |||||
to your classpath (e.g. via the <code>-lib</code> option). | to your classpath (e.g. via the <code>-lib</code> option). | ||||
(For using the bridge Ant 1.9.10/1.10.2 or higher is required.) | (For using the bridge Ant 1.9.10/1.10.2 or higher is required.) | ||||
Translating the 1.x properties file into the 2.x xml syntax would result in | Translating the 1.x properties file into the 2.x xml syntax would result in | ||||
<blockquote> | |||||
<pre><?xml version="1.0" encoding="UTF-8"?> | <pre><?xml version="1.0" encoding="UTF-8"?> | ||||
<Configuration status="WARN"> | <Configuration status="WARN"> | ||||
<Appenders> | <Appenders> | ||||
@@ -442,7 +429,6 @@ Translating the 1.x properties file into the 2.x xml syntax would result in | |||||
</Loggers> | </Loggers> | ||||
</Configuration> | </Configuration> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
<h3 id="XmlLogger">XmlLogger</h3> | <h3 id="XmlLogger">XmlLogger</h3> | ||||
<p>Writes all build information out to an XML file named log.xml, or the value | <p>Writes all build information out to an XML file named log.xml, or the value | ||||
@@ -459,10 +445,8 @@ this can be a relative or absolute file path, or an http URL. | |||||
If you set the property to the empty string, "", no XSLT transform | If you set the property to the empty string, "", no XSLT transform | ||||
is declared at all.</p> | is declared at all.</p> | ||||
<blockquote> | |||||
<pre>ant -listener org.apache.tools.ant.XmlLogger | <pre>ant -listener org.apache.tools.ant.XmlLogger | ||||
ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | ||||
</blockquote> | |||||
<h3 id="TimestampedLogger">TimestampedLogger</h3> | <h3 id="TimestampedLogger">TimestampedLogger</h3> | ||||
<p> | <p> | ||||
@@ -474,9 +458,7 @@ ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | |||||
</pre> | </pre> | ||||
<p>To use this listener, use the command:</p> | <p>To use this listener, use the command:</p> | ||||
<blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.listener.TimestampedLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.TimestampedLogger</pre> | ||||
</blockquote> | |||||
<h3 id="BigProjectLogger">BigProjectLogger</h3> | <h3 id="BigProjectLogger">BigProjectLogger</h3> | ||||
<p> | <p> | ||||
@@ -528,9 +510,7 @@ Exiting project "junit" | |||||
are in charge -or more importantly, which project is failing. | are in charge -or more importantly, which project is failing. | ||||
</p> | </p> | ||||
<p>To use this listener, use the command:</p> | <p>To use this listener, use the command:</p> | ||||
<blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.listener.BigProjectLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.BigProjectLogger</pre> | ||||
</blockquote> | |||||
<h3 id="SimpleBigProjectLogger">SimpleBigProjectLogger</h3> | <h3 id="SimpleBigProjectLogger">SimpleBigProjectLogger</h3> | ||||
<p>Like <code>BigProjectLogger</code>, project-qualified target names are printed, | <p>Like <code>BigProjectLogger</code>, project-qualified target names are printed, | ||||
@@ -558,9 +538,7 @@ Total time: 1 second | |||||
</pre> | </pre> | ||||
<p><em>since Ant 1.8.1</em></p> | <p><em>since Ant 1.8.1</em></p> | ||||
<p>To use this listener, use the command:</p> | <p>To use this listener, use the command:</p> | ||||
<blockquote> | |||||
<pre>ant -logger org.apache.tools.ant.listener.SimpleBigProjectLogger</pre> | <pre>ant -logger org.apache.tools.ant.listener.SimpleBigProjectLogger</pre> | ||||
</blockquote> | |||||
<h3 id="ProfileLogger">ProfileLogger</h3> | <h3 id="ProfileLogger">ProfileLogger</h3> | ||||
<p>This logger stores the time needed for executing a task, target and the whole build and prints | <p>This logger stores the time needed for executing a task, target and the whole build and prints | ||||
@@ -191,41 +191,30 @@ JVM documentation for more details. | |||||
</p> | </p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<blockquote> | |||||
<pre>ant</pre> | |||||
</blockquote> | |||||
<pre>ant</pre> | |||||
<p>runs Ant using the <code>build.xml</code> file in the current directory, on | <p>runs Ant using the <code>build.xml</code> file in the current directory, on | ||||
the default target.</p> | the default target.</p> | ||||
<blockquote> | |||||
<pre>ant -buildfile test.xml</pre> | |||||
</blockquote> | |||||
<pre>ant -buildfile test.xml</pre> | |||||
<p>runs Ant using the <code>test.xml</code> file in the current directory, on | <p>runs Ant using the <code>test.xml</code> file in the current directory, on | ||||
the default target.</p> | the default target.</p> | ||||
<blockquote> | |||||
<pre>ant -buildfile test.xml dist</pre> | |||||
</blockquote> | |||||
<pre>ant -buildfile test.xml dist</pre> | |||||
<p>runs Ant using the <code>test.xml</code> file in the current directory, on | <p>runs Ant using the <code>test.xml</code> file in the current directory, on | ||||
the target called <code>dist</code>.</p> | the target called <code>dist</code>.</p> | ||||
<blockquote> | |||||
<pre>ant -buildfile test.xml -Dbuild=build/classes dist</pre> | |||||
</blockquote> | |||||
<pre>ant -buildfile test.xml -Dbuild=build/classes dist</pre> | |||||
<p>runs Ant using the <code>test.xml</code> file in the current directory, on | <p>runs Ant using the <code>test.xml</code> file in the current directory, on | ||||
the target called <code>dist</code>, setting the <code>build</code> property | the target called <code>dist</code>, setting the <code>build</code> property | ||||
to the value <code>build/classes</code>.</p> | to the value <code>build/classes</code>.</p> | ||||
<blockquote> | |||||
<pre>ant -lib /home/ant/extras</pre> | |||||
</blockquote> | |||||
<pre>ant -lib /home/ant/extras</pre> | |||||
<p>runs Ant picking up additional task and support jars from the | <p>runs Ant picking up additional task and support jars from the | ||||
/home/ant/extras location</p> | /home/ant/extras location</p> | ||||
<blockquote> | |||||
<pre>ant -lib one.jar;another.jar</pre> | |||||
<pre>ant -lib one.jar -lib another.jar</pre> | |||||
</blockquote> | |||||
<pre>ant -lib one.jar;another.jar</pre> | |||||
<pre>ant -lib one.jar -lib another.jar</pre> | |||||
<p>adds two jars to Ants classpath.</p> | <p>adds two jars to Ants classpath.</p> | ||||
<h3 id="files">Files</h3> | <h3 id="files">Files</h3> | ||||
@@ -262,9 +251,7 @@ set):</p> | |||||
<p>Some of Ant's core classes can be configured via system properties.</p> | <p>Some of Ant's core classes can be configured via system properties.</p> | ||||
<p>Here is the result of a search through the codebase. Because system properties are | <p>Here is the result of a search through the codebase. Because system properties are | ||||
available via Project instance, I searched for them with a</p> | available via Project instance, I searched for them with a</p> | ||||
<pre> | |||||
grep -r -n "getPropert" * > ..\grep.txt | |||||
</pre> | |||||
<pre>grep -r -n "getPropert" * > ..\grep.txt</pre> | |||||
<p>command. After that I filtered out the often-used but not-so-important values (most of them | <p>command. After that I filtered out the often-used but not-so-important values (most of them | ||||
read-only values): <i>path.separator, ant.home, basedir, user.dir, os.name, | read-only values): <i>path.separator, ant.home, basedir, user.dir, os.name, | ||||
line.separator, java.home, java.version, java.version, user.home, java.class.path</i><br> | line.separator, java.home, java.version, java.version, user.home, java.class.path</i><br> | ||||
@@ -565,13 +552,9 @@ have some documentation inside.</p> | |||||
<h2 id="viajava">Running Ant via Java</h2> | <h2 id="viajava">Running Ant via Java</h2> | ||||
<p>If you have installed Ant in the do-it-yourself way, Ant can be started | <p>If you have installed Ant in the do-it-yourself way, Ant can be started | ||||
from one of two entry points:</p> | from one of two entry points:</p> | ||||
<blockquote> | |||||
<pre>java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]</pre> | |||||
</blockquote> | |||||
<blockquote> | |||||
<pre>java -Dant.home=c:\ant org.apache.tools.ant.launch.Launcher [options] [target]</pre> | |||||
</blockquote> | |||||
<pre>java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]</pre> | |||||
<pre>java -Dant.home=c:\ant org.apache.tools.ant.launch.Launcher [options] [target]</pre> | |||||
<p> | <p> | ||||
The first method runs Ant's traditional entry point. The second method uses | The first method runs Ant's traditional entry point. The second method uses | ||||
@@ -84,11 +84,13 @@ code { | |||||
pre { | pre { | ||||
background-color: #efefef; | background-color: #efefef; | ||||
margin-right: 4rem; | |||||
margin-left: 4rem; | |||||
} | } | ||||
/* code snippets in examples and tutorials */ | /* code snippets in examples and tutorials */ | ||||
.code { | .code { | ||||
background: #EFEFEF; | |||||
background: #efefef; | |||||
} | } | ||||
/* highlight console output */ | /* highlight console output */ | ||||
@@ -40,12 +40,10 @@ | |||||
mind that it is possible that a target can get executed earlier | mind that it is possible that a target can get executed earlier | ||||
when an earlier target depends on it:</p> | when an earlier target depends on it:</p> | ||||
<blockquote> | |||||
<pre><target name="A"/> | |||||
<pre><target name="A"/> | |||||
<target name="B" depends="A"/> | <target name="B" depends="A"/> | ||||
<target name="C" depends="B"/> | <target name="C" depends="B"/> | ||||
<target name="D" depends="C,B,A"/></pre> | <target name="D" depends="C,B,A"/></pre> | ||||
</blockquote> | |||||
<p>Suppose we want to execute target D. From its | <p>Suppose we want to execute target D. From its | ||||
<code>depends</code> attribute, you might think that first target | <code>depends</code> attribute, you might think that first target | ||||
@@ -53,7 +51,7 @@ | |||||
depends on A, so first A is executed, then B, then C, and finally | depends on A, so first A is executed, then B, then C, and finally | ||||
D.</p> | D.</p> | ||||
<blockquote><pre><b>Call-Graph:</b> A --> B --> C --> D</pre></blockquote> | |||||
<pre><b>Call-Graph:</b> A --> B --> C --> D</pre> | |||||
<p>In a chain of dependencies stretching back from a given target | <p>In a chain of dependencies stretching back from a given target | ||||
such as D above, each target gets executed only once, even when | such as D above, each target gets executed only once, even when | ||||
@@ -81,10 +79,8 @@ | |||||
<a href="properties.html#if+unless">the properties page</a> for | <a href="properties.html#if+unless">the properties page</a> for | ||||
more details. For example:</p> | more details. For example:</p> | ||||
<blockquote> | |||||
<pre><target name="build-module-A" if="module-A-present"/></pre> | <pre><target name="build-module-A" if="module-A-present"/></pre> | ||||
<pre><target name="build-own-fake-module-A" unless="module-A-present"/></pre> | <pre><target name="build-own-fake-module-A" unless="module-A-present"/></pre> | ||||
</blockquote> | |||||
<p>In the first example, if the <code>module-A-present</code> | <p>In the first example, if the <code>module-A-present</code> | ||||
property is set (to any value, e.g. <i>false</i>), the target will | property is set (to any value, e.g. <i>false</i>), the target will | ||||
@@ -96,7 +92,7 @@ | |||||
clause. If you want to check multiple conditions, you can use a | clause. If you want to check multiple conditions, you can use a | ||||
dependent target for computing the result for the check:</p> | dependent target for computing the result for the check:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<target name="myTarget" depends="myTarget.check" if="myTarget.run"> | <target name="myTarget" depends="myTarget.check" if="myTarget.run"> | ||||
<echo>Files foo.txt and bar.txt are present.</echo> | <echo>Files foo.txt and bar.txt are present.</echo> | ||||
</target> | </target> | ||||
@@ -109,9 +105,9 @@ | |||||
</and> | </and> | ||||
</condition> | </condition> | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<blockquote><pre><b>Call-Graph:</b> myTarget.check --> maybe(myTarget)</pre></blockquote> | |||||
<pre><b>Call-Graph:</b> myTarget.check --> maybe(myTarget)</pre> | |||||
<p>If no <code>if</code> and no <code>unless</code> attribute is | <p>If no <code>if</code> and no <code>unless</code> attribute is | ||||
present, the target will always be executed.</p> | present, the target will always be executed.</p> | ||||
@@ -136,7 +132,7 @@ | |||||
depend. Make sure that target is always the first one in the | depend. Make sure that target is always the first one in the | ||||
depends list of the other targets. In this manual, most | depends list of the other targets. In this manual, most | ||||
initialization targets have the name <code>"init"</code>.</p> | initialization targets have the name <code>"init"</code>.</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<project> | <project> | ||||
<target name="init"> | <target name="init"> | ||||
<tstamp/> | <tstamp/> | ||||
@@ -145,15 +141,15 @@ | |||||
... | ... | ||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>Especially if you only have a few tasks you also could place these | <p>Especially if you only have a few tasks you also could place these | ||||
tasks directly under the project tag (since Ant 1.6.0):</p> | tasks directly under the project tag (since Ant 1.6.0):</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<project> | <project> | ||||
<tstamp/> | <tstamp/> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>If the depends attribute and the if/unless attribute are set, the | <p>If the depends attribute and the if/unless attribute are set, the | ||||
depends attribute is executed first.</p> | depends attribute is executed first.</p> | ||||
@@ -263,7 +259,7 @@ | |||||
<p>For example your imported build file may need to compile code, it | <p>For example your imported build file may need to compile code, it | ||||
might look like:</p> | might look like:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<target name="create-directory-layout"> | <target name="create-directory-layout"> | ||||
... | ... | ||||
</target> | </target> | ||||
@@ -272,20 +268,20 @@ | |||||
<target name="compile" depends="ready-to-compile"> | <target name="compile" depends="ready-to-compile"> | ||||
... | ... | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<blockquote><pre><b>Call-Graph:</b> create-directory-layout --> 'empty slot' --> compile</pre></blockquote> | |||||
<pre><b>Call-Graph:</b> create-directory-layout --> 'empty slot' --> compile</pre> | |||||
<p>And you need to generate some source before compilation, then in | <p>And you need to generate some source before compilation, then in | ||||
your main build file you may use something like</p> | your main build file you may use something like</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<target name="generate-sources" | <target name="generate-sources" | ||||
extensionOf="ready-to-compile"> | extensionOf="ready-to-compile"> | ||||
... | ... | ||||
</target> | </target> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<blockquote><pre><b>Call-Graph:</b> create-directory-layout --> generate-sources --> compile</pre></blockquote> | |||||
<pre><b>Call-Graph:</b> create-directory-layout --> generate-sources --> compile</pre> | |||||
<p>This will ensure that the <em>generate-sources</em> target is | <p>This will ensure that the <em>generate-sources</em> target is | ||||
executed before the <em>compile</em> target.</p> | executed before the <em>compile</em> target.</p> | ||||
@@ -486,11 +486,11 @@ need the HTML report just for testing, e.g. if you are fixing an error or a inte | |||||
</p> | </p> | ||||
<h2 id="resources">Resources</h2> | <h2 id="resources">Resources</h2> | ||||
<pre> | |||||
[1] <a href="http://www.apache.org/dist/logging/log4j/1.2.13/logging-log4j-1.2.13.zip">http://www.apache.org/dist/logging/log4j/1.2.13/logging-log4j-1.2.13.zip</a> | |||||
[2] <a href="http://logging.apache.org/log4j/docs/manual.html">http://logging.apache.org/log4j/docs/manual.html</a> | |||||
[3] <a href="http://www.junit.org/index.htm">http://www.junit.org/index.htm</a> | |||||
</pre> | |||||
<ol class="refs"> | |||||
<li><a href="http://www.apache.org/dist/logging/log4j/1.2.13/logging-log4j-1.2.13.zip">http://www.apache.org/dist/logging/log4j/1.2.13/logging-log4j-1.2.13.zip</a></li> | |||||
<li><a href="http://logging.apache.org/log4j/docs/manual.html">http://logging.apache.org/log4j/docs/manual.html</a></li> | |||||
<li><a href="http://www.junit.org/index.htm">http://www.junit.org/index.htm</a></li> | |||||
</ol> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -99,9 +99,9 @@ executed if the dependent target(s) did not (need to) run. | |||||
of an attribute might contain references to a property. These references will be | of an attribute might contain references to a property. These references will be | ||||
resolved before the task is executed.</p> | resolved before the task is executed.</p> | ||||
<p>Tasks have a common structure:</p> | <p>Tasks have a common structure:</p> | ||||
<blockquote> | |||||
<pre><<i>name</i> <i>attribute1</i>="<i>value1</i>" <i>attribute2</i>="<i>value2</i>" ... /></pre> | |||||
</blockquote> | |||||
<pre><<i>name</i> <i>attribute1</i>="<i>value1</i>" <i>attribute2</i>="<i>value2</i>" ... /></pre> | |||||
<p>where <i>name</i> is the name of the task, | <p>where <i>name</i> is the name of the task, | ||||
<i>attributeN</i> is the attribute name, and | <i>attributeN</i> is the attribute name, and | ||||
<i>valueN</i> is the value for this attribute.</p> | <i>valueN</i> is the value for this attribute.</p> | ||||
@@ -111,21 +111,21 @@ easy to <a href="develop.html#writingowntask">write your own</a>.</p> | |||||
this attribute will be used in the logging messages generated by | this attribute will be used in the logging messages generated by | ||||
Ant.</p> | Ant.</p> | ||||
Tasks can be assigned an <code>id</code> attribute: | Tasks can be assigned an <code>id</code> attribute: | ||||
<blockquote> | |||||
<pre><<i>taskname</i> id="<i>taskID</i>" ... /></pre> | <pre><<i>taskname</i> id="<i>taskID</i>" ... /></pre> | ||||
</blockquote> | |||||
where <i>taskname</i> is the name of the task, and <i>taskID</i> is | where <i>taskname</i> is the name of the task, and <i>taskID</i> is | ||||
a unique identifier for this task. | a unique identifier for this task. | ||||
You can refer to the | You can refer to the | ||||
corresponding task object in scripts or other tasks via this name. | corresponding task object in scripts or other tasks via this name. | ||||
For example, in scripts you could do: | For example, in scripts you could do: | ||||
<blockquote> | |||||
<pre> | <pre> | ||||
<script ... > | <script ... > | ||||
task1.setFoo("bar"); | task1.setFoo("bar"); | ||||
</script> | </script> | ||||
</pre> | </pre> | ||||
</blockquote> | |||||
to set the <code>foo</code> attribute of this particular task instance. | to set the <code>foo</code> attribute of this particular task instance. | ||||
In another task (written in Java), you can access the instance via | In another task (written in Java), you can access the instance via | ||||
<code>project.getReference("task1")</code>. | <code>project.getReference("task1")</code>. | ||||
@@ -356,18 +356,15 @@ via nested <code><path></code> elements:</p> | |||||
</path> | </path> | ||||
</pre> | </pre> | ||||
can be written as: | can be written as: | ||||
<pre> | |||||
<path id="base.path" path="${classpath}"/> | |||||
</pre> | |||||
<h4 id="pathshortcut">Path Shortcut</h4> | |||||
<p> | |||||
<pre><path id="base.path" path="${classpath}"/></pre> | |||||
<h4 id="pathshortcut">Path Shortcut</h4> | |||||
<p> | |||||
In Ant 1.6 a shortcut for converting paths to OS specific strings | In Ant 1.6 a shortcut for converting paths to OS specific strings | ||||
in properties has been added. One can use the expression | in properties has been added. One can use the expression | ||||
${toString:<em>pathreference</em>} to convert a path element | ${toString:<em>pathreference</em>} to convert a path element | ||||
reference to a string that can be used for a path argument. | reference to a string that can be used for a path argument. | ||||
For example: | For example: | ||||
</p> | |||||
</p> | |||||
<pre> | <pre> | ||||
<path id="lib.path.ref"> | <path id="lib.path.ref"> | ||||
<fileset dir="lib" includes="*.jar"/> | <fileset dir="lib" includes="*.jar"/> | ||||
@@ -438,18 +435,18 @@ similar to what a (Unix) shell would do, but may create something that | |||||
is very different from what you expect under some circumstances.</p> | is very different from what you expect under some circumstances.</p> | ||||
<h4>Examples</h4> | <h4>Examples</h4> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<arg value="-l -a"/> | <arg value="-l -a"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>is a single command-line argument containing a space character, | <p>is a single command-line argument containing a space character, | ||||
<i>not</i> separate commands "-l" and "-a".</p> | <i>not</i> separate commands "-l" and "-a".</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<arg line="-l -a"/> | <arg line="-l -a"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>This is a command line with two separate arguments, "-l" and "-a".</p> | <p>This is a command line with two separate arguments, "-l" and "-a".</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<arg path="/dir;/dir2:\dir3"/> | <arg path="/dir;/dir2:\dir3"/> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>is a single command-line argument with the value | <p>is a single command-line argument with the value | ||||
<code>\dir;\dir2;\dir3</code> on DOS-based systems and | <code>\dir;\dir2;\dir3</code> on DOS-based systems and | ||||
<code>/dir:/dir2:/dir3</code> on Unix-like systems.</p> | <code>/dir:/dir2:/dir3</code> on Unix-like systems.</p> | ||||
@@ -463,7 +460,7 @@ element of the same type. This can be useful if you are going to | |||||
replicate the same snippet of XML over and over again--using a | replicate the same snippet of XML over and over again--using a | ||||
<code><classpath></code> structure more than once, for example.</p> | <code><classpath></code> structure more than once, for example.</p> | ||||
<p>The following example:</p> | <p>The following example:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<project ... > | <project ... > | ||||
<target ... > | <target ... > | ||||
<rmic ...> | <rmic ...> | ||||
@@ -485,9 +482,9 @@ replicate the same snippet of XML over and over again--using a | |||||
</javac> | </javac> | ||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>could be rewritten as:</p> | <p>could be rewritten as:</p> | ||||
<blockquote><pre> | |||||
<pre> | |||||
<project ... > | <project ... > | ||||
<path id="project.class.path"> | <path id="project.class.path"> | ||||
<pathelement location="lib/"/> | <pathelement location="lib/"/> | ||||
@@ -507,7 +504,7 @@ replicate the same snippet of XML over and over again--using a | |||||
</javac> | </javac> | ||||
</target> | </target> | ||||
</project> | </project> | ||||
</pre></blockquote> | |||||
</pre> | |||||
<p>All tasks that use nested elements for | <p>All tasks that use nested elements for | ||||
<a href="Types/patternset.html">PatternSet</a>s, | <a href="Types/patternset.html">PatternSet</a>s, | ||||
<a href="Types/fileset.html">FileSet</a>s, | <a href="Types/fileset.html">FileSet</a>s, | ||||