| @@ -330,7 +330,7 @@ targets so specified, in the order specified.</p> | |||
| corresponding Ant tasks set the dir attribute explicitly.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="subproject/subbuild.xml" target="compile"/> | |||
| <ant dir="subproject"/> | |||
| @@ -343,66 +343,66 @@ targets so specified, in the order specified.</p> | |||
| <ant inheritAll="false" antfile="subproject/subbuild.xml"> | |||
| <property name="output.type" value="html"/> | |||
| </ant> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>These lines invoke the same build file:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="sub1/sub2/build.xml" /> | |||
| <ant antfile="sub2/build.xml" dir="sub1" /> | |||
| <ant antfile="build.xml" dir="sub1/sub2" /> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>The build file of the calling project defines some | |||
| <code><path></code> elements like this:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <path id="path1"> | |||
| ... | |||
| </path> | |||
| <path id="path2"> | |||
| ... | |||
| </path> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="true"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="subbuild.xml"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>as well as</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>will neither override <code>path1</code> nor copy | |||
| <code>path2</code>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"> | |||
| <reference refid="path1"/> | |||
| </ant> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>will override <code>subbuild</code>'s definition of | |||
| <code>path1</code>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <ant antfile="subbuild.xml" inheritrefs="false"> | |||
| <reference refid="path1" torefid="path2"/> | |||
| </ant> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>will copy the parent's definition of <code>path1</code> into the | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <target name="default"> | |||
| <antcall target="doSomethingElse"> | |||
| <param name="param1" value="value"/> | |||
| @@ -183,14 +183,14 @@ targets so specified, in the order specified.</p> | |||
| <target name="doSomethingElse"> | |||
| <echo message="param1=${param1}"/> | |||
| </target> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <antcall ... > | |||
| <reference refid="path1" torefid="path2"/> | |||
| </antcall> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>will copy the parent's definition of <code>path1</code> into the | |||
| 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> | |||
| <h3>Example</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <antlr | |||
| target="etc/java.g" | |||
| outputdirectory="build/src"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| This invokes ANTLR on grammar file etc/java.g, writing the generated | |||
| files to build/src. | |||
| @@ -68,9 +68,7 @@ element of this task - see the example below. | |||
| </tr> | |||
| </table> | |||
| <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> | |||
| @@ -60,34 +60,33 @@ Stores the Apache Ant version (when used as task) or checks for a specific Ant v | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <antversion property="antversion"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Stores the current Ant version in the property <i>antversion</i>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <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 | |||
| or higher. Otherwise the property remains unset.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <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 | |||
| would match.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <condition property="Ant17isOnline"> | |||
| <and> | |||
| <antversion exactly="1.7.0"/> | |||
| <http url="http://ant.apache.org"/> | |||
| </and> | |||
| </condition> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Sets <i>Ant17isOnline</i> if Ant 1.7.0 is running and can get a non-error-response from | |||
| the Ant homepage.</p> | |||
| @@ -399,7 +399,7 @@ files for each sourcefile. | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <apply executable="ls"> | |||
| <arg value="-l"/> | |||
| <fileset dir="/tmp"> | |||
| @@ -409,25 +409,25 @@ files for each sourcefile. | |||
| </fileset> | |||
| <fileset refid="other.files"/> | |||
| </apply> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 of the FileSet with <code>id</code> <code>other.files</code> to | |||
| the command line.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <apply executable="somecommand" parallel="false"> | |||
| <arg value="arg1"/> | |||
| <srcfile/> | |||
| <arg value="arg2"/> | |||
| <fileset dir="/tmp"/> | |||
| </apply> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each | |||
| file in <code>/tmp</code> replacing SOURCEFILENAME with the absolute | |||
| filename of each file in turn. If <code>parallel</code> had been set | |||
| to true, SOURCEFILENAME would be replaced with the absolute filenames | |||
| of all files separated by spaces.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <apply executable="cc" dest="src/C" parallel="false"> | |||
| <arg value="-c"/> | |||
| <arg value="-o"/> | |||
| @@ -436,13 +436,13 @@ of all files separated by spaces.</p> | |||
| <fileset dir="src/C" includes="*.c"/> | |||
| <mapper type="glob" from="*.c" to="*.o"/> | |||
| </apply> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>invokes <code>cc -c -o TARGETFILE SOURCEFILE</code> for each | |||
| <code>.c</code> file that is newer than the corresponding | |||
| <code>.o</code>, replacing TARGETFILE with the absolute filename of | |||
| the <code>.o</code> and SOURCEFILE with the absolute name of the | |||
| <code>.c</code> file.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper id="out" type="glob" | |||
| from="src${file.separator}*.file" | |||
| to="dest${file.separator}*.out"/> | |||
| @@ -454,7 +454,7 @@ the <code>.o</code> and SOURCEFILE with the absolute name of the | |||
| <outputmapper refid="out"/> | |||
| </redirector> | |||
| </apply> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Applies the fictitious "processfile" executable to all | |||
| files matching <code>*.file</code> in the <code>src</code> directory. | |||
| 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 | |||
| nested beneath this <code><apply></code> instance. This allows us to perform | |||
| dependency checking against output files--the target files in this case. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <apply executable="ls" parallel="true" | |||
| force="true" dest="${basedir}" append="true" type="both"> | |||
| <path> | |||
| @@ -472,11 +472,11 @@ dependency checking against output files--the target files in this case. | |||
| </path> | |||
| <identitymapper/> | |||
| </apply> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Applies the "ls" executable to all directories in the PATH, effectively | |||
| listing all executables that are available on the PATH. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <apply executable="jsmin" addsourcefile="false"> | |||
| <!-- Collect the JS-files --> | |||
| <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"/> | |||
| </redirector> | |||
| </apply> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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 | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></pre> | |||
| </blockquote> | |||
| <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"/> | |||
| </attrib> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <attrib readonly="true" archive="true"> | |||
| <fileset dir="shared/sources1"> | |||
| <exclude name="**/trial/**"/> | |||
| @@ -158,7 +152,7 @@ directory tree), so you'll have to experiment a little.</p--> | |||
| <fileset refid="other.shared.sources"/> | |||
| </attrib> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| 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 | |||
| <code><filepath></code> element.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <available classname="org.whatever.Myclass" property="Myclass.present"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | |||
| <available file="${jaxp.jar}" property="jaxp.jar.present"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <available file="/usr/local/lib" type="dir" | |||
| property="local.lib.present"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>sets the <code>local.lib.present</code> property to the value "true" | |||
| if the directory <code>/usr/local/lib</code> is found.</p> | |||
| <blockquote><pre> | |||
| <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></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <available property="have.extras" resource="extratasks.properties"> | |||
| <classpath> | |||
| <pathelement location="/usr/local/ant/extra.jar" /> | |||
| </classpath> | |||
| </available> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>sets the <code>have.extras</code> property to the value "true" | |||
| if the resource-file <code>extratasks.properties</code> is found. | |||
| </p> | |||
| @@ -64,23 +64,23 @@ the basename will be the simple file name, without any directory elements. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <basename property="jar.filename" file="${lib.jarfile}"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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>). | |||
| <blockquote><pre> | |||
| <pre> | |||
| <basename property="cmdname" file="D:/usr/local/foo.exe" | |||
| suffix=".exe"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| will set <code>cmdname</code> to <code>foo</code>. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property environment="env"/> | |||
| <basename property="temp.dirname" file="${env.TEMP}"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| will set <code>temp.dirname</code> to the last directory element of | |||
| 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 | |||
| point. For instance: | |||
| </p> | |||
| <blockquote><pre><bindtargets targets="jar,javadoc" extensionPoint="dist" /></pre></blockquote> | |||
| <pre><bindtargets targets="jar,javadoc" extensionPoint="dist" /></pre> | |||
| 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 | |||
| 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> | |||
| <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> | |||
| </html> | |||
| @@ -53,16 +53,16 @@ the number format.) | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <buildnumber/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Read, increment, and write a build number to the default file, | |||
| <code>build.number</code>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <buildnumber file="mybuild.number"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Read, increment, and write a build number to the file | |||
| <code>mybuild.number</code>.</p> | |||
| @@ -118,34 +118,34 @@ element to specify the files to be included in the archive. | |||
| </p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <cab cabfile="${dist}/manual.cab" | |||
| basedir="htdocs/manual"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>cabs all files in the htdocs/manual directory into a file called | |||
| manual.cab in the ${dist} directory.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <cab cabfile="${dist}/manual.cab" | |||
| basedir="htdocs/manual" | |||
| excludes="mydocs/**, **/todo.html"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>cabs all files in the htdocs/manual directory into a file called | |||
| manual.cab in the ${dist} directory. Files in the directory mydocs, | |||
| or files with the name todo.html are excluded.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <cab cabfile="${dist}/manual.cab" | |||
| basedir="htdocs/manual" | |||
| includes="api/**/*.html" | |||
| excludes="**/todo.html" | |||
| verbose="yes"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Cab all files in the htdocs/manual directory into a file called | |||
| manual.cab in the ${dist} directory. Only html files under the | |||
| directory api are archived, and files with the name todo.html are | |||
| excluded. Output from the cabarc tool is displayed in the build | |||
| output.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <cab cabfile="${dist}/manual.cab" | |||
| verbose="yes"> | |||
| <fileset | |||
| @@ -153,7 +153,7 @@ output.</p> | |||
| includes="api/**/*.html" | |||
| excludes="**/todo.html"/> | |||
| </cab> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>is equivalent to the example above.</p> | |||
| </body> | |||
| @@ -68,11 +68,11 @@ Task to checkin a file | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre><ccmcheckin file="c:/wa/com/foo/MyFile.java" | |||
| comment="mycomment"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| used is the one set as the default.</p> | |||
| @@ -114,22 +114,19 @@ Task to perform a Checkout command to Continuus | |||
| </tr> | |||
| </table> | |||
| <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>. | |||
| Comment attribute <i>mycomment</i> is added as a task comment | |||
| The used task is the one set as the default.</p> | |||
| <blockquote> | |||
| <pre><ccmcheckout comment="mycomment"> | |||
| <pre><ccmcheckout comment="mycomment"> | |||
| <fileset dir="lib" > | |||
| <include name="**/*.jar"/> | |||
| </fileset> | |||
| </ccmcheckout > | |||
| </pre> | |||
| </blockquote> | |||
| </ccmcheckout ></pre> | |||
| <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 | |||
| @@ -162,10 +159,9 @@ Task to perform a check in default task command to Continuus | |||
| </tr> | |||
| </table> | |||
| <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> | |||
| <hr/> | |||
| <h2 id="ccmreconfigure">CCMReconfigure</h2> | |||
| @@ -200,11 +196,11 @@ Task to perform an reconfigure command to Continuus. | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre><ccmreconfigure ccmproject="ANTCCM_TEST#BMO_1" | |||
| <pre><ccmreconfigure ccmproject="ANTCCM_TEST#BMO_1" | |||
| verbose="true"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Does a Continuus <i>reconfigure</i> on the project <i>ANTCCM_TEST#BMO_1</i>. | |||
| </p> | |||
| <hr/> | |||
| @@ -255,11 +251,11 @@ Create a Continuus task. | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre><ccmcreatetask resolver="${user.name}" | |||
| <pre><ccmcreatetask resolver="${user.name}" | |||
| release="ANTCCM_TEST" comment="blahblah"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Creates a task for the release <i>ANTCCM_TEST</i> with the | |||
| 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> | |||
| <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 | |||
| foo.bar.MD5. foo.bar.MD5 is overwritten only if foo.bar is newer than itself. | |||
| <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. | |||
| If foo.bar.MD5 already exists, it is overwritten. | |||
| <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. | |||
| <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 | |||
| isMD5ok to either true or false, depending upon the result. | |||
| <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 | |||
| foo.bar.asc. foo.bar.asc is overwritten only if foo.bar is newer than itself. | |||
| <p><b>Example 6</b></p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <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 | |||
| md5, and sets isEqual to either true or false, depending upon the result. | |||
| <p><b>Example 7</b></p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <checksum> | |||
| <fileset dir="."> | |||
| <include name="foo*"/> | |||
| </fileset> | |||
| </checksum> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <condition property="isChecksumEqual"> | |||
| <checksum> | |||
| <fileset dir="."> | |||
| @@ -251,7 +251,7 @@ Works just like Example 1, but generates a .MD5 file for every file that begins | |||
| </fileset> | |||
| </checksum> | |||
| </condition> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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. | |||
| @@ -127,22 +127,22 @@ could use as initial value for these experiments.</p> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <chgrp file="${dist}/start.sh" group="coders"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes the "start.sh" file belong to the coders group on a | |||
| UNIX system.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chgrp group="coders"> | |||
| <fileset dir="${dist}/bin" includes="**/*.sh"/> | |||
| </chgrp> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all ".sh" files below <code>${dist}/bin</code> | |||
| belong to the coders group on a UNIX system.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chgrp group="coders"> | |||
| <fileset dir="shared/sources1"> | |||
| @@ -151,14 +151,14 @@ belong to the coders group on a UNIX system.</p> | |||
| <fileset refid="other.shared.sources"/> | |||
| </chgrp> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all files below <code>shared/sources1</code> (except those | |||
| below any directory named trial) belong to the coders 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 | |||
| group.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chgrp group="webdev" type="file"> | |||
| <fileset dir="/web"> | |||
| @@ -170,7 +170,6 @@ group.</p> | |||
| </dirset> | |||
| </chmod> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| @@ -155,25 +155,23 @@ could use as initial value for these experiments.</p> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <chmod file="${dist}/start.sh" perm="ugo+rx"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>makes the "start.sh" file readable and executable for anyone on a | |||
| UNIX system.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <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 | |||
| UNIX system.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chmod dir="${dist}/bin" perm="ugo+rx" | |||
| includes="**/*.sh"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all ".sh" files below <code>${dist}/bin</code> | |||
| readable and executable for anyone on a UNIX system.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chmod perm="g+w"> | |||
| <fileset dir="shared/sources1"> | |||
| @@ -182,14 +180,11 @@ readable and executable for anyone on a UNIX system.</p> | |||
| <fileset refid="other.shared.sources"/> | |||
| </chmod> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all files below <code>shared/sources1</code> (except those | |||
| below any directory named trial) writable for members of the same | |||
| 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 | |||
| permissions.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chmod perm="go-rwx" type="file"> | |||
| <fileset dir="/web"> | |||
| @@ -201,14 +196,11 @@ permissions.</p> | |||
| </dirset> | |||
| </chmod> | |||
| </pre> | |||
| </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 | |||
| ending in <code>.old</code> or a file beginning with private_ would remain | |||
| unaffected.</p> | |||
| <h3>Note on maxparallel attribute</h3> | |||
| <p> | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <chown file="${dist}/start.sh" owner="coderjoe"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes the "start.sh" file belong to coderjoe on a | |||
| UNIX system.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chown owner="coderjoe"> | |||
| <fileset dir="${dist}/bin" includes="**/*.sh"/> | |||
| </chown> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all ".sh" files below <code>${dist}/bin</code> | |||
| belong to coderjoe on a UNIX system.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chown owner="coderjoe"> | |||
| <fileset dir="shared/sources1"> | |||
| @@ -150,14 +148,12 @@ belong to coderjoe on a UNIX system.</p> | |||
| <fileset refid="other.shared.sources"/> | |||
| </chown> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes all files below <code>shared/sources1</code> (except those | |||
| below any directory named trial) belong to coderjoe on a UNIX | |||
| system. In addition all files belonging to a FileSet | |||
| with <code>id</code> <code>other.shared.sources</code> get the same | |||
| owner.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <chown owner="webadmin" type="file"> | |||
| <fileset dir="/web"> | |||
| @@ -169,8 +165,6 @@ owner.</p> | |||
| </dirset> | |||
| </chmod> | |||
| </pre> | |||
| </blockquote> | |||
| <p>makes cgi scripts, files with a <code>.old</code> extension or | |||
| directories beginning with <code>private_</code> belong to the user named | |||
| 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> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <cccheckin viewpath="c:/views/viewdir/afile" | |||
| commentfile="acomment.txt" | |||
| nowarn="true" | |||
| identical="true"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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. | |||
| 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> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <cccheckout viewpath="c:/views/viewdir/afile" | |||
| reserved="true" | |||
| @@ -212,7 +212,7 @@ Task to perform a "cleartool checkout" command to ClearCase. | |||
| nowarn="true" | |||
| comment="Some comment text"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| 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> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccuncheckout viewpath="c:/views/viewdir/afile" | |||
| keepcopy="true"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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> | |||
| <hr/> | |||
| @@ -315,7 +315,7 @@ Task to perform an "cleartool update" command to ClearCase. | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccupdate viewpath="c:/views/viewdir" | |||
| graphical="false" | |||
| @@ -324,7 +324,7 @@ Task to perform an "cleartool update" command to ClearCase. | |||
| currenttime="true" | |||
| rename="false"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| <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> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccmklbtype typename="VERSION_1" | |||
| ordinary="true" | |||
| comment="Development version 1"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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. | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccmklabel viewpath="c:/views/viewdir/afile" | |||
| comment="Some comment text" | |||
| @@ -470,7 +470,7 @@ Task to perform a "mklabel" command to ClearCase. | |||
| version="\main\2" | |||
| typename="VERSION_1"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| as a comment. It will <i>recurse</i> all subdirectories. | |||
| @@ -561,14 +561,14 @@ Task to perform a "rmtype" command to ClearCase. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccrmtype typekind="lbtype" | |||
| typename="VERSION_1" | |||
| commentfile="acomment.txt" | |||
| rmall="true"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| are removed, including the type object itself.</p> | |||
| @@ -627,12 +627,12 @@ Task to perform a "cleartool lock" command to ClearCase. | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <cclock | |||
| objsel="stream:Application_Integration@\MyProject_PVOB"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Does a ClearCase <i>lock</i> on the object <i>stream:Application_Integration@\MyProject_PVOB</i>.</p> | |||
| <hr> | |||
| <h2 id="ccunlock">CCUnlock</h2> | |||
| @@ -674,12 +674,12 @@ Task to perform a "cleartool unlock" command to ClearCase. | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccunlock | |||
| objsel="stream:Application_Integration@\MyProject_PVOB"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Does a ClearCase <i>unlock</i> on the object <i>stream:Application_Integration@\MyProject_PVOB</i>.</p> | |||
| <hr> | |||
| <h2 id="ccmkbl">CCMkbl</h2> | |||
| @@ -736,7 +736,7 @@ Task to perform a "cleartool mkbl" command to ClearCase. | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccmkbl | |||
| baselinerootname="Application_Baseline_AUTO" | |||
| @@ -744,7 +744,7 @@ Task to perform a "cleartool mkbl" command to ClearCase. | |||
| full="no" | |||
| viewpath="v:\ApplicationCC"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| incremental and named "Application_Baseline_AUTO".</p> | |||
| @@ -807,13 +807,13 @@ Task to perform a "cleartool mkattr" command to ClearCase.<br> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccmkattr viewpath="c:/views/viewdir/afile" | |||
| typename="BugFix" | |||
| typevalue="34445"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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> | |||
| <hr/> | |||
| @@ -854,13 +854,13 @@ Task to perform a "cleartool mkdir" command to ClearCase.<br> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccmkdir viewpath="c:/views/viewdir/adir" | |||
| nocheckout="true" | |||
| comment="Some comment text"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Does a ClearCase <i>mkdir</i> on the dir <i>c:/views/viewdir/adir</i> and | |||
| does not automatically check it out.</p> | |||
| <hr/> | |||
| @@ -927,14 +927,14 @@ Task to perform a "cleartool mkelem" command to ClearCase.<br> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <ccmkelem viewpath="c:/views/viewdir/afile" | |||
| eltype="text_file" | |||
| checkin="true" | |||
| comment="Some comment text"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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> | |||
| @@ -335,10 +335,10 @@ that is "true","yes", or "on"</p> | |||
| <td valign="top" align="center">Yes</td> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <istrue value="${someproperty}"/> | |||
| <istrue value="false"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="isfalse">isfalse</h4> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <isfalse value="${someproperty}"/> | |||
| <isfalse value="false"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="isreference">isreference</h4> | |||
| <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> | |||
| Example usage: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <isfileselected file="a.xml"> | |||
| <date datetime="06/28/2000 2:02 pm" when="equal"/> | |||
| </isfileselected> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="typefound">typefound</h4> | |||
| @@ -486,10 +486,10 @@ tasks, datatypes, scriptdefs, macrodefs and presetdefs.</p> | |||
| <p> | |||
| Example usages: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <typefound name="junit"/> | |||
| <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="scriptcondition">scriptcondition</h4> | |||
| @@ -578,12 +578,12 @@ Alternatively, <code>self.value</code> can be used to set the evaluation result. | |||
| <p> | |||
| Example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <scriptcondition language="javascript" | |||
| value="true"> | |||
| self.setValue(false); | |||
| </scriptcondition> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Sets the default value of the condition to true, then in the script, | |||
| sets the value to false. This condition always evaluates to "false" | |||
| @@ -618,18 +618,18 @@ attempting to set the appropriate property/feature/</p> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <parsersupports feature="http://xml.org/sax/features/namespaces"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Check for namespace support. All SAX2 parsers should have this. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <or> | |||
| <parsersupports | |||
| feature="http://apache.org/xml/features/validation/schema"/> | |||
| <parsersupports | |||
| feature="http://java.sun.com/xml/jaxp/properties/schemaSource"/> | |||
| </or> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Check for XML Schema support. | |||
| @@ -691,21 +691,21 @@ not reachable on other ports (i.e. port 80), because of firewalls. | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <condition property="offline"> | |||
| <isreachable url="http://ibiblio.org/maven/" /> | |||
| </condition> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| Probe for the maven repository being reachable. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <condition property="offline"> | |||
| <isreachable host="ibiblio.org" timeout="10" /> | |||
| </condition> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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> | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <length string=" foo " trim="true" length="3" /> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Verify a string is of a certain length.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <length file="foo" when="greater" length="0" /> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Verify that file <i>foo</i> is not empty.</p> | |||
| <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> | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <resourcecount refid="myresourcecollection" when="greater" count="0" /> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Verify that a resource collection is not empty.</p> | |||
| <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 | |||
| a classpath. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <hasmethod classname="java.util.ArrayList" method="trimToSize" /> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Looks for the method trimToSize in the ArrayList class.</p> | |||
| @@ -934,29 +934,29 @@ must match. <em>Since Ant 1.7</em> | |||
| <p> | |||
| An example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <condition property="legal-password"> | |||
| <matches pattern="[1-9]" string="${user-input}"/> | |||
| </condition> | |||
| <fail message="Your password should at least contain one number" | |||
| unless="legal-password"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| The following example sets the property "ok" if | |||
| the property "input" is three characters long, starting | |||
| with 'a' and ending with 'b'. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <condition property="ok"> | |||
| <matches string="${input}" pattern="^a.b$"/> | |||
| </condition> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| The following defines a reference regular expression for | |||
| matching dates and then uses antunit to check if the | |||
| property "today" is in the correct format: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <regexp id="date.pattern" pattern="^[0123]\d-[01]\d-[12]\d\d\d$"/> | |||
| <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"/> | |||
| </matches> | |||
| </au:assertTrue> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| The following example shows the use of the singleline and the casesensitive | |||
| flags. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <au:assertTrue> | |||
| <matches string="AB${line.separator}C" pattern="^ab.*C$" | |||
| casesensitive="false" | |||
| @@ -980,7 +980,7 @@ must match. <em>Since Ant 1.7</em> | |||
| casesensitive="false" | |||
| singleline="false"/> | |||
| </au:assertFalse> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="antversion">antversion</h4> | |||
| <p>This condition is identical to the <a | |||
| @@ -1022,9 +1022,9 @@ is redundant and will be ignored.</p> | |||
| <p> | |||
| An example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <hasfreespace partition="c:" needed="100M"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="islastmodified">islastmodified</h4> | |||
| @@ -1070,11 +1070,11 @@ is redundant and will be ignored.</p> | |||
| <p> | |||
| An example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-before"> | |||
| <file file="${file}"/> | |||
| </islastmodified> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="resourceexists">resourceexists</h4> | |||
| @@ -1085,11 +1085,11 @@ is redundant and will be ignored.</p> | |||
| <p> | |||
| An example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <resourceexists> | |||
| <file file="${file}"/> | |||
| </resourceexists> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="javaversion">javaversion</h4> | |||
| @@ -1122,9 +1122,9 @@ is redundant and will be ignored.</p> | |||
| An example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <javaversion atleast="9"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>will evaluate to true if the current JVM is Java 9 or above.</p> | |||
| @@ -62,10 +62,8 @@ does not exist.</p> | |||
| </tr> | |||
| </table> | |||
| <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> | |||
| </html> | |||
| @@ -132,7 +132,7 @@ Multiple <code><targetfilelist></code> filelists may be specified. | |||
| </p> | |||
| <h3>Examples</h3> | |||
| <blockquote> <pre> | |||
| <pre> | |||
| <dependset> | |||
| <srcfilelist | |||
| dir = "${dtd.dir}" | |||
| @@ -147,7 +147,6 @@ Multiple <code><targetfilelist></code> filelists may be specified. | |||
| dir = "${output.dir}" | |||
| includes = "**/*.html"/> | |||
| </dependset></pre> | |||
| </blockquote> | |||
| <p> | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <echoproperties/> | |||
| </pre></blockquote> | |||
| <pre><echoproperties/></pre> | |||
| <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 | |||
| 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 | |||
| log a message if the file could not be created or written to, but will still | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <echoproperties> | |||
| <propertyset> | |||
| <propertyref prefix="java."/> | |||
| </propertyset> | |||
| </echoproperties> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>This again lists all properties beginning with "java." using a nested | |||
| <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. | |||
| The equivalent snippet with <tt></propertyset></tt> is:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <echoproperties> | |||
| <propertyset> | |||
| <propertyref regex=".*ant.*"/> | |||
| </propertyset> | |||
| </echoproperties> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </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> | |||
| using the <code>/c</code> switch. | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <target name="help"> | |||
| <exec executable="cmd"> | |||
| @@ -69,7 +68,7 @@ types listed in the environment variable PATHEXT. That is only used by the shell | |||
| <arg value="-p"/> | |||
| </exec> | |||
| </target> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| @@ -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. | |||
| </p> | |||
| <h4>Cygwin Users</h4> | |||
| <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 | |||
| @@ -116,27 +114,20 @@ set to <code>true</code> instead as this task will follow the VM's | |||
| interpretation of exit codes.</p> | |||
| <h4>RedHat S/390 Users</h4> | |||
| <p>It has been <a | |||
| 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 | |||
| task must have their interpreter specified, i.e., the scripts must | |||
| start with something like:</p> | |||
| <blockquote> | |||
| <pre> | |||
| #!/bin/bash | |||
| </pre> | |||
| </blockquote> | |||
| <p>or the task will fail as follows:</p> | |||
| <blockquote> | |||
| <pre> | |||
| [exec] Warning: UNIXProcess.forkAndExec native error: Exec format error | |||
| [exec] Result: 255 | |||
| </pre> | |||
| </blockquote> | |||
| <h4 id="background">Running Ant as a background process on Unix(-like) systems</h4> | |||
| @@ -318,12 +309,11 @@ start with something like:</p> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <exec dir="${src}" executable="cmd.exe" os="Windows 2000" output="dir.txt"> | |||
| <arg line="/c dir"/> | |||
| </exec></pre> | |||
| </blockquote> | |||
| <h3>Parameters specified as nested elements</h3> | |||
| <h4>arg</h4> | |||
| <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. | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <exec executable="emacs"> | |||
| <env key="DISPLAY" value=":1.0"/> | |||
| </exec> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>starts <code>emacs</code> on display 1 of the X Window System.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property environment="env"/> | |||
| <exec ... > | |||
| <env key="PATH" path="${env.PATH}:${basedir}/bin"/> | |||
| </exec> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>adds <code>${basedir}/bin</code> to the <code>PATH</code> of the | |||
| system command.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property name="browser" location="C:/Program Files/Internet Explorer/iexplore.exe"/> | |||
| <property name="file" location="ant/docs/manual/index.html"/> | |||
| <exec executable="${browser}" spawn="true"> | |||
| <arg value="${file}"/> | |||
| </exec> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Starts the <i>${browser}</i> with the specified <i>${file}</i> and end the | |||
| Ant process. The browser will remain.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <exec executable="cat"> | |||
| <redirector outputproperty="redirector.out" | |||
| errorproperty="redirector.err" | |||
| @@ -437,7 +424,7 @@ Ant process. The browser will remain.</p> | |||
| <errormapper type="merge" to="redirector.err"/> | |||
| </redirector> | |||
| </exec> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Sends the string "blah before blah" to the "cat" executable, | |||
| 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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <genkey alias="apache-group" storepass="secret" | |||
| dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <genkey alias="apache-group" storepass="secret" > | |||
| <dname> | |||
| <param name="CN" value="Ant Group"/> | |||
| @@ -117,7 +116,6 @@ with "<code>\,</code>".</p> | |||
| <param name="C" value="US"/> | |||
| </dname> | |||
| </genkey></pre> | |||
| </blockquote> | |||
| </body> | |||
| </html> | |||
| @@ -219,38 +219,38 @@ nested inside the Draw object.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <image destdir="samples/low" overwrite="yes"> | |||
| <fileset dir="samples/full"> | |||
| <include name="**/*.jpg"/> | |||
| </fileset> | |||
| <scale width="160" height="160" proportions="fit"/> | |||
| </image> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Create thumbnails of my images and make sure they all fit within the 160x160 size whether the | |||
| image is portrait or landscape.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <image srcdir="src" includes="*.png"> | |||
| <scale proportions="width" width="40"/> | |||
| </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 | |||
| and stores the <i>src</i>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <image srcdir="src" destdir="dest" includes="*.png"> | |||
| <scale proportions="width" width="40"/> | |||
| </image> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Same as above but stores the result in <i>dest</i>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <image srcdir="src" destdir="dest" includes="*.png"> | |||
| <scale proportions="width" width="40"/> | |||
| <globmapper from="*" to="scaled-*"/> | |||
| </image> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Same as above but stores the resulting file names will be prefixed | |||
| by "scaled-".</p> | |||
| @@ -440,39 +440,38 @@ depend on your manifest:</p> | |||
| nested <provider> elements may be used. | |||
| </p> | |||
| <h3>Examples</h3> | |||
| <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 | |||
| called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p> | |||
| <h4>With filters</h4> | |||
| <blockquote><pre> <jar destfile="${dist}/lib/app.jar" | |||
| <pre> <jar destfile="${dist}/lib/app.jar" | |||
| 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 | |||
| called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files | |||
| 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" | |||
| 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 | |||
| 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 | |||
| the name <code>Test.class</code> are excluded.</p> | |||
| <h4>Multiple filesets</h4> | |||
| <blockquote><pre> <jar destfile="${dist}/lib/app.jar"> | |||
| <pre> <jar destfile="${dist}/lib/app.jar"> | |||
| <fileset dir="${build}/classes" | |||
| excludes="**/Test.class"/> | |||
| <fileset dir="${src}/resources"/> | |||
| </jar></pre></blockquote> | |||
| </jar></pre> | |||
| <p>jars all files in the <code>${build}/classes</code> directory and also | |||
| in the <code>${src}/resources</code> directory together into a file | |||
| called <code>app.jar</code> in the <code>${dist}/lib</code> directory. | |||
| @@ -484,20 +483,20 @@ by Java).</p> | |||
| <h4>Merging archives</h4> | |||
| <blockquote><pre> <jar destfile="build/main/checksites.jar"> | |||
| <pre> <jar destfile="build/main/checksites.jar"> | |||
| <fileset dir="build/main/classes"/> | |||
| <zipfileset includes="**/*.class" src="lib/main/some.jar"/> | |||
| <manifest> | |||
| <attribute name="Main-Class" | |||
| value="com.acme.checksites.Main"/> | |||
| </manifest> | |||
| </jar></pre></blockquote> | |||
| </jar></pre> | |||
| <p> | |||
| 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>. | |||
| </p> | |||
| <blockquote><pre> <jar destfile="build/main/checksites.jar"> | |||
| <pre> <jar destfile="build/main/checksites.jar"> | |||
| <fileset dir="build/main/classes"/> | |||
| <restrict> | |||
| <name name="**/*.class"/> | |||
| @@ -511,14 +510,14 @@ by Java).</p> | |||
| <attribute name="Main-Class" | |||
| value="com.acme.checksites.Main"/> | |||
| </manifest> | |||
| </jar></pre></blockquote> | |||
| </jar></pre> | |||
| <p> | |||
| 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>. | |||
| </p> | |||
| <h4>Inline manifest</h4> | |||
| <blockquote><pre> <jar destfile="test.jar" basedir="."> | |||
| <pre> <jar destfile="test.jar" basedir="."> | |||
| <include name="build"/> | |||
| <manifest> | |||
| <!-- If this is an Applet or Web Start application, include | |||
| @@ -536,14 +535,14 @@ by Java).</p> | |||
| <attribute name="Sealed" value="false"/> | |||
| </section> | |||
| </manifest> | |||
| </jar></pre></blockquote> | |||
| </jar></pre> | |||
| <p> | |||
| 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 | |||
| property ${user.name}. The manifest produced by the above would look like this: | |||
| </p> | |||
| <blockquote><pre>Manifest-Version: 1.0 | |||
| <pre>Manifest-Version: 1.0 | |||
| Permissions: sandbox | |||
| Codebase: example.com | |||
| Built-By: conor | |||
| @@ -553,7 +552,7 @@ Implementation-Version: 1.0.0beta2 | |||
| Created-By: Apache Ant 1.9.2 | |||
| Name: common/MyClass.class | |||
| Sealed: false</pre></blockquote> | |||
| Sealed: false</pre> | |||
| <h4>Service Provider</h4> | |||
| @@ -561,20 +560,18 @@ Sealed: false</pre></blockquote> | |||
| The following shows how to create a jar file specifying a service | |||
| with an implementation of the JDK 6 scripting interface: | |||
| </p> | |||
| <blockquote><pre><jar destfile="pinky.jar"> | |||
| <pre><jar destfile="pinky.jar"> | |||
| <fileset dir="build/classes"/> | |||
| <service type="javax.script.ScriptEngineFactory" | |||
| provider="org.acme.PinkyLanguage"/> | |||
| </jar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| The following shows how to create a jar file specifying a service | |||
| with two implementations of the JDK 6 scripting interface: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <jar destfile="pinkyandbrain.jar"> | |||
| <fileset dir="classes"/> | |||
| <service type="javax.script.ScriptEngineFactory"> | |||
| @@ -582,8 +579,7 @@ Sealed: false</pre></blockquote> | |||
| <provider classname="org.acme.BrainLanguage"/> | |||
| </service> | |||
| </jar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4> | |||
| <p> | |||
| @@ -601,7 +597,7 @@ Sealed: false</pre></blockquote> | |||
| <code>${java.classes}</code> and the Java 9 classes are compiled into | |||
| <code>${java9.classes}</code>. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <jar destfile="mrjar.jar"> | |||
| <manifest> | |||
| <!-- 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 --> | |||
| <zipfileset prefix="META-INF/versions/9/" dir="${java9.classes}"/> | |||
| </jar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </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 prepended with a "-J". For example: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property name="patched.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" | |||
| debug="yes"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3>Note on package-info.java</h3> | |||
| <p> | |||
| @@ -189,13 +189,13 @@ | |||
| </tr> | |||
| </table> | |||
| <h3>Example</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <javacc | |||
| target="src/Parser.jj" | |||
| outputdirectory="build/src" | |||
| javacchome="c:/program files/JavaCC" | |||
| static="true"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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 | |||
| @@ -117,7 +117,6 @@ to ignore (requires JDepend 2.5 or above).</p> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <jdepend classpathref="base.path"> | |||
| <classespath> | |||
| @@ -125,13 +124,12 @@ to ignore (requires JDepend 2.5 or above).</p> | |||
| </classespath> | |||
| </jdepend> | |||
| </pre> | |||
| </blockquote> | |||
| <p>This invokes JDepend on the <code>build</code> directory, writing | |||
| the output on the standard output. The classpath is defined using a | |||
| classpath reference.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml"> | |||
| <sourcespath> | |||
| @@ -143,14 +141,12 @@ classpath reference.</p> | |||
| </classpath> | |||
| </jdepend> | |||
| </pre> | |||
| </blockquote> | |||
| <p>This invokes JDepend in a separate VM on the <code>src</code> and | |||
| <code>testsrc</code> directories, writing the output to the | |||
| <code><docs/jdepend.xml></code> file in xml format. The | |||
| classpath is defined using nested elements.</p> | |||
| <blockquote> | |||
| <pre> | |||
| <jdepend classpathref="base.path"> | |||
| <exclude name="java.*> | |||
| @@ -160,7 +156,6 @@ classpath is defined using nested elements.</p> | |||
| </classespath> | |||
| </jdepend> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| @@ -44,56 +44,42 @@ generated BNF documentation file.</p> | |||
| <table> | |||
| <tr> | |||
| <td valign="top"><b>Attribute</b></td> | |||
| <td valign="top"><b>Description</b></td> | |||
| <td align="center" valign="top"><b>Required</b></td> | |||
| <td valign="top"><b>Attribute</b></td> | |||
| <td valign="top"><b>Description</b></td> | |||
| <td align="center" valign="top"><b>Required</b></td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">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> | |||
| <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> | |||
| <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> | |||
| <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> | |||
| <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> | |||
| <td valign="top">maxmemory</td> | |||
| <td valign="top">Max amount of memory to allocate to the forked | |||
| VM. <em>since Ant 1.8.3</em></td> | |||
| @@ -101,15 +87,13 @@ option.</td> | |||
| </tr> | |||
| </table> | |||
| <h3> | |||
| Example</h3> | |||
| <h3>Example</h3> | |||
| <blockquote> | |||
| <pre><jjdoc | |||
| target="src/Parser.jj" | |||
| outputfile="doc/ParserBNF.html" | |||
| javacchome="c:/program files/JavaCC"/></pre> | |||
| </blockquote> | |||
| This invokes JJDoc on grammar file src/Parser.jj, writing the generated | |||
| BNF documentation file, ParserBNF.html, file to doc. | |||
| @@ -194,17 +194,14 @@ option.</td> | |||
| <h3>Example</h3> | |||
| <blockquote> | |||
| <pre><jjtree | |||
| target="src/Parser.jjt" | |||
| outputdirectory="build/src" | |||
| javacchome="c:/program files/JavaCC" | |||
| nodeusesparser="true"/></pre> | |||
| </blockquote> | |||
| 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 | |||
| is set to true when invoking JJTree. | |||
| <br> | |||
| <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> | |||
| <blockquote> | |||
| <pre><junitreport todir="./reports"> | |||
| <pre><junitreport todir="./reports"> | |||
| <fileset dir="./reports"> | |||
| <include name="TEST-*.xml"/> | |||
| </fileset> | |||
| <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 | |||
| generate the default framed report in the directory <tt>report/html</tt>.</p> | |||
| <h3>Example of report with xsl params</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <junitreport todir="${outputdir}"> | |||
| <fileset dir="${jrdir}"> | |||
| <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="key2" expression="value2"/> | |||
| </report> | |||
| </junitreport> | |||
| </pre> | |||
| </blockquote> | |||
| </junitreport></pre> | |||
| <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> | |||
| @@ -243,7 +243,6 @@ | |||
| The following example defined a task called testing and | |||
| runs it. | |||
| </p> | |||
| <blockquote> | |||
| <pre class=code> | |||
| <macrodef name="testing"> | |||
| <attribute name="v" default="NOT SET"/> | |||
| @@ -260,7 +259,6 @@ | |||
| </some-tasks> | |||
| </testing> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following fragment defines a task called <code><call-cc></code> which | |||
| take the attributes "target", "link" and "target.dir" and the | |||
| @@ -268,7 +266,6 @@ | |||
| uses the <code><cc></code> task from the | |||
| <a href="http://ant-contrib.sourceforge.net/">ant-contrib</a> project. | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <macrodef name="call-cc"> | |||
| <attribute name="target"/> | |||
| @@ -286,11 +283,9 @@ | |||
| </sequential> | |||
| </macrodef> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| This then can be used as follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <call-cc target="unittests" link="executable" | |||
| target.dir="${build.bin.dir}"> | |||
| @@ -303,13 +298,11 @@ | |||
| </cc-elements> | |||
| </call-cc> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following fragment shows <call-cc>, but this time | |||
| using an implicit element and with the link and target.dir arguments | |||
| having default values. | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <macrodef name="call-cc"> | |||
| <attribute name="target"/> | |||
| @@ -327,12 +320,10 @@ | |||
| </sequential> | |||
| </macrodef> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| This then can be used as follows, note that <cc-elements> | |||
| is not specified. | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <call-cc target="unittests"> | |||
| <includepath location="${gen.dir}"/> | |||
| @@ -342,11 +333,9 @@ | |||
| <linker refid="linker-libs"/> | |||
| </call-cc> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following shows the use of the <code>text</code> element. | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <macrodef name="echotest"> | |||
| <text name="text"/> | |||
| @@ -358,7 +347,6 @@ | |||
| Hello world | |||
| </echotest> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following uses a prior defined attribute for setting the | |||
| default value of another. The output would be | |||
| @@ -367,7 +355,6 @@ | |||
| because while processing the <i>two</i>-line the value for | |||
| <i>one</i> is not set. | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <macrodef name="test"> | |||
| <attribute name="one"/> <b>*1</b> | |||
| @@ -378,7 +365,6 @@ | |||
| </macrodef> | |||
| <test one="test"/> | |||
| </pre> | |||
| </blockquote> | |||
| </body> | |||
| </html> | |||
| @@ -309,18 +309,18 @@ the <code><message></code> element.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mail from="me" | |||
| tolist="you" | |||
| subject="Results of nightly build" | |||
| files="build.log"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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>build.log</i> in the body of the message.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mail mailhost="smtp.myisp.com" mailport="1025" subject="Test build"> | |||
| <from address="config@myisp.com"/> | |||
| <replyto address="me@myisp.com"/> | |||
| @@ -332,7 +332,7 @@ the <code><message></code> element.</p> | |||
| </fileset> | |||
| </attachments> | |||
| </mail> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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>. | |||
| @@ -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> | |||
| will be replaced with the <code>buildname</code> property's value.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property name="line2" value="some_international_message"/> | |||
| <echo message="${line2}"/> | |||
| @@ -350,7 +350,7 @@ will be replaced with the <code>buildname</code> property's value.</p> | |||
| <to address="all@xyz.com"/> | |||
| <message>some international text:${line2}</message> | |||
| </mail> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| @@ -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> | |||
| <h3>Examples</h3> | |||
| <div id="example1"> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="build/acme.jar"> | |||
| <classpath refid="classpath" /> | |||
| </manifestclasspath> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Assuming a path of id "classpath" was already defined, convert this | |||
| path relatively to the build/ directory that will contain acme.jar, which | |||
| can later be created with <code><jar></code> with a nested | |||
| <code><manifest></code> element that lists an | |||
| <code><attribute name="Class-Path" value="${jar.classpath}"/></code>. | |||
| </p> | |||
| </div> | |||
| </body> | |||
| </html> | |||
| @@ -324,16 +324,14 @@ for more information.</p> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <p><code><netrexxc srcDir="/source/project" | |||
| <pre><netrexxc srcDir="/source/project" | |||
| includes="vnr/util/*" | |||
| destDir="/source/project/build" | |||
| classpath="/source/project2/proj.jar" | |||
| comments="true" | |||
| crossref="false" replace="true" | |||
| keep="true"/></code> | |||
| </p> | |||
| </blockquote> | |||
| keep="true"/></pre> | |||
| </body> | |||
| </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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <gzip src="test.tar" destfile="test.tar.gz"/> | |||
| </pre></blockquote> | |||
| <blockquote><pre> | |||
| </pre> | |||
| <pre> | |||
| <bzip2 src="test.tar" destfile="test.tar.bz2"/> | |||
| </pre></blockquote> | |||
| <blockquote><pre> | |||
| </pre> | |||
| <pre> | |||
| <xz src="test.tar" destfile="test.tar.xz"/> | |||
| </pre></blockquote> | |||
| <blockquote><pre> | |||
| </pre> | |||
| <pre> | |||
| <gzip destfile="archive.tar.gz"> | |||
| <url url="http://example.org/archive.tar"/> | |||
| </gzip> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| @@ -71,7 +71,6 @@ | |||
| srcdir and destdir | |||
| attributes set. It also has a src element to source files from a generated | |||
| directory. | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <presetdef name="my.javac"> | |||
| <javac debug="${debug}" deprecation="${deprecation}" | |||
| @@ -80,24 +79,18 @@ | |||
| </javac> | |||
| </presetdef> | |||
| </pre> | |||
| </blockquote> | |||
| This can be used as a normal javac task - example: | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <my.javac/> | |||
| </pre> | |||
| </blockquote> | |||
| The attributes specified in the preset task may be overridden - i.e. | |||
| they may be seen as optional attributes - example: | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <my.javac srcdir="${test.src}" deprecation="no"/> | |||
| </pre> | |||
| </blockquote> | |||
| One may put a presetdef definition in an antlib. | |||
| For example suppose the jar file antgoodies.jar has | |||
| the antlib.xml as follows: | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <antlib> | |||
| <taskdef resource="com/acme/antgoodies/tasks.properties"/> | |||
| @@ -108,9 +101,7 @@ | |||
| </presetdef> | |||
| </antlib> | |||
| </pre> | |||
| </blockquote> | |||
| One may then use this in a build file as follows: | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <project default="example" xmlns:antgoodies="antlib:com.acme.antgoodies"> | |||
| <target name="example"> | |||
| @@ -121,12 +112,10 @@ | |||
| </target> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following is an example of evaluation of properties when the | |||
| definition is used: | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| <target name="defineandcall"> | |||
| <presetdef name="showmessage"> | |||
| @@ -143,11 +132,9 @@ | |||
| <showmessage/> | |||
| </target> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The command ant defineandcall results in the output: | |||
| </p> | |||
| <blockquote> | |||
| <pre class="code"> | |||
| defineandcall: | |||
| [showmessage] message is '${message}' | |||
| @@ -156,14 +143,13 @@ defineandcall: | |||
| called: | |||
| [showmessage] message is 'Message 2' | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| 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 | |||
| properties to be available in child builds run with | |||
| <code><ant ... inheritall="false"></code>: | |||
| </p> | |||
| <blockquote><pre class="code"> | |||
| <pre class="code"> | |||
| <macrodef name="showmessage-presetdef"> | |||
| <attribute name="messageval"/> | |||
| <presetdef name="showmessage"> | |||
| @@ -171,7 +157,7 @@ properties to be available in child builds run with | |||
| </presetdef> | |||
| </macrodef> | |||
| <showmessage-presetdef messageval="${message}"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </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. | |||
| </p> | |||
| <blockquote><pre><propertyfile | |||
| <pre><propertyfile | |||
| file="my.properties" | |||
| comment="My properties"> | |||
| <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.date" type="date" value="now" pattern="DDD HH:mm"/> | |||
| </propertyfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| To produce dates relative from today :</p> | |||
| <blockquote><pre><propertyfile | |||
| <pre><propertyfile | |||
| file="my.properties" | |||
| comment="My properties"> | |||
| <entry key="formated.date-1" | |||
| @@ -213,21 +213,21 @@ To produce dates relative from today :</p> | |||
| type="date" default="now" pattern="DDD" | |||
| operation="+" value="1"/> | |||
| </propertyfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| Concatenation of strings :</p> | |||
| <blockquote><pre><propertyfile | |||
| <pre><propertyfile | |||
| file="my.properties" | |||
| comment="My properties"> | |||
| <entry key="progress" default="" operation="+" value="."/> | |||
| </propertyfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Each time called, a "." will be appended to "progress" | |||
| </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 | |||
| name="header" | |||
| value="##Generated file - do not modify!"/> | |||
| @@ -238,7 +238,7 @@ Concatenation of strings :</p> | |||
| <entry key="product.build.date" type="date" value="now" /> | |||
| </propertyfile> | |||
| </target> | |||
| </pre></blockquote> | |||
| </pre> | |||
| After running this target the version changed e.g. from 3.2.2 to 3.3.0. | |||
| </body> | |||
| @@ -105,16 +105,14 @@ supports most attributes of <code><fileset></code> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <p><code><renameext srcDir="/source/project1" | |||
| <pre><renameext srcDir="/source/project1" | |||
| includes="**" | |||
| excludes="**/samples/*" | |||
| fromExtension=".java.keep" | |||
| toExtension=".java" | |||
| replace="true"/> | |||
| </code> | |||
| </p> | |||
| </blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -159,30 +159,30 @@ them.</p> | |||
| <tr> | |||
| <td valign="top">expandProperties</td> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <replace dir="${src}" value="wombat"> | |||
| <include name="**/*.html"/> | |||
| <replacetoken><![CDATA[multi line | |||
| token]]></replacetoken> | |||
| </replace> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>replaces occurrences of the string "multi | |||
| line<i>\n</i>token" with the string "wombat", in all | |||
| HTML files in the directory <code>${src}</code>.Where <i>\n</i> is | |||
| the platform specific line separator.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <replace file="${src}/index.html"> | |||
| <replacetoken><![CDATA[two line | |||
| token]]></replacetoken> | |||
| <replacevalue><![CDATA[two line | |||
| token]]></replacevalue> | |||
| </replace> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| @@ -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> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <replace | |||
| file="configure.sh" | |||
| value="defaultvalue" | |||
| @@ -231,7 +231,7 @@ token]]></replacevalue> | |||
| <replacevalue>value4</replacevalue> | |||
| </replacefilter> | |||
| </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><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 | |||
| the regular expression. You can use this element to refer to a previously | |||
| defined regular expression datatype instance.</p> | |||
| <blockquote> | |||
| <regexp id="id" pattern="alpha(.+)beta"/><br> | |||
| <regexp refid="id"/> | |||
| </blockquote> | |||
| <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 | |||
| defined substitution pattern datatype instance.</p> | |||
| <blockquote> | |||
| <substitution id="id" expression="beta\1alpha"/><br> | |||
| <substitution refid="id"/> | |||
| </blockquote> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <replaceregexp byline="true"> | |||
| <regexp pattern="OldProperty=(.*)"/> | |||
| <substitution expression="NewProperty=\1"/> | |||
| @@ -139,62 +138,54 @@ value, in the file <code>${src}/build.properties</code></p> | |||
| <include name="*.properties"/> | |||
| </fileset> | |||
| </replaceregexp> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>replaces occurrences of the property name "OldProperty" | |||
| with "NewProperty" in a properties file, preserving the existing | |||
| 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"> | |||
| <fileset dir="${html.dir}" includes="**/*.html"/> | |||
| </replaceregexp> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>replaces all whitespaces (blanks, tabs, etc) by one blank remaining the | |||
| line separator. So with input</p> | |||
| <blockquote> | |||
| <pre> | |||
| <html> <body> | |||
| <<TAB>><h1> T E S T </h1> <<TAB>> | |||
| <<TAB>> </body></html> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>would converted to</p> | |||
| <blockquote> | |||
| <pre> | |||
| <html> <body> | |||
| <h1> T E S T </h1> </body></html> | |||
| </pre> | |||
| </blockquote> | |||
| <br><!-- small distance from code of the previous example --> | |||
| <blockquote> | |||
| <pre><replaceregexp match="\\n" replace="${line.separator}" flags="g" byline="true"> | |||
| <fileset dir="${dir}"/> | |||
| </replaceregexp> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>replaces all <tt>\n</tt> markers (beware the quoting of the backslash) by a line break. | |||
| So with input</p> | |||
| <blockquote> | |||
| <pre> | |||
| one\ntwo\nthree | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>would converted to</p> | |||
| <blockquote> | |||
| <pre> | |||
| one | |||
| two | |||
| three | |||
| </pre> | |||
| </blockquote> | |||
| <p>Beware that inserting line breaks could break file syntax. For example in xml:</p> | |||
| <blockquote> | |||
| <pre> | |||
| <root> | |||
| <text>line breaks \n should work in text</text> | |||
| <attribute value="but breaks \n attributes" /> | |||
| </root> | |||
| </pre> | |||
| </blockquote> | |||
| </body> | |||
| </html> | |||
| @@ -100,14 +100,14 @@ this is "true" by default | |||
| <h3>Example</h3> | |||
| A simple example of connecting to a server and running a command. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <rexec userid="bob" password="badpass" server="localhost" command="ls"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| The task can be used with other ports as well: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <rexec port="80" userid="bob" password="badpass" server="localhost" command="ls"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -162,7 +162,7 @@ different location values.</p> | |||
| </p> | |||
| <h3>Examples</h3> | |||
| The following snippet shows use of five different languages: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <property name="message" value="Hello world"/> | |||
| <script language="groovy"> | |||
| @@ -185,7 +185,6 @@ The following snippet shows use of five different languages: | |||
| print "message is %s" % message | |||
| </script> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| Note that for the <i>jython</i> example, the script contents <b>must</b> | |||
| start on the first column. | |||
| @@ -196,28 +195,26 @@ print "message is %s" % message | |||
| <p> | |||
| The following script shows a little more complicated jruby example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <script language="ruby"> | |||
| xmlfiles = Dir.new(".").entries.delete_if { |i| ! (i =~ /\.xml$/) } | |||
| xmlfiles.sort.each { |i| $self.log(i) } | |||
| </script> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The same example in groovy is: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <script language="groovy"> | |||
| xmlfiles = new java.io.File(".").listFiles().findAll{ it =~ "\.xml$"} | |||
| xmlfiles.sort().each { self.log(it.toString())} | |||
| </script> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following example shows the use of classpath to specify the location | |||
| of the beanshell jar file. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <script language="beanshell" setbeans="true"> | |||
| <classpath> | |||
| <fileset dir="${user.home}/lang/beanshell" includes="*.jar" /> | |||
| @@ -225,12 +222,11 @@ print "message is %s" % message | |||
| System.out.println("Hello world"); | |||
| </script> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| The following script uses javascript to create a number of | |||
| echo tasks and execute them. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <project name="squares" default="main" basedir="."> | |||
| <target name="main"> | |||
| @@ -248,9 +244,9 @@ print "message is %s" % message | |||
| </target> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>generates</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| main: | |||
| 1 | |||
| 4 | |||
| @@ -264,11 +260,11 @@ main: | |||
| 100 | |||
| 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 | |||
| filesizes of all files a <code><fileset/></code> caught.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <?xml version="1.0" encoding="ISO-8859-1"?> | |||
| <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> | |||
| </target> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| 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 | |||
| path. If the path does not exist, it will be created. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <!-- | |||
| Define addtopath task | |||
| --> | |||
| @@ -372,14 +368,14 @@ appropriate logging before and after invoking execute(). | |||
| } | |||
| project.addTaskDefinition("addtopath", AddToPath.class); | |||
| </script> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| An example of using this task to create a path | |||
| from a list of directories (using antcontrib's | |||
| <a href="http://ant-contrib.sourceforge.net/tasks/tasks/for.html"> | |||
| <for></a> task) follows: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <path id="main.path"> | |||
| <fileset dir="build/classes"/> | |||
| </path> | |||
| @@ -392,7 +388,7 @@ appropriate logging before and after invoking execute(). | |||
| </addtopath> | |||
| </sequential> | |||
| </ac:for> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -282,8 +282,8 @@ error. For example in the above script, removing the closing curly bracket | |||
| would result in this error | |||
| </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> | |||
| Script errors are only detected when a script task is actually executed. | |||
| @@ -91,18 +91,18 @@ | |||
| <p><a href="../Types/resources.html#collection">Resource | |||
| Collection</a>s are used to select groups of resources.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <setpermissions mode="755"> | |||
| <file file="${dist}/start.sh"/> | |||
| </setpermissions> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>makes the "start.sh" file readable and executable for | |||
| 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"> | |||
| <file file="${dist}/start.sh"/> | |||
| </setpermissions> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>makes the "start.sh" file readable and executable for | |||
| anyone and in addition writable by the owner.</p> | |||
| </body> | |||
| @@ -223,15 +223,15 @@ block</td> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <signjar jar="${dist}/lib/ant.jar" | |||
| alias="apache-group" storepass="secret"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| signs the ant.jar with alias "apache-group" accessing the | |||
| keystore and private key via "secret" password. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <signjar destDir="signed" | |||
| alias="testonly" keystore="testkeystore" | |||
| storepass="apacheant" | |||
| @@ -241,14 +241,13 @@ alias="apache-group" storepass="secret"/> | |||
| </path> | |||
| <flattenmapper /> | |||
| </signjar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| Sign all JAR files matching the dist/**/*.jar pattern, copying them to the | |||
| directory "signed" afterwards. The flatten mapper means that they will | |||
| all be copied to this directory, not to subdirectories. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <signjar | |||
| alias="testonly" keystore="testkeystore" | |||
| storepass="apacheant" | |||
| @@ -258,12 +257,12 @@ all be copied to this directory, not to subdirectories. | |||
| <fileset dir="dist" includes="**/*.jar" /> | |||
| </path> | |||
| </signjar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <signjar | |||
| alias="testonly" keystore="testkeystore" | |||
| storepass="apacheant" | |||
| @@ -273,7 +272,7 @@ so the files will only be signed if they are not already signed. | |||
| <fileset dir="dist" includes="**/*.jar" /> | |||
| </path> | |||
| </signjar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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 | |||
| @@ -84,7 +84,7 @@ will be logged. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <target name="fun" if="fun" unless="fun.done"> | |||
| <sound> | |||
| @@ -94,7 +94,6 @@ will be logged. | |||
| <property name="fun.done" value="true"/> | |||
| </target> | |||
| </pre> | |||
| </blockquote> | |||
| 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, | |||
| 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 | |||
| <code>fun.done</code> property prevents the target from being executed | |||
| more than once. | |||
| <blockquote> | |||
| <pre> | |||
| <target name="fun" if="fun" unless="fun.done"> | |||
| <sound> | |||
| @@ -113,7 +111,6 @@ more than once. | |||
| <property name="fun.done" value="true"/> | |||
| </target> | |||
| </pre> | |||
| </blockquote> | |||
| randomly selects a sound-file to play when the build succeeds or fails. | |||
| </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" align="center">No</td> | |||
| <td valign="top" align="center">None</td> | |||
| </tr> | |||
| <tr> | |||
| <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">None</td> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <splash/> | |||
| </pre></blockquote> | |||
| <pre><splash/></pre> | |||
| <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" | |||
| useproxy="true" | |||
| showduration="5000"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Splashes the jakarta logo, for an initial period of 5 seconds.</p> | |||
| <p>Splash with controlled progress and nondefault text</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <target name="test_new_features"> | |||
| <echo>New features</echo> | |||
| <splash progressRegExp="Progress: (.*)%" showduration="0" displayText="Test text"/> | |||
| @@ -145,7 +141,7 @@ the build exactly what is going on. | |||
| <echo>Progress: 100%</echo> | |||
| <sleep seconds="3"/> | |||
| </target> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -352,19 +352,19 @@ href="../using.html#path">PATH like structure</a> and can also be set via a nest | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| password="pass" | |||
| src="data.sql"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| the file data.sql</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -372,14 +372,14 @@ the file data.sql</p> | |||
| src="data.sql"> | |||
| <connectionProperty name="internal_logon" value="SYSDBA"> | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 the file data.sql. Also sets the | |||
| property <i>internal_logon</i> to the value <i>SYSDBA</i>.</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -390,7 +390,7 @@ values(1,2,3,4); | |||
| truncate table some_other_table; | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| @@ -402,7 +402,7 @@ truncate table some_other_table; | |||
| need to escape <code><</code>, <code>></code> <code>&</code> | |||
| or other special characters. For example:</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -411,12 +411,12 @@ or other special characters. For example:</p> | |||
| update some_table set column1 = column1 + 1 where column2 < 42; | |||
| ]]></sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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. | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.hsqldb.jdbcDriver"; | |||
| url="jdbc:hsqldb:file:${database.dir}" | |||
| userid="sa" | |||
| @@ -426,14 +426,14 @@ compatibility), then creates a new user in the HSQLDB database using Ant propert | |||
| CREATE USER ${newuser} PASSWORD ${newpassword} | |||
| </transaction> | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 files data1.sql, data2.sql and data3.sql and then executes the truncate | |||
| operation on <i>some_other_table</i>.</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -445,14 +445,14 @@ operation on <i>some_other_table</i>.</p> | |||
| truncate table some_other_table; | |||
| </transaction> | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>The following example does the same as (and may execute additional | |||
| SQL files if there are more files matching the pattern | |||
| <code>data*.sql</code>) but doesn't guarantee that data1.sql will be | |||
| run before <code>data2.sql</code>.</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -466,14 +466,14 @@ run before <code>data2.sql</code>.</p> | |||
| truncate table some_other_table; | |||
| </transaction> | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| file data.sql, with output piped to outputfile.txt, searching /some/jdbc.jar | |||
| as well as the system classpath for the driver class.</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -485,12 +485,12 @@ as well as the system classpath for the driver class.</p> | |||
| <pathelement location="/some/jdbc.jar"/> | |||
| </classpath> | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>The following will only execute if the RDBMS is "oracle" and the version | |||
| starts with "8.1."</p> | |||
| <blockquote><pre><sql | |||
| <pre><sql | |||
| driver="org.database.jdbcDriver" | |||
| url="jdbc:database-url" | |||
| userid="sa" | |||
| @@ -504,7 +504,7 @@ values(1,2,3,4); | |||
| truncate table some_other_table; | |||
| </sql> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -137,23 +137,23 @@ defaults to false.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <sync todir="site"> | |||
| <fileset dir="generated-site"/> | |||
| </sync> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| present in <em>generated-site</em>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <sync todir="site"> | |||
| <fileset dir="generated-site"/> | |||
| <preserveintarget> | |||
| <include name="**/CVS/**"/> | |||
| </preserveintarget> | |||
| </sync> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| 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:" | |||
| for the password. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <telnet userid="bob" password="badpass" server="localhost"> | |||
| <read>/home/bob</read> | |||
| <write>ls</write> | |||
| <read string="/home/bob"/> | |||
| </telnet> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This task can be rewritten as: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <telnet server="localhost"> | |||
| <read>ogin:</read> | |||
| <write>bob</write> | |||
| @@ -120,28 +120,28 @@ This task can be rewritten as: | |||
| <write>ls</write> | |||
| <read>/home/bob</read> | |||
| </telnet> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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 | |||
| 10 seconds before quitting. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <telnet userid="bob" password="badpass" server="localhost" timeout="20"> | |||
| <read>/home/bob</read> | |||
| <write echo="false">sleep 15</write> | |||
| <read timeout="10">/home/bob</read> | |||
| </telnet> | |||
| </pre></blockquote> | |||
| </pre> | |||
| The task can be used with other ports as well: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <telnet port="80" server="localhost" timeout="20"> | |||
| <read/> | |||
| <write>GET / http/0.9</write> | |||
| <write/> | |||
| <read timeout="10">&lt;/HTML&gt;</read> | |||
| </telnet> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| To use this task against the WinNT telnet service, you need to configure the service to use | |||
| classic authentication rather than NTLM negotiated authentication. | |||
| @@ -66,32 +66,22 @@ resource collection</h4> | |||
| <p>The specified resource will be used as src.</p> | |||
| <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> | |||
| <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> | |||
| <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> | |||
| <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> | |||
| <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 | |||
| subdir is a directory).</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <gunzip dest="."> | |||
| <url url="http://example.org/archive.tar.gz"/> | |||
| </gunzip> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| @@ -100,9 +90,7 @@ to <i>archive.tar</i> in the project's basedir on the fly.</p> | |||
| <pre> | |||
| <gunzip src="some-archive.gz" dest="some-dest-dir"/> | |||
| </pre> | |||
| is identical to | |||
| <pre> | |||
| <copy todir="some-dest-dir"> | |||
| <gzipresource> | |||
| @@ -126,12 +126,11 @@ supported | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <verifyjar jar="${dist}/lib/ant.jar" | |||
| alias="apache-group" storepass="secret"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| verifies the ant.jar with alias "apache-group" accessing the | |||
| 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> | |||
| <p>Note that only one of version, date or label should be specified</p> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <vssget localPath="C:\mysrc\myproject" | |||
| recursive="true" | |||
| @@ -207,7 +207,7 @@ label only one will be used in the order version, date, label.</p> | |||
| vsspath="$/source/aProject" | |||
| writable="true"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| which are labeled <i>Release1</i> and write them to the local directory | |||
| @@ -282,24 +282,24 @@ project.</p> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <vsslabel vsspath="$/source/aProject" | |||
| login="me,mypassword" | |||
| label="Release1"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| <i>mypassword</i>. | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <vsslabel vsspath="$/source/aProject/myfile.txt" | |||
| version="4" | |||
| label="1.03.004"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| the build) will fail. | |||
| @@ -414,25 +414,25 @@ Task to perform HISTORY commands to Microsoft Visual SourceSafe. | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <vsshistory vsspath="$/myProject" recursive="true" | |||
| fromLabel="Release1" | |||
| toLabel="Release2"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Shows all changes between "Release1" and "Release2".</p> | |||
| <blockquote> | |||
| <pre> | |||
| <vsshistory vsspath="$/myProject" recursive="true" | |||
| fromDate="01.01.2001" | |||
| toDate="31.03.2001"/> | |||
| </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> | |||
| <blockquote> | |||
| <pre> | |||
| <tstamp> | |||
| <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" | |||
| toDate="${to.tstamp}"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Shows all changes in the 14 days before today.</p> | |||
| <hr> | |||
| @@ -517,13 +517,13 @@ Task to perform CHECKIN commands to Microsoft Visual SourceSafe. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <vsscheckin vsspath="$/test/test*" | |||
| localpath="D:\build\" | |||
| comment="Modified by automatic build"/> | |||
| </pre> | |||
| </blockquote> | |||
| <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> | |||
| <hr> | |||
| @@ -621,14 +621,14 @@ label only one will be used in the order version, date, label.</p> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <vsscheckout vsspath="$/test" | |||
| localpath="D:\build" | |||
| recursive="true" | |||
| login="me,mypass"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Does a recursive checkout of the project <i>$/test</i> to the directory D:\build. | |||
| </p> | |||
| <hr> | |||
| @@ -697,12 +697,12 @@ Task to perform ADD commands to Microsoft Visual SourceSafe. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <vssadd localpath="D:\build\build.00012.zip" | |||
| comment="Added by automatic build"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p>Add the file named build.00012.zip into the project current working | |||
| directory (see vsscp).</p> | |||
| <hr> | |||
| @@ -753,11 +753,9 @@ directory (see vsscp).</p> | |||
| </table> | |||
| <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> | |||
| <hr> | |||
| @@ -811,11 +809,9 @@ directory (see vsscp).</p> | |||
| </tr> | |||
| </table> | |||
| <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> | |||
| </body> | |||
| @@ -102,27 +102,27 @@ true within the specified time.</p> | |||
| <a href="conditions.html">here</a> for the full list.</p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <waitfor maxwait="30" maxwaitunit="second"> | |||
| <available file="errors.log"/> | |||
| </waitfor> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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"> | |||
| <http url="http://localhost/myapp/index.html"/> | |||
| </waitfor> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost | |||
| to serve up the specified URL.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <waitfor maxwait="10" maxwaitunit="second"> | |||
| <and> | |||
| <socket server="dbserver" port="1521"/> | |||
| <http url="http://webserver/mypage.html"/> | |||
| </and> | |||
| </waitfor> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| to become available.</p> | |||
| @@ -31,9 +31,9 @@ | |||
| The named property is set if the item can be found. | |||
| For example: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <whichresource resource="/log4j.properties" property="log4j.url" > | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3>Parameters</h3> | |||
| <table> | |||
| <tr> | |||
| @@ -91,7 +91,7 @@ | |||
| <p> | |||
| The following shows using a classpath reference. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <path id="bsf.classpath"> | |||
| <fileset dir="${user.home}/lang/bsf" includes="*.jar"/> | |||
| </path> | |||
| @@ -99,11 +99,11 @@ | |||
| class="org.apache.bsf.BSFManager" | |||
| classpathref="bsf.classpath"/> | |||
| <echo>${bsf.class.location}</echo> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| The following shows using a nested classpath. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <whichresource | |||
| property="ant-contrib.antlib.location" | |||
| resource="net/sf/antcontrib/antlib.xml"> | |||
| @@ -112,6 +112,6 @@ | |||
| </classpath> | |||
| </whichresource> | |||
| <echo>${ant-contrib.antlib.location}</echo> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -25,7 +25,6 @@ | |||
| <body> | |||
| <h2 id="antlib">Antlib</h2> | |||
| <h3>Description</h3> | |||
| <p> | |||
| 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 | |||
| file. For example the file <i>sample.xml</i> contains the following: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <?xml version="1.0"?> | |||
| <antlib> | |||
| <typedef name="if" classname="org.acme.ant.If"/> | |||
| @@ -70,17 +68,14 @@ | |||
| </sequential> | |||
| </macrodef> | |||
| </antlib> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| 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: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <typedef file="sample.xml"/> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| 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 | |||
| @@ -88,25 +83,20 @@ | |||
| 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>. | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <typedef resource="org/acme/ant/sample.xml" | |||
| uri="samples:/acme.org"/> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| The definitions may then be used as follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <sample:if valuetrue="${props}" xmlns:sample="samples:/acme.org"> | |||
| <sample:scriptpathmapper language="beanshell"> | |||
| some bean shell | |||
| </sample:scriptpathmapper> | |||
| </sample:if> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <h3 id="antlibnamespace">Antlib namespace</h3> | |||
| <p> | |||
| @@ -125,8 +115,7 @@ | |||
| defined, the following build file will automatically load the antcontrib | |||
| definitions at location <i>HERE</i>: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <project default="deletetest" xmlns:antcontrib="antlib:net.sf.antcontrib"> | |||
| <macrodef name="showdir"> | |||
| <attribute name="dir"/> | |||
| @@ -148,22 +137,18 @@ | |||
| <showdir dir="a"/> | |||
| </target> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| The requirement that the resource is in the default classpath | |||
| may be removed in future versions of Ant. | |||
| </p> | |||
| <h3 id="loadFromInside">Load antlib from inside of the buildfile</h3> | |||
| <p> | |||
| If you want to separate the antlib from your local Ant installation, e.g. because you | |||
| want to hold that jar in your projects SCM system, you have to specify a classpath, so | |||
| that Ant could find that jar. The best solution is loading the antlib with <tt><taskdef></tt>. | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <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>" | |||
| resource="net/sf/antcontrib/antlib.xml" | |||
| @@ -178,9 +163,7 @@ | |||
| </antcontrib:for> | |||
| </target> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <h3 id="currentnamespace">Current namespace</h3> | |||
| <p> | |||
| Definitions defined in antlibs may be used in antlibs. However | |||
| @@ -192,8 +175,7 @@ | |||
| type <code><isallowed></code> and a macro | |||
| <code><ifallowed></code> that makes use of the task and type: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <antlib xmlns:current="ant:current"> | |||
| <taskdef name="if" classname="org.acme.ant.If"/> | |||
| <typedef name="isallowed" classname="org.acme.ant.Isallowed"/> | |||
| @@ -210,10 +192,7 @@ | |||
| </sequential> | |||
| </macrodef> | |||
| </antlib> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <h3>Other examples and comments</h3> | |||
| <p> | |||
| Antlibs may make use of other antlibs. | |||
| @@ -226,8 +205,7 @@ | |||
| following antlib may be used to define defaults for various | |||
| tasks: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <antlib xmlns:antcontrib="antlib:net.sf.antcontrib"> | |||
| <presetdef name="javac"> | |||
| <javac deprecation="${deprecation}" | |||
| @@ -240,21 +218,18 @@ | |||
| <antcontrib:shellscript shell="bash"/> | |||
| </presetdef> | |||
| </antlib> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| This may be used as follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <project xmlns:local="localpresets"> | |||
| <typedef file="localpresets.xml" uri="localpresets"/> | |||
| <local:shellscript> | |||
| echo "hello world" | |||
| </local:shellscript> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -85,28 +85,28 @@ relative location of the classfile in the fileset. So, the file | |||
| <code>org.apache.tools.ant.Project</code>.</p> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <classfileset id="reqdClasses" dir="${classes.dir}"> | |||
| <root classname="org.apache.tools.ant.Project"/> | |||
| </classfileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>This example creates a fileset containing all the class files upon which the | |||
| <code>org.apache.tools.ant.Project</code> class depends. This fileset could | |||
| then be used to create a jar. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <jar destfile="minimal.jar"> | |||
| <fileset refid="reqdClasses"/> | |||
| </jar> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <classfileset id="reqdClasses" dir="${classes.dir}"> | |||
| <rootfileset dir="${classes.dir}" includes="org/apache/tools/ant/Project*.class"/> | |||
| </classfileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>This example constructs the classfileset using all the class with names starting with Project | |||
| in the org.apache.tools.ant package</p> | |||
| @@ -64,8 +64,7 @@ | |||
| For example a custom condition that returns true if a | |||
| string is all upper case could be written as: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| package com.mydomain; | |||
| import org.apache.tools.ant.BuildException; | |||
| @@ -87,31 +86,25 @@ public class AllUpperCaseCondition implements Condition { | |||
| return value.toUpperCase().equals(value); | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| Adding the condition to the system is achieved as follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <typedef | |||
| name="alluppercase" | |||
| classname="com.mydomain.AllUpperCaseCondition" | |||
| classpath="${mydomain.classes}"/> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| This condition can now be used wherever a Core Ant condition | |||
| is used. | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <condition property="allupper"> | |||
| <alluppercase value="THIS IS ALL UPPER CASE"/> | |||
| </condition> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <h3 id="customselectors">Custom Selectors</h3> | |||
| <p> | |||
| 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 | |||
| in ".java" would be: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| package com.mydomain; | |||
| import java.io.File; | |||
| import org.apache.tools.ant.types.selectors.FileSelector; | |||
| @@ -138,34 +130,28 @@ public class JavaSelector implements FileSelector { | |||
| return filename.toLowerCase().endsWith(".java"); | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| Adding the selector to the system is achieved as follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <typedef | |||
| name="javaselector" | |||
| classname="com.mydomain.JavaSelector" | |||
| classpath="${mydomain.classes}"/> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| </pre> | |||
| <p> | |||
| This selector can now be used wherever a Core Ant selector | |||
| is used, for example: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <copy todir="to"> | |||
| <fileset dir="src"> | |||
| <javaselector/> | |||
| </fileset> | |||
| </copy> | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| </pre> | |||
| <p> | |||
| One may use | |||
| <code>org.apache.tools.ant.types.selectors.BaseSelector</code>, | |||
| 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 | |||
| a selector as follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| public class MatchNumberSelectors extends BaseSelectorContainer { | |||
| private int number = -1; | |||
| public void setNumber(int number) { | |||
| @@ -221,13 +206,11 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||
| return numberSelected == number; | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| To define and use this selector one could do: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <typedef name="numberselected" | |||
| classname="com.mydomain.MatchNumberSelectors"/> | |||
| ... | |||
| @@ -238,8 +221,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||
| <javaselector/> | |||
| </numberselected> | |||
| </fileset> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| <i>The custom selector</i> | |||
| </p> | |||
| @@ -250,7 +232,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||
| <p>You can write your own selectors and use them within the selector | |||
| 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 | |||
| <code>org.apache.tools.ant.types.selectors.ExtendFileSelector</code>. | |||
| 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 | |||
| use your class as a selector: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${mydir}" includes="**/*"> | |||
| <custom classname="com.mydomain.MySelector"> | |||
| <param name="myattribute" value="myvalue"/> | |||
| </custom> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>The core selectors that can also be used as custom selectors | |||
| are</p> | |||
| @@ -337,15 +317,13 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||
| <p>Here is the example from the Depth Selector section rewritten | |||
| to use the selector through <code><custom></code>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${doc.path}" includes="**/*"> | |||
| <custom classname="org.apache.tools.ant.types.selectors.DepthSelector"> | |||
| <param name="max" value="1"/> | |||
| </custom> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all files in the base directory and one directory below | |||
| that.</p> | |||
| @@ -363,8 +341,7 @@ public class MatchNumberSelectors extends BaseSelectorContainer { | |||
| For example a filterreader that removes every second character | |||
| could be: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| public class RemoveOddCharacters implements ChainableReader { | |||
| public Reader chain(Reader reader) { | |||
| return new BaseFilterReader(reader) { | |||
| @@ -384,8 +361,7 @@ public class RemoveOddCharacters implements ChainableReader { | |||
| } | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| For line oriented filters it may be easier to extend | |||
| <code>ChainableFilterReader</code> an inner class of | |||
| @@ -394,8 +370,7 @@ public class RemoveOddCharacters implements ChainableReader { | |||
| <p> | |||
| For example a filter that appends the line number could be | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| public class AddLineNumber extends ChainableReaderFilter { | |||
| private void lineNumber = 0; | |||
| public String filter(String string) { | |||
| @@ -403,8 +378,7 @@ public class AddLineNumber extends ChainableReaderFilter { | |||
| return "" + lineNumber + "\t" + string; | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -98,9 +98,8 @@ equivalent to an <code><and></code> selector container.</p> | |||
| Specify what happens if the base directory does not exist. | |||
| If true a build error will happen, if false, the dirset | |||
| 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 valign="top" align="center">No</td> | |||
| </tr> | |||
| @@ -108,43 +107,43 @@ equivalent to an <code><and></code> selector container.</p> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <dirset dir="${build.dir}"> | |||
| <include name="apps/**/classes"/> | |||
| <exclude name="apps/**/*Test*"/> | |||
| </dirset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups all directories named <code>classes</code> found under the | |||
| <code>apps</code> subdirectory of <code>${build.dir}</code>, except those | |||
| that have the text <code>Test</code> in their name.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <dirset dir="${build.dir}"> | |||
| <patternset id="non.test.classes"> | |||
| <include name="apps/**/classes"/> | |||
| <exclude name="apps/**/*Test*"/> | |||
| </patternset> | |||
| </dirset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups the same directories as the above example, but also establishes | |||
| a PatternSet that can be referenced in other | |||
| <code><dirset></code> elements, rooted at a different directory.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <dirset dir="${debug_build.dir}"> | |||
| <patternset refid="non.test.classes"/> | |||
| </dirset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups all directories in directory <code>${debug_build.dir}</code>, | |||
| using the same patterns as the above example.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <dirset id="dirset" dir="${workingdir}"> | |||
| <present targetdir="${workingdir}"> | |||
| <mapper type="glob" from="*" to="*/${markerfile}" /> | |||
| </present> | |||
| </dirset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all directories somewhere under <code>${workingdir}</code> | |||
| which contain a <code>${markerfile}</code>.</p> | |||
| @@ -83,7 +83,7 @@ Java2 Standard Edition package, in file | |||
| </table> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <extension id="e1" | |||
| extensionName="MyExtensions" | |||
| specificationVersion="1.0" | |||
| @@ -92,18 +92,18 @@ Java2 Standard Edition package, in file | |||
| implementationVendor="Apache" | |||
| implementationVersion="2.0" | |||
| 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" | |||
| extensionName="MyExtensions" | |||
| specificationVersion="1.0" | |||
| 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> | |||
| </html> | |||
| @@ -48,7 +48,7 @@ Java2 Standard Edition package, in file | |||
| may be modified by attributes of libfileset</p> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <extension id="e1" | |||
| extensionName="MyExtensions" | |||
| specificationVersion="1.0" | |||
| @@ -72,8 +72,7 @@ Java2 Standard Edition package, in file | |||
| <libfileset refid="lfs"/> | |||
| <extension refid="e1"/> | |||
| </extensionSet> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -74,42 +74,42 @@ types. | |||
| </tr> | |||
| </table> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filelist | |||
| id="docfiles" | |||
| dir="${doc.src}" | |||
| files="foo.xml,bar.xml"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>The files <code>${doc.src}/foo.xml</code> and | |||
| <code>${doc.src}/bar.xml</code>. Note that these files may not (yet) | |||
| actually exist. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filelist | |||
| id="docfiles" | |||
| dir="${doc.src}" | |||
| files="foo.xml | |||
| bar.xml"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Same files as the example above.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filelist refid="docfiles"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Same files as the example above.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filelist | |||
| id="docfiles" | |||
| dir="${doc.src}"> | |||
| <file name="foo.xml"/> | |||
| <file name="bar.xml"/> | |||
| </filelist> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${server.src}" casesensitive="yes"> | |||
| <include name="**/*.java"/> | |||
| <exclude name="**/*Test*"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| name.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${server.src}" casesensitive="yes"> | |||
| <patternset id="non.test.sources"> | |||
| <include name="**/*.java"/> | |||
| <exclude name="**/*Test*"/> | |||
| </patternset> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups the same files as the above example, but also establishes | |||
| a PatternSet that can be referenced in other | |||
| <code><fileset></code> elements, rooted at a different directory.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${client.src}" > | |||
| <patternset refid="non.test.sources"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups all files in directory <code>${client.src}</code>, using the | |||
| same patterns as the above example.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${server.src}" casesensitive="yes"> | |||
| <filename name="**/*.java"/> | |||
| <filename name="**/*Test*" negate="true"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups the same files as the top example, but using the | |||
| <code><filename></code> selector.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${server.src}" casesensitive="yes"> | |||
| <filename name="**/*.java"/> | |||
| <not> | |||
| <filename name="**/*Test*"/> | |||
| </not> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups the same files as the previous example using a combination of the | |||
| <code><filename></code> selector and the <code><not></code> | |||
| selector container.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <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 | |||
| <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. | |||
| <p> | |||
| Example: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy file="${src.file}" tofile="${dest.file}"> | |||
| <filterchain> | |||
| <filterreader classname="your.extension.of.java.io.FilterReader"> | |||
| @@ -71,21 +71,21 @@ Example: | |||
| </filterreader> | |||
| </filterchain> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Ant provides some built-in filter readers. These filter readers | |||
| can also be declared using a syntax similar to the above syntax. | |||
| However, they can be declared using some simpler syntax also.<p> | |||
| Example: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="src.file.head"> | |||
| <filterchain> | |||
| <headfilter lines="15"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| is equivalent to: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="src.file.head"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | |||
| @@ -93,7 +93,7 @@ is equivalent to: | |||
| </filterreader> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| The following built-in tasks support nested <code><filterchain></code> elements.<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. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadproperties srcfile="foo.class" encoding="ISO-8859-1"> | |||
| <filterchain> | |||
| <classconstants/> | |||
| </filterchain> | |||
| </loadproperties> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This loads the constants from a Java class file as Ant properties, | |||
| prepending the names with a prefix. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadproperties srcfile="build/classes/org/acme/bar.class" | |||
| encoding="ISO-8859-1"> | |||
| <filterchain> | |||
| @@ -207,7 +207,7 @@ prepending the names with a prefix. | |||
| <prefixlines prefix="ini."/> | |||
| </filterchain> | |||
| </loadproperties> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="escapeunicode">EscapeUnicode</h3> | |||
| <p> | |||
| 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> | |||
| This loads the basic constants defined in a Java class as Ant properties. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadproperties srcfile="non_ascii_property.properties"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.EscapeUnicode"/> | |||
| </filterchain> | |||
| </loadproperties> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadproperties srcfile="non_ascii_property.properties"> | |||
| <filterchain> | |||
| <escapeunicode/> | |||
| </filterchain> | |||
| </loadproperties> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="expandproperties">ExpandProperties</h3> | |||
| <p> | |||
| If the data contains data that represents Ant | |||
| properties (of the form ${...}), that is substituted | |||
| with the property's actual value. | |||
| <p> | |||
| </p> | |||
| <h4>Example:</h4> | |||
| This results in the property modifiedmessage holding the value | |||
| "All these moments will be lost in time, like teardrops in the rain" | |||
| <blockquote><pre> | |||
| <pre> | |||
| <echo | |||
| message="All these moments will be lost in time, like teardrops in the ${weather}" | |||
| file="loadfile1.tmp" | |||
| @@ -256,10 +256,10 @@ This results in the property modifiedmessage holding the value | |||
| <filterreader classname="org.apache.tools.ant.filters.ExpandProperties"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <echo | |||
| message="All these moments will be lost in time, like teardrops in the ${weather}" | |||
| file="loadfile1.tmp" | |||
| @@ -270,12 +270,12 @@ Convenience method: | |||
| <expandproperties/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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"/> | |||
| <loadfile property="modifiedmessage" srcFile="loadfile1.tmp"> | |||
| <filterchain> | |||
| @@ -286,7 +286,7 @@ Convenience method: | |||
| </expandproperties> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| 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"> | |||
| <filterchain> | |||
| <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> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="src.file.head"> | |||
| <filterchain> | |||
| <headfilter lines="15"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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) | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="src.file.head"> | |||
| <filterchain> | |||
| <headfilter lines="15" skip="2"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| See the testcases for more examples (<i>src\etc\testcases\filters\head-tail.xml</i> in the | |||
| source distribution). | |||
| @@ -376,36 +376,36 @@ strings. | |||
| This will include only those lines that contain <code>foo</code> and | |||
| <code>bar</code>. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.LineContains"> | |||
| <param type="contains" value="foo"/> | |||
| <param type="contains" value="bar"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <linecontains> | |||
| <contains value="foo"/> | |||
| <contains value="bar"/> | |||
| </linecontains> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Negation: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.LineContains"> | |||
| <param type="negate" value="true"/> | |||
| <param type="contains" value="foo"/> | |||
| <param type="contains" value="bar"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <i>or</i> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <linecontains negate="true"> | |||
| <contains value="foo"/> | |||
| <contains value="bar"/> | |||
| </linecontains> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="linecontainsregexp">LineContainsRegExp</h3> | |||
| @@ -447,32 +447,32 @@ the choice of regular expression implementation. | |||
| <h4>Example:</h4> | |||
| This will fetch all those lines that contain the pattern <code>foo</code> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp"> | |||
| <param type="regexp" value="foo*"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <linecontainsregexp> | |||
| <regexp pattern="foo*"/> | |||
| </linecontainsregexp> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Negation: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp"> | |||
| <param type="negate" value="true"/> | |||
| <param type="regexp" value="foo*"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <i>or</i> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <linecontainsregexp negate="true"> | |||
| <regexp pattern="foo*"/> | |||
| </linecontainsregexp> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="prefixlines">PrefixLines</h3> | |||
| @@ -494,16 +494,16 @@ Attaches a prefix to every line. | |||
| <h4>Example:</h4> | |||
| This will attach the prefix <code>Foo</code> to all lines. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.PrefixLines"> | |||
| <param name="prefix" value="Foo"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <prefixlines prefix="Foo"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="suffixlines">SuffixLines</h3> | |||
| @@ -527,16 +527,16 @@ Attaches a suffix to every line. | |||
| <h4>Example:</h4> | |||
| This will attach the suffix <code>Foo</code> to all lines. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.SuffixLines"> | |||
| <param name="suffix" value="Foo"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <suffixlines suffix="Foo"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="replacetokens">ReplaceTokens</h3> | |||
| @@ -598,7 +598,7 @@ user defined values. | |||
| This replaces occurrences of the string @DATE@ in the data | |||
| with today's date and stores it in the property ${src.file.replaced}. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tstamp/> | |||
| <!-- just for explaining the use of the properties --> | |||
| <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 --> | |||
| <echo message="${orders.replaced}"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tstamp/> | |||
| <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | |||
| <filterchain> | |||
| @@ -627,11 +627,11 @@ Convenience method: | |||
| </replacetokens> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This replaces occurrences of the string {{DATE}} in the data | |||
| with today's date and stores it in the property ${src.file.replaced}. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | |||
| <filterchain> | |||
| <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> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tstamp/> | |||
| <loadfile srcfile="${src.file}" property="${src.file.replaced}"> | |||
| <filterchain> | |||
| @@ -652,10 +652,10 @@ Convenience method: | |||
| </replacetokens> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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}"> | |||
| <filterchain> | |||
| <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> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This reads the properties from an Ant resource referenced by its id: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <string id="embedded-properties"> | |||
| foo=bar | |||
| baz=xyzzy | |||
| @@ -676,7 +676,7 @@ baz=xyzzy | |||
| <replacetokens propertiesResource="${ant.refid:embedded-properties}"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="stripjavacomments">StripJavaComments</h3> | |||
| @@ -686,22 +686,22 @@ take in any parameters. | |||
| <p> | |||
| <h4>Example:</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> | |||
| <filterchain> | |||
| <stripjavacomments/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="striplinebreaks">StripLineBreaks</h3> | |||
| @@ -725,26 +725,26 @@ from the data supplied to it. | |||
| <h4>Examples:</h4> | |||
| This strips the '\r' and '\n' characters. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.contents}"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.contents}"> | |||
| <filterchain> | |||
| <striplinebreaks/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This treats the '(' and ')' characters as line break characters and | |||
| strips them. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.contents}"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> | |||
| @@ -752,7 +752,7 @@ strips them. | |||
| </filterreader> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="striplinecomments">StripLineComments</h3> | |||
| @@ -776,7 +776,7 @@ that represent comments as specified by the user. | |||
| <h4>Examples:</h4> | |||
| This removes all lines that begin with #, --, REM, rem and // | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterreader classname="org.apache.tools.ant.filters.StripLineComments"> | |||
| <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="//"/> | |||
| </filterreader> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <striplinecomments> | |||
| <comment value="#"/> | |||
| <comment value="--"/> | |||
| @@ -795,7 +795,7 @@ Convenience method: | |||
| <comment value="rem "/> | |||
| <comment value="//"/> | |||
| </striplinecomments> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="tabstospaces">TabsToSpaces</h3> | |||
| @@ -817,22 +817,22 @@ This filter replaces tabs with spaces | |||
| <h4>Examples:</h4> | |||
| This replaces tabs in ${src.file} with spaces. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.notab}"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.TabsToSpaces"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.notab}"> | |||
| <filterchain> | |||
| <tabstospaces/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="tailfilter">TailFilter</h3> | |||
| @@ -931,7 +931,7 @@ This graphic shows the dependencies: | |||
| <h4>Examples:</h4> | |||
| 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}"> | |||
| <filterchain> | |||
| <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> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.tail}"> | |||
| <filterchain> | |||
| <tailfilter lines="15"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This stores the last 5 lines of the first 15 lines of the supplied | |||
| data in the property ${src.file.mid} | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.mid}"> | |||
| <filterchain> | |||
| <filterreader classname="org.apache.tools.ant.filters.HeadFilter"> | |||
| @@ -963,28 +963,28 @@ data in the property ${src.file.mid} | |||
| </filterreader> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Convenience method: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="${src.file.mid}"> | |||
| <filterchain> | |||
| <headfilter lines="15"/> | |||
| <tailfilter lines="5"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| 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, | |||
| lines 49-58 are extracted) | |||
| <blockquote><pre> | |||
| <pre> | |||
| <loadfile srcfile="${src.file}" property="src.file.head"> | |||
| <filterchain> | |||
| <tailfilter lines="10" skip="2"/> | |||
| </filterchain> | |||
| </loadfile> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="deletecharacters">DeleteCharacters</h3> | |||
| @@ -1011,9 +1011,9 @@ lines 49-58 are extracted) | |||
| <h4>Examples:</h4> | |||
| Delete tabs and returns from the data. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <deletecharacters chars="\t\r"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="concatfilter">ConcatFilter</h3> | |||
| <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> | |||
| Do nothing: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterchain> | |||
| <concatfilter/> | |||
| </filterchain> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Adds a license text before each java source: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterchain> | |||
| <concatfilter prepend="apache-license-java.txt"/> | |||
| </filterchain> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="sortfilter">SortFilter</h3> | |||
| <p><em>since Ant 1.8.0</em></p> | |||
| @@ -1094,14 +1094,14 @@ Adds a license text before each java source: | |||
| <h4>Examples:</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy todir="build"> | |||
| <fileset dir="input" includes="*.txt"/> | |||
| <filterchain> | |||
| <sortfilter/> | |||
| </filterchain> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy todir="build"> | |||
| <fileset dir="input" includes="*.txt"/> | |||
| <filterchain> | |||
| <sortfilter reverse="true"/> | |||
| </filterchain> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| Sort all files <code>*.txt</code> from <i>src</i> location into reverse | |||
| order and copy them into <i>build</i> location. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy todir="build"> | |||
| <fileset dir="input" includes="*.txt"/> | |||
| <filterchain> | |||
| @@ -1133,7 +1133,7 @@ order and copy them into <i>build</i> location. | |||
| </filterreader> | |||
| </filterchain> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <componentdef name="evenfirst" | |||
| classname="org.apache.tools.ant.filters.EvenFirstCmp"/> | |||
| <copy todir="build"> | |||
| @@ -1168,7 +1168,7 @@ implement <code>java.util.Comparator</code> interface, for example: | |||
| </sortfilter> | |||
| </filterchain> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h3 id="tokenfilter">TokenFilter</h3> | |||
| This filter tokenizes the inputstream into strings and passes these | |||
| @@ -1274,17 +1274,17 @@ This is the default tokenizer. | |||
| <h5>Examples:</h5> | |||
| Convert input current line endings to unix style line endings. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter delimoutput="\n"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Remove blank lines. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <ignoreblank/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="filetokenizer">FileTokenizer</h4> | |||
| 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> | |||
| Replace the first occurrence of package with //package. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <filetokenizer/> | |||
| <replaceregex pattern="([\n\r]+[ \t]*|^[ \t]*)package" | |||
| flags="s" | |||
| replace="\1//package"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="stringtokenizer">StringTokenizer</h4> | |||
| This tokenizer is based on java.util.StringTokenizer. | |||
| @@ -1353,13 +1353,13 @@ attribute is used). | |||
| Surround each non space token with a "[]". | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <stringtokenizer/> | |||
| <replaceregex pattern="(.+)" replace="[\1]"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="replacestring">ReplaceString</h4> | |||
| 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". | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <replacestring from="sun" to="moon"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="containsstring">ContainsString</h4> | |||
| This is a simple filter to filter tokens that contains | |||
| @@ -1416,12 +1416,12 @@ a specified string. | |||
| Include only lines that contain "foo"; | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <containsstring contains="foo"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="replaceregex">ReplaceRegex</h4> | |||
| 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. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <replaceregex pattern="hello" replace="world" flags="gi"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="containsregex">ContainsRegex</h4> | |||
| 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. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <containsregex pattern="(hello|world)" flags="i"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| This example replaces lines like "SUITE(TestSuite, bits);" with | |||
| "void register_bits();" and removes other lines. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <containsregex | |||
| pattern="^ *SUITE\(.*,\s*(.*)\s*\).*" | |||
| replace="void register_\1();"/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="trim">Trim</h4> | |||
| 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. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <deletecharacters chars="\t"/> | |||
| <trim/> | |||
| <ignoreblank/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="uniqfilter">UniqFilter</h4> | |||
| @@ -1576,11 +1576,11 @@ Delete tabs from lines, trim the lines and removes empty lines. | |||
| <h5>Example:</h5> | |||
| This suppresses duplicate lines. | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <uniqfilter/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="native2asciifilter">Native2AsciiFilter</h4> | |||
| @@ -1609,11 +1609,11 @@ This suppresses duplicate lines. | |||
| <h5>Example:</h5> | |||
| <p>This replaces all non-ASCII characters by their Unicode-escapes.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <native2asciifilter/> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="scriptfilter">ScriptFilter</h4> | |||
| <p> | |||
| @@ -1694,18 +1694,17 @@ Must be a supported Apache BSF or JSR 223 language</td> | |||
| <h5>Examples:</h5> | |||
| Convert to uppercase: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <tokenfilter> | |||
| <scriptfilter language="javascript"> | |||
| self.setToken(self.getToken().toUpperCase()); | |||
| </scriptfilter> | |||
| </tokenfilter> | |||
| </pre></blockquote> | |||
| </pre> | |||
| Remove lines containing the string "bad" while | |||
| copying text files: | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <copy todir="dist"> | |||
| <fileset dir="src" includes="**/*.txt"/> | |||
| <filterchain> | |||
| @@ -1716,8 +1715,7 @@ copying text files: | |||
| </scriptfilter> | |||
| </filterchain> | |||
| </copy> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <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 | |||
| example a string filter that capitalizes words may be declared as: | |||
| <blockquote><pre> | |||
| <pre> | |||
| package my.customant; | |||
| import org.apache.tools.ant.filters.TokenFilter; | |||
| @@ -1741,10 +1739,10 @@ public class Capitalize | |||
| token.substring(1); | |||
| } | |||
| } | |||
| </pre></blockquote> | |||
| </pre> | |||
| This may be used as follows: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <typedef name="capitalize" classname="my.customant.Capitalize" | |||
| classpath="my.customant.path"/> | |||
| <copy file="input" tofile="output"> | |||
| @@ -1755,6 +1753,7 @@ This may be used as follows: | |||
| </tokenfilter> | |||
| </filterchain> | |||
| </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> | |||
| directory from the <code>build</code> directory | |||
| 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"> | |||
| <filterset> | |||
| <filter token="DATE" value="${TODAY}"/> | |||
| </filterset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>You are copying the <code>version.txt</code> file to the <code>dist</code> | |||
| directory from the build directory | |||
| 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"> | |||
| <filterset begintoken="%" endtoken="*"> | |||
| <filter token="DATE" value="${TODAY}"/> | |||
| </filterset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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"> | |||
| <fileset dir="${build.dir}/docs"> | |||
| <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"/> | |||
| </filterset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Define a FilterSet and reference it later.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filterset id="myFilterSet" begintoken="%" endtoken="*"> | |||
| <filter token="DATE" value="${TODAY}"/> | |||
| </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"> | |||
| <filterset refid="myFilterSet"/> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>You are copying the <code>version.txt</code> file to the <code>dist</code> | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy file="${build.dir}/version.txt" toFile="${dist.dir}/version.txt"> | |||
| <filterset> | |||
| <propertyset> | |||
| @@ -194,5 +194,6 @@ but wish to replace the token <code>@project.date@</code> with the prope | |||
| </propertyset> | |||
| </filterset> | |||
| </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 | |||
| <code>to</code> and <code>from</code> will be ignored.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="identity"/> | |||
| <identitymapper/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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 | |||
| <code>from</code> will be ignored.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="flatten"/> | |||
| <flattenmapper/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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 | |||
| <code>to</code> - <code>from</code> will be ignored.</p> | |||
| <h5>Examples:</h5> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="merge" to="archive.tar"/> | |||
| <mergemapper to="archive.tar"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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 | |||
| that don't match the <code>from</code> pattern will be ignored.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="glob" from="*.java" to="*.java.bak"/> | |||
| <globmapper from="*.java" to="*.java.bak"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="glob" from="C*ies" to="Q*y"/> | |||
| <globmapper from="C*ies" to="Q*y"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <td valign="top"><b>Source file name</b></td> | |||
| @@ -404,10 +404,10 @@ should be used.</li> | |||
| </ul> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/> | |||
| <regexpmapper from="^(.*)\.java$$" to="\1.java.bak"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <td valign="top"><b>Source file name</b></td> | |||
| @@ -430,10 +430,10 @@ should be used.</li> | |||
| <td valign="top">ignored</td> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="regexp" from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/> | |||
| <regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/\2/\2-\3"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/> | |||
| <regexpmapper from="^(.*)\.(.*)$$" to="\2.\1"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/> | |||
| <regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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> | |||
| <p>The to and from attributes are both required.</p> | |||
| <b>Example:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="package" from="*Test.java" to="TEST-*Test.xml"/> | |||
| <packagemapper from="*Test.java" to="TEST-*Test.xml"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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>The to and from attributes are both required.</p> | |||
| <b>Example:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <mapper type="unpackage" 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> | |||
| <tr> | |||
| <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 | |||
| order has been undefined.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <compositemapper> | |||
| <identitymapper/> | |||
| <packagemapper from="*.java" to="*"/> | |||
| </compositemapper> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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 | |||
| mapping operation. The <i>to</i> and <i>from</i> attributes are ignored.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <chainedmapper> | |||
| <flattenmapper/> | |||
| <globmapper from="*" to="new/path/*"/> | |||
| @@ -683,7 +683,7 @@ with <code><uptodate></code> and <code><junit></code> output.</p> | |||
| <globmapper from="*" to="*2"/> | |||
| </mapper> | |||
| </chainedmapper> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| <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. | |||
| </p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filtermapper> | |||
| <replacestring from="\" to="/"/> | |||
| </filtermapper> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <filtermapper> | |||
| <scriptfilter language="beanshell"> | |||
| self.setToken(self.getToken().toUpperCase()); | |||
| </scriptfilter> | |||
| </filtermapper> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| @@ -838,12 +838,12 @@ an explanation of scripts and dependencies. | |||
| <p> | |||
| <b>Example:</b> | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <scriptmapper language="javascript"> | |||
| self.addMappedName(source.toUpperCase()); | |||
| self.addMappedName(source.toLowerCase()); | |||
| </scriptmapper> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| @@ -907,12 +907,12 @@ list of mapped names reset after every invocation. | |||
| different from <a href="#composite-mapper">composite mapper</a> | |||
| which collects the results of all matching children.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <firstmatchmapper> | |||
| <globmapper from="*.txt" to="*.bak"/> | |||
| <globmapper from="*A.*" to="*B.*"/> | |||
| </firstmatchmapper> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| @@ -939,9 +939,9 @@ list of mapped names reset after every invocation. | |||
| the source file name.</p> | |||
| <b>Examples:</b> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <cutdirsmapper dirs="1"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <table> | |||
| <tr> | |||
| @@ -143,25 +143,25 @@ an <code><and></code> selector container.</p> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <multirootfileset basedirs="${build.dir},${other.project.dir}"> | |||
| <include name="apps/**/classes"/> | |||
| <exclude name="apps/**/*Test*"/> | |||
| </multirootfileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Groups all files inside <code>classes</code> found under the | |||
| <code>apps</code> subdirectory of <code>${build.dir}</code> or | |||
| <code>${other.project.dir}</code>, except those that have the text | |||
| <code>Test</code> in their name.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <multirootfileset> | |||
| <basedir file="${build.dir}"/> | |||
| <basedir file="${other.project.dir}" | |||
| <include name="apps/**/classes"/> | |||
| <exclude name="apps/**/*Test*"/> | |||
| </multirootfileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Is equivalent to the first example but used | |||
| nested <code>basedir</code> elements. The nested elements 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> | |||
| element. <em>Since Apache Ant 1.7.1</em></p> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <patternset id="non.test.sources"> | |||
| <include name="**/*.java"/> | |||
| <exclude name="**/*Test*"/> | |||
| </patternset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| 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 | |||
| that it should be used only if a property is not set.</p> | |||
| <p>For example</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <patternset id="sources"> | |||
| <include name="std/**/*.java"/> | |||
| <include name="prof/**/*.java" if="professional"/> | |||
| <exclude name="**/*Test*"/> | |||
| </patternset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <p>The two sets</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <patternset includesfile="some-file"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>and</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <patternset> | |||
| <includesfile name="some-file"/> | |||
| <patternset/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>are identical. The include patterns will be read from the file | |||
| <code>some-file</code>, one pattern per line.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <patternset> | |||
| <includesfile name="some-file"/> | |||
| <includesfile name="${some-other-file}" | |||
| if="some-other-file"/> | |||
| <patternset/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>will also read include patterns from the file the property | |||
| <code>some-other-file</code> points to, if a property of that name has | |||
| been defined.</p> | |||
| @@ -114,7 +114,7 @@ If the actions are left empty all actions match, and are revoked. | |||
| </p> | |||
| <h3 id="baseset">Base set</h3> | |||
| A permissions set implicitly contains the following permissions: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <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.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.vendor" 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. | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <permissions> | |||
| <grant class="java.security.AllPermission"/> | |||
| <revoke class="java.util.PropertyPermission"/> | |||
| </permissions> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| Grants all permissions to the code except for those handling Properties. | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <permissions> | |||
| <grant class="java.net.SocketPermission" name="foo.bar.com" action="connect"/> | |||
| <grant class="java.util.PropertyPermission" name="user.home" action="read,write"/> | |||
| </permissions> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p> | |||
| 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. | |||
| @@ -56,8 +56,7 @@ supports this.</p> | |||
| <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> | |||
| <tr> | |||
| @@ -100,7 +99,7 @@ set.</p> | |||
| <p>For example:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <propertyset id="properties-starting-with-foo"> | |||
| <propertyref prefix="foo"/> | |||
| </propertyset> | |||
| @@ -111,7 +110,7 @@ set.</p> | |||
| <propertyset refid="properties-starting-with-foo"/> | |||
| <propertyset refid="properties-starting-with-bar"/> | |||
| </propertyset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>collects all properties whose name starts with either | |||
| "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 | |||
| keys, for example: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <propertyset id="properties-starting-with-foo"> | |||
| <propertyref prefix="foo"/> | |||
| <mapper type="glob" from="foo*" to="bar*"/> | |||
| </propertyset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>collects all properties whose name starts with "foo", but | |||
| changes the names to start with "bar" instead.</p> | |||
| @@ -42,15 +42,11 @@ Regexp represents a regular expression. | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| <regexp id="myregexp" pattern="alpha(.+)beta"/><br> | |||
| </pre></blockquote> | |||
| <pre><regexp id="myregexp" pattern="alpha(.+)beta"/></pre> | |||
| <p> | |||
| Defines a regular expression for later use with id myregexp. | |||
| </p> | |||
| <blockquote><pre> | |||
| <regexp refid="myregexp"/><br> | |||
| </pre></blockquote> | |||
| <pre><regexp refid="myregexp"/></pre> | |||
| <p> | |||
| Use the regular expression with id myregexp. | |||
| </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. | |||
| Possible values for this property are:</p> | |||
| <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> | |||
| <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> | |||
| @@ -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 | |||
| duplicate resources (contrast with <a href="#union">union</a>). | |||
| </p> | |||
| <blockquote> | |||
| <table> | |||
| <tr> | |||
| <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> | |||
| </tr> | |||
| </table> | |||
| </blockquote> | |||
| <h4 id="files">files</h4> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${doc.path}" includes="**/*.html"> | |||
| <contains text="script" casesensitive="no"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the HTML files that contain the string | |||
| <code>script</code>.</p> | |||
| @@ -232,11 +232,11 @@ | |||
| <p>Here is an example of how to use the Date Selector:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${jar.path}" includes="**/*.jar"> | |||
| <date datetime="01/01/2001 12:00 AM" when="before"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all JAR files which were last modified before midnight | |||
| January 1, 2001.</p> | |||
| @@ -282,11 +282,11 @@ | |||
| <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"> | |||
| <depend targetdir="${ant.1.4.1}/src/main"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the Java source files which were modified in the | |||
| 1.5 release. | |||
| @@ -324,11 +324,11 @@ | |||
| <p>Here is an example of how to use the Depth Selector:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${doc.path}" includes="**/*"> | |||
| <depth max="1"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all files in the base directory and one directory below | |||
| that.</p> | |||
| @@ -410,12 +410,12 @@ | |||
| <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"> | |||
| <different targetdir="${ant.1.4.1}/src/main" | |||
| ignoreFileTimes="true"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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. | |||
| @@ -470,11 +470,11 @@ | |||
| <p>Here is an example of how to use the Filename Selector:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${doc.path}" includes="**/*"> | |||
| <filename name="**/*.css"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${ant.1.5}/src/main" includes="**/*.java"> | |||
| <present present="srconly" targetdir="${ant.1.4.1}/src/main"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the Java source files which are new in the | |||
| 1.5 release. | |||
| @@ -585,11 +585,11 @@ | |||
| <p>Here is an example of how to use the regular expression Selector:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${doc.path}" includes="*.txt"> | |||
| <containsregexp expression="[4-6]\.[0-9]"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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). | |||
| @@ -643,14 +643,14 @@ | |||
| <p>Here is an example of how to use the Size Selector:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${jar.path}"> | |||
| <patternset> | |||
| <include name="**/*.jar"/> | |||
| </patternset> | |||
| <size value="4" units="Ki" when="more"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| directories in <code>${src}</code></p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${src}"> | |||
| <type type="dir"/> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| directory, but avoid selecting empty directories, use: | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${src}"> | |||
| <and> | |||
| <present targetdir="template"/> | |||
| <type type="file"/> | |||
| </and> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <h4 id="modified">Modified Selector</h4> | |||
| <p>The <code><modified></code> selector computes a value for a file, compares that | |||
| @@ -892,18 +892,18 @@ | |||
| <h5>Examples</h5> | |||
| <p>Here are some examples of how to use the Modified Selector:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy todir="dest"> | |||
| <fileset dir="src"> | |||
| <modified/> | |||
| </fileset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 | |||
| MD5-DigestAlgorithm.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy todir="dest"> | |||
| <fileset dir="src"> | |||
| <modified update="true" | |||
| @@ -916,11 +916,11 @@ | |||
| </modified> | |||
| </fileset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>This is the same example rewritten as CoreSelector with setting the all the values | |||
| (same as defaults are).</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <copy todir="dest"> | |||
| <fileset dir="src"> | |||
| <custom class="org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector"> | |||
| @@ -934,10 +934,10 @@ | |||
| </custom> | |||
| </fileset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>And this is the same rewritten as CustomSelector.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <target name="generate-and-upload-site"> | |||
| <echo> generate the site using forrest </echo> | |||
| <antcall target="site"/> | |||
| @@ -949,19 +949,19 @@ | |||
| </fileset> | |||
| </ftp> | |||
| </target> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>A useful scenario for this selector inside a build environment | |||
| 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 | |||
| CacheSelector saves therefore much upload time.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <modified cacheclassname="com.mycompany.MyCache"> | |||
| <classpath> | |||
| <pathelement location="lib/mycompany-antutil.jar"/> | |||
| </classpath> | |||
| </modified> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Uses <tt>com.mycompany.MyCache</tt> from a jar outside of Ants own classpath | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${dist}" includes="**/*.jar"> | |||
| <and> | |||
| <size value="4" units="Ki" when="more"/> | |||
| <date datetime="01/01/2001 12:00 AM" when="before"/> | |||
| </and> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the JAR file larger than 4096 bytes which haven't been update | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${docs}" includes="**/*.html"> | |||
| <majority> | |||
| <contains text="project" casesensitive="false"/> | |||
| @@ -1323,7 +1323,7 @@ Select files whose filename length is even. | |||
| <contains text="IntrospectionHelper" casesensitive="true"/> | |||
| </majority> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the HTML files which contain at least two of the three | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${src}" includes="**/*.java"> | |||
| <none> | |||
| <present targetdir="${dest}"/> | |||
| @@ -1349,7 +1349,7 @@ Select files whose filename length is even. | |||
| </present> | |||
| </none> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects only Java files which do not have equivalent java or | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${src}" includes="**/*.java"> | |||
| <not> | |||
| <contains text="test"/> | |||
| </not> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the files in the src directory that do not contain the | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${basedir}"> | |||
| <or> | |||
| <depth max="0"/> | |||
| @@ -1394,7 +1394,7 @@ Select files whose filename length is even. | |||
| <filename name="*.jpg"/> | |||
| </or> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all the files in the top directory along with all the | |||
| 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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <project default="all" basedir="./ant"> | |||
| <selector id="completed"> | |||
| @@ -1465,7 +1465,7 @@ Select files whose filename length is even. | |||
| </target> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Zips up all the Java files which have an up-to-date equivalent | |||
| 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 | |||
| properties are set:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${working.copy}"> | |||
| <or> | |||
| <selector if="include.tests"> | |||
| @@ -1492,7 +1492,7 @@ Select files whose filename length is even. | |||
| </selector> | |||
| </or> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>A fileset that conditionally contains Java source files and Test | |||
| source and class files.</p> | |||
| @@ -1550,13 +1550,13 @@ Select files whose filename length is even. | |||
| use your class as a selector: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${mydir}" includes="**/*"> | |||
| <custom classname="com.mydomain.MySelector"> | |||
| <param name="myattribute" value="myvalue"/> | |||
| </custom> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>A number of core selectors can also be used as custom selectors | |||
| 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 | |||
| to use the selector through <code><custom></code>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <fileset dir="${doc.path}" includes="**/*"> | |||
| <custom classname="org.apache.tools.ant.types.selectors.DepthSelector"> | |||
| <param name="max" value="1"/> | |||
| </custom> | |||
| </fileset> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Selects all files in the base directory and one directory below | |||
| that.</p> | |||
| @@ -159,7 +159,7 @@ resource collection</h4> | |||
| <p>The specified resource will be used as src.</p> | |||
| <h4>Examples</h4> | |||
| <blockquote> | |||
| <pre> | |||
| <copy todir="some-dir"> | |||
| <tarfileset includes="lib/**"> | |||
| @@ -168,7 +168,7 @@ resource collection</h4> | |||
| </bzip2resource> | |||
| </tarfileset> | |||
| </copy> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>downloads the archive some-archive.tar.bz2, uncompresses and | |||
| 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 | |||
| home | |||
| directory:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <xmlcatalog> | |||
| <dtd | |||
| publicId="-//OASIS//DTD DocBook XML V4.1.2//EN" | |||
| location="/home/dion/downloads/docbook/docbookx.dtd"/> | |||
| </xmlcatalog> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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: | |||
| </p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <xmlcatalog id="commonDTDs"> | |||
| <dtd | |||
| 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" | |||
| location="web-app_2_2.dtd"/> | |||
| </xmlcatalog> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>Set up an XMLCatalog with a combination of DTDs and entities as | |||
| well as a nested XMLCatalog and external catalog files in both | |||
| formats:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <xmlcatalog id="allcatalogs"> | |||
| <dtd | |||
| publicId="-//ArielPartners//DTD XML Article V1.0//EN" | |||
| @@ -286,9 +286,9 @@ formats:</p> | |||
| </catalogpath> | |||
| </xmlcatalog> | |||
| </xmlcatalog> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>To reference the above XMLCatalog in an <code>xslt</code> task:<p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <xslt basedir="${source.doc}" | |||
| destdir="${dest.xdocs}" | |||
| extension=".xml" | |||
| @@ -297,7 +297,7 @@ formats:</p> | |||
| force="true"> | |||
| <xmlcatalog refid="allcatalogs"/> | |||
| </xslt> | |||
| </pre></blockquote> | |||
| </pre> | |||
| </body> | |||
| </html> | |||
| @@ -130,21 +130,19 @@ single element resource collection</h4> | |||
| <p>The specified resource will be used as src.</p> | |||
| <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="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/> | |||
| <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/> | |||
| </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 | |||
| file <code>ChangeLog27.txt</code> in the current directory as <code>docs/ChangeLog.txt</code>, | |||
| and includes all the html files in <code>examples.zip</code> under <code>docs/examples</code>. | |||
| The archive might end up containing the files:</p> | |||
| <code>docs/user-guide/html/index.html<br> | |||
| 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> | |||
| </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 | |||
| have a class: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| public class MyTask extends Task { | |||
| private List conditions = new ArrayList(); | |||
| @@ -287,25 +286,21 @@ public class MyTask extends Task { | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| <p> | |||
| One may define and use this class like this: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| <taskdef name="mytask" classname="MyTask" classpath="classes"/> | |||
| <typedef name="condition.equals" | |||
| classname="org.apache.tools.ant.taskdefs.conditions.Equals"/> | |||
| <mytask> | |||
| <condition.equals arg1="${debug}" arg2="true"/> | |||
| </mytask> | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| A more complicated example follows: | |||
| </p> | |||
| <blockquote> | |||
| <pre> | |||
| <pre> | |||
| public class Sample { | |||
| public static class MyFileSelector implements FileSelector { | |||
| public void setAttrA(int a) {} | |||
| @@ -334,14 +329,13 @@ public class Sample { | |||
| public void setCount(int c) {} | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| </pre> | |||
| <p> | |||
| This class defines a number of static classes that implement/extend | |||
| Path, MyFileSelector and MyInterface. These may be defined and used | |||
| as follows: | |||
| </p> | |||
| <pre> | |||
| <pre> | |||
| <typedef name="myfileselector" classname="Sample$MyFileSelector" | |||
| classpath="classes" loaderref="classes"/> | |||
| <typedef name="buildpath" classname="Sample$BuildPath" | |||
| @@ -358,7 +352,7 @@ public class Sample { | |||
| </myfileselector> | |||
| </fileset> | |||
| </copy> | |||
| </pre> | |||
| </pre> | |||
| <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 | |||
| <code>System.out</code> stream. | |||
| The task has one attribute, called <code>message</code>.</p> | |||
| <blockquote> | |||
| <pre> | |||
| package com.mydomain; | |||
| @@ -403,7 +397,7 @@ public class MyVeryOwnTask extends Task { | |||
| } | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| <p>It's really this simple ;-)</p> | |||
| <p>Adding your task to the system is rather simple too:</p> | |||
| <ol> | |||
| @@ -415,7 +409,7 @@ public class MyVeryOwnTask extends Task { | |||
| </ol> | |||
| <h3>Example</h3> | |||
| <blockquote> | |||
| <pre> | |||
| <?xml version="1.0"?> | |||
| @@ -427,7 +421,6 @@ public class MyVeryOwnTask extends Task { | |||
| </target> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| <h3>Example 2</h3> | |||
| 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 | |||
| <code><taskdef></code> to point to where the code has just been | |||
| compiled. | |||
| <blockquote> | |||
| <pre> | |||
| <?xml version="1.0"?> | |||
| @@ -457,7 +450,6 @@ compiled. | |||
| </target> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| <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 | |||
| @@ -502,9 +494,9 @@ listener, of course).</p> | |||
| <p>If you wish to attach a listener from the command line you may use the | |||
| <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 | |||
| 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 | |||
| described above. | |||
| <blockquote> | |||
| <pre> | |||
| public class MyLogAdapter implements BuildListener { | |||
| @@ -555,7 +546,6 @@ public class MyLogAdapter implements BuildListener { | |||
| // implement all methods in that way | |||
| } | |||
| </pre> | |||
| </blockquote> | |||
| <hr> | |||
| <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>In order to use this feature you need to add the following namespace declarations</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| xmlns:if="ant:if" | |||
| xmlns:unless="ant:unless" | |||
| </pre> | |||
| </blockquote> | |||
| <p>The if and unless namespaces support the following 3 conditions:</p> | |||
| <ul> | |||
| @@ -40,8 +39,6 @@ | |||
| <li>blank</li>true if the value of the attribute is null or empty | |||
| <li>set</li>true if the specified property is set | |||
| </ul> | |||
| <blockquote> | |||
| <pre> | |||
| <project name="tryit" | |||
| xmlns:if="ant:if" | |||
| @@ -58,7 +55,6 @@ | |||
| <echo unless:set="onmac">not running on MacOS</echo> | |||
| </project> | |||
| </pre> | |||
| </blockquote> | |||
| </body> | |||
| </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: | |||
| </p> | |||
| <blockquote> | |||
| <pre>ant -f fetch.xml -Ddest=<i>[option]</i></pre> | |||
| </blockquote> | |||
| <pre>ant -f fetch.xml -Ddest=<i>[option]</i></pre> | |||
| <p> | |||
| 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> | |||
| For csh/tcsh: | |||
| </p> | |||
| <pre> | |||
| setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080" | |||
| </pre> | |||
| <pre>setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"</pre> | |||
| <p> | |||
| For bash: | |||
| </p> | |||
| <pre> | |||
| export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080" | |||
| </pre> | |||
| <pre>export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"</pre> | |||
| <p> | |||
| For Windows, set the environment variable in the appropriate dialog box and open a new console or, by hand | |||
| </p> | |||
| <pre> | |||
| set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 | |||
| </pre> | |||
| <pre>set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080</pre> | |||
| </blockquote> | |||
| </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 | |||
| property <code>chmod.fail</code> to false when starting the build like in | |||
| </p> | |||
| <blockquote> | |||
| <p><code>sh build.sh install -Dchmod.fail=false</code></p> | |||
| </blockquote> | |||
| <pre>sh build.sh install -Dchmod.fail=false</pre> | |||
| <p> | |||
| and any error to change permission will not result in a build failure. | |||
| </p> | |||
| @@ -134,15 +134,13 @@ listeners and loggers.</p> | |||
| <h3 id="DefaultLogger">DefaultLogger</h3> | |||
| <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> | |||
| <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> | |||
| <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> | |||
| </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> | |||
| @@ -353,9 +349,7 @@ Background is one of the following: | |||
| 46 -> Cyan | |||
| 47 -> White</pre> | |||
| <blockquote> | |||
| <pre>ant -logger org.apache.tools.ant.listener.AnsiColorLogger</pre> | |||
| </blockquote> | |||
| <h3 id="Log4jListener">Log4jListener</h3> | |||
| <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 | |||
| corresponding Log4j level.</p> | |||
| <blockquote> | |||
| <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' | |||
| configuration file. Both should be placed somewhere in your Ant | |||
| classpath. If the log4j.properties is in your project root folder you can | |||
| add this with <i>-lib</i> option:</p> | |||
| <blockquote> | |||
| <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 | |||
| console by the DefaultLogger and send it to a file named 'build.log', you | |||
| could use the following configuration:</p> | |||
| <blockquote> | |||
| <pre>log4j.rootLogger=ERROR, LogFile | |||
| log4j.logger.org.apache.tools.ant.Project=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.file=build.log | |||
| </pre> | |||
| </blockquote> | |||
| <p>For more information about configuring Log4J see <a href="http://logging.apache.org/log4j/docs/documentation.html">its | |||
| 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). | |||
| (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 | |||
| <blockquote> | |||
| <pre><?xml version="1.0" encoding="UTF-8"?> | |||
| <Configuration status="WARN"> | |||
| <Appenders> | |||
| @@ -442,7 +429,6 @@ Translating the 1.x properties file into the 2.x xml syntax would result in | |||
| </Loggers> | |||
| </Configuration> | |||
| </pre> | |||
| </blockquote> | |||
| <h3 id="XmlLogger">XmlLogger</h3> | |||
| <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 | |||
| is declared at all.</p> | |||
| <blockquote> | |||
| <pre>ant -listener org.apache.tools.ant.XmlLogger | |||
| ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | |||
| </blockquote> | |||
| <h3 id="TimestampedLogger">TimestampedLogger</h3> | |||
| <p> | |||
| @@ -474,9 +458,7 @@ ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml</pre> | |||
| </pre> | |||
| <p>To use this listener, use the command:</p> | |||
| <blockquote> | |||
| <pre>ant -logger org.apache.tools.ant.listener.TimestampedLogger</pre> | |||
| </blockquote> | |||
| <h3 id="BigProjectLogger">BigProjectLogger</h3> | |||
| <p> | |||
| @@ -528,9 +510,7 @@ Exiting project "junit" | |||
| are in charge -or more importantly, which project is failing. | |||
| </p> | |||
| <p>To use this listener, use the command:</p> | |||
| <blockquote> | |||
| <pre>ant -logger org.apache.tools.ant.listener.BigProjectLogger</pre> | |||
| </blockquote> | |||
| <h3 id="SimpleBigProjectLogger">SimpleBigProjectLogger</h3> | |||
| <p>Like <code>BigProjectLogger</code>, project-qualified target names are printed, | |||
| @@ -558,9 +538,7 @@ Total time: 1 second | |||
| </pre> | |||
| <p><em>since Ant 1.8.1</em></p> | |||
| <p>To use this listener, use the command:</p> | |||
| <blockquote> | |||
| <pre>ant -logger org.apache.tools.ant.listener.SimpleBigProjectLogger</pre> | |||
| </blockquote> | |||
| <h3 id="ProfileLogger">ProfileLogger</h3> | |||
| <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> | |||
| <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 | |||
| 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 | |||
| 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 | |||
| 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 | |||
| the target called <code>dist</code>, setting the <code>build</code> property | |||
| 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 | |||
| /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> | |||
| <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>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> | |||
| <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 | |||
| 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> | |||
| @@ -565,13 +552,9 @@ have some documentation inside.</p> | |||
| <h2 id="viajava">Running Ant via Java</h2> | |||
| <p>If you have installed Ant in the do-it-yourself way, Ant can be started | |||
| 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> | |||
| The first method runs Ant's traditional entry point. The second method uses | |||
| @@ -84,11 +84,13 @@ code { | |||
| pre { | |||
| background-color: #efefef; | |||
| margin-right: 4rem; | |||
| margin-left: 4rem; | |||
| } | |||
| /* code snippets in examples and tutorials */ | |||
| .code { | |||
| background: #EFEFEF; | |||
| background: #efefef; | |||
| } | |||
| /* highlight console output */ | |||
| @@ -40,12 +40,10 @@ | |||
| mind that it is possible that a target can get executed earlier | |||
| when an earlier target depends on it:</p> | |||
| <blockquote> | |||
| <pre><target name="A"/> | |||
| <pre><target name="A"/> | |||
| <target name="B" depends="A"/> | |||
| <target name="C" depends="B"/> | |||
| <target name="D" depends="C,B,A"/></pre> | |||
| </blockquote> | |||
| <p>Suppose we want to execute target D. From its | |||
| <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 | |||
| 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 | |||
| 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 | |||
| more details. For example:</p> | |||
| <blockquote> | |||
| <pre><target name="build-module-A" if="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> | |||
| 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 | |||
| dependent target for computing the result for the check:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <target name="myTarget" depends="myTarget.check" if="myTarget.run"> | |||
| <echo>Files foo.txt and bar.txt are present.</echo> | |||
| </target> | |||
| @@ -109,9 +105,9 @@ | |||
| </and> | |||
| </condition> | |||
| </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 | |||
| present, the target will always be executed.</p> | |||
| @@ -136,7 +132,7 @@ | |||
| depend. Make sure that target is always the first one in the | |||
| depends list of the other targets. In this manual, most | |||
| initialization targets have the name <code>"init"</code>.</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <project> | |||
| <target name="init"> | |||
| <tstamp/> | |||
| @@ -145,15 +141,15 @@ | |||
| ... | |||
| </target> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <project> | |||
| <tstamp/> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>If the depends attribute and the if/unless attribute are set, the | |||
| depends attribute is executed first.</p> | |||
| @@ -263,7 +259,7 @@ | |||
| <p>For example your imported build file may need to compile code, it | |||
| might look like:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <target name="create-directory-layout"> | |||
| ... | |||
| </target> | |||
| @@ -272,20 +268,20 @@ | |||
| <target name="compile" depends="ready-to-compile"> | |||
| ... | |||
| </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 | |||
| your main build file you may use something like</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <target name="generate-sources" | |||
| extensionOf="ready-to-compile"> | |||
| ... | |||
| </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 | |||
| 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> | |||
| <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> | |||
| </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 | |||
| resolved before the task is executed.</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, | |||
| <i>attributeN</i> is the attribute name, and | |||
| <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 | |||
| Ant.</p> | |||
| Tasks can be assigned an <code>id</code> attribute: | |||
| <blockquote> | |||
| <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 | |||
| a unique identifier for this task. | |||
| You can refer to the | |||
| corresponding task object in scripts or other tasks via this name. | |||
| For example, in scripts you could do: | |||
| <blockquote> | |||
| <pre> | |||
| <script ... > | |||
| task1.setFoo("bar"); | |||
| </script> | |||
| </pre> | |||
| </blockquote> | |||
| to set the <code>foo</code> attribute of this particular task instance. | |||
| In another task (written in Java), you can access the instance via | |||
| <code>project.getReference("task1")</code>. | |||
| @@ -356,18 +356,15 @@ via nested <code><path></code> elements:</p> | |||
| </path> | |||
| </pre> | |||
| 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 properties has been added. One can use the expression | |||
| ${toString:<em>pathreference</em>} to convert a path element | |||
| reference to a string that can be used for a path argument. | |||
| For example: | |||
| </p> | |||
| </p> | |||
| <pre> | |||
| <path id="lib.path.ref"> | |||
| <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> | |||
| <h4>Examples</h4> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <arg value="-l -a"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>is a single command-line argument containing a space character, | |||
| <i>not</i> separate commands "-l" and "-a".</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <arg line="-l -a"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>This is a command line with two separate arguments, "-l" and "-a".</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <arg path="/dir;/dir2:\dir3"/> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <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 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 | |||
| <code><classpath></code> structure more than once, for example.</p> | |||
| <p>The following example:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <project ... > | |||
| <target ... > | |||
| <rmic ...> | |||
| @@ -485,9 +482,9 @@ replicate the same snippet of XML over and over again--using a | |||
| </javac> | |||
| </target> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>could be rewritten as:</p> | |||
| <blockquote><pre> | |||
| <pre> | |||
| <project ... > | |||
| <path id="project.class.path"> | |||
| <pathelement location="lib/"/> | |||
| @@ -507,7 +504,7 @@ replicate the same snippet of XML over and over again--using a | |||
| </javac> | |||
| </target> | |||
| </project> | |||
| </pre></blockquote> | |||
| </pre> | |||
| <p>All tasks that use nested elements for | |||
| <a href="Types/patternset.html">PatternSet</a>s, | |||
| <a href="Types/fileset.html">FileSet</a>s, | |||