git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277837 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -198,72 +198,72 @@ details:</p> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <pre> | |||
| <ant antfile="subproject/subbuild.xml" dir="subproject" target="compile"/> | |||
| <blockquote><pre> | |||
| <ant antfile="subproject/subbuild.xml" | |||
| dir="subproject" target="compile"/> | |||
| <ant dir="subproject"/> | |||
| <ant dir="subproject"/> | |||
| <ant antfile="subproject/property_based_subbuild.xml"> | |||
| <property name="param1" value="version 1.x"/> | |||
| <property file="config/subproject/default.properties"/> | |||
| </ant> | |||
| <ant inheritAll="false" antfile="subproject/subbuild.xml"> | |||
| <property name="output.type" value="html"/> | |||
| </ant> | |||
| </pre> | |||
| <ant antfile="subproject/property_based_subbuild.xml"> | |||
| <property name="param1" value="version 1.x"/> | |||
| <property file="config/subproject/default.properties"/> | |||
| </ant> | |||
| <ant inheritAll="false" antfile="subproject/subbuild.xml"> | |||
| <property name="output.type" value="html"/> | |||
| </ant> | |||
| </pre></blockquote> | |||
| <p>The build file of the calling project defines some | |||
| <code><path></code> elements like this:</p> | |||
| <pre> | |||
| <path id="path1"> | |||
| <blockquote><pre> | |||
| <path id="path1"> | |||
| ... | |||
| </path> | |||
| <path id="path2"> | |||
| </path> | |||
| <path id="path2"> | |||
| ... | |||
| </path> | |||
| </pre> | |||
| </path> | |||
| </pre></blockquote> | |||
| <p>and the called build file (<code>subbuild.xml</code>) also defines | |||
| a <code><path></code> with the id <code>path1</code>, but | |||
| <code>path2</code> is not defined:</p> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="true"/> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="true"/> | |||
| </pre></blockquote> | |||
| <p>will not override <code>subbuild</code>'s definition of | |||
| <code>path1</code>, but make the parent's definition of | |||
| <code>path2</code> available in the subbuild.</p> | |||
| <pre> | |||
| <ant antfile="subbuild.xml"/> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <ant antfile="subbuild.xml"/> | |||
| </pre></blockquote> | |||
| <p>as well as</p> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"/> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"/> | |||
| </pre></blockquote> | |||
| <p>will neither override <code>path1</code> nor copy | |||
| <code>path2</code>.</p> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"> | |||
| <reference refid="path1"/> | |||
| </ant> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"> | |||
| <reference refid="path1"/> | |||
| </ant> | |||
| </pre></blockquote> | |||
| <p>will override <code>subbuild</code>'s definition of | |||
| <code>path1</code>.</p> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"> | |||
| <reference refid="path1" torefid="path2"/> | |||
| </ant> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"> | |||
| <reference refid="path1" torefid="path2"/> | |||
| </ant> | |||
| </pre></blockquote> | |||
| <p>will copy the parent's definition of <code>path1</code> into the | |||
| new project using the id <code>path2</code>.</p> | |||
| @@ -147,24 +147,24 @@ targets so specified, in the order specified.</p> | |||
| <p><em>since Ant 1.6.3</em>.</p> | |||
| <h3>Examples</h3> | |||
| <pre> | |||
| <target name="default"> | |||
| <antcall target="doSomethingElse"> | |||
| <param name="param1" value="value"/> | |||
| </antcall> | |||
| </target> | |||
| <target name="doSomethingElse"> | |||
| <echo message="param1=${param1}"/> | |||
| </target> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <target name="default"> | |||
| <antcall target="doSomethingElse"> | |||
| <param name="param1" value="value"/> | |||
| </antcall> | |||
| </target> | |||
| <target name="doSomethingElse"> | |||
| <echo message="param1=${param1}"/> | |||
| </target> | |||
| </pre></blockquote> | |||
| <p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p> | |||
| <pre> | |||
| <antcall ... > | |||
| <reference refid="path1" torefid="path2"/> | |||
| </antcall> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <antcall ... > | |||
| <reference refid="path1" torefid="path2"/> | |||
| </antcall> | |||
| </pre></blockquote> | |||
| <p>will copy the parent's definition of <code>path1</code> into the | |||
| new project using the id <code>path2</code>.</p> | |||
| @@ -173,4 +173,4 @@ new project using the id <code>path2</code>.</p> | |||
| Reserved.</p> | |||
| </body> | |||
| </html> | |||
| </html> | |||
| @@ -84,15 +84,17 @@ | |||
| </tbody></table> | |||
| <h3>Examples</h3> | |||
| <pre> <apt srcdir="${src}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="on" | |||
| compile="true" | |||
| factory="com.mycom.MyAnnotationProcessorFactory" | |||
| factorypathref="my.factorypath.id" | |||
| preprocessdir="${preprocess.dir}"> | |||
| </apt></pre> | |||
| <blockquote><pre> | |||
| <apt srcdir="${src}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="on" | |||
| compile="true" | |||
| factory="com.mycom.MyAnnotationProcessorFactory" | |||
| factorypathref="my.factorypath.id" | |||
| preprocessdir="${preprocess.dir}"> | |||
| </apt> | |||
| </pre></blockquote> | |||
| <p>compiles all <code>.java</code> files under the <code>${src}</code> | |||
| directory, and stores | |||
| the <code>.class</code> files in the <code>${build}</code> directory. | |||
| @@ -121,26 +123,27 @@ The inherited "compiler" attribute is ignored, as it is forced to use the Apt co | |||
| <code><javac></code> task to compile first your original source code, and then the | |||
| generated source code:</p> | |||
| <pre> <apt srcdir="${src}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="true" | |||
| compile="false" | |||
| factory="com.mycom.MyAnnotationProcessorFactory" | |||
| factorypathref="my.factorypath.id" | |||
| preprocessdir="${preprocess.dir}"> | |||
| </apt> | |||
| <javac srcdir="${src}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="on"/> | |||
| <javac srcdir="${preprocess.dir}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="true"/> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <apt srcdir="${src}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="true" | |||
| compile="false" | |||
| factory="com.mycom.MyAnnotationProcessorFactory" | |||
| factorypathref="my.factorypath.id" | |||
| preprocessdir="${preprocess.dir}"> | |||
| </apt> | |||
| <javac srcdir="${src}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="on"/> | |||
| <javac srcdir="${preprocess.dir}" | |||
| destdir="${build}" | |||
| classpath="xyz.jar" | |||
| debug="true"/> | |||
| </pre></blockquote> | |||
| This may involve more build file coding, but the speedup gained from switching | |||
| to jikes may justify the effort. | |||
| @@ -87,37 +87,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 | |||
| <code><filepath></code> element.</p> | |||
| <h3>Examples</h3> | |||
| <pre> <available classname="org.whatever.Myclass" property="Myclass.present"/></pre> | |||
| <blockquote><pre> | |||
| <available classname="org.whatever.Myclass" property="Myclass.present"/> | |||
| </pre></blockquote> | |||
| <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> | |||
| <pre> | |||
| <blockquote><pre> | |||
| <property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | |||
| <available file="${jaxp.jar}" property="jaxp.jar.present"/> | |||
| </pre> | |||
| </pre></blockquote> | |||
| <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> | |||
| <pre> | |||
| <available file="/usr/local/lib" type="dir" property="local.lib.present"/> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <available file="/usr/local/lib" type="dir" | |||
| property="local.lib.present"/> | |||
| </pre></blockquote> | |||
| <p>sets the <code>local.lib.present</code> property to the value "true" | |||
| if the directory <code>/usr/local/lib</code> is found.</p> | |||
| <pre> | |||
| <blockquote><pre> | |||
| ...in project ... | |||
| <property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | |||
| <path id="jaxp" location="${jaxp.jar}"/> | |||
| ...in target ... | |||
| <available classname="javax.xml.transform.Transformer" classpathref="jaxp" property="jaxp11.present"/> | |||
| </pre> | |||
| <available classname="javax.xml.transform.Transformer" | |||
| classpathref="jaxp" property="jaxp11.present"/> | |||
| </pre></blockquote> | |||
| <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>). | |||
| </p> | |||
| <pre> | |||
| <blockquote><pre> | |||
| <available property="have.extras" resource="extratasks.properties"> | |||
| <classpath> | |||
| <pathelement location="/usr/local/ant/extra.jar/> | |||
| </classpath> | |||
| </available> | |||
| </pre> | |||
| </pre></blockquote> | |||
| <p>sets the <code>have.extras</code> property to the value "true" | |||
| if the resource-file <code>extratasks.properties</code> is found. | |||
| </p> | |||
| @@ -48,16 +48,23 @@ the basename will be the simple file name, without any directory elements. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <pre> <basename property="jar.filename" file="${lib.jarfile}"/></pre> | |||
| <blockquote><pre> | |||
| <basename property="jar.filename" file="${lib.jarfile}"/> | |||
| </pre></blockquote> | |||
| will set <code>jar.filename</code> to | |||
| <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>), | |||
| a relative-path filename (eg., <code>lib/myjar.jar</code>), | |||
| or a simple filename (eg., <code>myjar.jar</code>). | |||
| <pre> <basename property="cmdname" file="D:/usr/local/foo.exe" suffix=".exe"/></pre> | |||
| <blockquote><pre> | |||
| <basename property="cmdname" file="D:/usr/local/foo.exe" | |||
| suffix=".exe"/> | |||
| </pre></blockquote> | |||
| will set <code>cmdname</code> to <code>foo</code>. | |||
| <pre> <property environment="env"/> | |||
| <basename property="temp.dirname" file="${env.TEMP}"/></pre> | |||
| <blockquote><pre> | |||
| <property environment="env"/> | |||
| <basename property="temp.dirname" file="${env.TEMP}"/> | |||
| </pre></blockquote> | |||
| will set <code>temp.dirname</code> to the last directory element of | |||
| the path defined for the <code>TEMP</code> environment variable.</p> | |||
| @@ -37,12 +37,16 @@ the number format.) | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <pre> <buildnumber/></pre> | |||
| <blockquote><pre> | |||
| <buildnumber/> | |||
| </pre></blockquote> | |||
| <p>Read, increment, and write a build number to the default file, | |||
| <code>build.number</code>.</p> | |||
| <pre> <buildnumber file="mybuild.number"/></pre> | |||
| <blockquote><pre> | |||
| <buildnumber file="mybuild.number"/> | |||
| </pre></blockquote> | |||
| <p>Read, increment, and write a build number to the file | |||
| <code>mybuild.number</code>.</p> | |||
| @@ -150,48 +150,48 @@ built-in into your JDK.</p> | |||
| <h3>Examples</h3> | |||
| <p><b>Example 1</b></p> | |||
| <pre><checksum file="foo.bar"/></pre> | |||
| <blockquote><pre><checksum file="foo.bar"/></pre></blockquote> | |||
| 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. | |||
| <p><b>Example 2</b></p> | |||
| <pre><checksum file="foo.bar" forceOverwrite="yes"/></pre> | |||
| <blockquote><pre><checksum file="foo.bar" forceOverwrite="yes"/></pre></blockquote> | |||
| Generates a MD5 checksum for foo.bar and stores the checksum in foo.bar.MD5. | |||
| If foo.bar.MD5 already exists, it is overwritten. | |||
| <p><b>Example 3</b></p> | |||
| <pre><checksum file="foo.bar" property="foobarMD5"/></pre> | |||
| <blockquote><pre><checksum file="foo.bar" property="foobarMD5"/></pre></blockquote> | |||
| Generates a MD5 checksum for foo.bar and stores it in the Project Property foobarMD5. | |||
| <p><b>Example 4</b></p> | |||
| <pre><checksum file="foo.bar" verifyProperty="isMD5ok"/></pre> | |||
| <blockquote><pre><checksum file="foo.bar" verifyProperty="isMD5ok"/></pre></blockquote> | |||
| 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. | |||
| <p><b>Example 5</b></p> | |||
| <pre><checksum file="foo.bar" algorithm="SHA" fileext="asc"/></pre> | |||
| <blockquote><pre><checksum file="foo.bar" algorithm="SHA" fileext="asc"/></pre></blockquote> | |||
| Generates a SHA 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. | |||
| <p><b>Example 6</b></p> | |||
| <pre> | |||
| <blockquote><pre> | |||
| <checksum file="foo.bar" property="${md5}" verifyProperty="isEqual"/> | |||
| </pre> | |||
| </pre></blockquote> | |||
| 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. | |||
| <p><b>Example 7</b></p> | |||
| <pre> | |||
| <blockquote><pre> | |||
| <checksum> | |||
| <fileset dir="."> | |||
| <include name="foo*"/> | |||
| </fileset> | |||
| </checksum> | |||
| </pre> | |||
| </pre></blockquote> | |||
| 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> | |||
| <pre> | |||
| <blockquote><pre> | |||
| <condition property="isChecksumEqual"> | |||
| <checksum> | |||
| <fileset dir="."> | |||
| @@ -199,7 +199,7 @@ Works just like Example 1, but generates a .MD5 file for every file that begins | |||
| </fileset> | |||
| </checksum> | |||
| </condition> | |||
| </pre> | |||
| </pre></blockquote> | |||
| Works like Example 4, but only sets isChecksumEqual to true, if the | |||
| checksum matches - it will never be set to false. This example | |||
| demonstrates use with the Condition task. | |||
| @@ -145,7 +145,7 @@ permissions.</p> | |||
| </dirset> | |||
| </chmod> | |||
| </pre> | |||
| </blockquote> | |||
| </blockquote>blockquote> | |||
| <p>keeps non-owners from touching cgi scripts, files with a <code>.old</code> | |||
| extension or directories beginning with <code>private_</code>. A directory | |||
| @@ -36,12 +36,12 @@ file is newer.</p> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <p><code><gzip src="test.tar" destfile="test.tar.gz"/></code></p> | |||
| </blockquote> | |||
| <blockquote> | |||
| <p><code><bzip2 src="test.tar" destfile="test.tar.bz2"/></code></p> | |||
| </blockquote> | |||
| <blockquote><pre> | |||
| <gzip src="test.tar" destfile="test.tar.gz"/> | |||
| </pre></blockquote> | |||
| <blockquote><pre> | |||
| <bzip2 src="test.tar" destfile="test.tar.bz2"/> | |||
| </pre></blockquote> | |||
| <hr> | |||
| <p align="center">Copyright © 2000-2005 The Apache Software Foundation. All rights | |||
| Reserved.</p> | |||
| @@ -38,21 +38,21 @@ does not exist.</p> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <p><code><gunzip src="test.tar.gz"/></code></p> | |||
| </blockquote> | |||
| <blockquote><pre> | |||
| <gunzip src="test.tar.gz"/> | |||
| </pre></blockquote> | |||
| <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p> | |||
| <blockquote> | |||
| <p><code><bunzip2 src="test.tar.bz2"/></code></p> | |||
| </blockquote> | |||
| <blockquote><pre> | |||
| <bunzip2 src="test.tar.bz2"/> | |||
| </pre></blockquote> | |||
| <p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p> | |||
| <blockquote> | |||
| <p><code><gunzip src="test.tar.gz" dest="test2.tar"/></code></p> | |||
| </blockquote> | |||
| <blockquote><pre> | |||
| <gunzip src="test.tar.gz" dest="test2.tar"/> | |||
| </pre></blockquote> | |||
| <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p> | |||
| <blockquote> | |||
| <p><code><gunzip src="test.tar.gz" dest="subdir"/></code></p> | |||
| </blockquote> | |||
| <blockquote><pre> | |||
| <gunzip src="test.tar.gz" dest="subdir"/> | |||
| </pre></blockquote> | |||
| <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming | |||
| subdir is a directory).</p> | |||