@@ -293,6 +293,7 @@ will be set to the specified value of the property element unless the correspond | |||
the <var>dir</var> attribute explicitly.</p> | |||
<h3>Examples</h3> | |||
<p>These are different ways of using the task:</p> | |||
<pre> | |||
<ant antfile="subproject/subbuild.xml" target="compile"/> | |||
@@ -325,12 +326,12 @@ this:</p> | |||
</path></pre> | |||
<p>and the called build file (<samp>subbuild.xml</samp>) also defines a <code><path></code> | |||
with the <var>id</var> <samp>path1</samp>, but <samp>path2</samp> is not defined:</p> | |||
with the <var>id</var> <samp>path1</samp>, but <samp>path2</samp> is not defined; then</p> | |||
<pre><ant antfile="subbuild.xml" inheritrefs="true"/></pre> | |||
<p>will not override <samp>subbuild</samp>'s definition of <samp>path1</samp>, but make the parent's | |||
definition of <samp>path2</samp> available in the <samp>subbuild</samp>.</p> | |||
definition of <samp>path2</samp> available in the <samp>subbuild</samp>, whereas</p> | |||
<pre><ant antfile="subbuild.xml"/></pre> | |||
@@ -338,14 +339,14 @@ definition of <samp>path2</samp> available in the <samp>subbuild</samp>.</p> | |||
<pre><ant antfile="subbuild.xml" inheritrefs="false"/></pre> | |||
<p>will neither override <samp>path1</samp> nor copy <samp>path2</samp>.</p> | |||
<p>will neither override <samp>path1</samp> nor copy <samp>path2</samp>, while</p> | |||
<pre> | |||
<ant antfile="subbuild.xml" inheritrefs="false"> | |||
<reference refid="path1"/> | |||
</ant></pre> | |||
<p>will override <samp>subbuild</samp>'s definition of <samp>path1</samp>.</p> | |||
<p>will override <samp>subbuild</samp>'s definition of <samp>path1</samp>, and</p> | |||
<pre> | |||
<ant antfile="subbuild.xml" inheritrefs="false"> | |||
@@ -154,6 +154,7 @@ single target whose dependencies are the targets so specified, in the order spec | |||
</table> | |||
<h3>Examples</h3> | |||
<p>The following</p> | |||
<pre> | |||
<target name="default"> | |||
<antcall target="doSomethingElse"> | |||
@@ -164,13 +165,11 @@ single target whose dependencies are the targets so specified, in the order spec | |||
<target name="doSomethingElse"> | |||
<echo message="param1=${param1}"/> | |||
</target></pre> | |||
<p>Will run the target <var>doSomethingElse</var> and echo <code>param1=value</code>.</p> | |||
<p>will run the target <var>doSomethingElse</var> and echo <code>param1=value</code>, whereas</p> | |||
<pre> | |||
<antcall ... > | |||
<reference refid="path1" torefid="path2"/> | |||
</antcall></pre> | |||
<p>will copy the parent's definition of <samp>path1</samp> into the new project using | |||
the <var>id</var> <samp>path2</samp>.</p> | |||
@@ -137,12 +137,12 @@ nested <code><jvmarg></code> attributes, for example:</p> | |||
in <a href="../using.html#arg">Command line arguments</a>.</p> | |||
<h3>Example</h3> | |||
<p>Invoke ANTLR on grammar file <samp>etc/java.g</samp>, writing the generated files | |||
to <samp>build/src</samp>:</p> | |||
<pre> | |||
<antlr | |||
target="etc/java.g" | |||
outputdirectory="build/src"/></pre> | |||
<p>This invokes ANTLR on grammar file <samp>etc/java.g</samp>, writing the generated files | |||
to <samp>build/src</samp>.</p> | |||
</body> | |||
</html> |
@@ -64,11 +64,11 @@ task—see the example below. | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><antstructure output="project.dtd"/></pre> | |||
<p>Basic usage</p> | |||
<p><strong>Emitting your own structure instead of a DTD</strong></p> | |||
<pre><antstructure output="project.dtd"/></pre> | |||
<p>First you need to implement the interface</p> | |||
<p>Emit your own structure instead of a DTD: first you need to implement the interface</p> | |||
<pre> | |||
package org.example; | |||
@@ -85,8 +85,8 @@ public class MyPrinter implements AntStructure.StructurePrinter { | |||
<myprinter/> | |||
</antstructure></pre> | |||
<p>Your own StructurePrinter can accept attributes and nested elements just like any other Ant type | |||
or task.</p> | |||
<p>Your own <code class="code">StructurePrinter</code> can accept attributes and nested elements | |||
just like any other Ant type or task.</p> | |||
</body> | |||
</html> |
@@ -62,17 +62,19 @@ as condition).</p> | |||
<h3>Examples</h3> | |||
<p>Store the current Ant version in the property <code>antversion</code>.</p> | |||
<pre><antversion property="antversion"/></pre> | |||
<p>Stores the current Ant version in the property <code>antversion</code>.</p> | |||
<p>Store the Ant version in the property <code>antversion</code> if the current Ant version is 1.6.0 | |||
or higher. Otherwise the property remains unset.</p> | |||
<pre><antversion property="antversion" atleast="1.6"/></pre> | |||
<p>Stores the Ant version in the property <code>antversion</code> if the current Ant version is | |||
1.6.0 or higher. Otherwise the property remains unset.</p> | |||
<pre><antversion property="ant-is-exact-7" exactly="1.7.0"/></pre> | |||
<p>Sets the property <code>ant-is-exact-7</code> if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.1 | |||
<p>Set the property <code>ant-is-exact-7</code> if Ant 1.7.0 is running. Neither 1.6.5 nor 1.7.1 | |||
would match.</p> | |||
<pre><antversion property="ant-is-exact-7" exactly="1.7.0"/></pre> | |||
<p>Set <code>Ant17isOnline</code> if Ant 1.7.0 is running and can get a non-error-response from the | |||
Ant homepage.</p> | |||
<pre> | |||
<condition property="Ant17isOnline"> | |||
<and> | |||
@@ -80,8 +82,6 @@ would match.</p> | |||
<http url="http://ant.apache.org"/> | |||
</and> | |||
</condition></pre> | |||
<p>Sets <code>Ant17isOnline</code> if Ant 1.7.0 is running and can get a non-error-response from the | |||
Ant homepage.</p> | |||
</body> | |||
</html> |
@@ -350,6 +350,9 @@ files for each sourcefile.</p> | |||
(with <var>maxparallel</var> > 0) and null will be used a source file just like it is in the case | |||
of <code>exec</code>.</p> | |||
<h3>Examples</h3> | |||
<p>Invoke <kbd>ls -l</kbd>, adding the absolute filenames of all files below <samp>/tmp</samp> not | |||
ending in <samp>.txt</samp> and all files of the FileSet with <var>id</var> <samp>other.files</samp> | |||
to the command line.</p> | |||
<pre> | |||
<apply executable="ls"> | |||
<arg value="-l"/> | |||
@@ -360,9 +363,11 @@ of <code>exec</code>.</p> | |||
</fileset> | |||
<fileset refid="other.files"/> | |||
</apply></pre> | |||
<p>invokes <kbd>ls -l</kbd>, adding the absolute filenames of all files below <samp>/tmp</samp> not | |||
ending in <samp>.txt</samp> and all files of the FileSet with <var>id</var> <samp>other.files</samp> | |||
to the command line.</p> | |||
<p>Invoke <kbd>somecommand arg1 SOURCEFILENAME arg2</kbd> for each file in <samp>/tmp</samp> | |||
replacing <code>SOURCEFILENAME</code> with the absolute filename of each file in | |||
turn. If <var>parallel</var> had been set to <q>true</q>, <code>SOURCEFILENAME</code> would be | |||
replaced with the absolute filenames of all files separated by spaces.</p> | |||
<pre> | |||
<apply executable="somecommand" parallel="false"> | |||
<arg value="arg1"/> | |||
@@ -371,10 +376,11 @@ to the command line.</p> | |||
<fileset dir="/tmp"/> | |||
</apply> | |||
</pre> | |||
<p>invokes <code>somecommand arg1 SOURCEFILENAME arg2</code> for each file in <samp>/tmp</samp> | |||
replacing <code>SOURCEFILENAME</code> with the absolute filename of each file in | |||
turn. If <var>parallel</var> had been set to true, <code>SOURCEFILENAME</code> would be replaced | |||
with the absolute filenames of all files separated by spaces.</p> | |||
<p>Invoke <kbd>cc -c -o TARGETFILE SOURCEFILE</kbd> for each <samp>.c</samp> file that is newer than | |||
the corresponding <samp>.o</samp>, replacing <code>TARGETFILE</code> with the absolute filename of | |||
the <samp>.o</samp> and <code>SOURCEFILE</code> with the absolute name of the <samp>.c</samp> | |||
file.</p> | |||
<pre> | |||
<apply executable="cc" dest="src/C" parallel="false"> | |||
<arg value="-c"/> | |||
@@ -384,10 +390,15 @@ with the absolute filenames of all files separated by spaces.</p> | |||
<fileset dir="src/C" includes="*.c"/> | |||
<mapper type="glob" from="*.c" to="*.o"/> | |||
</apply></pre> | |||
<p>invokes <kbd>cc -c -o TARGETFILE SOURCEFILE</kbd> for each <samp>.c</samp> file that is newer | |||
than the corresponding <samp>.o</samp>, replacing <code>TARGETFILE</code> with the absolute filename | |||
of the <samp>.o</samp> and <code>SOURCEFILE</code> with the absolute name of the <samp>.c</samp> | |||
file.</p> | |||
<p>Apply the fictitious <kbd>processfile</kbd> executable to all files matching <samp>*.file</samp> | |||
in the <samp>src</samp> directory. The <samp>out</samp> <code><mapper></code> has been set up | |||
to map <samp>*.file</samp> to <samp>*.out</samp>, then this <code><mapper></code> is used to | |||
specify <code>targetfile</code>s for this <code><apply></code> task. A reference | |||
to <samp>out</samp> 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.</p> | |||
<pre> | |||
<mapper id="out" type="glob" | |||
from="src${file.separator}*.file" | |||
@@ -400,15 +411,9 @@ file.</p> | |||
<outputmapper refid="out"/> | |||
</redirector> | |||
</apply></pre> | |||
<p>Applies the fictitious <kbd>processfile</kbd> executable to all files | |||
matching <samp>*.file</samp> in the <samp>src</samp> directory. | |||
The <samp>out</samp> <code><mapper></code> has been set up to map <samp>*.file</samp> | |||
to <samp>*.out</samp>, then this <code><mapper></code> is used to | |||
specify <code>targetfile</code>s for this <code><apply></code> task. A reference | |||
to <samp>out</samp> 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.</p> | |||
<p>Apply the <kbd>ls</kbd> executable to all directories in the <code>PATH</code>, effectively | |||
listing all executables that are available on the <code>PATH</code>.</p> | |||
<pre> | |||
<apply executable="ls" parallel="true" | |||
force="true" dest="${basedir}" append="true" type="both"> | |||
@@ -417,9 +422,10 @@ in this case.</p> | |||
</path> | |||
<identitymapper/> | |||
</apply></pre> | |||
<p>Applies the <kbd>ls</kbd> executable to all directories in the <code>PATH</code>, effectively | |||
listing all executables that are available on the <code>PATH</code>.</p> | |||
<p>Convert all JavaScript files in the <samp>src</samp> directory using the command <kbd>jsmin < | |||
src/a.js > dest/a.js</kbd>. Because the filename itself should not be passed to | |||
the <code>jsmin</code> program, the <var>addsourcefile</var> is set to <q>false</q>.</p> | |||
<pre> | |||
<apply executable="jsmin" addsourcefile="false"> | |||
<!-- Collect the JS-files --> | |||
@@ -432,9 +438,6 @@ listing all executables that are available on the <code>PATH</code>.</p> | |||
<outputmapper id="out" type="glob" from="*.js" to="dest/*.js"/> | |||
</redirector> | |||
</apply></pre> | |||
<p>Conversion of the command <kbd>jsmin < src/a.js > dest/a.js</kbd> but for all files in | |||
the <samp>src</samp> directory. Because the filename itself should not be passed to | |||
the <code>jsmin</code> program, the <var>addsourcefile</var> is set to <q>false</q>.</p> | |||
</body> | |||
</html> |
@@ -129,16 +129,17 @@ alternative.</p> | |||
<h3>Examples</h3> | |||
<p>Make the <code>run.bat</code> file read-only and hidden.</p> | |||
<pre><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></pre> | |||
<p>makes the <code>run.bat</code> file read-only and hidden.</p> | |||
<p>Make all <samp>.xml</samp> files below <samp>${meta.inf}</samp> readable.</p> | |||
<pre><attrib readonly="false"> | |||
<fileset dir="${meta.inf}" includes="**/*.xml"/> | |||
</attrib></pre> | |||
<p>makes all <samp>.xml</samp> files below <samp>${meta.inf}</samp> readable.</p> | |||
<p>Make all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) read-only and archived. In addition all files belonging to a FileSet | |||
with <var>id</var> <samp>other.shared.sources</samp> get the same attributes.</p> | |||
<pre> | |||
<attrib readonly="true" archive="true"> | |||
<fileset dir="shared/sources1"> | |||
@@ -147,9 +148,5 @@ alternative.</p> | |||
<fileset refid="other.shared.sources"/> | |||
</attrib></pre> | |||
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) read-only and archived. In addition all files belonging to a FileSet | |||
with <var>id</var> <samp>other.shared.sources</samp> get the same attributes.</p> | |||
</body> | |||
</html> |
@@ -58,16 +58,18 @@ declared <code>augment</code> element as though it were the original element.</p | |||
<pre><fileset id="input-fs" dir="${basedir}"/></pre> | |||
<p>invocation</p> | |||
<pre><augment id="input-fs" excludes="foo"/></pre> | |||
<p>modifies the <var>excludes</var> attribute of <samp>input-fs</samp>.</p> | |||
<p>modifies the <var>excludes</var> attribute of <samp>input-fs</samp>, whereas</p> | |||
<pre> | |||
<augment id="input-fs"> | |||
<filename name="bar"/> | |||
</augment></pre> | |||
<p>Adds a <code>filename</code> selector to <samp>input-fs</samp>.</p> | |||
<p>adds a <code>filename</code> selector to <samp>input-fs</samp>.</p> | |||
</body> | |||
</html> |
@@ -110,20 +110,27 @@ a <a href="../using.html#path">path-like structure</a> and can also be set via a | |||
<p><code>Available</code>'s <var>filepath</var> attribute is | |||
a <a href="../using.html#path">path-like structure</a> and can also be set via a | |||
nested <code><filepath></code> element.</p> | |||
<h3>Examples</h3> | |||
<pre><available classname="org.whatever.Myclass" property="Myclass.present"/></pre> | |||
<p>sets the <code>Myclass.present</code> property to the value <q>true</q> if the | |||
<p>Set the <code>Myclass.present</code> property to the value <q>true</q> if the | |||
class <code>org.whatever.Myclass</code> is found in Ant's classpath.</p> | |||
<pre><available classname="org.whatever.Myclass" property="Myclass.present"/></pre> | |||
<p>Set the <code>jaxp.jar.present</code> property to the value <q>true</q> if the | |||
file <samp>./lib/jaxp11/jaxp.jar</samp> is found.</p> | |||
<pre> | |||
<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | |||
<available file="${jaxp.jar}" property="jaxp.jar.present"/></pre> | |||
<p>sets the <code>jaxp.jar.present</code> property to the value <q>true</q> if the | |||
file <samp>./lib/jaxp11/jaxp.jar</samp> is found.</p> | |||
<p>Set the <code>local.lib.present</code> property to the value <q>true</q> if the | |||
directory <samp>/usr/local/lib</samp> is found.</p> | |||
<pre> | |||
<available file="/usr/local/lib" type="dir" | |||
property="local.lib.present"/></pre> | |||
<p>sets the <code>local.lib.present</code> property to the value <q>true</q> if the | |||
directory <samp>/usr/local/lib</samp> is found.</p> | |||
<p>Set the <code>jaxp11.present</code> property to the value <q>true</q> if the | |||
class <code>javax.xml.transform.Transformer</code> is found in the classpath referenced | |||
by <samp>jaxp</samp> (in this case, <samp>./lib/jaxp11/jaxp.jar</samp>).</p> | |||
<pre> | |||
...in project ... | |||
<property name="jaxp.jar" value="./lib/jaxp11/jaxp.jar"/> | |||
@@ -131,19 +138,15 @@ directory <samp>/usr/local/lib</samp> is found.</p> | |||
...in target ... | |||
<available classname="javax.xml.transform.Transformer" | |||
classpathref="jaxp" property="jaxp11.present"/></pre> | |||
<p>sets the <code>jaxp11.present</code> property to the value <q>true</q> if the | |||
class <code>javax.xml.transform.Transformer</code> is found in the classpath referenced | |||
by <samp>jaxp</samp> (in this case, <samp>./lib/jaxp11/jaxp.jar</samp>). | |||
</p> | |||
<p>Set the <code>have.extras</code> property to the value <q>true</q> if the resource | |||
file <samp>extratasks.properties</samp> is found.</p> | |||
<pre> | |||
<available property="have.extras" resource="extratasks.properties"> | |||
<classpath> | |||
<pathelement location="/usr/local/ant/extra.jar"/> | |||
</classpath> | |||
</available></pre> | |||
<p>sets the <code>have.extras</code> property to the value <q>true</q> if the resource | |||
file <samp>extratasks.properties</samp> is found. | |||
</p> | |||
</body> | |||
</html> |
@@ -59,20 +59,22 @@ the simple file name, without any directory elements.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><basename property="jar.filename" file="${lib.jarfile}"/></pre> | |||
<p>will set <code>jar.filename</code> to <samp>myjar.jar</samp>, if <code>lib.jarfile</code> is | |||
defined as either a full-path filename (eg., <samp>/usr/local/lib/myjar.jar</samp>), a relative-path | |||
<p>Set <code>jar.filename</code> to <samp>myjar.jar</samp>, if <code>lib.jarfile</code> is defined | |||
as either a full-path filename (eg., <samp>/usr/local/lib/myjar.jar</samp>), a relative-path | |||
filename (eg., <samp>lib/myjar.jar</samp>), or a simple filename (eg., <samp>myjar.jar</samp>).</p> | |||
<pre><basename property="jar.filename" file="${lib.jarfile}"/></pre> | |||
<p>Set <code>cmdname</code> to <samp>foo</samp>.</p> | |||
<pre> | |||
<basename property="cmdname" file="D:/usr/local/foo.exe" | |||
suffix=".exe"/></pre> | |||
<p>will set <code>cmdname</code> to <samp>foo</samp>.</p> | |||
<p>Set <code>temp.dirname</code> to the last directory element of the path defined for | |||
the <code>TEMP</code> environment variable.</p> | |||
<pre> | |||
<property environment="env"/> | |||
<basename property="temp.dirname" file="${env.TEMP}"/> | |||
</pre> | |||
<p>will set <code>temp.dirname</code> to the last directory element of the path defined for | |||
the <code>TEMP</code> environment variable.</p> | |||
</body> | |||
</html> |
@@ -48,13 +48,11 @@ need finer control over things such as the property name or the number format.)< | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><buildnumber/></pre> | |||
<p>Read, increment, and write a build number to the default file, <samp>build.number</samp>.</p> | |||
<pre><buildnumber file="mybuild.number"/></pre> | |||
<pre><buildnumber/></pre> | |||
<p>Read, increment, and write a build number to the file <samp>mybuild.number</samp>.</p> | |||
<pre><buildnumber file="mybuild.number"/></pre> | |||
</body> | |||
</html> |
@@ -106,29 +106,32 @@ element to specify the files to be included in the archive. If this is specifie | |||
the <var>basedir</var> attribute cannot be used.</p> | |||
<h3>Examples</h3> | |||
<p>Cab all files in the <samp>htdocs/manual</samp> directory into a file | |||
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory.</p> | |||
<pre> | |||
<cab cabfile="${dist}/manual.cab" | |||
basedir="htdocs/manual"/></pre> | |||
<p>cabs all files in the <samp>htdocs/manual</samp> directory into a file | |||
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory.</p> | |||
<p>Cab all files in the <samp>htdocs/manual</samp> directory into a file | |||
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Files in the | |||
directory <samp>mydocs</samp>, or files with the name <samp>todo.html</samp> are excluded.</p> | |||
<pre> | |||
<cab cabfile="${dist}/manual.cab" | |||
basedir="htdocs/manual" | |||
excludes="mydocs/**, **/todo.html"/></pre> | |||
<p>cabs all files in the <samp>htdocs/manual</samp> directory into a file | |||
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Files in the | |||
directory <samp>mydocs</samp>, or files with the name <samp>todo.html</samp> are excluded.</p> | |||
<p>Cab all files in the <samp>htdocs/manual</samp> directory into a file | |||
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Only <samp>.html</samp> files | |||
under the directory <samp>api</samp> are archived, and files with the name <samp>todo.html</samp> | |||
are excluded. Output from the <kbd>cabarc</kbd> tool is displayed in the build output.</p> | |||
<pre> | |||
<cab cabfile="${dist}/manual.cab" | |||
basedir="htdocs/manual" | |||
includes="api/**/*.html" | |||
excludes="**/todo.html" | |||
verbose="yes"/></pre> | |||
<p>Cab all files in the <samp>htdocs/manual</samp> directory into a file | |||
called <samp>manual.cab</samp> in the <samp>${dist}</samp> directory. Only <samp>.html</samp> files | |||
under the directory <samp>api</samp> are archived, and files with the name <samp>todo.html</samp> | |||
are excluded. Output from the <code>cabarc</code> tool is displayed in the build output.</p> | |||
<p>The following is equivalent to the example above.</p> | |||
<pre> | |||
<cab cabfile="${dist}/manual.cab" | |||
verbose="yes"> | |||
@@ -137,7 +140,6 @@ are excluded. Output from the <code>cabarc</code> tool is displayed in the build | |||
includes="api/**/*.html" | |||
excludes="**/todo.html"/> | |||
</cab></pre> | |||
<p>is equivalent to the example above.</p> | |||
</body> | |||
</html> |
@@ -74,13 +74,12 @@ other platforms with <kbd>ccm</kbd> installed.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Check in the file <samp>c:/wa/com/foo/MyFile.java</samp>. Text <samp>mycomment</samp> is added | |||
as a comment. The task used is the one set as the default.</p> | |||
<pre> | |||
<ccmcheckin file="c:/wa/com/foo/MyFile.java" | |||
comment="mycomment"/></pre> | |||
<p>Checks in the file <samp>c:/wa/com/foo/MyFile.java</samp>. Text <samp>mycomment</samp> is added | |||
as a comment. The task used is the one set as the default.</p> | |||
<hr/> | |||
<h2 id="ccmcheckout">CCMCheckout</h2> | |||
@@ -121,14 +120,16 @@ as a comment. The task used is the one set as the default.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Check out the file <samp>c:/wa/com/foo/MyFile.java</samp>. Comment | |||
attribute <samp>mycomment</samp> is added as a task comment. The task used is the one set as the | |||
default.</p> | |||
<pre> | |||
<ccmcheckout file="c:/wa/com/foo/MyFile.java" | |||
comment="mycomment"/></pre> | |||
<p>Check out the file <samp>c:/wa/com/foo/MyFile.java</samp>. Comment | |||
attribute <samp>mycomment</samp> is added as a task comment The used task is the one set as the | |||
default.</p> | |||
<p>Check out all the files in the <samp>lib</samp> directory having the <samp>.jar</samp> | |||
extension. Comment attribute <samp>mycomment</samp> is added as a task comment The used task is the | |||
one set as the default.</p> | |||
<pre> | |||
<ccmcheckout comment="mycomment"> | |||
<fileset dir="lib" > | |||
@@ -136,10 +137,6 @@ default.</p> | |||
</fileset> | |||
</ccmcheckout ></pre> | |||
<p>Check out all the files in the <samp>lib</samp> directory having the <samp>.jar</samp> extension. | |||
Comment attribute <samp>mycomment</samp> is added as a task comment The used task is the one set as | |||
the default.</p> | |||
<hr/> | |||
<h2 id="ccmcheckintask">CCMCheckinTask</h2> | |||
@@ -171,10 +168,9 @@ the default.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a Checkin default task on all the checked out files in the current task.</p> | |||
<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> | |||
@@ -211,12 +207,11 @@ the default.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a Continuus <code>reconfigure</code> on the project <samp>ANTCCM_TEST#BMO_1</samp>.</p> | |||
<pre> | |||
<ccmreconfigure ccmproject="ANTCCM_TEST#BMO_1" | |||
verbose="true"/></pre> | |||
<p>Does a Continuus <code>reconfigure</code> on the project <samp>ANTCCM_TEST#BMO_1</samp>.</p> | |||
<hr/> | |||
<h2 id="ccmcreatetask">CCMCreateTask</h2> | |||
@@ -268,12 +263,11 @@ the default.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Create a task for the release <samp>ANTCCM_TEST</samp> with the current user as the resolver for | |||
this task.</p> | |||
<pre> | |||
<ccmcreatetask resolver="${user.name}" | |||
release="ANTCCM_TEST" comment="blahblah"/></pre> | |||
<p>Creates a task for the release <samp>ANTCCM_TEST</samp> with the current user as the resolver for | |||
this task.</p> | |||
</body> | |||
</html> |
@@ -184,59 +184,53 @@ attribute can contain spaces in their name.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Generate a change log report for all the changes that have been made under | |||
the <samp>dve/network</samp> directory. Write these changes into the | |||
file <samp>changelog.xml</samp>.</p> | |||
<pre> | |||
<cvschangelog dir="dve/network" | |||
destfile="changelog.xml"/></pre> | |||
<p>Generates a change log report for all the changes that have been made under | |||
the <samp>dve/network</samp> directory. It writes these changes into the | |||
file <samp>changelog.xml</samp>.</p> | |||
<p>Generate a change log report for any changes that were made under the <samp>dve/network</samp> | |||
directory in the past 10 days. Write these changes into the file <samp>changelog.xml</samp>.</p> | |||
<pre> | |||
<cvschangelog dir="dve/network" | |||
destfile="changelog.xml" | |||
daysinpast="10"/></pre> | |||
<p>Generates a change log report for any changes that were made under the <samp>dve/network</samp> | |||
directory in the past 10 days. It writes these changes into the | |||
<p>Generate a change log report for any changes that were made between February 20, 2002 and March | |||
20, 2002 under the <samp>dve/network</samp> directory. Write these changes into the | |||
file <samp>changelog.xml</samp>.</p> | |||
<pre> | |||
<cvschangelog dir="dve/network" | |||
destfile="changelog.xml" | |||
start="20 Feb 2002" | |||
end="20 Mar 2002"/></pre> | |||
<p>Generates a change log report for any changes that were made between February 20, 2002 and March | |||
20, 2002 under the <samp>dve/network</samp> directory. It writes these changes into the | |||
<p>Generate a change log report for any changes that were made after February 20, 2002 under | |||
the <samp>dve/network</samp> directory. Write these changes into the | |||
file <samp>changelog.xml</samp>.</p> | |||
<pre> | |||
<cvschangelog dir="dve/network" | |||
destfile="changelog.xml" | |||
start="20 Feb 2002"/></pre> | |||
<p>Generates a change log report for any changes that were made after February 20, 2002 under | |||
the <samp>dve/network</samp> directory. It writes these changes into the | |||
file <samp>changelog.xml</samp>.</p> | |||
<p>Generate a change log report for all the changes that were made under | |||
the <code>dve/network</code> directory, substituting the name <samp>Peter Donald</samp> in | |||
the <code><author></code> tags anytime a change made by the user ID <samp>donaldp</samp> is | |||
encountered. Write these changes into the file <samp>changelog.xml</samp>.</p> | |||
<pre> | |||
<cvschangelog dir="dve/network" | |||
destfile="changelog.xml"> | |||
<user displayname="Peter Donald" userid="donaldp"/> | |||
</cvschangelog></pre> | |||
<p>Generates a change log report for all the changes that were made under | |||
the <code>dve/network</code> directory, substituting the name <samp>Peter Donald</samp> in | |||
the <code><author></code> tags anytime it encounters a change made by the user | |||
ID <samp>donaldp</samp>. It writes these changes into the file <samp>changelog.xml</samp>.</p> | |||
<p>Generates a change log report on the <code>ANT_16_BRANCH</code>.</p> | |||
<p>Generate a change log report on the <code>ANT_16_BRANCH</code>.</p> | |||
<pre> | |||
<cvschangelog dir="c:/dev/asf/ant.head" passfile="c:/home/myself/.cvspass" | |||
destfile="changelogant.xml" tag="ANT_16_BRANCH"/></pre> | |||
<h4>Generate Report</h4> | |||
<p>Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the xml | |||
<p>Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the XML | |||
output. The following example illustrates how to generate a HTML report from the XML report.</p> | |||
<pre> | |||
@@ -173,50 +173,54 @@ target="_top">Cryptography Architecture Standard Algorithm Name Documentation</a | |||
for which checksums should be generated.</p> | |||
<h3>Examples</h3> | |||
<p><strong>Example 1</strong></p> | |||
<pre><checksum file="foo.bar"/></pre> | |||
<p>Generates a MD5 checksum for <samp>foo.bar</samp> and stores the checksum in the destination | |||
<p>Generate a MD5 checksum for <samp>foo.bar</samp> and store the checksum in the destination | |||
file <samp>foo.bar.MD5</samp>. <samp>foo.bar.MD5</samp> is overwritten only if <samp>foo.bar</samp> | |||
is newer than itself.</p> | |||
<pre><checksum file="foo.bar"/></pre> | |||
<p><strong>Example 2</strong></p> | |||
<pre><checksum file="foo.bar" forceOverwrite="yes"/></pre> | |||
<p>Generates a MD5 checksum for <samp>foo.bar</samp> and stores the checksum | |||
<p>Generate a MD5 checksum for <samp>foo.bar</samp> and store the checksum | |||
in <samp>foo.bar.MD5</samp>. If <samp>foo.bar.MD5</samp> already exists, it is overwritten.</p> | |||
<pre><checksum file="foo.bar" forceOverwrite="yes"/></pre> | |||
<p><strong>Example 3</strong></p> | |||
<pre><checksum file="foo.bar" property="foobarMD5"/></pre> | |||
<p>Generates a MD5 checksum for <samp>foo.bar</samp> and stores it in the project | |||
<p>Generate a MD5 checksum for <samp>foo.bar</samp> and store it in the project | |||
property <code>foobarMD5</code>.</p> | |||
<pre><checksum file="foo.bar" property="foobarMD5"/></pre> | |||
<p><strong>Example 4</strong></p> | |||
<p>Generate a MD5 checksum for <samp>foo.bar</samp>, compare it against <samp>foo.bar.MD5</samp> and | |||
set <code>isMD5ok</code> to either <q>true</q> or <q>false</q>, depending upon the result.</p> | |||
<pre><checksum file="foo.bar" verifyProperty="isMD5ok"/></pre> | |||
<p>Generates a MD5 checksum for <samp>foo.bar</samp>, compares it against <samp>foo.bar.MD5</samp> | |||
and sets <code>isMD5ok</code> to either <q>true</q> or <q>false</q>, depending upon the result.</p> | |||
<p><strong>Example 5</strong></p> | |||
<pre><checksum file="foo.bar" algorithm="SHA-512" fileext="asc"/></pre> | |||
<p>Generates a SHA-512 checksum for <samp>foo.bar</samp> and stores the checksum in the destination | |||
<p>Generate a SHA-512 checksum for <samp>foo.bar</samp> and store the checksum in the destination | |||
file <samp>foo.bar.asc</samp>. <samp>foo.bar.asc</samp> is overwritten only if <samp>foo.bar</samp> | |||
is newer than itself.</p> | |||
<pre><checksum file="foo.bar" algorithm="SHA-512" fileext="asc"/></pre> | |||
<p><strong>Example 6</strong></p> | |||
<pre><checksum file="foo.bar" property="${md5}" verifyProperty="isEqual"/></pre> | |||
<p>Generates a MD5 checksum for <samp>foo.bar</samp>, compares it against the value of the | |||
property <code>md5</code>, and sets <code>isEqual</code> to either <q>true</q> or <q>false</q>, | |||
<p>Generate a MD5 checksum for <samp>foo.bar</samp>, compare it against the value of the | |||
property <code>md5</code>, and set <code>isEqual</code> to either <q>true</q> or <q>false</q>, | |||
depending upon the result.</p> | |||
<pre><checksum file="foo.bar" property="${md5}" verifyProperty="isEqual"/></pre> | |||
<p><strong>Example 7</strong></p> | |||
<p>Just like Example 1, but generates a <samp>.MD5</samp> file for every file that begins with the | |||
name <samp>foo</samp>.</p> | |||
<pre> | |||
<checksum> | |||
<fileset dir="."> | |||
<include name="foo*"/> | |||
</fileset> | |||
</checksum></pre> | |||
<p>Works just like Example 1, but generates a <samp>.MD5</samp> file for every file that begins with | |||
the name <samp>foo</samp>.</p> | |||
<p><strong>Example 8</strong></p> | |||
<p>Just like Example 4, but only sets <code>isChecksumEqual</code> to <q>true</q>, if the checksum | |||
matches—it will never be set to <q>false</q>. This example demonstrates use with | |||
the <code>condition</code> task.</p> | |||
<pre> | |||
<condition property="isChecksumEqual"> | |||
<checksum> | |||
@@ -225,9 +229,6 @@ the name <samp>foo</samp>.</p> | |||
</fileset> | |||
</checksum> | |||
</condition></pre> | |||
<p>Works like Example 4, but only sets <code>isChecksumEqual</code> to <q>true</q>, if the checksum | |||
matches—it will never be set to <q>false</q>. This example demonstrates use with | |||
the <code>condition</code> task.</p> | |||
<h3>Note</h3> | |||
<p>When working with more than one file, if condition and/or <var>verifyproperty</var> is used, the | |||
@@ -110,19 +110,21 @@ set its value to your current OS.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><chgrp file="${dist}/start.sh" group="coders"/></pre> | |||
<p>makes the <samp>start.sh</samp> file belong to the <samp>coders</samp> group on a UNIX | |||
system.</p> | |||
<p>Make the <samp>start.sh</samp> file belong to the <samp>coders</samp> group on a UNIX system.</p> | |||
<pre><chgrp file="${dist}/start.sh" group="coders"/></pre> | |||
<p>Make all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to the <samp>coders</samp> | |||
group on a UNIX system.</p> | |||
<pre> | |||
<chgrp group="coders"> | |||
<fileset dir="${dist}/bin" includes="**/*.sh"/> | |||
</chgrp></pre> | |||
<p>makes all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to the <samp>coders</samp> | |||
group on a UNIX system.</p> | |||
<p>Make all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) belong to the <samp>coders</samp> group on a UNIX system. In addition, all | |||
files belonging to a FileSet with <var>id</var>=<samp>other.shared.sources</samp> get the same | |||
group.</p> | |||
<pre> | |||
<chgrp group="coders"> | |||
<fileset dir="shared/sources1"> | |||
@@ -132,11 +134,10 @@ group on a UNIX system.</p> | |||
</chgrp> | |||
</pre> | |||
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) belong to the <samp>coders</samp> group on a UNIX system. In addition all | |||
files belonging to a FileSet with <var>id</var> <samp>other.shared.sources</samp> get the same | |||
group.</p> | |||
<p>Make all <samp>.test.jsp</samp>, and <samp>.new</samp> files belong to | |||
group <samp>webdev</samp>. Directories with names beginning with <samp>test_</samp> also will belong | |||
to <samp>webdev</samp>, but if there is a directory name that ends in <samp>.new</samp> or a file | |||
name that begins with <samp>test_</samp> it will be unaffected.</p> | |||
<pre> | |||
<chgrp group="webdev" type="file"> | |||
<fileset dir="/web"> | |||
@@ -148,10 +149,5 @@ group.</p> | |||
</dirset> | |||
</chmod></pre> | |||
<p>makes all <samp>.test.jsp</samp>, and <samp>.new</samp> files belong to | |||
group <samp>webdev</samp>. Directories with names beginning with <samp>test_</samp> also will belong | |||
to <samp>webdev</samp>, but if there is a directory name that ends in <samp>.new</samp> or a file | |||
name that begins with <samp>test_</samp> it will be unaffected.</p> | |||
</body> | |||
</html> |
@@ -138,19 +138,24 @@ alternative.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Make the <samp>start.sh</samp> file readable and executable for anyone on a UNIX system.</p> | |||
<pre><chmod file="${dist}/start.sh" perm="ugo+rx"/></pre> | |||
<p>makes the <samp>start.sh</samp> file readable and executable for anyone on a UNIX system.</p> | |||
<pre><chmod file="${dist}/start.sh" perm="700"/></pre> | |||
<p>makes the <samp>start.sh</samp> file readable, writable and executable only for the owner on a | |||
<p>Make the <samp>start.sh</samp> file readable, writable and executable only for the owner on a | |||
UNIX system.</p> | |||
<pre><chmod file="${dist}/start.sh" perm="700"/></pre> | |||
<p>Make all <samp>.sh</samp> files below <samp>${dist}/bin</samp> readable and executable for anyone | |||
on a UNIX system.</p> | |||
<pre> | |||
<chmod dir="${dist}/bin" perm="ugo+rx" | |||
includes="**/*.sh"/></pre> | |||
<p>makes all <samp>.sh</samp> files below <samp>${dist}/bin</samp> readable and executable for | |||
anyone on a UNIX system.</p> | |||
<p>Make all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) writable for members of the same group on a UNIX system. In addition, all | |||
files belonging to a FileSet with <var>id</var> <samp>other.shared.sources</samp> get the same | |||
permissions.</p> | |||
<pre> | |||
<chmod perm="g+w"> | |||
<fileset dir="shared/sources1"> | |||
@@ -158,10 +163,10 @@ anyone on a UNIX system.</p> | |||
</fileset> | |||
<fileset refid="other.shared.sources"/> | |||
</chmod></pre> | |||
<p>makes all files below <samp>shared/sources1</samp> (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 <var>id</var> <samp>other.shared.sources</samp> get the same permissions.</p> | |||
<p>Keep non-owners from touching <code>cgi</code> scripts, files with a <samp>.old</samp> extension | |||
or directories beginning with <samp>private_</samp>. A directory ending in <samp>.old</samp> or a | |||
file beginning with <samp>private_</samp> would remain unaffected.</p> | |||
<pre> | |||
<chmod perm="go-rwx" type="file"> | |||
<fileset dir="/web"> | |||
@@ -172,9 +177,6 @@ FileSet with <var>id</var> <samp>other.shared.sources</samp> get the same permis | |||
<include name="**/private_*"/> | |||
</dirset> | |||
</chmod></pre> | |||
<p>keeps non-owners from touching cgi scripts, files with a <samp>.old</samp> extension or | |||
directories beginning with <samp>private_</samp>. A directory ending in <samp>.old</samp> or a file | |||
beginning with <samp>private_</samp> would remain unaffected.</p> | |||
<h3>Note on <var>maxparallel</var> attribute</h3> | |||
<p>Some shells have a limit of the number of characters that a command line may contain. This | |||
@@ -111,16 +111,20 @@ value to your current OS.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Make the <samp>start.sh</samp> file belong to <samp>coderjoe</samp> on a UNIX system.</p> | |||
<pre><chown file="${dist}/start.sh" owner="coderjoe"/></pre> | |||
<p>makes the <samp>start.sh</samp> file belong to <samp>coderjoe</samp> on a UNIX system.</p> | |||
<p>Make all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to <samp>coderjoe</samp> on | |||
a UNIX system.</p> | |||
<pre> | |||
<chown owner="coderjoe"> | |||
<fileset dir="${dist}/bin" includes="**/*.sh"/> | |||
</chown></pre> | |||
<p>makes all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to <samp>coderjoe</samp> | |||
on a UNIX system.</p> | |||
<p>Make all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) belong to <samp>coderjoe</samp> on a UNIX system. In addition, all files | |||
belonging to a FileSet with <var>id</var>=<code>other.shared.sources</code> get the same owner.</p> | |||
<pre> | |||
<chown owner="coderjoe"> | |||
<fileset dir="shared/sources1"> | |||
@@ -128,10 +132,10 @@ on a UNIX system.</p> | |||
</fileset> | |||
<fileset refid="other.shared.sources"/> | |||
</chown></pre> | |||
<p>makes all files below <samp>shared/sources1</samp> (except those below any directory | |||
named <samp>trial</samp>) belong to <samp>coderjoe</samp> on a UNIX system. In addition all files | |||
belonging to a FileSet with <var>id</var> <code>other.shared.sources</code> get the same owner.</p> | |||
<p>Make <samp>cgi</samp> scripts, files with a <samp>.old</samp> extension or directories beginning | |||
with <samp>private_</samp> belong to the user named <samp>webadmin</samp>. A directory ending | |||
in <samp>.old</samp> or a file beginning with <samp>private_</samp> would remain unaffected.</p> | |||
<pre> | |||
<chown owner="webadmin" type="file"> | |||
<fileset dir="/web"> | |||
@@ -142,9 +146,6 @@ belonging to a FileSet with <var>id</var> <code>other.shared.sources</code> get | |||
<include name="**/private_*"/> | |||
</dirset> | |||
</chmod></pre> | |||
<p>makes <samp>cgi</samp> scripts, files with a <samp>.old</samp> extension or directories beginning | |||
with <samp>private_</samp> belong to the user named <samp>webadmin</samp>. A directory ending | |||
in <samp>.old</samp> or a file beginning with <samp>private_</samp> would remain unaffected.</p> | |||
</body> | |||
</html> |
@@ -118,17 +118,16 @@ problem.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>checkin</code> on the file <samp>c:/views/viewdir/afile</samp>. Comment | |||
text from the file <samp>acomment.txt</samp> is added to ClearCase as a comment. All warning | |||
messages are suppressed. The file is checked in even if it is <em>identical</em> to the | |||
original.</p> | |||
<pre> | |||
<cccheckin viewpath="c:/views/viewdir/afile" | |||
commentfile="acomment.txt" | |||
nowarn="true" | |||
identical="true"/></pre> | |||
<p>Does a ClearCase <code>checkin</code> on the file <samp>c:/views/viewdir/afile</samp>. Comment | |||
text from the file <samp>acomment.txt</samp> is added to ClearCase as a comment. All warning | |||
messages are suppressed. The file is checked in even if it is <em>identical</em> to the | |||
original.</p> | |||
<hr/> | |||
<h2 id="cccheckout">CCCheckout</h2> | |||
@@ -200,6 +199,9 @@ original.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>checkout</code> on the file <samp>c:/views/viewdir/afile</samp>. It is | |||
checked out as <em>reserved</em> on branch called <samp>abranch</samp>. All warning messages are | |||
suppressed. A "<samp>Some comment text</samp>" is added to ClearCase as a comment.</p> | |||
<pre> | |||
<cccheckout viewpath="c:/views/viewdir/afile" | |||
reserved="true" | |||
@@ -207,10 +209,6 @@ original.</p> | |||
nowarn="true" | |||
comment="Some comment text"/></pre> | |||
<p>Does a ClearCase <code>checkout</code> on the file <samp>c:/views/viewdir/afile</samp>. It is | |||
checked out as <em>reserved</em> on branch called <samp>abranch</samp>. All warning messages are | |||
suppressed. A "<samp>Some comment text</samp>" is added to ClearCase as a comment.</p> | |||
<hr/> | |||
<h2 id="ccuncheckout">CCUnCheckout</h2> | |||
@@ -241,11 +239,10 @@ suppressed. A "<samp>Some comment text</samp>" is added to ClearCase a | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>uncheckout</code> on the file <samp>c:/views/viewdir/afile</samp>. A | |||
copy of the file named <samp>c:/views/viewdir/afile.keep</samp> is kept.</p> | |||
<pre><ccuncheckout viewpath="c:/views/viewdir/afile" keepcopy="true"/></pre> | |||
<p>Does a ClearCase <code>uncheckout</code> on the file <samp>c:/views/viewdir/afile</samp>. A copy | |||
of the file called <samp>c:/views/viewdir/afile.keep</samp> is kept.</p> | |||
<hr/> | |||
<h2 id="ccupdate">CCUpdate</h2> | |||
@@ -303,6 +300,10 @@ of the file called <samp>c:/views/viewdir/afile.keep</samp> is kept.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>update</code> on the snapshot view | |||
directory <samp>c:/views/viewdir</samp>. A graphical dialog will be displayed. The output will be | |||
logged to <samp>log.log</samp> and it will overwrite any hijacked files. The modified time will be | |||
set to the current time.</p> | |||
<pre> | |||
<ccupdate viewpath="c:/views/viewdir" | |||
graphical="false" | |||
@@ -311,11 +312,6 @@ of the file called <samp>c:/views/viewdir/afile.keep</samp> is kept.</p> | |||
currenttime="true" | |||
rename="false"/></pre> | |||
<p>Does a ClearCase <code>update</code> on the snapshot view | |||
directory <samp>c:/views/viewdir</samp>. A graphical dialog will be displayed. The output will be | |||
logged to <samp>log.log</samp> and it will overwrite any hijacked files. The modified time will be | |||
set to the current time.</p> | |||
<hr/> | |||
<h2 id="ccmklbtype">CCMklbtype</h2> | |||
@@ -382,15 +378,14 @@ set to the current time.</p> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>mklbtype</code> to create a label type named <samp>VERSION_1</samp>. It | |||
is created as <em>ordinary</em> so it is available only to the current VOB. The text <q>Development | |||
version 1</q> is added as a comment.</p> | |||
<pre> | |||
<ccmklbtype typename="VERSION_1" | |||
ordinary="true" | |||
comment="Development version 1"/></pre> | |||
<p>Does a ClearCase <code>mklbtype</code> to create a label type named <samp>VERSION_1</samp>. It | |||
is created as <em>ordinary</em> so it is available only to the current VOB. The text <q>Development | |||
version 1</q> is added as a comment.</p> | |||
<hr/> | |||
<h2 id="ccmklabel">CCMklabel</h2> | |||
@@ -451,6 +446,9 @@ version 1</q> is added as a comment.</p> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>mklabel</code> on the file <samp>c:/views/viewdir/afile</samp> under | |||
the <samp>main</samp> branch for version 2 (<samp>\main\2</samp>). Text "<samp>Some comment | |||
text</samp>" is added as a comment. It will <em>recurse</em> all subdirectories.</p> | |||
<pre> | |||
<ccmklabel viewpath="c:/views/viewdir/afile" | |||
comment="Some comment text" | |||
@@ -459,10 +457,6 @@ version 1</q> is added as a comment.</p> | |||
typename="VERSION_1"/> | |||
</pre> | |||
<p>Does a ClearCase <code>mklabel</code> on the file <samp>c:/views/viewdir/afile</samp> under the | |||
main branch for version 2 (<samp>\main\2</samp>). Text "<samp>Some comment text</samp>" is | |||
added as a comment. It will <em>recurse</em> all subdirectories.</p> | |||
<hr/> | |||
<h2 id="ccrmtype">CCRmtype</h2> | |||
@@ -544,16 +538,15 @@ added as a comment. It will <em>recurse</em> all subdirectories.</p> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>rmtype</code> to remove a label type (<q>lbtype</q>) | |||
named <samp>VERSION_1</samp>. Comment text from the file <samp>acomment.txt</samp> is added as a | |||
comment. All instances of the type are removed, including the type object itself.</p> | |||
<pre> | |||
<ccrmtype typekind="lbtype" | |||
typename="VERSION_1" | |||
commentfile="acomment.txt" | |||
rmall="true"/></pre> | |||
<p>Does a ClearCase <code>rmtype</code> to remove a label type (<q>lbtype</q>) | |||
named <samp>VERSION_1</samp>. Comment text from the file <samp>acomment.txt</samp> is added as a | |||
comment. All instances of the type are removed, including the type object itself.</p> | |||
<hr/> | |||
<h2 id="cclock">CCLock</h2> | |||
@@ -609,10 +602,9 @@ comment. All instances of the type are removed, including the type object itself | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><cclock objsel="stream:Application_Integration@\MyProject_PVOB"/></pre> | |||
<p>Does a ClearCase <code>lock</code> on the | |||
<p>Perform a ClearCase <code>lock</code> on the | |||
object <samp>stream:Application_Integration@\MyProject_PVOB</samp>.</p> | |||
<pre><cclock objsel="stream:Application_Integration@\MyProject_PVOB"/></pre> | |||
<hr/> | |||
@@ -654,10 +646,9 @@ object <samp>stream:Application_Integration@\MyProject_PVOB</samp>.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><ccunlock objsel="stream:Application_Integration@\MyProject_PVOB"/></pre> | |||
<p>Does a ClearCase <code>unlock</code> on the | |||
<p>Perform a ClearCase <code>unlock</code> on the | |||
object <samp>stream:Application_Integration@\MyProject_PVOB</samp>.</p> | |||
<pre><ccunlock objsel="stream:Application_Integration@\MyProject_PVOB"/></pre> | |||
<hr/> | |||
@@ -713,16 +704,15 @@ object <samp>stream:Application_Integration@\MyProject_PVOB</samp>.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>mkbl</code> on the Integration view at <samp>v:\ApplicationCC</samp> | |||
even if it is <em>identical</em> to a previous baseline. The new baseline with be incremental and | |||
named <samp>Application_Baseline_AUTO</samp>.</p> | |||
<pre> | |||
<ccmkbl baselinerootname="Application_Baseline_AUTO" | |||
identical="yes" | |||
full="no" | |||
viewpath="v:\ApplicationCC"/></pre> | |||
<p>Does a ClearCase <code>mkbl</code> on the Integration view at <samp>v:\ApplicationCC</samp> even | |||
if it is <em>identical</em> to a previous baseline. The new baseline with be incremental and | |||
named <samp>Application_Baseline_AUTO</samp>.</p> | |||
<hr/> | |||
<h2 id="ccmkattr">CCMkattr</h2> | |||
@@ -783,15 +773,14 @@ named <samp>Application_Baseline_AUTO</samp>.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>mkattr</code> on the file <samp>c:/views/viewdir/afile</samp> and | |||
attach the attribute <samp>BugFix</samp> with a value of <samp>34445</samp> to it.</p> | |||
<pre> | |||
<ccmkattr viewpath="c:/views/viewdir/afile" | |||
typename="BugFix" | |||
typevalue="34445"/> | |||
</pre> | |||
<p>Does a ClearCase <code>mkattr</code> on the file <samp>c:/views/viewdir/afile</samp> and attaches | |||
the attribute <samp>BugFix</samp> with a value of <samp>34445</samp> to it.</p> | |||
<hr/> | |||
<h2 id="ccmkdir">CCMkdir</h2> | |||
@@ -832,14 +821,13 @@ the attribute <samp>BugFix</samp> with a value of <samp>34445</samp> to it.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform a ClearCase <code>mkdir</code> on the dir <samp>c:/views/viewdir/adir</samp> and do not | |||
automatically check it out.</p> | |||
<pre> | |||
<ccmkdir viewpath="c:/views/viewdir/adir" | |||
nocheckout="true" | |||
comment="Some comment text"/></pre> | |||
<p>Does a ClearCase <code>mkdir</code> on the dir <samp>c:/views/viewdir/adir</samp> and does not | |||
automatically check it out.</p> | |||
<hr/> | |||
<h2 id="ccmkelem">CCMkelem</h2> | |||
@@ -905,14 +893,13 @@ automatically check it out.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Perform ClearCase <code>mkelem</code> on the file <samp>c:/views/viewdir/afile</samp> with | |||
element type <samp>text_file</samp>, check in the file after creation.</p> | |||
<pre> | |||
<ccmkelem viewpath="c:/views/viewdir/afile" | |||
eltype="text_file" | |||
checkin="true" | |||
comment="Some comment text"/></pre> | |||
<p>Does a ClearCase <code>mkelem</code> on the file <samp>c:/views/viewdir/afile</samp> with element | |||
type <samp>text_file</samp>. It also checks in the file after creation.</p> | |||
</body> | |||
</html> |
@@ -38,13 +38,13 @@ like <samp>and</samp> or <samp>or</samp>.</p> | |||
<h3>Examples</h3> | |||
<p>Define two components with the same name <samp>or</samp>; one is a | |||
condition (see <a href="conditions.html">conditions</a>) and one is a | |||
selector (see <a href="../Types/selectors.html">selectors</a>).</p> | |||
<pre> | |||
<componentdef name="or" onerror="ignore" | |||
classname="com.apache.tools.ant.taskdefs.conditions.Or"/> | |||
<componentdef name="or" onerror="ignore" | |||
classname="com.apache.tools.ant.types.resources.selectors.Or"/></pre> | |||
<p>defines two components with the same name <samp>or</samp>; one is a condition | |||
(see <a href="conditions.html">conditions</a>) and one is a selector | |||
(see <a href="../Types/selectors.html">selectors</a>).</p> | |||
</body> | |||
</html> |
@@ -185,27 +185,23 @@ | |||
<h3>Examples</h3> | |||
<p><strong>Concatenate a string to a file:</strong></p> | |||
<p>Concatenate a string to a file:</p> | |||
<pre><concat destfile="README">Hello, World!</concat></pre> | |||
<p><strong>Concatenate a series of files to the console:</strong></p> | |||
<p>Concatenate a series of files to the console:</p> | |||
<pre> | |||
<concat> | |||
<fileset dir="messages" includes="*important*"/> | |||
</concat></pre> | |||
<p><strong>Concatenate a single file, appending if the destination file exists:</strong></p> | |||
<p>Concatenate a single file, appending if the destination file exists:</p> | |||
<pre> | |||
<concat destfile="NOTES" append="true"> | |||
<filelist dir="notes" files="note.txt"/> | |||
</concat></pre> | |||
<p><strong>Concatenate a series of files, update the destination file only if is older that all | |||
the source files:</strong></p> | |||
<p>Concatenate a series of files, update the destination file only if is older that all the | |||
source files:</p> | |||
<pre> | |||
<concat destfile="${docbook.dir}/all-sections.xml" | |||
force="no"> | |||
@@ -216,7 +212,7 @@ | |||
excludes="introduction.xml,overview.xml"/> | |||
</concat></pre> | |||
<p><strong>Concatenate a series of files, expanding Ant properties</strong></p> | |||
<p>Concatenate a series of files, expanding Ant properties.</p> | |||
<pre> | |||
<concat destfile="${build.dir}/subs"> | |||
<path> | |||
@@ -228,8 +224,8 @@ | |||
</filterchain> | |||
</concat></pre> | |||
<p><strong>Filter the lines containing project from build.xml and output them to report.output, | |||
prepending with a header</strong></p> | |||
<p>Filter the lines containing project from <samp>build.xml</samp> and output them | |||
to <samp>report.output</samp>, prepending with a header.</p> | |||
<pre> | |||
<concat destfile="${build.dir}/report.output"> | |||
<header filtering="no" trimleading="yes"> | |||
@@ -244,7 +240,7 @@ | |||
</filterchain> | |||
</concat></pre> | |||
<p><strong>Concatenate a number of binary files.</strong></p> | |||
<p>Concatenate a number of binary files.</p> | |||
<pre> | |||
<concat destfile="${build.dir}/dist.bin" binary="yes"> | |||
<fileset file="${src.dir}/scripts/dist.sh"/> | |||
@@ -63,6 +63,9 @@ condition.</p> | |||
see <a href="conditions.html">here</a>.</p> | |||
<h3>Examples</h3> | |||
<p>Set the property <code>javamail.complete</code> if both the JavaBeans Activation Framework and | |||
JavaMail are available in the classpath.</p> | |||
<pre> | |||
<condition property="javamail.complete"> | |||
<and> | |||
@@ -70,9 +73,9 @@ see <a href="conditions.html">here</a>.</p> | |||
<available classname="javax.mail.Transport"/> | |||
</and> | |||
</condition></pre> | |||
<p>sets the property <code>javamail.complete</code> if both the JavaBeans Activation Framework and | |||
JavaMail are available in the classpath.</p> | |||
<p>Set the property <code>isMacOsButNotMacOsX</code> if the current operating system is MacOS, but | |||
not MacOS X/macOS—which Ant considers to be in the Unix family as well.</p> | |||
<pre> | |||
<condition property="isMacOsButNotMacOsX"> | |||
<and> | |||
@@ -82,15 +85,13 @@ JavaMail are available in the classpath.</p> | |||
</not> | |||
</and> | |||
</condition></pre> | |||
<p>sets the property <code>isMacOsButNotMacOsX</code> if the current operating system is MacOS, but | |||
not MacOS X/macOS—which Ant considers to be in the Unix family as well.</p> | |||
<p>Set the property <code>isSunOSonSparc</code> if the current operating system is SunOS and if it | |||
is running on a SPARC architecture.</p> | |||
<pre> | |||
<condition property="isSunOSonSparc"> | |||
<os name="SunOS" arch="sparc"/> | |||
</condition></pre> | |||
<p>sets the property <code>isSunOSonSparc</code> if the current operating system is SunOS and if it | |||
is running on a SPARC architecture.</p> | |||
</body> | |||
</html> |
@@ -183,17 +183,21 @@ the same <code><copy></code> task, all <code><filterchain></code> el | |||
first followed by <code><filterset></code> elements.</p> | |||
<h3>Examples</h3> | |||
<p><strong>Copy a single file</strong></p> | |||
<p>Copy a single file</p> | |||
<pre><copy file="myfile.txt" tofile="mycopy.txt"/></pre> | |||
<p><strong>Copy a single file to a directory</strong></p> | |||
<p>Copy a single file to a directory</p> | |||
<pre><copy file="myfile.txt" todir="../some/other/dir"/></pre> | |||
<p><strong>Copy a directory to another directory</strong></p> | |||
<p>Copy a directory to another directory</p> | |||
<pre> | |||
<copy todir="../new/dir"> | |||
<fileset dir="src_dir"/> | |||
</copy> | |||
</pre> | |||
<p><strong>Copy a set of files to a directory</strong></p> | |||
<p>Copy a set of files to a directory</p> | |||
<pre> | |||
<copy todir="../dest/dir"> | |||
<fileset dir="src_dir"> | |||
@@ -204,16 +208,17 @@ first followed by <code><filterset></code> elements.</p> | |||
<copy todir="../dest/dir"> | |||
<fileset dir="src_dir" excludes="**/*.java"/> | |||
</copy></pre> | |||
<p><strong>Copy a set of files to a directory, appending <samp>.bak</samp> to the file name on the | |||
fly</strong></p> | |||
<p>Copy a set of files to a directory, appending <samp>.bak</samp> to the file name on the | |||
fly</p> | |||
<pre> | |||
<copy todir="../backup/dir"> | |||
<fileset dir="src_dir"/> | |||
<globmapper from="*" to="*.bak"/> | |||
</copy></pre> | |||
<p><strong>Copy a set of files to a directory, replacing <code>@TITLE@</code> with <samp>Foo | |||
Bar</samp> in all files.</strong></p> | |||
<p>Copy a set of files to a directory, replacing <code>@TITLE@</code> with <samp>Foo | |||
Bar</samp> in all files.</p> | |||
<pre> | |||
<copy todir="../backup/dir"> | |||
<fileset dir="src_dir"/> | |||
@@ -222,8 +227,8 @@ Bar</samp> in all files.</strong></p> | |||
</filterset> | |||
</copy></pre> | |||
<p><strong>Collect all items from the current <code>CLASSPATH</code> setting into a destination | |||
directory, flattening the directory structure.</strong></p> | |||
<p>Collect all items from the current <code>CLASSPATH</code> setting into a destination | |||
directory, flattening the directory structure.</p> | |||
<pre> | |||
<copy todir="dest" flatten="true"> | |||
<path> | |||
@@ -231,7 +236,7 @@ directory, flattening the directory structure.</strong></p> | |||
</path> | |||
</copy></pre> | |||
<p><strong>Copies some resources to a given directory.</strong></p> | |||
<p>Copies some resources to a given directory.</p> | |||
<pre> | |||
<copy todir="dest" flatten="true"> | |||
<resources> | |||
@@ -245,7 +250,7 @@ resource would have returned its full path as source and target name and would n | |||
at all. In general it is a good practice to use an explicit mapper together with resources that use | |||
an absolute path as their names.</p> | |||
<p><strong>Copies the two newest resources into a destination directory.</strong></p> | |||
<p>Copies the two newest resources into a destination directory.</p> | |||
<pre> | |||
<copy todir="dest" flatten="true"> | |||
<first count="2"> | |||
@@ -102,26 +102,28 @@ and <code><patternset></code> elements.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Copy the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>.</p> | |||
<pre> | |||
<copydir src="${src}/resources" | |||
dest="${dist}"/></pre> | |||
<p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>.</p> | |||
<p>Copy the directory <samp>${src}/resources</samp> to <samp>${dist}</samp> | |||
recursively. All <samp>.java</samp> files are copied, except for files with the | |||
name <samp>Test.java</samp>.</p> | |||
<pre> | |||
<copydir src="${src}/resources" | |||
dest="${dist}" | |||
includes="**/*.java" | |||
excludes="**/Test.java"/></pre> | |||
<p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp> | |||
recursively. All <samp>.java</samp> files are copied, except for files with the | |||
name <samp>Test.java</samp>.</p> | |||
<p>Copy the directory <samp>${src}/resources</samp> to <samp>${dist}</samp> | |||
recursively. All <samp>.java</samp> files are copied, except for the files under | |||
the <samp>mypackage/test</samp> directory.</p> | |||
<pre> | |||
<copydir src="${src}/resources" | |||
dest="${dist}" | |||
includes="**/*.java" | |||
excludes="mypackage/test/**"/></pre> | |||
<p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp> | |||
recursively. All <samp>.java</samp> files are copied, except for the files under | |||
the <samp>mypackage/test</samp> directory.</p> | |||
</body> | |||
</html> |
@@ -169,22 +169,23 @@ attribute can contain spaces in their name.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Check out the package/module <samp>ant</samp> from the CVS repository pointed to by | |||
the <var>cvsRoot</var> attribute, and store the files in <samp>${ws.dir}</samp>.</p> | |||
<pre> | |||
<cvs cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | |||
package="ant" | |||
dest="${ws.dir}"/></pre> | |||
<p>checks out the package/module <samp>ant</samp> from the CVS repository pointed to by | |||
the <var>cvsRoot</var> attribute, and stores the files in <samp>${ws.dir}</samp>.</p> | |||
<p>Update the package/module that has previously been checked out into <samp>${ws.dir}</samp>.</p> | |||
<pre><cvs dest="${ws.dir}" command="update"/></pre> | |||
<p>updates the package/module that has previously been checked out into <samp>${ws.dir}</samp>.</p> | |||
<p>Silently (<kbd>-q</kbd>) create a file called <samp>patch.txt</samp> containing a unified | |||
(<kbd>-u</kbd>) diff which includes new files added via <kbd>cvs add</kbd> (<kbd>-N</kbd>) and can | |||
be used as input to <kbd>patch</kbd>.</p> | |||
<pre><cvs command="-q diff -u -N" output="patch.txt"/></pre> | |||
<p>silently (<kbd>-q</kbd>) creates a file called <samp>patch.txt</samp> which contains a unified | |||
(<kbd>-u</kbd>) diff which includes new files added via <kbd>cvs add</kbd> (<kbd>-N</kbd>) and | |||
can be used as input to <kbd>patch</kbd>. The equivalent, using <code><commandline></code> | |||
elements, is:</p> | |||
<p>The equivalent, using <code><commandline></code> elements, is:</p> | |||
<pre> | |||
<cvs output="patch"> | |||
<commandline> | |||
@@ -205,15 +206,15 @@ elements, is:</p> | |||
the <var>failonerror</var>, <var>compression</var>, and other "global" parameters from | |||
the <code><cvs></code> element.</p> | |||
<pre> <cvs command="update -A -d"/></pre> | |||
<p>Updates from the head of repository ignoring sticky bits (<kbd>-A</kbd>) and creating any new | |||
<p>Update from the head of repository ignoring sticky bits (<kbd>-A</kbd>) and creating any new | |||
directories as necessary (<kbd>-d</kbd>).</p> | |||
<p>Note: the text of the command is passed to <kbd>cvs</kbd> "as-is" so any cvs options | |||
should appear before the command, and any command options should appear after the command as in the | |||
diff example above. See <a href="http://cvsbook.red-bean.com/cvsbook.html" target="_top">the CVS | |||
book</a> for details, specifically | |||
<pre><cvs command="update -A -d"/></pre> | |||
<p>Note: the text of the command is passed to <kbd>cvs</kbd> "as-is" so any <kbd>cvs</kbd> | |||
options should appear before the command, and any command options should appear after the command as | |||
in the <code>diff</code> example above. See <a href="http://cvsbook.red-bean.com/cvsbook.html" | |||
target="_top">the CVS book</a> for details, specifically | |||
the <a href="http://cvsbook.red-bean.com/cvsbook.html#Commands%20And%20Options" target="_top">Guide | |||
to CVS commands</a></p> | |||
to CVS commands</a>.</p> | |||
</body> | |||
</html> |
@@ -59,10 +59,10 @@ target="_top">bugzilla report 21657</a> for recommended workarounds.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Add an entry into the <samp>~/.cvspass</samp> password file.</p> | |||
<pre> | |||
<cvspass cvsroot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | |||
password="anoncvs"/></pre> | |||
<p>Adds an entry into the <samp>~/.cvspass</samp> password file.</p> | |||
</body> | |||
</html> |
@@ -147,6 +147,9 @@ attribute can contain spaces in their name.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Generate a <code>tagdiff</code> report for all the changes that have been made in | |||
the <code>ant</code> module between the tags <samp>ANT_14</samp> | |||
and <samp>ANT_141</samp>. Write these changes into the file <samp>tagdiff.xml</samp>.</p> | |||
<pre> | |||
<cvstagdiff cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | |||
destfile="tagdiff.xml" | |||
@@ -154,36 +157,31 @@ attribute can contain spaces in their name.</p> | |||
startTag="ANT_14" | |||
endTag="ANT_141"/></pre> | |||
<p>Generates a <code>tagdiff</code> report for all the changes that have been made in | |||
the <code>ant</code> module between the tags <samp>ANT_14</samp> and <samp>ANT_141</samp>. It | |||
writes these changes into the file <samp>tagdiff.xml</samp>.</p> | |||
<p>Generate a <code>tagdiff</code> report for all the changes that have been made in | |||
the <samp>ant</samp> module in January 2002. Write the changes into the | |||
file <samp>tagdiff.xml</samp>. In this example, <var>cvsRoot</var> has not been | |||
set. The current <var>cvsRoot</var> will be used (assuming the build is started from a folder stored | |||
in CVS.</p> | |||
<pre> | |||
<cvstagdiff destfile="tagdiff.xml" | |||
package="ant" | |||
startDate="2002-01-01" | |||
endDate="2002-31-01"/></pre> | |||
<p>Generates a <code>tagdiff</code> report for all the changes that have been made in | |||
the <samp>ant</samp> module in January 2002. In this example <var>cvsRoot</var> has not been | |||
set. The current <var>cvsRoot</var> will be used (assuming the build is started from a folder stored | |||
in <samp>cvs</samp>. It writes these changes into the file <samp>tagdiff.xml</samp>.</p> | |||
<p>Generate a <code>tagdiff</code> report for all the changes that have been made in | |||
the <samp>ant</samp> and <samp>jakarta-gump</samp> modules in January 2003. Write the changes into | |||
the file <samp>tagdiff.xml</samp>. In this | |||
example, <var>cvsRoot</var> has not been set. The current <var>cvsRoot</var> will be used (assuming | |||
the build is started from a folder stored in CVS.</p> | |||
<pre> | |||
<cvstagdiff destfile="tagdiff.xml" | |||
package="ant jakarta-gump" | |||
startDate="2003-01-01" | |||
endDate="2003-31-01"/></pre> | |||
<p>Generates a <code>tagdiff</code> report for all the changes that have been made in | |||
the <samp>ant</samp> and <samp>jakarta-gump</samp> modules in January 2003. In this | |||
example <var>cvsRoot</var> has not been set. The current <var>cvsRoot</var> will be used (assuming | |||
the build is started from a folder stored in <samp>cvs</samp>. It writes these changes into the | |||
file <samp>tagdiff.xml</samp>.</p> | |||
<h4>Generate Report</h4> | |||
<p>Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the xml | |||
output. The following example illustrates how to generate a HTML report from the XML report.</p> | |||
<p>Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the XML | |||
output. The following example illustrates how to generate an HTML report from the XML report.</p> | |||
<pre> | |||
<style in="tagdiff.xml" | |||
@@ -195,27 +193,31 @@ output. The following example illustrates how to generate a HTML report from the | |||
</style></pre> | |||
<h4>Output</h4> | |||
<p>The <var>cvsroot</var> and <var>package</var> attributes of the <code>tagdiff</code> element are | |||
new in Ant 1.6.<br/> Notes on <code>entry</code> attributes:</p> | |||
<p>The <var>cvsroot</var> and <var>package</var> attributes of the <code><tagdiff></code> element are | |||
added <em>since Ant 1.6</em>.</p> | |||
<p>Description of <code><entry></code> attributes:</p> | |||
<table> | |||
<tr> | |||
<th>Attribute</th> | |||
<th>Comment</th> | |||
</tr> | |||
<tr> | |||
<td>name</td> | |||
<td><var>name</var></td> | |||
<td>when reporting on one package, the package name is removed from the output</td> | |||
</tr> | |||
<tr> | |||
<td>revision</td> | |||
<td><var>revision</var></td> | |||
<td>supplied for files which exist at the end of the reporting period</td> | |||
</tr> | |||
<tr> | |||
<td>prevrevision</td> | |||
<td><var>prevrevision</var></td> | |||
<td>supplied for files which exist at the beginning of the reporting period.<br/>Old CVS servers | |||
do not supply it for deleted files. CVS 1.12.2 supplies it.</td> | |||
</tr> | |||
</table> | |||
<p>Example:</p> | |||
<pre> | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<tagdiff startTag="ANT_14" endTag="ANT_141" | |||
@@ -89,13 +89,14 @@ | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Find out the CVS client and server versions and store the versions in the properties | |||
called <code>apachecvsversion</code> and <code>localcvsversion</code></p> | |||
<pre> | |||
<cvsversion cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | |||
passfile="/home/myself/.cvspass" | |||
serverversionproperty="apachecvsversion" | |||
clientversionproperty="localcvsversion"/></pre> | |||
<p>finds out the CVS client and server versions and stores the versions in the properties | |||
called <code>apachecvsversion</code> and <code>localcvsversion</code></p> | |||
</body> | |||
</html> |
@@ -153,45 +153,46 @@ nested <code><fileset></code>.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Delete the file <samp>/lib/ant.jar</samp>.</p> | |||
<pre><delete file="/lib/ant.jar"/></pre> | |||
<p>deletes the file <samp>/lib/ant.jar</samp>.</p> | |||
<pre><delete dir="lib"/></pre> | |||
<p>deletes the <samp>lib</samp> directory, including all files and subdirectories | |||
<p>Delete the <samp>lib</samp> directory, including all files and subdirectories | |||
of <samp>lib</samp>.</p> | |||
<pre><delete dir="lib"/></pre> | |||
<p>Delete all files with the extension <samp>.bak</samp> from the current directory and any | |||
subdirectories.</p> | |||
<pre> | |||
<delete> | |||
<fileset dir="." includes="**/*.bak"/> | |||
</delete> | |||
</pre> | |||
<p>deletes all files with the extension <samp>.bak</samp> from the current directory and any | |||
subdirectories.</p> | |||
<p>Delete all files and subdirectories of <samp>build</samp>, including <samp>build</samp> | |||
itself.</p> | |||
<pre> | |||
<delete includeEmptyDirs="true"> | |||
<fileset dir="build"/> | |||
</delete> | |||
</pre> | |||
<p>deletes all files and subdirectories of <samp>build</samp>, including <samp>build</samp> | |||
itself.</p> | |||
<p>Delete all files and subdirectories of <samp>build</samp>, without <samp>build</samp> itself.</p> | |||
<pre> | |||
<delete includeemptydirs="true"> | |||
<fileset dir="build" includes="**/*"/> | |||
</delete> | |||
</pre> | |||
<p>deletes all files and subdirectories of <samp>build</samp>, without <samp>build</samp> | |||
itself.</p> | |||
<p>Delete the Subversion metadata directories under <samp>src</samp>. Because <samp>.svn</samp> is | |||
on of the <a href="../dirtasks.html#defaultexcludes">default excludes</a> you have to use | |||
the <var>defaultexcludes</var> flag, otherwise Ant won't delete these directories and the files in | |||
it.</p> | |||
<pre> | |||
<delete includeemptydirs="true"> | |||
<fileset dir="src" includes="**/.svn/" defaultexcludes="false"/> | |||
</delete> | |||
</pre> | |||
<p>deletes the subversion metadata directories under <samp>src</samp>. Because <samp>.svn</samp> is | |||
on of the <a href="../dirtasks.html#defaultexcludes">default excludes</a> you have to use the | |||
<var>defaultexcludes</var> flag, otherwise Ant won't delete these directories and the files in it.</p> | |||
</body> | |||
</html> |
@@ -43,10 +43,12 @@ | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Delete the directory <samp>dist</samp>, including its files and subdirectories.</p> | |||
<pre><deltree dir="dist"/></pre> | |||
<p>deletes the directory <samp>dist</samp>, including its files and subdirectories.</p> | |||
<p>Delete the directory <samp>${dist}</samp>, including its files and subdirectories.</p> | |||
<pre><deltree dir="${dist}"/></pre> | |||
<p>deletes the directory <samp>${dist}</samp>, including its files and subdirectories.</p> | |||
</body> | |||
</html> |
@@ -83,7 +83,6 @@ relationship complexity and how many class files are out of date. The decision a | |||
cheaper to just recompile all classes or to use the <code>depend</code> task will depend on the size | |||
of your project and how interrelated your classes are.</p> | |||
<h3>Limitations</h3> | |||
<p>There are some source dependencies which <code>depend</code> will not detect.</p> | |||
@@ -170,18 +169,20 @@ as well as the nested <code><include></code>, <code><exclude></code> | |||
and <code><patternset></code> elements.</p> | |||
<h3>Examples</h3> | |||
<pre> | |||
<depend srcdir="${java.dir}" | |||
destdir="${build.classes}" | |||
cache="depcache" | |||
closure="yes"/></pre> | |||
<p>removes any classes in the <samp>${build.classes}</samp> directory that depend on out-of-date | |||
<p>Remove any classes in the <samp>${build.classes}</samp> directory that depend on out-of-date | |||
classes. Classes are considered out-of-date with respect to the source in | |||
the <samp>${java.dir}</samp> directory, using the same mechanism as the <code><javac></code> | |||
task. In this example, the <code><depend></code> task caches its dependency information in | |||
the <samp>depcache</samp> directory.</p> | |||
<pre> | |||
<depend srcdir="${java.dir}" | |||
destdir="${build.classes}" | |||
cache="depcache" | |||
closure="yes"/></pre> | |||
<p>Do the same as the previous example, but explicitly include all <samp>.java</samp> files, except | |||
those that match the list given in <samp>${java.dir}/build_excludes</samp>.</p> | |||
<pre> | |||
<depend srcdir="${java.dir}" destdir="${build.classes}" | |||
cache="depcache" closure="yes"> | |||
@@ -189,8 +190,5 @@ the <samp>depcache</samp> directory.</p> | |||
<excludesfile name="${java.dir}/build_excludes"/> | |||
</depend></pre> | |||
<p>does the same as the previous example, but explicitly includes all <samp>.java</samp> files, | |||
except those that match the list given in <samp>${java.dir}/build_excludes</samp>.</p> | |||
</body> | |||
</html> |
@@ -110,6 +110,15 @@ and <code><sourcefilelist></code> filelists, and if any are older, they ar | |||
Multiple <code><targetfilelist></code> filelists may be specified.</p> | |||
<h3>Examples</h3> | |||
<p>Remove derived HTML files in the ${output.dir} directory if they are out-of-date with respect | |||
to:</p> | |||
<ol> | |||
<li>the DTD of their source XML files</li> | |||
<li>a common DTD (imported by the main DTD)</li> | |||
<li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li> | |||
<li>the buildfile</li> | |||
</ol> | |||
<pre> | |||
<dependset> | |||
<srcfilelist | |||
@@ -126,17 +135,8 @@ Multiple <code><targetfilelist></code> filelists may be specified.</p> | |||
includes = "**/*.html"/> | |||
</dependset></pre> | |||
<p>In this example derived HTML files in the ${output.dir} directory will be removed if any are | |||
out-of-date with respect to:</p> | |||
<ol> | |||
<li>the DTD of their source XML files</li> | |||
<li>a common DTD (imported by the main DTD)</li> | |||
<li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li> | |||
<li>the buildfile</li> | |||
</ol> | |||
<p>If any of the sources in the above example does not exist, all target files will also be removed. | |||
To ignore missing sources instead, use filesets instead of filelists for the sources.</p> | |||
<p>If any of the sources in the above example does not exist, all target files will also be | |||
removed. To ignore missing sources instead, use filesets instead of filelists for the sources.</p> | |||
</body> | |||
</html> |
@@ -32,11 +32,11 @@ Ant's configuration under an IDE.</p> | |||
<h3>Examples</h3> | |||
<p>Print out the current diagnostics dump.</p> | |||
<pre> | |||
<target name="diagnostics" description="diagnostics"> | |||
<diagnostics/> | |||
</target></pre> | |||
<p>Prints out the current diagnostics dump.</p> | |||
</body> | |||
</html> |
@@ -54,11 +54,12 @@ full directory path of the specified file.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Set <code>antfile.dir</code> to the directory path for <samp>${ant.file}</samp>.</p> | |||
<pre><dirname property="antfile.dir" file="${ant.file}"/></pre> | |||
<p>will set <code>antfile.dir</code> to the directory path for <samp>${ant.file}</samp>.</p> | |||
<p>Set <code>foo.dirname</code> to the project's <var>basedir</var>.</p> | |||
<pre><dirname property="foo.dirname" file="foo.txt"/></pre> | |||
<p>will set <code>foo.dirname</code> to the project's <var>basedir</var>.</p> | |||
</body> | |||
</html> |
@@ -257,7 +257,7 @@ named <samp>MANIFEST.MF</samp>, the file is ignored and you will get a warning.< | |||
<h4>manifest, indexjars, service</h4> | |||
<p>These are inherited from <a href="jar.html"><jar></a></p> | |||
<h2>Example</h2> | |||
<h3>Example</h3> | |||
<pre> | |||
<ear destfile="${build.dir}/myapp.ear" appxml="${src.dir}/metadata/application.xml"> | |||
<fileset dir="${build.dir}" includes="*.jar,*.war"/> | |||
@@ -84,34 +84,38 @@ file is available, and the <var>level</var> option is ignored</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Basic use:</p> | |||
<pre><echo message="Hello, world"/></pre> | |||
<pre><echo message="Embed a line break:${line.separator}"/></pre> | |||
<pre><echo>Embed another:${line.separator}</echo></pre> | |||
<pre><echo>This is a longer message stretching over | |||
two lines. | |||
</echo></pre> | |||
<p>The newline immediately following the <code><echo></code> tag is part of the | |||
output. Newlines in character data within the content of an element are not discarded by XML | |||
parsers.<br/>See <a href="https://www.w3.org/TR/xml/#sec-line-ends" target="_top">W3C Recommendation | |||
26 November 2008 / End of Line handling</a> for more details.</p> | |||
<pre><echo> | |||
This is a longer message stretching over | |||
three lines; the first line is a blank | |||
</echo></pre> | |||
<p>The newline immediately following the <code><echo></code> tag will be part of the | |||
output. Newlines in character data within the content of an element are not discarded by XML | |||
parsers.<br/>See <a href="https://www.w3.org/TR/xml/#sec-line-ends" target="_top">W3C Recommendation | |||
26 November 2008 / End of Line handling</a> for more details.</p> | |||
<pre><echo message="Deleting drive C:" level="debug"/></pre> | |||
<p>A message which only appears in <kbd>-debug</kbd> mode.</p> | |||
<pre><echo message="Deleting drive C:" level="debug"/></pre> | |||
<p>A message which appears even in <kbd>-quiet</kbd> mode.</p> | |||
<pre><echo level="error"> | |||
Imminent failure in the antimatter containment facility. | |||
Please withdraw to safe location at least 50km away. | |||
</echo></pre> | |||
<p>A message which appears even in <kbd>-quiet</kbd> mode.</p> | |||
<p>Generate a shell script by echoing to a file. Note the use of a double <q>$</q> symbol to stop | |||
Ant filtering out the single <q>$</q> during variable expansion.</p> | |||
<pre><echo file="runner.csh" append="false">#\!/bin/tcsh | |||
java-1.3.1 -mx1024m ${project.entrypoint} $$* | |||
</echo></pre> | |||
<p>Generate a shell script by echoing to a file. Note the use of a double <q>$</q> symbol to stop | |||
Ant filtering out the single <q>$</q> during variable expansion.</p> | |||
<p>Depending on the log level Ant runs at, messages are print out or silently ignored:</p> | |||
<table> | |||
@@ -86,27 +86,33 @@ more control on which properties will be picked up. The attributes <var>prefix</ | |||
and <var>regex</var> are just shortcuts that use <code>propertyset</code>s internally.</p> | |||
<h3>Examples</h3> | |||
<pre><echoproperties/></pre> | |||
<p>Report the current properties to the log.</p> | |||
<pre><echoproperties/></pre> | |||
<p>Report the current properties to the file <samp>my.properties</samp>, and fail the build if the | |||
file could not be created or written to.</p> | |||
<pre><echoproperties destfile="my.properties"/></pre> | |||
<p>Report the current properties to the file <samp>my.properties</samp>, and will fail the build if | |||
the file could not be created or written to.</p> | |||
<p>Report the current properties to the file <samp>my.properties</samp>, and log a message if the | |||
file could not be created or written to, but still allow the build to continue.</p> | |||
<pre><echoproperties destfile="my.properties" failonerror="false"/></pre> | |||
<p>Report the current properties to the file <samp>my.properties</samp>, and will log a message if | |||
the file could not be created or written to, but will still allow the build to continue.</p> | |||
<pre><echoproperties prefix="java."/></pre> | |||
<p>List all properties beginning with <samp>java.</samp></p> | |||
<pre><echoproperties prefix="java."/></pre> | |||
<p>Lists all properties beginning with <samp>java.</samp> using a | |||
nested <code><propertyset/></code> which is an equivalent but longer way.</p> | |||
<pre> | |||
<echoproperties> | |||
<propertyset> | |||
<propertyref prefix="java."/> | |||
</propertyset> | |||
</echoproperties></pre> | |||
<p>This again lists all properties beginning with <samp>java.</samp> using a | |||
nested <code><propertyset/></code> which is an equivalent but longer way.</p> | |||
<p>Lists all properties that contain <samp>ant</samp> in their names.</p> | |||
<pre><echoproperties regex=".*ant.*"/></pre> | |||
<p>Lists all properties that contain <samp>ant</samp> in their names. The equivalent snippet | |||
with <code><propertyset/></code> is:</p> | |||
<p>The equivalent snippet with <code><propertyset/></code> is:</p> | |||
<pre> | |||
<echoproperties> | |||
<propertyset> | |||
@@ -57,6 +57,8 @@ | |||
<p>Nested XML content is required.</p> | |||
<h3>Examples</h3> | |||
<p>Create an Ant buildfile, <samp>subbuild.xml</samp>.</p> | |||
<pre><echoxml file="subbuild.xml"> | |||
<project default="foo"> | |||
<target name="foo"> | |||
@@ -64,7 +66,6 @@ | |||
</target> | |||
</project> | |||
</echoxml></pre> | |||
<p>Creates an Ant buildfile, <samp>subbuild.xml</samp>.</p> | |||
</body> | |||
</html> |
@@ -330,21 +330,24 @@ means it is not on the path. Any time you see such an error from any Ant task, i | |||
Ant bug, but some configuration problem on your machine.</p> | |||
<h3>Examples</h3> | |||
<p>Start <kbd>emacs</kbd> on display 1 of the X Window System.</p> | |||
<pre> | |||
<exec executable="emacs"> | |||
<env key="DISPLAY" value=":1.0"/> | |||
</exec> | |||
</pre> | |||
<p>starts <code>emacs</code> on display 1 of the X Window System.</p> | |||
<p>Add <samp>${basedir}/bin</samp> to the <code>PATH</code> of the system command.</p> | |||
<pre> | |||
<property environment="env"/> | |||
<exec ... > | |||
<env key="PATH" path="${env.PATH}:${basedir}/bin"/> | |||
</exec> | |||
</pre> | |||
<p>adds <samp>${basedir}/bin</samp> to the <code>PATH</code> of the system command.</p> | |||
<p>Start the <samp>${browser}</samp> with the specified <samp>${file}</samp> and end the Ant | |||
process. The browser will remain.</p> | |||
<pre> | |||
<property name="browser" location="C:/Program Files/Internet Explorer/iexplore.exe"/> | |||
<property name="file" location="ant/docs/manual/index.html"/> | |||
@@ -353,9 +356,12 @@ Ant bug, but some configuration problem on your machine.</p> | |||
<arg value="${file}"/> | |||
</exec> | |||
</pre> | |||
<p>Starts the <samp>${browser}</samp> with the specified <samp>${file}</samp> and end the Ant | |||
process. The browser will remain.</p> | |||
<p>Send the string <q>blah before blah</q> to the <kbd>cat</kbd> executable, using | |||
an <a href="../Types/filterchain.html"><inputfilterchain></a> to replace <q>before</q> | |||
with <q>after</q> on the way in. Output is sent to the file <samp>redirector.out</samp> and stored | |||
in a property of the same name. Similarly, error output is sent to a file and a property, both | |||
named <samp>redirector.err</samp>.</p> | |||
<pre> | |||
<exec executable="cat"> | |||
<redirector outputproperty="redirector.out" | |||
@@ -370,12 +376,6 @@ process. The browser will remain.</p> | |||
</exec> | |||
</pre> | |||
<p>Sends the string <q>blah before blah</q> to the <kbd>cat</kbd> executable, using | |||
an <a href="../Types/filterchain.html"><inputfilterchain></a> to replace <q>before</q> | |||
with <q>after</q> on the way in. Output is sent to the file <samp>redirector.out</samp> and stored | |||
in a property of the same name. Similarly, error output is sent to a file and a property, both | |||
named <samp>redirector.err</samp>.</p> | |||
<p><strong>Note</strong>: do not try to specify arguments using a simple <code>arg</code>-element | |||
and separate them by spaces. This results in only a single argument containing the entire | |||
string.</p> | |||
@@ -73,34 +73,34 @@ see <a href="conditions.html">here</a>.<br/><em>Since Ant 1.6.2</em> | |||
<h3>Examples</h3> | |||
<p>Exit the current build with no further information given.</p> | |||
<pre><fail/></pre> | |||
<p>will exit the current build with no further information given.</p> | |||
<pre class="output"> | |||
BUILD FAILED | |||
build.xml:4: No message</pre> | |||
<p>Exit the current build and print a message to wherever your output goes:</p> | |||
<pre><fail message="Something wrong here."/></pre> | |||
<p>will exit the current build and print something like the following to wherever your output | |||
goes:</p> | |||
<pre class="output"> | |||
BUILD FAILED | |||
build.xml:4: Something wrong here.</pre> | |||
<p>A different way to achieve the same result as above.</p> | |||
<pre><fail>Something wrong here.</fail></pre> | |||
<p>will give the same result as above.</p> | |||
<p>Exit the current build and print an explanation to wherever your output goes:</p> | |||
<pre><fail unless="thisdoesnotexist"/></pre> | |||
<p>will exit the current build and print something like the following to wherever your output | |||
goes:</p> | |||
<pre class="output"> | |||
BUILD FAILED | |||
build.xml:2: unless=thisdoesnotexist</pre> | |||
Using a condition to achieve the same effect: | |||
<p>Use a condition to achieve the same effect:</p> | |||
<pre> | |||
<fail> | |||
<condition> | |||
@@ -110,12 +110,13 @@ Using a condition to achieve the same effect: | |||
</condition> | |||
</fail></pre> | |||
<p>Output:</p> | |||
<pre class="output"> | |||
BUILD FAILED | |||
build.xml:2: condition satisfied</pre> | |||
<p>Check that both files <samp>one.txt</samp> and <samp>two.txt</samp> are present otherwise the | |||
build will fail.</p> | |||
<pre> | |||
<fail message="Files are missing."> | |||
<condition> | |||
@@ -126,8 +127,6 @@ build.xml:2: condition satisfied</pre> | |||
</not> | |||
</condition> | |||
</fail></pre> | |||
<p>Will check that both files <samp>one.txt</samp> and <samp>two.txt</samp> are present otherwise | |||
the build will fail.</p> | |||
</body> | |||
</html> |
@@ -57,17 +57,19 @@ incorrect tokens are ignored.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Copy recursively all the files from the <samp>src.dir</samp> directory into | |||
the <samp>dest.dir</samp> directory replacing all the occurrences of the string <code>@year@</code> | |||
with <q>2000</q>.</p> | |||
<pre> | |||
<filter token="year" value="2000"/> | |||
<copy todir="${dest.dir}" filtering="true"> | |||
<fileset dir="${src.dir}"/> | |||
</copy></pre> | |||
<p>will copy recursively all the files from the <samp>src.dir</samp> directory into | |||
the <samp>dest.dir</samp> directory replacing all the occurrences of the string <code>@year@</code> | |||
with <q>2000</q>.</p> | |||
<pre><filter filtersfile="deploy_env.properties"/></pre> | |||
<p>will read all property entries from the <samp>deploy_env.properties</samp> file and set these as | |||
<p>Read all property entries from the <samp>deploy_env.properties</samp> file and set these as | |||
filters.</p> | |||
<pre><filter filtersfile="deploy_env.properties"/></pre> | |||
</body> | |||
</html> |
@@ -208,38 +208,42 @@ | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Replace EOLs with LF characters and remove EOF characters from the shell scripts. Tabs and spaces | |||
are left as is.</p> | |||
<pre> | |||
<fixcrlf srcdir="${src}" includes="**/*.sh" | |||
eol="lf" eof="remove"/></pre> | |||
<p>Replaces EOLs with LF characters and removes eof characters from the shell scripts. Tabs and | |||
spaces are left as is.</p> | |||
<p>Replace all EOLs with cr-lf pairs in the batch files. Tabs and spaces are left as is. EOF | |||
characters are left alone if run on DOS systems, and are removed if run on Unix systems.</p> | |||
<pre> | |||
<fixcrlf srcdir="${src}" | |||
includes="**/*.bat" eol="crlf"/></pre> | |||
<p>Replaces all EOLs with cr-lf pairs in the batch files. Tabs and spaces are left as is. EOF | |||
characters are left alone if run on DOS systems, and are removed if run on Unix systems.</p> | |||
<p>Set EOLs according to local OS conventions, and convert sequences of spaces and tabs into the | |||
minimal set of spaces and tabs which will preserve spacing within the line. Tabs are set at 8 | |||
character intervals. EOF characters are left alone if run on DOS systems, and are removed if run on | |||
Unix systems. Many versions of make require tabs prior to commands.</p> | |||
<pre> | |||
<fixcrlf srcdir="${src}" | |||
includes="**/Makefile" tab="add"/></pre> | |||
<p>Sets EOLs according to local OS conventions, and converts sequences of spaces and tabs to the | |||
minimal set of spaces and tabs which will maintain spacing within the line. Tabs are set at 8 | |||
character intervals. EOF characters are left alone if run on DOS systems, and are removed if run on | |||
Unix systems. Many versions of make require tabs prior to commands.</p> | |||
<p>Convert all EOLs in the included Java source files to a single LF. Replace all tab characters | |||
except those in string or character constants with spaces, assuming a tab width of 3. If run on a | |||
Unix system, any CTRL-Z EOF characters at the end of the file are removed. On DOS/Windows, any such | |||
EOF characters will be left untouched. | |||
</p> | |||
<pre> | |||
<fixcrlf srcdir="${src}" includes="**/*.java" | |||
tab="remove" tablength="3" | |||
eol="lf" javafiles="yes"/></pre> | |||
<p>Converts all EOLs in the included Java source files to a single LF. Replace all TAB characters | |||
except those in string or character constants with spaces, assuming a tab width of 3. If run on a | |||
Unix system, any CTRL-Z EOF characters at the end of the file are removed. On DOS/Windows, any such | |||
EOF characters will be left untouched. | |||
</p> | |||
<p>Set EOLs according to local OS conventions, and convert all tabs to spaces, assuming a tab width | |||
of 8. EOF characters are left alone if run on DOS systems, and are removed if run on Unix | |||
systems. You never know what editor a user will use to browse READMEs.</p> | |||
<pre> | |||
<fixcrlf srcdir="${src}" | |||
includes="**/README*" tab="remove"/></pre> | |||
<p>Sets EOLs according to local OS conventions, and converts all tabs to spaces, assuming a tab | |||
width of 8. EOF characters are left alone if run on DOS systems, and are removed if run on Unix | |||
systems. You never know what editor a user will use to browse READMEs.</p> | |||
</body> | |||
</html> |
@@ -394,15 +394,19 @@ to <q>false</q>.</em> On remote filesets hidden files are not checked for being | |||
Hidden files are currently assumed to not be symbolic links.</p> | |||
<h3>Sending files</h3> | |||
<p>The easiest way to describe how to send files is with a couple of examples:</p> | |||
<p>The easiest way to describe how to send files is with a couple of examples.</p> | |||
<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and upload all files in | |||
the <samp>htdocs/manual</samp> directory to the default directory for that user.</p> | |||
<pre> | |||
<ftp server="ftp.apache.org" | |||
userid="anonymous" | |||
password="me@myorg.com"> | |||
<fileset dir="htdocs/manual"/> | |||
</ftp></pre> | |||
<p>Logs in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and uploads all files in | |||
the <samp>htdocs/manual</samp> directory to the default directory for that user.</p> | |||
<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and upload all new or changed | |||
files in the <samp>htdocs/manual</samp> directory to the <samp>incoming</samp> directory relative to | |||
the default directory for <samp>anonymous</samp>.</p> | |||
<pre> | |||
<ftp server="ftp.apache.org" | |||
remotedir="incoming" | |||
@@ -411,9 +415,12 @@ the <samp>htdocs/manual</samp> directory to the default directory for that user. | |||
depends="yes"> | |||
<fileset dir="htdocs/manual"/> | |||
</ftp></pre> | |||
<p>Logs in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and uploads all new or changed | |||
files in the <samp>htdocs/manual</samp> directory to the <samp>incoming</samp> directory relative to | |||
the default directory for <samp>anonymous</samp>.</p> | |||
<p>Log in to <samp>ftp.apache.org</samp> at port <samp>2121</samp> as <samp>coder</samp> with | |||
password <samp>java1</samp> and upload all new or changed HTML files in | |||
the <samp>htdocs/manual</samp> directory to the <samp>/pub/incoming</samp> directory. The files are | |||
transferred in text mode. Passive mode has been switched on to send files from behind a | |||
firewall.</p> | |||
<pre> | |||
<ftp server="ftp.apache.org" | |||
port="2121" | |||
@@ -427,11 +434,11 @@ the default directory for <samp>anonymous</samp>.</p> | |||
<include name="**/*.html"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs in to <samp>ftp.apache.org</samp> at port <samp>2121</samp> as <samp>coder</samp> with | |||
password <samp>java1</samp> and uploads all new or changed HTML files in | |||
the <samp>htdocs/manual</samp> directory to the <samp>/pub/incoming</samp> directory. The files are | |||
transferred in text mode. Passive mode has been switched on to send files from behind a | |||
firewall.</p> | |||
<p>Log in to a Windows server at <samp>ftp.hypothetical.india.org</samp> at port <samp>2121</samp> | |||
as <samp>coder</samp> with password <samp>java1</samp> and upload all new or changed (accounting for | |||
timezone differences) HTML files in the <samp>htdocs/manual</samp> directory to | |||
the <samp>/pub/incoming</samp> directory. The files are transferred in text mode.</p> | |||
<pre> | |||
<ftp server="ftp.hypothetical.india.org" | |||
port="2121" | |||
@@ -446,10 +453,10 @@ firewall.</p> | |||
<include name="**/*.html"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs in to a Windows server at <samp>ftp.hypothetical.india.org</samp> at port <samp>2121</samp> | |||
as <samp>coder</samp> with password <samp>java1</samp> and uploads all new or changed (accounting | |||
for timezone differences) HTML files in the <samp>htdocs/manual</samp> directory to | |||
the <samp>/pub/incoming</samp> directory. The files are transferred in text mode.</p> | |||
<p>Log in to the Windows-based <samp>ftp.nt.org</samp> as <samp>coder</samp> with | |||
password <samp>java1</samp> and upload all HTML files in the <samp>htdocs/manual</samp> directory to | |||
the <samp>c:\uploads</samp> directory. Progress messages are displayed as each file is uploaded.</p> | |||
<pre> | |||
<ftp server="ftp.nt.org" | |||
remotedir="c:\uploads" | |||
@@ -461,15 +468,16 @@ the <samp>/pub/incoming</samp> directory. The files are transferred in text mode | |||
<include name="**/*.html"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs in to the Windows-based <samp>ftp.nt.org</samp> as <samp>coder</samp> with | |||
password <samp>java1</samp> and uploads all HTML files in the <samp>htdocs/manual</samp> directory | |||
to the <samp>c:\uploads</samp> directory. Progress messages are displayed as each file is | |||
uploaded.</p> | |||
<h3>Getting files</h3> | |||
<p>Getting files from an FTP server works pretty much the same way as sending them does. The only | |||
<p>Getting files from an FTP server works pretty much the same way as sending them does. The only | |||
difference is that the nested filesets use the <var>remotedir</var> attribute as the base directory | |||
for the files on the FTP server, and the <var>dir</var> attribute as the local directory to put the | |||
files into. The file structure from the FTP site is preserved on the local machine.</p> | |||
files into. The file structure from the FTP site is preserved on the local machine.</p> | |||
<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and recursively download | |||
all <samp>.html</samp> files from default directory for that user into | |||
the <samp>htdocs/manual</samp> directory on the local machine.</p> | |||
<pre> | |||
<ftp action="get" | |||
server="ftp.apache.org" | |||
@@ -479,9 +487,12 @@ files into. The file structure from the FTP site is preserved on the local mach | |||
<include name="**/*.html"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and recursively downloads | |||
all <samp>.html</samp> files from default directory for that user into | |||
the <samp>htdocs/manual</samp> directory on the local machine.</p> | |||
<p>If <samp>apache.org</samp> ever switches to a Unix FTP server that uses the new all-numeric | |||
format for timestamps, this version would become necessary. It would accomplish the same | |||
functionality as the previous example but would successfully handle the numeric | |||
timestamps. The <var>systemTypeKey</var> is not necessary here but helps clarify what is going | |||
on.</p> | |||
<pre> | |||
<ftp action="get" | |||
server="ftp.apache.org" | |||
@@ -493,10 +504,11 @@ the <samp>htdocs/manual</samp> directory on the local machine.</p> | |||
<include name="**/*.html"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>If <samp>apache.org</samp> ever switches to a Unix FTP server that uses the new all-numeric | |||
format for timestamps, this version would become necessary. It would accomplish the same | |||
functionality as the previous example but would successfully handle the numeric timestamps. | |||
The <var>systemTypeKey</var> is not necessary here but helps clarify what is going on.</p> | |||
<p>Log into a UNIX FTP server at <samp>ftp.hypothetical.fr</samp> which displays dates with French | |||
names in Standard European format, as <samp>anonymous</samp>, and recursively download | |||
all <samp>.html</samp> files from default directory for that user into | |||
the <samp>htdocs/manual</samp> directory on the local machine.</p> | |||
<pre> | |||
<ftp action="get" | |||
server="ftp.hypthetical.fr" | |||
@@ -509,16 +521,15 @@ The <var>systemTypeKey</var> is not necessary here but helps clarify what is goi | |||
<include name="**/*.html"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs into a UNIX FTP server at <samp>ftp.hypothetical.fr</samp> which displays dates with French | |||
names in Standard European format, as <samp>anonymous</samp>, and recursively downloads | |||
all <samp>.html</samp> files from default directory for that user into | |||
the <samp>htdocs/manual</samp> directory on the local machine.</p> | |||
<h3>Deleting files</h3> | |||
<p>As you've probably guessed by now, you use nested fileset elements to select the files to delete | |||
from the remote FTP server. Again, the filesets are relative to the remote directory, not a local | |||
directory. In fact, the <var>dir</var> attribute of the fileset is ignored completely.</p> | |||
<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and try to delete | |||
all <samp>*.tmp</samp> files from the default directory for that user. If you don't have permission | |||
to delete a file, a <code>BuildException</code> is thrown.</p> | |||
<pre> | |||
<ftp action="del" | |||
server="ftp.apache.org" | |||
@@ -528,10 +539,11 @@ directory. In fact, the <var>dir</var> attribute of the fileset is ignored comp | |||
<include name="**/*.tmp"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and tries to delete | |||
all <samp>*.tmp</samp> files from the default directory for that user. If you don't have permission | |||
to delete a file, a <code>BuildException</code> is thrown.</p> | |||
<h3>Listing Files</h3> | |||
<p>Get a file listing in <samp>data/ftp.listing</samp> of all the files on the FTP server relative | |||
to the default directory of the <samp>anonymous</samp> user. The listing is in whatever format the | |||
FTP server normally lists files.</p> | |||
<pre> | |||
<ftp action="list" | |||
server="ftp.apache.org" | |||
@@ -542,30 +554,34 @@ to delete a file, a <code>BuildException</code> is thrown.</p> | |||
<include name="**"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>This provides a file listing in <samp>data/ftp.listing</samp> of all the files on the FTP server | |||
relative to the default directory of the <samp>anonymous</samp> user. The listing is in whatever | |||
format the FTP server normally lists files.</p> | |||
<h3>Creating directories</h3> | |||
<p>Note that with the <q>mkdir</q> action, the directory to create is specified using | |||
the <var>remotedir</var> attribute.</p> | |||
<p>Create the directory <samp>some/remote/dir</samp> beneath the default root directory. As with all | |||
other actions, the directory separator character must be correct according to the desires of the FTP | |||
server.</p> | |||
<pre> | |||
<ftp action="mkdir" | |||
server="ftp.apache.org" | |||
userid="anonymous" | |||
password="me@myorg.com" | |||
remotedir="some/remote/dir"/></pre> | |||
<p>This creates the directory <samp>some/remote/dir</samp> beneath the default root directory. As | |||
with all other actions, the directory separator character must be correct according to the desires | |||
of the FTP server.</p> | |||
<h3>Removing directories</h3> | |||
<p>This action uses nested fileset elements to select the directories to remove from the remote FTP | |||
server. The filesets are relative to the remote directory, not a local directory. | |||
The <var>dir</var> attribute of the fileset is ignored completely. The directories to be removed | |||
must be empty, or contain only other directories that have been also selected to be removed by the | |||
filesets patterns, otherwise a <code>BuildException</code> will be thrown. Also, if you don't have | |||
permission to remove a directory, a <code>BuildException</code> is thrown.</p> | |||
server. The filesets are relative to the remote directory, not a local directory. The <var>dir</var> | |||
attribute of the fileset is ignored completely. The directories to be removed must be empty, or | |||
contain only other directories that have been also selected to be removed by the filesets patterns, | |||
otherwise a <code>BuildException</code> will be thrown. Also, if you don't have permission to remove | |||
a directory, a <code>BuildException</code> is thrown.</p> | |||
<p>Log in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and try to | |||
remove <samp>/somedir/dira</samp> directory and all the directory tree starting at, and | |||
including, <samp>/somedir/dirb</samp>. When removing the <samp>/somedir/dirb</samp> tree, the task | |||
starts at the leaves moving up to the root, so that when it tries to remove a directory it is sure | |||
all the directories under it are already removed. Obviously all the files in the tree must have | |||
been already deleted.</p> | |||
<pre> | |||
<ftp action="rmdir" | |||
server="ftp.apache.org" | |||
@@ -577,14 +593,8 @@ permission to remove a directory, a <code>BuildException</code> is thrown.</p> | |||
<include name="dirb/**"/> | |||
</fileset> | |||
</ftp></pre> | |||
<p>Logs in to <samp>ftp.apache.org</samp> as <samp>anonymous</samp> and tries to | |||
remove <samp>/somedir/dira</samp> directory and all the directories tree starting at, and | |||
including, <samp>/somedir/dirb</samp>. When removing the <samp>/somedir/dirb</samp> tree, it will | |||
start at the leaves moving up to the root, so that when it tries to remove a directory it is sure | |||
all the directories under it are already removed. Obviously all the files in the tree must have | |||
been already deleted.</p> | |||
<p>As an example suppose you want to delete everything contained into <samp>/somedir</samp>, so | |||
invoke first the <code><ftp></code> task with <var>action</var>=<q>delete</q>, then | |||
<p>As an example suppose you want to delete everything contained in <samp>/somedir</samp>, so invoke | |||
first the <code><ftp></code> task with <var>action</var>=<q>delete</q>, then | |||
with <var>action</var>=<q>rmdir</q> specifying in both cases <var>remotedir</var>=<q>/somedir</q> | |||
and</p> | |||
<pre> | |||
@@ -97,9 +97,8 @@ sub-element and populating it with <code><param></code> elements that have | |||
and a <var>value</var>. When using the subelement, it is automatically encoded properly and commas | |||
(<q>,</q>) are replaced with <q>\,</q>.</p> | |||
<p>The following two examples are identical:</p> | |||
<h3>Examples</h3> | |||
<p>The following two examples are identical:</p> | |||
<pre> | |||
<genkey alias="apache-group" storepass="secret" | |||
dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/></pre> | |||
@@ -174,27 +174,28 @@ nested <code><header/></code> node are as follows:</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><get src="http://ant.apache.org/" dest="help/index.html"/></pre> | |||
<p>Gets the index page of <samp>http://ant.apache.org/</samp>, and stores it in the | |||
<p>Get the index page of <samp>http://ant.apache.org/</samp>, and store it in the | |||
file <samp>help/index.html</samp>.</p> | |||
<pre><get src="http://ant.apache.org/" dest="help/index.html"/></pre> | |||
<p>Get the PGP keys of Ant's (current and past) release managers, if the local copy is missing or | |||
out of date. Use the <var>verbose</var> option for progress information.</p> | |||
<pre> | |||
<get src="http://www.apache.org/dist/ant/KEYS" | |||
dest="KEYS" | |||
verbose="true" | |||
usetimestamp="true"/></pre> | |||
<p>Gets the PGP keys of Ant's (current and past) release managers, if the local copy is missing or | |||
out of date. Uses the verbose option for progress information.</p> | |||
<p>Fetch some file from a server with access control. Because HTTPS is being used, the fact that | |||
basic auth sends passwords in plaintext is moot if you ignore the fact that it is part of your build | |||
file which may be readable by third parties. If you need more security, consider using | |||
the <a href="input.html">input</a> task to query for a password.</p> | |||
<pre> | |||
<get src="https://insecure-bank.org/statement/user=1214" | |||
dest="statement.html" | |||
username="1214" | |||
password="secret"/></pre> | |||
<p>Fetches some file from a server with access control. Because https is being used the fact that | |||
basic auth sends passwords in plaintext is moot if you ignore the fact that it is part of your build | |||
file which may be readable by third parties. If you need more security, consider using | |||
the <a href="input.html">input task</a> to query for a password.</p> | |||
<p>Using a macro like the following</p> | |||
@@ -233,7 +234,7 @@ naming convention for the checksum file, of course) and validate the checksum on | |||
<url url="http://ant.apache.org/faq.html"/> | |||
</get></pre> | |||
<p>With custom HTTP headers</p> | |||
<p>Using custom HTTP headers</p> | |||
<pre> | |||
<get src="http://ant.apache.org/index.html" dest="downloads"> | |||
@@ -242,7 +243,7 @@ naming convention for the checksum file, of course) and validate the checksum on | |||
<header name="header3" value="headerValue3"/> | |||
</get></pre> | |||
<p>Gets the index and FAQ pages of <samp>http://ant.apache.org/</samp>, and stores them in the | |||
<p>get the index and FAQ pages of <samp>http://ant.apache.org/</samp>, and store them in the | |||
directory <samp>downloads</samp> which will be created if necessary.</p> | |||
</body> | |||
</html> |
@@ -68,17 +68,16 @@ build was performed on. The best place for this task is probably in an initiali | |||
<h3>Examples</h3> | |||
<pre><hostinfo/></pre> | |||
<p>Sets the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and <code>ADDR6</code> for | |||
<p>Set the <code>NAME</code>, <code>DOMAIN</code>, <code>ADDR4</code>, and <code>ADDR6</code> for | |||
the local host, using the most "global" address available.</p> | |||
<pre><hostinfo/></pre> | |||
<pre><hostinfo prefix="remotehost" host="www.apache.org"/></pre> | |||
<p>Sets the properties <code>remotehost.NAME</code> | |||
<p>Set the properties <code>remotehost.NAME</code> | |||
to <samp>eos</samp>, <code>remotehost.DOMAIN</code> | |||
to <samp>apache.org</samp>, <code>remotehost.ADDR4</code> to <samp>140.211.11.130</samp> | |||
and <code>remotehost.ADDR6</code> to <samp>::</samp> for the host with the | |||
name <samp>www.apache.org</samp> (provided the canonical name and IP addresses do not change).</p> | |||
<pre><hostinfo prefix="remotehost" host="www.apache.org"/></pre> | |||
</body> | |||
</html> |
@@ -209,6 +209,8 @@ element.</p> | |||
<h3>Examples</h3> | |||
<p>Create thumbnails of my images and make sure they all fit within the 160x160 size whether the | |||
image is portrait or landscape.</p> | |||
<pre> | |||
<image destdir="samples/low" overwrite="yes"> | |||
<fileset dir="samples/full"> | |||
@@ -216,28 +218,27 @@ element.</p> | |||
</fileset> | |||
<scale width="160" height="160" proportions="fit"/> | |||
</image></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> | |||
<p>Create a thumbnail for all PNG files in <samp>src</samp> of the size of 40 pixel keeping the | |||
proportions and store the <samp>src</samp>.</p> | |||
<pre> | |||
<image srcdir="src" includes="*.png"> | |||
<scale proportions="width" width="40"/> | |||
</image></pre> | |||
<p>Creates a thumbnail for all PNG files in <samp>src</samp> of the size of 40 pixel keeping the | |||
proportions and stores the <samp>src</samp>.</p> | |||
<p>Same as above but store the result in <samp>dest</samp>.</p> | |||
<pre> | |||
<image srcdir="src" destdir="dest" includes="*.png"> | |||
<scale proportions="width" width="40"/> | |||
</image></pre> | |||
<p>Same as above but stores the result in <samp>dest</samp>.</p> | |||
<p>Same as above but store the result to files with original names prefixed | |||
by <samp>scaled-</samp>.</p> | |||
<pre> | |||
<image srcdir="src" destdir="dest" includes="*.png"> | |||
<scale proportions="width" width="40"/> | |||
<globmapper from="*" to="scaled-*"/> | |||
</image></pre> | |||
<p>Same as above but stores the resulting file names will be prefixed by <samp>scaled-</samp>.</p> | |||
</body> | |||
</html> |
@@ -137,16 +137,22 @@ different <code>Input</code> tasks.</p> | |||
elements.</p> | |||
<h3>Examples</h3> | |||
<pre><input/></pre> | |||
<p>Will pause the build run until return key is pressed when using | |||
<p>Pause the build run until return key is pressed when using | |||
the <a href="../inputhandler.html#defaulthandler">default InputHandler</a>, the concrete behavior is | |||
defined by the <code>InputHandler</code> implementation you use.</p> | |||
<pre><input/></pre> | |||
<p>Display the message <q>Press Return key to continue...</q> and pause the build run until return | |||
key is pressed (again, the concrete behavior is implementation dependent).</p> | |||
<pre><input>Press Return key to continue...</input></pre> | |||
<p>Will display the message <q>Press Return key to continue...</q> and pause the build run until | |||
return key is pressed (again, the concrete behavior is implementation dependent).</p> | |||
<p>Display the message <q>Press Return key to continue...</q> and pause the build run until return | |||
key is pressed (see above).</p> | |||
<pre><input message="Press Return key to continue..."/></pre> | |||
<p>Will display the message <q>Press Return key to continue...</q> and pause the build run until | |||
return key is pressed (see above).</p> | |||
<p>Display the message <q>All data is going to be deleted from DB continue (y/n)?</q> and | |||
require <q>y</q> to continue build or <q>n</q> to exit build with following message <q>Build aborted | |||
by user.</q>.</p> | |||
<pre> | |||
<input message="All data is going to be deleted from DB continue (y/n)?" | |||
validargs="y,n" | |||
@@ -156,21 +162,19 @@ return key is pressed (see above).</p> | |||
</condition> | |||
<fail if="do.abort">Build aborted by user.</fail> | |||
</pre> | |||
<p>Will display the message <q>All data is going to be deleted from DB continue (y/n)?</q> and | |||
require <q>y</q> to continue build or <q>n</q> to exit build with following message <q>Build aborted | |||
by user.</q>.</p> | |||
<p>Display the message <q>Please enter db-username:</q> and set the property <code>db.user</code> to | |||
the value entered by the user.</p> | |||
<pre> | |||
<input message="Please enter db-username:" | |||
addproperty="db.user"/></pre> | |||
<p>Will display the message <q>Please enter db-username:</q> and set the | |||
property <code>db.user</code> to the value entered by the user.</p> | |||
<p>Same as above, but set <code>db.user</code> to the value <q>Scott-Tiger</q> if the user enters no | |||
value (simply presses <q>return</q>).</p> | |||
<pre> | |||
<input message="Please enter db-username:" | |||
addproperty="db.user" | |||
defaultvalue="Scott-Tiger"/></pre> | |||
<p>Same as above, but will set <code>db.user</code> to the value <q>Scott-Tiger</q> if the user | |||
enters no value (simply presses <q>return</q>).</p> | |||
</body> | |||
</html> |
@@ -388,45 +388,47 @@ nested <code><provider></code> elements may be used.</p> | |||
<h3>Examples</h3> | |||
<h4>Simple</h4> | |||
<pre><jar destfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | |||
<p>jars all files in the <samp>${build}/classes</samp> directory into a file | |||
<p>Jar all files in the <samp>${build}/classes</samp> directory into a file | |||
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory.</p> | |||
<pre><jar destfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | |||
<h4>With filters</h4> | |||
<p>Jar all files in the <samp>${build}/classes</samp> directory into a file | |||
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory. Files with the | |||
name <samp>Test.class</samp> are excluded.</p> | |||
<pre><jar destfile="${dist}/lib/app.jar" | |||
basedir="${build}/classes" | |||
excludes="**/Test.class"/></pre> | |||
<p>jars all files in the <samp>${build}/classes</samp> directory into a file | |||
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory. Files with the | |||
name <samp>Test.class</samp> are excluded.</p> | |||
<p>Jar all files in the <samp>${build}/classes</samp> directory into a file | |||
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory. Only files under the | |||
directory <samp>mypackage/test</samp> are used, and files with the name <samp>Test.class</samp> are | |||
excluded.</p> | |||
<pre> | |||
<jar destfile="${dist}/lib/app.jar" | |||
basedir="${build}/classes" | |||
includes="mypackage/test/**" | |||
excludes="**/Test.class"/></pre> | |||
<p>jars all files in the <samp>${build}/classes</samp> directory into a file | |||
called <samp>app.jar</samp> in the <samp>${dist}/lib</samp> directory. Only files under the | |||
directory <samp>mypackage/test</samp> are used, and files with the name <samp>Test.class</samp> are | |||
excluded.</p> | |||
<h4>Multiple filesets</h4> | |||
<p>Jar all files in the <samp>${build}/classes</samp> directory and also in | |||
the <samp>${src}/resources</samp> directory together into a file called <samp>app.jar</samp> in | |||
the <samp>${dist}/lib</samp> directory. Files with the name <samp>Test.class</samp> are excluded. If | |||
there are files such as <samp>${build}/classes/mypackage/MyClass.class</samp> | |||
and <samp>${src}/resources/mypackage/image.gif</samp>, they will appear in the same directory in the | |||
jar (and thus be considered in the same package by Java).</p> | |||
<pre> | |||
<jar destfile="${dist}/lib/app.jar"> | |||
<fileset dir="${build}/classes" | |||
excludes="**/Test.class"/> | |||
<fileset dir="${src}/resources"/> | |||
</jar></pre> | |||
<p>jars all files in the <samp>${build}/classes</samp> directory and also in | |||
the <samp>${src}/resources</samp> directory together into a file called <samp>app.jar</samp> in | |||
the <samp>${dist}/lib</samp> directory. Files with the name <samp>Test.class</samp> are excluded. | |||
If there are files such as <samp>${build}/classes/mypackage/MyClass.class</samp> | |||
and <samp>${src}/resources/mypackage/image.gif</samp>, they will appear in the same directory in the | |||
JAR (and thus be considered in the same package by Java).</p> | |||
<h4>Merging archives</h4> | |||
<p>Create an executable jar file with a main class <samp>com.acme.checksites.Main</samp>, and embed | |||
all the classes from the jar <samp>lib/main/some.jar</samp>.</p> | |||
<pre> | |||
<jar destfile="build/main/checksites.jar"> | |||
<fileset dir="build/main/classes"/> | |||
@@ -436,9 +438,9 @@ JAR (and thus be considered in the same package by Java).</p> | |||
value="com.acme.checksites.Main"/> | |||
</manifest> | |||
</jar></pre> | |||
<p>Creates an executable jar file with a main class <samp>com.acme.checksites.Main</samp>, and | |||
embeds all the classes from the jar <samp>lib/main/some.jar</samp>.</p> | |||
<p>Create an executable jar file with a main class <samp>com.acme.checksites.Main</samp>, and embed | |||
all the classes from all the jars in <samp>lib/main</samp>.</p> | |||
<pre> | |||
<jar destfile="build/main/checksites.jar"> | |||
<fileset dir="build/main/classes"/> | |||
@@ -455,8 +457,6 @@ embeds all the classes from the jar <samp>lib/main/some.jar</samp>.</p> | |||
value="com.acme.checksites.Main"/> | |||
</manifest> | |||
</jar></pre> | |||
<p>Creates an executable jar file with a main class <samp>com.acme.checksites.Main</samp>, and | |||
embeds all the classes from all the jars in <samp>lib/main</samp>.</p> | |||
<h4>Inline manifest</h4> | |||
<pre> | |||
@@ -521,9 +521,9 @@ JDK 6 scripting interface:</p> | |||
<h4 id="jep238-example">JEP 238 example: a Multi-Release JAR Files</h4> | |||
<p>Here we want to create a <em>Multi-Release JAR File</em> according the | |||
specification <a href="http://openjdk.java.net/jeps/238" target="_top">JEP 238</a>. It defines on | |||
specification <a href="http://openjdk.java.net/jeps/238" target="_top">JEP 238</a>. It defines on | |||
top of a JAR the possibility to place additional or overwriting classes in a jar, which are | |||
available according to the Java version you run.<br/> Basically it says, that you have to set the | |||
available according to the Java version you run.<br/>Basically it says, that you have to set the | |||
manifest entry <code>Multi-Release: true</code> and place all additional or overwriting classes | |||
in <samp>META-INF/versions/<i>number</i>/package-structure</samp>, | |||
e.g. <samp>META-INF/versions/9/org/apache/ant/MyClass.class</samp></p> | |||
@@ -69,7 +69,7 @@ extension.</p> | |||
extension in.</p> | |||
<h3>Examples</h3> | |||
<p><strong>Search for extension in single file</strong></p> | |||
<p>Search for extension in single file</p> | |||
<pre> | |||
<jarlib-available property="myext.present" file="myfile.jar"> | |||
<extension extensionName="org.apache.tools.ant" | |||
@@ -78,7 +78,7 @@ extension in.</p> | |||
</jarlib-available> | |||
</pre> | |||
<p><strong>Search for extension in single file referencing external Extension</strong></p> | |||
<p>Search for extension in single file referencing external Extension</p> | |||
<pre> | |||
<extension id="myext" | |||
extensionName="org.apache.tools.ant" | |||
@@ -88,7 +88,8 @@ extension in.</p> | |||
<jarlib-available property="myext.present" file="myfile.jar"> | |||
<extension refid="myext"/> | |||
</jarlib-available></pre> | |||
<p><strong>Search for extension in fileset</strong></p> | |||
<p>Search for extension in fileset</p> | |||
<pre> | |||
<extension id="myext" | |||
extensionName="org.apache.tools.ant" | |||
@@ -101,7 +102,8 @@ extension in.</p> | |||
<include name="*.jar"/> | |||
</fileset> | |||
</jarlib-available></pre> | |||
<p><strong>Search for extension in extensionSet</strong></p> | |||
<p>Search for extension in extensionSet</p> | |||
<pre> | |||
<extension id="myext" | |||
extensionName="org.apache.tools.ant" | |||
@@ -121,4 +123,3 @@ extension in.</p> | |||
</body> | |||
</html> | |||
@@ -56,10 +56,10 @@ target="_top">Extension and ExtensionSet documentation</a> for further details.< | |||
information about.</p> | |||
<h3>Examples</h3> | |||
<p><strong>Display Extension info for a single file</strong></p> | |||
<p>Display Extension info for a single file</p> | |||
<pre><jarlib-display file="myfile.jar"></pre> | |||
<p><strong>Display Extension info for a fileset</strong></p> | |||
<p>Display Extension info for a fileset</p> | |||
<pre> | |||
<jarlib-display> | |||
<fileset dir="lib"> | |||
@@ -63,7 +63,7 @@ target="_top">Extension and ExtensionSet documentation</a> for further details.< | |||
jar. (Optional dependencies will be used if present else they will be ignored)</p> | |||
<h3>Examples</h3> | |||
<p><strong>Basic Manifest generated for single Extension</strong></p> | |||
<p>Basic Manifest generated for single Extension</p> | |||
<pre> | |||
<extension id="e1" | |||
extensionName="MyExtensions" | |||
@@ -78,8 +78,7 @@ jar. (Optional dependencies will be used if present else they will be ignored)</ | |||
<extension refid="e1"/> | |||
</jarlib-manifest></pre> | |||
<p><strong>Search for extension in fileset</strong></p> | |||
<p><strong>A large example with required and optional dependencies</strong></p> | |||
<p>Search for extension in fileset: a large example with required and optional dependencies</p> | |||
<pre> | |||
<extension id="e1" | |||
extensionName="MyExtensions" | |||
@@ -135,8 +135,8 @@ library.</p> | |||
</table> | |||
<h3>Examples</h3> | |||
<p><strong>Resolve Extension to file.</strong> If file does not exist or file does not implement | |||
extension then throw an exception.</p> | |||
<p>Resolve Extension to file. If file does not exist or file does not implement extension then throw | |||
an exception.</p> | |||
<pre> | |||
<extension id="dve.ext" | |||
extensionName="org.realityforge.dve" | |||
@@ -148,8 +148,8 @@ extension then throw an exception.</p> | |||
<location location="/opt/jars/dve.jar"/> | |||
</jarlib-resolve></pre> | |||
<p><strong>Resolve Extension to URL.</strong> If URL does not exist or can not write | |||
to <var>destfile</var> or file does not implement extension then throw an exception.</p> | |||
<p>Resolve Extension to URL. If URL does not exist or can not write to <var>destfile</var> or file | |||
does not implement extension then throw an exception.</p> | |||
<pre> | |||
<extension id="dve.ext" | |||
extensionName="org.realityforge.dve" | |||
@@ -161,9 +161,9 @@ to <var>destfile</var> or file does not implement extension then throw an except | |||
<url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/> | |||
</jarlib-resolve></pre> | |||
<p><strong>Resolve Extension to file produce by Ant build.</strong> If file does not get produced or | |||
Ant file is missing or build fails then throw an exception. (<strong>Note</strong>: does not check | |||
that library implements extension.)</p> | |||
<p>Resolve Extension to file produce by Ant build. If file does not get produced or Ant file is | |||
missing or build fails then throw an exception. (<strong>Note</strong>: does not check that library | |||
implements extension.)</p> | |||
<pre> | |||
<extension id="dve.ext" | |||
extensionName="org.realityforge.dve" | |||
@@ -175,10 +175,9 @@ that library implements extension.)</p> | |||
<ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/> | |||
</jarlib-resolve></pre> | |||
<p><strong>Resolve Extension via multiple methods.</strong> First check local file to see if it | |||
implements extension. If it does not then try to build it from source in parallel directory. If that | |||
fails then finally try to download it from a website. If all steps fail then throw a build | |||
exception.</p> | |||
<p>Resolve Extension via multiple methods. First check local file to see if it implements | |||
extension. If it does not then try to build it from source in parallel directory. If that fails then | |||
finally try to download it from a website. If all steps fail then throw a build exception.</p> | |||
<pre> | |||
<extension id="dve.ext" | |||
extensionName="org.realityforge.dve" | |||
@@ -315,6 +315,7 @@ to <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.h | |||
target="_top">Oracle's specification</a>. | |||
<h3>Examples</h3> | |||
<p>Run a class in this JVM with a new jar on the classpath</p> | |||
<pre> | |||
<java classname="test.Main"> | |||
<arg value="-h"/> | |||
@@ -323,8 +324,10 @@ target="_top">Oracle's specification</a>. | |||
<pathelement path="${java.class.path}"/> | |||
</classpath> | |||
</java></pre> | |||
Run a class in this JVM with a new jar on the classpath | |||
<p>Run the JAR <samp>test.jar</samp> in this project's <samp>dist/lib</samp> directory, using the | |||
manifest supplied entry point, forking (as required), and with a maximum memory of 128 MB. Any non | |||
zero return code breaks the build.</p> | |||
<pre> | |||
<java jar="dist/test.jar" | |||
fork="true" | |||
@@ -336,10 +339,9 @@ Run a class in this JVM with a new jar on the classpath | |||
<pathelement path="${java.class.path}"/> | |||
</classpath> | |||
</java></pre> | |||
<p>Run the JAR <samp>test.jar</samp> in this project's <samp>dist/lib</samp> directory. using the | |||
manifest supplied entry point, forking (as required), and with a maximum memory of 128 MB. Any non | |||
zero return code breaks the build.</p> | |||
<p>Run the JAR <samp>dist/test.jar</samp> relative to the directory <code>${exec.dir}</code>, this | |||
being the same directory in which JVM is to start up.</p> | |||
<pre> | |||
<java dir="${exec.dir}" | |||
jar="${exec.dir}/dist/test.jar" | |||
@@ -352,12 +354,12 @@ zero return code breaks the build.</p> | |||
<pathelement path="${java.class.path}"/> | |||
</classpath> | |||
</java></pre> | |||
<p>Run the JAR <samp>dist/test.jar</samp> relative to the directory <code>${exec.dir}</code>, this | |||
being the same directory in which JVM is to start up.</p> | |||
<p>Run a given class with the current classpath.</p> | |||
<pre><java classname="test.Main"/></pre> | |||
<p>Runs a given class with the current classpath.</p> | |||
<p>Add system properties and JVM properties to JVM as in <code>java | |||
-Xrunhprof:cpu=samples,file=log.txt,depth=3 -DDEBUG=true test.Main</code> | |||
<pre> | |||
<java classname="test.Main" | |||
fork="yes" > | |||
@@ -365,31 +367,31 @@ being the same directory in which JVM is to start up.</p> | |||
<arg value="-h"/> | |||
<jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3"/> | |||
</java></pre> | |||
<p>Add system properties and JVM properties to JVM as in <code>java | |||
-Xrunhprof:cpu=samples,file=log.txt,depth=3 -DDEBUG=true test.Main</code> | |||
<p>Use a given Java implementation (other than the one Ant is currently using) to run the class. For | |||
documentation in the log <var>taskname</var> is used to change the <q>[java]</q> log-prefix | |||
to <q>[java1.4]</q>.</p> | |||
<pre> | |||
<java classname="ShowJavaVersion" classpath="." | |||
jvm="path-to-java14-home/bin/java" fork="true" | |||
taskname="java1.4"/></pre> | |||
<p>Use a given Java implementation (other than the one Ant is currently using) to run the class. | |||
For documentation in the log <var>taskname</var> is used to change the <q>[java]</q> log-prefix | |||
to <q>[java1.4]</q>.</p> | |||
<p><strong>Note</strong>: you can not specify the (highly deprecated) MS | |||
JVM, <samp>jview.exe</samp>, as <var>jvm</var>, since it takes different parameters than other JVMs. | |||
That JVM can be started from <code><exec></code> if required.</p> | |||
<p>Run the module <samp>TestModule</samp> resolved on the modulepath <samp>lib/:dist/test.jar</samp> | |||
with a maximum memory of 128 MB. Any non zero return code breaks the build.</p> | |||
<pre> | |||
<java fork="true" | |||
failonerror="true" | |||
maxmemory="128m" | |||
module="TestModule" | |||
modulepath="lib:dist/test.jar"/></pre> | |||
<p>Runs the module <samp>TestModule</samp> resolved on the | |||
<p>Run the class <samp>Main</samp> in module <samp>TestModule</samp> resolved on the | |||
modulepath <samp>lib/:dist/test.jar</samp> with a maximum memory of 128 MB. Any non zero return code | |||
breaks the build.</p> | |||
<pre> | |||
<java fork="true" | |||
failonerror="true" | |||
@@ -401,8 +403,5 @@ breaks the build.</p> | |||
<pathelement location="dist/test.jar"/> | |||
</modulepath> | |||
</java></pre> | |||
<p>Runs the class <samp>Main</samp> in module <samp>TestModule</samp> resolved on the | |||
modulepath <samp>lib/:dist/test.jar</samp> with a maximum memory of 128 MB. Any non zero return code | |||
breaks the build.</p> | |||
</body> | |||
</html> |
@@ -488,6 +488,10 @@ type can be used as an alternative to the <var>compiler</var> attribute.</p> | |||
<h3>Examples</h3> | |||
<p>Compile all <samp>.java</samp> files under the <samp>${src}</samp> directory, and store | |||
the <samp>.class</samp> files in the <samp>${build}</samp> directory. The classpath used | |||
includes <samp>xyz.jar</samp>, and compiling with debug information is on. The source level | |||
is <q>1.4</q>, so you can use <code>assert</code> statements.</p> | |||
<pre> | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
@@ -495,11 +499,10 @@ type can be used as an alternative to the <var>compiler</var> attribute.</p> | |||
debug="on" | |||
source="1.4"/></pre> | |||
<p>compiles all <samp>.java</samp> files under the <samp>${src}</samp> directory, and stores | |||
the <samp>.class</samp> files in the <samp>${build}</samp> directory. The classpath used | |||
includes <samp>xyz.jar</samp>, and compiling with debug information is on. The source level | |||
is <q>1.4</q>, so you can use <code>assert</code> statements.</p> | |||
<p>Compile all <samp>.java</samp> files under the <samp>${src}</samp> directory, and store | |||
the <samp>.class</samp> files in the <samp>${build}</samp> directory. Java compiler is forked using | |||
the default <kbd>javac</kbd> executable. The source level is <q>1.2</q> (similar to <q>1.1</q> | |||
or <q>1.3</q>) and the class files should be runnable under JDK 1.2+ as well.</p> | |||
<pre> | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
@@ -507,50 +510,34 @@ is <q>1.4</q>, so you can use <code>assert</code> statements.</p> | |||
source="1.2" | |||
target="1.2"/></pre> | |||
<p>compiles all <samp>.java</samp> files under the <samp>${src}</samp> directory, and stores | |||
the <samp>.class</samp> files in the <samp>${build}</samp> directory. This will fork off the Java | |||
compiler using the default <kbd>javac</kbd> executable. The source level is <q>1.2</q> (similar | |||
to <q>1.1</q> or <q>1.3</q>) and the class files should be runnable under JDK 1.2+ as well.</p> | |||
<p>Compile all <samp>.java</samp> files under the <samp>${src}</samp> directory, and store | |||
the <samp>.class</samp> files in the <samp>${build}</samp> directory. Java compiler is forked using | |||
the executable named <kbd>java$javac.exe</kbd>. Note that the <q>$</q> sign needs to be escaped by a | |||
second one. The source level is <q>1.5</q>, so you can use generics.</p> | |||
<pre> | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
fork="java$$javac.exe" | |||
source="1.5"/></pre> | |||
<p>compiles all <samp>.java</samp> files under the <samp>${src}</samp> directory, and stores | |||
the <samp>.class</samp> files in the <samp>${build}</samp> directory. This will fork off the Java | |||
compiler, using the executable named <kbd>java$javac.exe</kbd>. Note that the <q>$</q> sign needs | |||
to be escaped by a second one. The source level is <q>1.5</q>, so you can use generics.</p> | |||
<pre> | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
includes="mypackage/p1/**,mypackage/p2/**" | |||
excludes="mypackage/p1/testpackage/**" | |||
classpath="xyz.jar" | |||
debug="on"/></pre> | |||
<p>compiles <samp>.java</samp> files under the <samp>${src}</samp> directory, and stores | |||
the <samp>.class</samp> files in the <code>${build}</code> directory. The classpath used | |||
includes <samp>xyz.jar</samp>, and debug information is on. Only files | |||
<p>Compile <samp>.java</samp> files under the <samp>${src}</samp> directory, and store | |||
the <samp>.class</samp> files in the <code>${build}</code> directory. The classpath used | |||
includes <samp>xyz.jar</samp>, and debug information is on. Only files | |||
under <samp>mypackage/p1</samp> and <samp>mypackage/p2</samp> are used. All files in and below | |||
the <samp>mypackage/p1/testpackage</samp> directory are excluded from compilation. You didn't | |||
the <samp>mypackage/p1/testpackage</samp> directory are excluded from compilation. You didn't | |||
specify a source or target level, so the actual values used will depend on which JDK you ran Ant | |||
with.</p> | |||
<pre> | |||
<javac srcdir="${src}:${src2}" | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
includes="mypackage/p1/**,mypackage/p2/**" | |||
excludes="mypackage/p1/testpackage/**" | |||
classpath="xyz.jar" | |||
debug="on"/></pre> | |||
<p>is the same as the previous example, with the addition of a second source path, defined by the | |||
property <samp>src2</samp>. This can also be represented using nested <code><src></code> | |||
<p>This is the same as the previous example, with the addition of a second source path, defined by | |||
the property <samp>src2</samp>. This can also be represented using nested <code><src></code> | |||
elements as follows:</p> | |||
<pre> | |||
<javac destdir="${build}" | |||
classpath="xyz.jar" | |||
@@ -562,11 +549,10 @@ elements as follows:</p> | |||
<exclude name="mypackage/p1/testpackage/**"/> | |||
</javac></pre> | |||
<p>If you want to run the <kbd>javac</kbd> compiler of a different JDK, you should tell Ant, where | |||
to find the compiler and which version of JDK you will be using so it can choose the correct command | |||
line switches. The following example executes a JDK 1.1 <kbd>javac</kbd> in a new process and | |||
uses the correct command line switches even when Ant is running in a JVM of a different version:</p> | |||
<p>If you want to run the <kbd>javac</kbd> compiler of a different JDK, you should tell Ant where to | |||
find the compiler and which version of JDK you will be using so it can choose the correct command | |||
line switches. The following example executes a JDK 1.1 <kbd>javac</kbd> in a new process and uses | |||
the correct command line switches even when Ant is running in a JVM of a different version:</p> | |||
<pre> | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
@@ -584,7 +570,6 @@ target="_top">Ant FAQ</a> for additional information.</p> | |||
<p>If you wish to compile only files explicitly specified and disable <code>javac</code>'s default | |||
searching mechanism then you can unset the <var>sourcepath</var> attribute:</p> | |||
<pre> | |||
<javac sourcepath="" srcdir="${src}" | |||
destdir="${build}" > | |||
@@ -599,7 +584,6 @@ files refers to them.</p> | |||
<p>If you wish to compile with a special JDK (another than the one Ant is currently using), set | |||
the <var>executable</var> and <var>fork</var> attribute. Using <var>taskname</var> could show in the | |||
log, that these settings are fix.</p> | |||
<pre> | |||
<javac srcdir="" | |||
destdir="" | |||
@@ -613,7 +597,6 @@ with all JDKs prior to 1.2.</p> | |||
<p>If you want to activate other compiler options like <code>lint</code> you could use | |||
the <code><compilerarg></code> element:</p> | |||
<pre> | |||
<javac srcdir="${src.dir}" | |||
destdir="${classes.dir}" | |||
@@ -641,6 +624,12 @@ the <var>compiler</var> attribute:</p> | |||
<p>in which case your compiler adapter can support attributes and nested elements of its own.</p> | |||
<p>The following examples demonstrate the use of Java 9+ modules.</p> | |||
<p>Compile all <samp>.java</samp> files in a single module under the <samp>${src}</samp> directory, | |||
and store the <samp>.class</samp> files in the <code>${build}</code> directory. The compilation uses | |||
application modules located in <samp>modules</samp> folder. The source level is <q>9</q> to enable | |||
modules.</p> | |||
<pre> | |||
<javac srcdir="${src}" | |||
destdir="${build}" | |||
@@ -648,11 +637,14 @@ the <var>compiler</var> attribute:</p> | |||
modulepath="modules" | |||
source="9"/></pre> | |||
<p>compiles all <samp>.java</samp> files in a single module under the <samp>${src}</samp> directory, | |||
and stores the <samp>.class</samp> files in the <code>${build}</code> directory. The compilation | |||
uses application modules located in <samp>modules</samp> folder.The source level is <q>9</q> to | |||
enable modules.</p> | |||
<p>Compile all <samp>.java</samp> files in <samp>gen/classes</samp>, <samp>lin32/classes</samp> | |||
and <code>lin64/classes</code> in all source modules under the <code>${src}</code> | |||
directory. Generate module directories in the <samp>${build}</samp> directory. Each generated module | |||
directory under the <samp>${build}</samp> directory contains <code>.class</code> files from | |||
corresponding source module. The <samp>*</samp> is a token representing the name of any of the | |||
modules in the compilation module set. The <code>{ ... , ... }</code> express alternates for | |||
expansion. The compilation uses application modules located in <code>modules</code> folder. The | |||
source level is <q>9</q> to enable modules.</p> | |||
<pre> | |||
<javac modulesourcepath="${src}/*/{gen,lin{32,64}}/classes" | |||
destdir="${build}" | |||
@@ -660,15 +652,6 @@ enable modules.</p> | |||
modulepath="modules" | |||
source="9"/></pre> | |||
<p>compiles all <samp>.java</samp> files in <samp>gen/classes</samp>, <samp>lin32/classes</samp> | |||
and <code>lin64/classes</code> in all source modules under the <code>${src}</code> directory. | |||
Generates module directories in the <samp>${build}</samp> directory. Each generated module directory | |||
under the <samp>${build}</samp> directory contains <code>.class</code> files from corresponding | |||
source module. The <samp>*</samp> is a token representing the name of any of the modules in the | |||
compilation module set. The <code>{ ... , ... }</code> express alternates for expansion. The | |||
compilation uses application modules located in <code>modules</code> folder.The source level | |||
is <q>9</q> to enable modules.</p> | |||
<h3 id="jikes">Jikes notes</h3> | |||
<p>You need Jikes 1.15 or later.</p> | |||
@@ -179,14 +179,14 @@ task will still work, but it will always generate the output files.</p> | |||
</tr> | |||
</table> | |||
<h3>Example</h3> | |||
<p>Invoke JavaCC on grammar file <samp>src/Parser.jj</samp>, writing the generated files | |||
to <samp>build/src</samp>. The grammar option STATIC is set to <q>true</q> when invoking JavaCC.</p> | |||
<pre> | |||
<javacc target="src/Parser.jj" | |||
outputdirectory="build/src" | |||
javacchome="c:/program files/JavaCC" | |||
static="true"/></pre> | |||
<p>This invokes JavaCC on grammar file <samp>src/Parser.jj</samp>, writing the generated files | |||
to <samp>build/src</samp>. The grammar option STATIC is set to <q>true</q> when invoking | |||
JavaCC.</p> | |||
</body> | |||
</html> |
@@ -188,25 +188,31 @@ using one of the built-in compilers.</p> | |||
element of that type can be used as an alternative to the <var>implementation</var> attribute.</p> | |||
<h3>Examples</h3> | |||
<pre><javah destdir="c" class="org.foo.bar.Wibble"/></pre> | |||
<p>makes a JNI header of the named class, using the JDK 1.2 JNI model. Assuming the | |||
<p>Make a JNI header of the named class, using the JDK 1.2 JNI model. Assuming the | |||
directory <samp>c</samp> already exists, the file <samp>org_foo_bar_Wibble.h</samp> is created | |||
there. If this file already exists, it is left unchanged.</p> | |||
<pre><javah destdir="c" class="org.foo.bar.Wibble"/></pre> | |||
<p>This is similar to the previous example, except the output is written to a file | |||
called <samp>wibble.h</samp> in the current directory.</p> | |||
<pre> | |||
<javah outputFile="wibble.h"> | |||
<class name="org.foo.bar.Wibble,org.foo.bar.Bobble"/> | |||
</javah></pre> | |||
<p>is similar to the previous example, except the output is written to a file | |||
called <samp>wibble.h</samp> in the current directory.</p> | |||
<p>Write three header files, one for each of the classes named. Because the <var>force</var> option | |||
is set, these header files are always written when the <code>Javah</code> task is invoked, even if | |||
they already exist.</p> | |||
<pre> | |||
<javah destdir="c" force="yes"> | |||
<class name="org.foo.bar.Wibble"/> | |||
<class name="org.foo.bar.Bobble"/> | |||
<class name="org.foo.bar.Tribble"/> | |||
</javah></pre> | |||
<p>writes three header files, one for each of the classes named. Because the force option is set, | |||
these header files are always written when the <code>Javah</code> task is invoked, even if they | |||
already exist.</p> | |||
<p>Write the headers for the three classes using the 'old' JNI format, then write the | |||
corresponding <samp>.c</samp> stubs. The <var>verbose</var> option will cause <code>Javah</code> to | |||
describe its progress.</p> | |||
<pre> | |||
<javah destdir="c" verbose="yes" old="yes" force="yes"> | |||
<class name="org.foo.bar.Wibble"/> | |||
@@ -218,9 +224,6 @@ already exist.</p> | |||
<class name="org.foo.bar.Bobble"/> | |||
<class name="org.foo.bar.Tribble"/> | |||
</javah></pre> | |||
<p>writes the headers for the three classes using the 'old' JNI format, then writes the | |||
corresponding <samp>.c</samp> stubs. The <var>verbose</var> option will cause <code>Javah</code> to | |||
describe its progress.</p> | |||
<p>If you want to use a | |||
custom <code class="code">JavahAdapter</code> <code>org.example.MyAdapter</code> you can either use | |||
@@ -119,6 +119,8 @@ or above).</p> | |||
<h3>Examples</h3> | |||
<p>Invoke JDepend on the <samp>build</samp> directory, writing the output on the standard | |||
output. The classpath is defined using a reference.</p> | |||
<pre> | |||
<jdepend classpathref="base.path"> | |||
<classespath> | |||
@@ -126,9 +128,9 @@ or above).</p> | |||
</classespath> | |||
</jdepend></pre> | |||
<p>This invokes JDepend on the <samp>build</samp> directory, writing the output on the standard | |||
output. The classpath is defined using a classpath reference.</p> | |||
<p>This invoke JDepend in a separate JVM on the <samp>src</samp> and <samp>testsrc</samp> | |||
directories, writing the output to the <samp>docs/jdepend.xml</samp> file in XML format. The | |||
classpath is defined using nested elements.</p> | |||
<pre> | |||
<jdepend outputfile="docs/jdepend.xml" fork="yes" format="xml"> | |||
<sourcespath> | |||
@@ -140,10 +142,8 @@ output. The classpath is defined using a classpath reference.</p> | |||
</classpath> | |||
</jdepend></pre> | |||
<p>This invokes JDepend in a separate JVM on the <samp>src</samp> and <samp>testsrc</samp> | |||
directories, writing the output to the <samp>docs/jdepend.xml</samp> file in xml format. The | |||
classpath is defined using nested elements.</p> | |||
<p>Invoke JDepend with the build directory as the base for class files to analyze, and ignore all | |||
classes in the <samp>java.*</samp> and <samp>javax.*</samp> packages.</p> | |||
<pre> | |||
<jdepend classpathref="base.path"> | |||
<exclude name="java.*> | |||
@@ -153,8 +153,5 @@ classpath is defined using nested elements.</p> | |||
</classespath> | |||
</jdepend></pre> | |||
<p>This invokes JDepend with the build directory as the base for class files to analyze, and will | |||
ignore all classes in the <samp>java.*</samp> and <samp>javax.*</samp> packages.</p> | |||
</body> | |||
</html> |
@@ -87,13 +87,13 @@ documentation file.</p> | |||
<h3>Example</h3> | |||
<p>Invoke JJDoc on grammar file <samp>src/Parser.jj</samp>, writing the generated BNF documentation | |||
file, <samp>ParserBNF.html</samp>, to <samp>doc</samp>.</p> | |||
<pre> | |||
<jjdoc target="src/Parser.jj" | |||
outputfile="doc/ParserBNF.html" | |||
javacchome="c:/program files/JavaCC"/></pre> | |||
<p>This invokes JJDoc on grammar file <samp>src/Parser.jj</samp>, writing the generated BNF | |||
documentation file, <samp>ParserBNF.html</samp>, to <samp>doc</samp>.</p> | |||
</body> | |||
</html> |
@@ -141,25 +141,24 @@ file as the JJTree grammar file with a suffix <samp>.jj</samp>.</p> | |||
<td>No</td> | |||
</tr> | |||
<tr> | |||
<td>maxmemory</td> | |||
<td>Max amount of memory to allocate to the forked JVM. <em>since Ant 1.8.3</em></td> | |||
<td>No</td> | |||
</tr> | |||
<tr> | |||
<td>maxmemory</td> | |||
<td>Max amount of memory to allocate to the forked JVM. <em>since Ant 1.8.3</em></td> | |||
<td>No</td> | |||
</tr> | |||
</table> | |||
<h3>Example</h3> | |||
<p>Invoke JJTree on grammar file <samp>src/Parser.jjt</samp>, writing the generated grammar | |||
file, <samp>Parser.jj</samp>, to <samp>build/src</samp>. The grammar option NODE_USES_PARSER is set | |||
to <q>true</q> when invoking JJTree.</p> | |||
<pre> | |||
<jjtree target="src/Parser.jjt" | |||
outputdirectory="build/src" | |||
javacchome="c:/program files/JavaCC" | |||
nodeusesparser="true"/></pre> | |||
<p>This invokes JJTree on grammar file <samp>src/Parser.jjt</samp>, writing the generated grammar | |||
file, <samp>Parser.jj</samp>, file to <samp>build/src</samp>. The grammar option NODE_USES_PARSER is | |||
set to <q>true</q> when invoking JJTree.</p> | |||
<h3>Comparison of output locations between command line JJTree and different Ant <code>taskdef</code> | |||
versions</h3> | |||
@@ -123,7 +123,7 @@ entries to <samp>out.jar</samp>.</p> | |||
</jar> | |||
</pre> | |||
<p>Suppose the file foo.jar contains two entries: <samp>bar.class</samp> | |||
<p>Suppose the file <samp>foo.jar</samp> contains two entries: <samp>bar.class</samp> | |||
and <samp>barnone/myClass.zip</samp>. Suppose the path for file <samp>foo.jar</samp> | |||
is <samp>build/tempbuild/foo.jar</samp>. The following example will provide the | |||
entry <samp>tempbuild/foo.jar</samp> in the <samp>out.jar</samp>.</p> | |||
@@ -213,7 +213,11 @@ checking to the compiler.</p> | |||
<td>Yes</td> | |||
</tr> | |||
</table> | |||
<h3>Example</h3> | |||
<p>Build all <samp>.jsp</samp> files under <samp>src/war</samp> into the | |||
destination <samp>/gensrc</samp>, in a package hierarchy beginning | |||
with <samp>com.i3sp.jsp</samp>.</p> | |||
<pre> | |||
<jspc srcdir="${basedir}/src/war" | |||
destdir="${basedir}/gensrc" | |||
@@ -222,9 +226,10 @@ checking to the compiler.</p> | |||
verbose="9"> | |||
<include name="**/*.jsp"/> | |||
</jspc></pre> | |||
<p>Build all <samp>.jsp</samp> files under <samp>src/war</samp> into the | |||
destination <samp>/gensrc</samp>, in a package hierarchy beginning | |||
with <samp>com.i3sp.jsp</samp>.</p> | |||
<p>Generate <samp>.java</samp> files from <samp>.jsp</samp> files, then <code>javac</code> them down | |||
to bytecode. Include <samp>lib/taglibs.jar</samp> in the Java compilation. Dependency checking is | |||
used to scrub the <samp>.java</samp> files if class dependencies indicate it is needed.</p> | |||
<pre> | |||
<jspc destdir="interim" | |||
verbose="1" | |||
@@ -241,9 +246,6 @@ with <samp>com.i3sp.jsp</samp>.</p> | |||
destdir="build" | |||
classpath="lib/taglibs.jar" | |||
debug="on"/></pre> | |||
<p>Generate <samp>.java</samp> files from <samp>.jsp</samp> files then <code>javac</code> them down | |||
to bytecodes. Include <samp>lib/taglibs.jar</samp> in the Java compilation. Dependency checking is | |||
used to scrub the <samp>.java</samp> files if class dependencies indicate it is needed.</p> | |||
<h4>Notes</h4> | |||
<p>Using the <var>package</var> attribute it is possible to identify the | |||
@@ -630,24 +630,29 @@ can ensure they will be generated even if the build file disables them.</p> | |||
<h3>Examples</h3> | |||
<p>Run the test defined in <code>my.test.TestCase</code> in the same VM. No output will be generated | |||
unless the test fails.</p> | |||
<pre> | |||
<junit> | |||
<test name="my.test.TestCase"/> | |||
</junit></pre> | |||
<p>Runs the test defined in <code>my.test.TestCase</code> in the same VM. No output will be | |||
generated unless the test fails.</p> | |||
<p>Run the test defined in <code>my.test.TestCase</code> in a separate JVM. At the end of the test, | |||
a one-line summary will be printed. A detailed report of the test can be found | |||
in <samp>TEST-my.test.TestCase.txt</samp>. The build process will be stopped if the test fails.</p> | |||
<pre> | |||
<junit printsummary="yes" fork="yes" haltonfailure="yes"> | |||
<formatter type="plain"/> | |||
<test name="my.test.TestCase"/> | |||
</junit></pre> | |||
<p>Runs the test defined in <code>my.test.TestCase</code> in a separate JVM. At the end of the | |||
test, a one-line summary will be printed. A detailed report of the test can be found | |||
in <samp>TEST-my.test.TestCase.txt</samp>. The build process will be stopped if the test fails.</p> | |||
<p>Run <code>my.test.TestCase</code> in the same JVM, ignoring the given <code>CLASSPATH</code>; | |||
only a warning is printed if this test fails. In addition to the plain text test results, for this | |||
test a XML result will be output to <samp>result.xml</samp>. Then, for each matching file in the | |||
directory defined for <samp>${src.tests}</samp>, a test is run in a separate JVM. If a test fails, | |||
the build process is aborted. Results are collected in files | |||
named <samp>TEST-</samp><var>name</var><samp>.txt</samp> and written | |||
to <samp>${reports.tests}</samp>.</p> | |||
<pre> | |||
<junit printsummary="yes" haltonfailure="yes"> | |||
<classpath> | |||
@@ -669,14 +674,14 @@ in <samp>TEST-my.test.TestCase.txt</samp>. The build process will be stopped if | |||
</batchtest> | |||
</junit></pre> | |||
<p>Runs <code>my.test.TestCase</code> in the same JVM, ignoring the given <code>CLASSPATH</code>; | |||
only a warning is printed if this test fails. In addition to the plain text test results, for this | |||
test a XML result will be output to <samp>result.xml</samp>. Then, for each matching file in the | |||
directory defined for <samp>${src.tests}</samp> a test is run in a separate JVM. If a test fails, | |||
the build process is aborted. Results are collected in files | |||
named <samp>TEST-</samp><var>name</var><samp>.txt</samp> and written | |||
to <samp>${reports.tests}</samp>.</p> | |||
<p>On the first run, all tests are collected via the <code><batchtest/></code> | |||
element. Its <var>plain</var> formatter shows the output on the console. The <var>failure</var> | |||
formatter creates a Java source file in <samp>${build.dir}/failingTests/FailedTests.java</samp> | |||
which extends <code class="code">junit.framework.TestCase</code> and returns from | |||
a <code class="code">suite()</code> method a test suite for the failing tests.<br/>On a second run | |||
the collector class exists and instead of the <code><batchtest/></code> the | |||
single <code><test/></code> will run. So only the failing test cases are re-run. The two | |||
nested formatters are for displaying (for the user) and for updating the collector class.</p> | |||
<pre> | |||
<target name="test"> | |||
<property name="collector.dir" value="${build.dir}/failingTests"/> | |||
@@ -708,14 +713,17 @@ to <samp>${reports.tests}</samp>.</p> | |||
</test> | |||
</junit> | |||
</target></pre> | |||
<p>On the first run all tests are collected via the <code><batchtest/></code> | |||
element. Its <var>plain</var> formatter shows the output on the console. The <var>failure</var> | |||
formatter creates a Java source file in <samp>${build.dir}/failingTests/FailedTests.java</samp> | |||
which extends <code>junit.framework.TestCase</code> and returns from a <code>suite()</code> method a | |||
test suite for the failing tests.<br/> On a second run the collector class exists and instead of | |||
the <code><batchtest/></code> the single <code><test/></code> will run. So only the | |||
failing test cases are re-run. The two nested formatters are for displaying (for the user) and for | |||
updating the collector class.</p> | |||
<p>Run <code>my.test.TestCase</code> as a white-box test in the forked JVM given by | |||
the <code>platform.java</code> property. The JUnit library is a part of an unnamed module while the | |||
tested project and required modules are on the module path. The tests do not have module-info file | |||
and are executed in the project module given by <code>module.name</code> | |||
property.<br/>The <kbd>--patch-module</kbd> Java option executes the tests built | |||
into <samp>${build.test.classes}</samp> in a module given by <code>module.name</code> | |||
property.<br/>The <kbd>--add-modules</kbd> Java option enables the tested | |||
module.<br/>The <kbd>--add-reads</kbd> Java option makes the unnamed module containing JUnit | |||
readable by tested module.<br/>The <kbd>--add-exports</kbd> Java option makes the non-exported test | |||
package <code>my.test</code> accessible from the unnamed module containing JUnit.</p> | |||
<pre> | |||
<junit fork="true" | |||
jvm="${platform.java}"> | |||
@@ -731,18 +739,15 @@ updating the collector class.</p> | |||
</modulepath> | |||
<formatter type="plain"/> | |||
<test name="my.test.TestCase"/> | |||
</junit> | |||
</pre> | |||
<p>Runs <code>my.test.TestCase</code> as a white-box test in the forked JVM given by | |||
the <code>platform.java</code> property. The JUnit library is a part of an unnamed module while the | |||
tested project and required modules are on the module path. The tests do not have module-info file | |||
and are executed in the project module given by <code>module.name</code> property.<br/> | |||
The <kbd>--patch-module</kbd> Java option executes the tests built | |||
into <samp>${build.test.classes}</samp> in a module given by <code>module.name</code> property.<br/> | |||
The <kbd>--add-modules</kbd> Java option enables the tested module.<br/> | |||
The <kbd>--add-reads</kbd> Java option makes the unnamed module containing JUnit readable by | |||
tested module.<br/> The <kbd>--add-exports</kbd> Java option makes the non-exported test | |||
package <code>my.test</code> accessible from the unnamed module containing JUnit.</p> | |||
</junit></pre> | |||
<p>Run <code>my.test.TestCase</code> as a black-box test in the forked JVM given by | |||
the <code>platform.java</code> property. The JUnit library is used as an automatic module. The | |||
tests' module-info requires the tested module and JUnit.<br/>The <kbd>--add-modules</kbd> Java | |||
option enables the test module.<br/>The <kbd>--add-exports</kbd> Java option makes the non-exported | |||
test package <code>my.test</code> accessible from the JUnit module and Ant's test runner. Another | |||
possibility is to export the test package in the tests' module-info by <code>exports my.test</code> | |||
directive.</p> | |||
<pre> | |||
<junit fork="true" | |||
jvm="${platform.java}"> | |||
@@ -753,14 +758,6 @@ package <code>my.test</code> accessible from the unnamed module containing JUnit | |||
</modulepath> | |||
<formatter type="plain"/> | |||
<test name="my.test.TestCase"/> | |||
</junit> | |||
</pre> | |||
<p>Runs <code>my.test.TestCase</code> as a black-box test in the forked JVM given by | |||
the <code>platform.java</code> property. The JUnit library is used as an automatic module. The | |||
tests' module-info requires the tested module and JUnit.<br/> The <kbd>--add-modules</kbd> Java | |||
option enables the test module.<br/> The <kbd>--add-exports</kbd> Java option makes the | |||
non-exported test package <code>my.test</code> accessible from the JUnit module and Ant's test | |||
runner. Another possibility is to export the test package in the tests' module-info | |||
by <code>exports my.test</code> directive.</p> | |||
</junit></pre> | |||
</body> | |||
</html> |
@@ -392,6 +392,10 @@ | |||
<h3>Examples</h3> | |||
<p> | |||
Launch the JUnit 5 platform to run the <samp>org.myapp.SimpleTest</samp> test | |||
</p> | |||
<pre> | |||
<path id="test.classpath"> | |||
... | |||
@@ -403,7 +407,9 @@ | |||
</junitlauncher></pre> | |||
<p> | |||
Launches the JUnit 5 platform to run the <samp>org.myapp.SimpleTest</samp> test | |||
Launch the JUnit 5 platform to run the <samp>org.myapp.SimpleTest</samp> and | |||
the <samp>org.myapp.AnotherTest</samp> tests. The build process will be stopped if any test, in | |||
the <samp>org.myapp.SimpleTest</samp>, fails. | |||
</p> | |||
<pre> | |||
@@ -415,9 +421,8 @@ | |||
</pre> | |||
<p> | |||
Launches the JUnit 5 platform to run the <samp>org.myapp.SimpleTest</samp> and | |||
the <samp>org.myapp.AnotherTest</samp> tests. The build process will be stopped if any test, in | |||
the <samp>org.myapp.SimpleTest</samp>, fails. | |||
Launch the JUnit 5 platform to run only the <samp>testFoo</samp> and <samp>testBar</samp> | |||
methods of the <samp>org.myapp.SimpleTest</samp> test class. | |||
</p> | |||
<pre> | |||
@@ -427,8 +432,10 @@ | |||
</junitlauncher></pre> | |||
<p> | |||
Launches the JUnit 5 platform to run only the <samp>testFoo</samp> and <samp>testBar</samp> | |||
methods of the <samp>org.myapp.SimpleTest</samp> test class. | |||
Select any <samp>.class</samp> files that match | |||
the <samp>org/example/**/tests/**/</samp> <code>fileset</code> filter, under | |||
the <samp>${build.classes.dir}</samp> and passes those classes to the JUnit 5 platform for | |||
execution as tests. | |||
</p> | |||
<pre> | |||
@@ -443,10 +450,14 @@ | |||
</junitlauncher></pre> | |||
<p> | |||
Selects any <samp>.class</samp> files that match | |||
Select any <samp>.class</samp> files that match | |||
the <samp>org/example/**/tests/**/</samp> <code>fileset</code> filter, under | |||
the <samp>${build.classes.dir}</samp> and passes those classes to the JUnit 5 platform for | |||
execution as tests. | |||
the <samp>${build.classes.dir}</samp> and pass those classes to the JUnit 5 platform for | |||
execution as tests. Test results will be written out to the <samp>${output.dir}</samp> by | |||
the <q>legacy-xml</q> and <q>legacy-plain</q> formatters, in separate files. Furthermore, both | |||
the <q>legacy-xml</q> and the <q>legacy-plain</q> listeners, above, are configured to receive | |||
the standard output content generated by the tests. The <q>legacy-xml</q> listener is configured | |||
to receive standard error content as well. | |||
</p> | |||
<pre> | |||
@@ -461,16 +472,6 @@ | |||
<listener type="legacy-plain" sendSysOut="true" /> | |||
</testclasses> | |||
</junitlauncher></pre> | |||
<p> | |||
Selects any <samp>.class</samp> files that match | |||
the <samp>org/example/**/tests/**/</samp> <code>fileset</code> filter, under | |||
the <samp>${build.classes.dir}</samp> and passes those classes to the JUnit 5 platform for | |||
execution as tests. Test results will be written out to the <samp>${output.dir}</samp> by | |||
the <q>legacy-xml</q> and <q>legacy-plain</q> formatters, in separate files. Furthermore, both | |||
the <q>legacy-xml</q> and the <q>legacy-plain</q> listeners, above, are configured to receive | |||
the standard output content generated by the tests. The <q>legacy-xml</q> listener is | |||
configured to receive standard error content as well. | |||
</p> | |||
</body> | |||
</html> |
@@ -177,7 +177,11 @@ nested <code><classpath></code> will be used to load the processor.</p> | |||
<p><em>Since Ant 1.9.5</em>. Like for the <a href="../Tasks/style.html#factory">XSLT task</a>, a | |||
nested <code><factory></code> can be used to specify factory settings.</p> | |||
<h3>Example of report</h3> | |||
<h3>Examples</h3> | |||
<p>Generate a <samp>TESTS-TestSuites.xml</samp> file in the directory <samp>reports</samp> and | |||
generate the default framed report in the directory <samp>report/html</samp>.</p> | |||
<pre> | |||
<junitreport todir="./reports"> | |||
<fileset dir="./reports"> | |||
@@ -186,10 +190,9 @@ nested <code><factory></code> can be used to specify factory settings.</p> | |||
<report format="frames" todir="./report/html"/> | |||
</junitreport></pre> | |||
<p>would generate a <samp>TESTS-TestSuites.xml</samp> file in the directory <samp>reports</samp> and | |||
generate the default framed report in the directory <samp>report/html</samp>.</p> | |||
<p>This example requires a file called <samp>junitreport/junit-frames.xsl</samp>. The XSL | |||
parameters <q>key1</q> and <q>key2</q> will be passed to the XSL transformation.</p> | |||
<h3>Example of report with XSL params</h3> | |||
<pre> | |||
<junitreport todir="${outputdir}"> | |||
<fileset dir="${jrdir}"> | |||
@@ -203,8 +206,5 @@ generate the default framed report in the directory <samp>report/html</samp>.</p | |||
</report> | |||
</junitreport></pre> | |||
<p>This example requires a file called <samp>junitreport/junit-frames.xsl</samp>. The XSL | |||
parameters <q>key1</q> and <q>key2</q> will be passed to the XSL transformation.</p> | |||
</body> | |||
</html> |
@@ -100,27 +100,27 @@ collection</a>s.</p> | |||
<h3>Examples</h3> | |||
<p>Store the length of the string <q>foo</q> in the property named <code>length.foo</code>.</p> | |||
<pre><length string="foo" property="length.foo"/></pre> | |||
<p>Stores the length of the string <q>foo</q> in the property named <code>length.foo</code>.</p> | |||
<p>Store the length of file <samp>bar</samp> in the property named <code>length.bar</code>.</p> | |||
<pre><length file="bar" property="length.bar"/></pre> | |||
<p>Stores the length of file <samp>bar</samp> in the property named <code>length.bar</code>.</p> | |||
<p>Store the file paths of <samp>foo</samp> and <samp>bar</samp> and their length into the | |||
property <code>length</code>.</p> | |||
<pre> | |||
<length property="length" mode="each"> | |||
<fileset dir="." includes="foo,bar"/> | |||
</length> | |||
</pre> | |||
<p>Writes the file paths of <samp>foo</samp> and <samp>bar</samp> and their length into the | |||
property <code>length</code>.</p> | |||
<p>Add the length of <samp>foo</samp> and <samp>bar</samp> and store the result in | |||
property <code>length</code>.</p> | |||
<pre> | |||
<length property="length" mode="all"> | |||
<fileset dir="." includes="foo,bar"/> | |||
</length> | |||
</pre> | |||
<p>Adds the length of <samp>foo</samp> and <samp>bar</samp> and stores the result in | |||
property <code>length</code>.</p> | |||
</body> | |||
</html> |
@@ -71,28 +71,32 @@ is not set.</p> | |||
<p>The LoadFile task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p> | |||
<h3>Examples</h3> | |||
<p>Load file <samp>message.txt</samp> into property <code>message</code>; | |||
an <code><echo></code> can print this.</p> | |||
<pre> | |||
<loadfile property="message" | |||
srcFile="message.txt"/></pre> | |||
<p>Load file message.txt into property <code>message</code>; an <code><echo></code> can print | |||
this. This is identical to</p> | |||
<p>The above is identical to</p> | |||
<pre> | |||
<loadresource property="message"> | |||
<file file="message.txt"/> | |||
</loadresource></pre> | |||
<p>Load a file using the Latin-1 encoding</p> | |||
<pre> | |||
<loadfile property="encoded-file" | |||
srcFile="loadfile.xml" | |||
encoding="ISO-8859-1"/></pre> | |||
<p>Load a file using the Latin-1 encoding</p> | |||
<p>Load a file, don't fail if it is missing (a message is printed, though)</p> | |||
<pre> | |||
<loadfile property="optional.value" | |||
srcFile="optional.txt" | |||
failonerror="false"/></pre> | |||
<p>Load a file, don't fail if it is missing (a message is printed, though)</p> | |||
<p>Load a property which can be used as a parameter for another task (in this | |||
case <code>mail</code>), merging lines to ensure this happens.</p> | |||
<pre> | |||
<loadfile property="mail.recipients" | |||
srcFile="recipientlist.txt"> | |||
@@ -100,9 +104,9 @@ this. This is identical to</p> | |||
<<a href="../Types/filterchain.html#striplinebreaks">striplinebreaks</a>/> | |||
</filterchain> | |||
</loadfile></pre> | |||
<p>Load a property which can be used as a parameter for another task (in this | |||
case <code>mail</code>), merging lines to ensure this happens.</p> | |||
<p>Load an XML file into a property, expanding all properties declared in the file in the | |||
process.</p> | |||
<pre> | |||
<loadfile property="system.configuration.xml" | |||
srcFile="configuration.xml"> | |||
@@ -110,8 +114,6 @@ case <code>mail</code>), merging lines to ensure this happens.</p> | |||
<<a href="../Types/filterchain.html#expandproperties">expandproperties</a>/> | |||
</filterchain> | |||
</loadfile></pre> | |||
<p>Load an XML file into a property, expanding all properties declared in the file in the | |||
process.</p> | |||
</body> | |||
</html> |
@@ -96,14 +96,17 @@ resource collection</h4> | |||
<p>for use with the <var>resource</var> attribute.</p> | |||
<h3>Examples</h3> | |||
<p>Load contents of <samp>file.properties</samp> as Ant properties.</p> | |||
<pre><loadproperties srcFile="file.properties"/></pre> | |||
<p>or</p> | |||
<pre> | |||
<loadproperties> | |||
<file file="file.properties"/> | |||
</loadproperties></pre> | |||
<p>Load contents of file.properties as Ant properties.</p> | |||
<p>Read the lines that contain the string <q>import.</q> from the file <samp>file.properties</samp> | |||
and load them as Ant properties.</p> | |||
<pre> | |||
<loadproperties srcFile="file.properties"> | |||
<filterchain> | |||
@@ -112,17 +115,15 @@ resource collection</h4> | |||
</linecontains> | |||
</filterchain> | |||
</loadproperties></pre> | |||
<p>Read the lines that contain the string <q>import.</q> from the file <samp>file.properties</samp> | |||
and load them as Ant properties.</p> | |||
<p>Load contents of <samp>http://example.org/url.properties.gz</samp>, uncompress it on the fly and | |||
load the contents as Ant properties.</p> | |||
<pre> | |||
<loadproperties> | |||
<<a href="../Types/resources.html#gzipresource">gzipresource</a>> | |||
<<a href="../Types/resources.html#url">url</a> url="http://example.org/url.properties.gz"/> | |||
</gzipresource> | |||
</loadproperties></pre> | |||
<p>Load contents of <samp>http://example.org/url.properties.gz</samp>, uncompress it on the fly and | |||
load the contents as Ant properties.</p> | |||
</body> | |||
</html> |
@@ -70,12 +70,13 @@ the property is not set.</p> | |||
<p>The LoadResource task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p> | |||
<h3>Examples</h3> | |||
<p>Load the entry point of Ant's homepage into property <code>homepage</code>; | |||
an <code><echo></code> can print this.</p> | |||
<pre> | |||
<loadresource property="homepage"> | |||
<url url="http://ant.apache.org/index.html"/> | |||
</loadresource></pre> | |||
<p>Load the entry point of Ant's homepage into property <code>homepage</code>; | |||
an <code><echo></code> can print this.</p> | |||
<p>For more examples see the <a href="loadfile.html">loadfile</a> task.</p> | |||
@@ -274,14 +274,21 @@ or more nested header elements:</p> | |||
<h3>Examples</h3> | |||
<p>Send an email from <q>me</q> to <q>you</q> with a subject of <q>Results of nightly build</q> and | |||
include the contents of the file <samp>build.log</samp> in the body of the message.</p> | |||
<pre> | |||
<mail from="me" | |||
tolist="you" | |||
subject="Results of nightly build" | |||
files="build.log"/></pre> | |||
<p>Sends an email from <q>me</q> to <q>you</q> with a subject of <q>Results of nightly build</q> and | |||
includes the contents of the file <samp>build.log</samp> in the body of the message.</p> | |||
<p>Send an email from <q>config@myisp.com</q> to <q>all@xyz.com</q> with a subject of <q>Test | |||
Build</q>. Replies to this email will go to <q>me@myisp.com</q>. Any zip files from | |||
the <samp>dist</samp> directory are attached. The 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. <samp>${buildname}</samp> will be replaced with the <code>buildname</code> property's | |||
value.</p> | |||
<pre> | |||
<mail mailhost="smtp.myisp.com" mailport="1025" subject="Test build"> | |||
@@ -296,12 +303,8 @@ includes the contents of the file <samp>build.log</samp> in the body of the mess | |||
</attachments> | |||
</mail></pre> | |||
<p>Sends an eMail from <q>config@myisp.com</q> to <q>all@xyz.com</q> with a subject of <q>Test | |||
Build</q>. Replies to this email will go to <q>me@myisp.com</q>. Any zip files from | |||
the <samp>dist</samp> directory are attached. The 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. <samp>${buildname}</samp> will be replaced with the <code>buildname</code> property's | |||
value.</p> | |||
<p>Send an email from <q>me@myisp.com</q> to <q>all@xyz.com</q> with a subject of <q>Test Build</q>, | |||
the message body being coded in UTF-8. | |||
<pre> | |||
<property name="line2" value="some_international_message"/> | |||
@@ -313,8 +316,5 @@ value.</p> | |||
<message>some international text:${line2}</message> | |||
</mail></pre> | |||
<p>Sends an eMail from <q>me@myisp.com</q> to <q>all@xyz.com</q> with a subject of <q>Test | |||
Build</q>, the message body being coded in UTF-8. | |||
</body> | |||
</html> |
@@ -71,14 +71,17 @@ them.</p> | |||
<h4><strong>path</strong> (org.apache.tools.ant.types.Path)</h4> | |||
<p>Add a path to the URL. All elements in the path will be converted to individual URL entries.</p> | |||
<h3>Examples</h3> | |||
<pre><makeurl file="${user.home}/.m2/repository" property="m2.repository.url"/></pre> | |||
<p>Sets the property <code>m2.repository.url</code> to the file: URL of the local Maven2 | |||
<p>Set the property <code>m2.repository.url</code> to the file: URL of the local Maven2 | |||
repository.</p> | |||
<pre><makeurl file="${user.home}/.m2/repository" property="m2.repository.url"/></pre> | |||
<p>Set the property <code>codebase</code> to the three URLs of the files provided as nested | |||
elements.</p> | |||
<pre><makeurl property="codebase"> | |||
<fileset dir="lib includes="*.jar"/> | |||
</makeurl></pre> | |||
<p>Set the property <code>codebase</code> to the three URLs of the files provided as nested | |||
elements.</p> | |||
</body> | |||
</html> |
@@ -131,6 +131,13 @@ sections.</p> | |||
<h3>Examples</h3> | |||
<p>Create or replace the file <samp>MANIFEST.MF</samp>. Note that the <code>Built-By</code> | |||
attribute will take the value of the Ant property <code>${user.name}</code>. The same is true for | |||
the <code>${version}</code> and <code>${TODAY}</code> properties. This example produces | |||
a <samp>MANIFEST.MF</samp> that | |||
contains <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779" | |||
target="_top">package version identification</a> for the package <samp>common</samp>.</p> | |||
<pre> | |||
<manifest file="MANIFEST.MF"> | |||
<attribute name="Built-By" value="${user.name}"/> | |||
@@ -147,13 +154,6 @@ sections.</p> | |||
</section> | |||
</manifest></pre> | |||
<p>Creates or replaces the file <samp>MANIFEST.MF</samp>. Note that the <code>Built-By</code> | |||
attribute will take the value of the Ant property <code>${user.name}</code>. The same is true for | |||
the <code>${version}</code> and <code>${TODAY}</code> properties. This example produces | |||
a <samp>MANIFEST.MF</samp> that | |||
contains <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/versioning/spec/versioning2.html#wp90779" | |||
target="_top">package version identification</a> for the package <samp>common</samp>.</p> | |||
<p>The manifest produced by the above would look like this:</p> | |||
<pre> | |||
@@ -84,15 +84,17 @@ a path defined elsewhere using the <code><classpath refid="pathid"/ | |||
This classpath must not be empty, and is required.</p> | |||
<h3>Examples</h3> | |||
<p>Assuming a path with <var>id</var>=<q>classpath</q> was already defined, convert this path | |||
relatively to the <samp>build/</samp> directory that will contain <samp>acme.jar</samp>, 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> | |||
<pre> | |||
<manifestclasspath property="jar.classpath" | |||
jarfile="build/acme.jar"> | |||
<classpath refid="classpath"/> | |||
</manifestclasspath></pre> | |||
<p>Assuming a path with <var>id</var> <q>classpath</q> was already defined, convert this path | |||
relatively to the <samp>build/</samp> directory that will contain <samp>acme.jar</samp>, 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> | |||
</body> | |||
</html> |
@@ -92,11 +92,12 @@ Activation Framework</a> are required for this task.</p> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p><strong>Send a single HTML file as the body of a message</strong></p> | |||
<p>Send a single HTML file as the body of a message</p> | |||
<pre> | |||
<mimemail messageMimeType="text/html" messageFile="overview-summary.html" | |||
tolist="you" subject="JUnit Test Results: ${TODAY}" from="me"/></pre> | |||
<p><strong>Sends all files in a directory as attachments</strong></p> | |||
<p>Send all files in a directory as attachments</p> | |||
<pre> | |||
<mimemail message="See attached files" tolist="you" subject="Attachments" from="me"> | |||
<fileset dir="."> | |||
@@ -41,11 +41,14 @@ nothing if the directory already exist.</p> | |||
<td>Yes</td> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Create a directory <code>${dist}</code>.</p> | |||
<pre><mkdir dir="${dist}"/></pre> | |||
<p>creates a directory <code>${dist}</code>.</p> | |||
<p>Create a directory <code>${dist}/lib</code>.</p> | |||
<pre><mkdir dir="${dist}/lib"/></pre> | |||
<p>creates a directory <code>${dist}/lib</code>.</p> | |||
</body> | |||
</html> |
@@ -169,18 +169,21 @@ the same <code><move></code> task, all <code><filterchain></code> el | |||
first followed by <code><filterset></code> elements.</p> | |||
<h3>Examples</h3> | |||
<p><strong>Move a single file (rename a file)</strong></p> | |||
<p>Move a single file (rename a file)</p> | |||
<pre><move file="file.orig" tofile="file.moved"/></pre> | |||
<p><strong>Move a single file to a directory</strong></p> | |||
<p>Move a single file to a directory</p> | |||
<pre><move file="file.orig" todir="dir/to/move/to"/></pre> | |||
<p><strong>Move a directory to a new directory</strong></p> | |||
<p>Move a directory to a new directory</p> | |||
<pre> | |||
<move todir="new/dir/to/move/to"> | |||
<fileset dir="src/dir"/> | |||
</move></pre> | |||
<p>or, <em>since Ant 1.6.3</em>:</p> | |||
<pre><move file="src/dir" tofile="new/dir/to/move/to"/></pre> | |||
<p><strong>Move a set of files to a new directory</strong></p> | |||
<p>Move a set of files to a new directory</p> | |||
<pre> | |||
<move todir="some/new/dir"> | |||
<fileset dir="my/src/dir"> | |||
@@ -188,7 +191,8 @@ first followed by <code><filterset></code> elements.</p> | |||
<exclude name="**/ant.jar"/> | |||
</fileset> | |||
</move></pre> | |||
<p><strong>Move a list of files to a new directory</strong></p> | |||
<p>Move a list of files to a new directory</p> | |||
<pre> | |||
<move todir="some/new/dir"> | |||
<filelist dir="my/src/dir"> | |||
@@ -196,8 +200,8 @@ first followed by <code><filterset></code> elements.</p> | |||
<file name="file2.txt"/> | |||
</filelist> | |||
</move></pre> | |||
<p><strong>Append <code>".bak"</code> to the names of all files in a | |||
directory.</strong></p> | |||
<p>Append <code>".bak"</code> to the names of all files in a directory.</p> | |||
<pre> | |||
<move todir="my/src/dir" includeemptydirs="false"> | |||
<fileset dir="my/src/dir"> | |||
@@ -174,21 +174,19 @@ element of that type can be used as an alternative to the <var>implementation</v | |||
<h3>Examples</h3> | |||
<p>Convert all files in the directory <samp>srcdir</samp> ending in <samp>.eucjis</samp> from the | |||
EUCJIS encoding to ASCII and rename them to end in <samp>.java</samp>.</p> | |||
<pre> | |||
<native2ascii encoding="EUCJIS" src="srcdir" dest="srcdir" | |||
includes="**/*.eucjis" ext=".java"/></pre> | |||
<p>Converts all files in the directory <samp>srcdir</samp> ending in <samp>.eucjis</samp> from the | |||
EUCJIS encoding to ASCII and renames them to end in <samp>.java</samp>.</p> | |||
<p>Convert all the files ending in <samp>.java</samp> in the directory <samp>native/japanese</samp> | |||
to ASCII, placing the results in the directory <samp>src</samp>. The names of the files remain the | |||
same.</p> | |||
<pre> | |||
<native2ascii encoding="EUCJIS" src="native/japanese" dest="src" | |||
includes="**/*.java"/></pre> | |||
<p>Converts all the files ending in <samp>.java</samp> in the directory <samp>native/japanese</samp> | |||
to ASCII, placing the results in the directory <samp>src</samp>. The names of the files remain the | |||
same.</p> | |||
<p>If you want to use a | |||
custom <code class="code">Native2AsciiAdapter</code> <code>org.example.MyAdapter</code> you can | |||
either use the implementation attribute:</p> | |||
@@ -47,15 +47,19 @@ | |||
<td>No</td> | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><nice newpriority="10"/></pre> | |||
<p>Set the Thread priority to 10 (highest).</p> | |||
<pre><nice currentpriority="priority"/></pre> | |||
<pre><nice newpriority="10"/></pre> | |||
<p>Store the current Thread priority in the user property <code>priority</code>.</p> | |||
<pre><nice currentpriority="currentpriority" newpriority="1"/></pre> | |||
<pre><nice currentpriority="priority"/></pre> | |||
<p>Set the current Thread priority to 1 (lowest), storing the original priority in the user | |||
property <code>currentpriority</code>. This can be used to set the priority back to its original | |||
property <code>currentpriority</code>. This can be used to set the priority back to its original | |||
value later.</p> | |||
<pre><nice currentpriority="currentpriority" newpriority="1"/></pre> | |||
</body> | |||
</html> |
@@ -64,12 +64,13 @@ See <a href="../install.html#librarydependencies">Library Dependencies</a> for m | |||
<pre><gzip src="test.tar" destfile="test.tar.gz"/></pre> | |||
<pre><bzip2 src="test.tar" destfile="test.tar.bz2"/></pre> | |||
<pre><xz src="test.tar" destfile="test.tar.xz"/></pre> | |||
<p>Download <samp>http://example.org/archive.tar</samp> and compress it | |||
to <samp>archive.tar.gz</samp> in the project's <var>basedir</var> on the fly.</p> | |||
<pre> | |||
<gzip destfile="archive.tar.gz"> | |||
<url url="http://example.org/archive.tar"/> | |||
</gzip></pre> | |||
<p>downloads <samp>http://example.org/archive.tar</samp> and compresses it | |||
to <samp>archive.tar.gz</samp> in the project's <var>basedir</var> on the fly.</p> | |||
</body> | |||
</html> |
@@ -136,6 +136,16 @@ reported.</p> | |||
from Ant. By using <code><daemons></code> such servers do not halt the build.</p> | |||
<h3>Examples</h3> | |||
<p>This is a typical pattern for testing a server application. In one thread the server is started | |||
(the <code><wlrun></code> task). The other thread consists of a three tasks which are | |||
performed in sequence. The <code><sleep></code> task is used to give the server time to come | |||
up. Another task which is capable of validating that the server is available could be used in place | |||
of the <code><sleep></code> task. The <code><junit></code> test harness then runs, again | |||
in its own JVM. Once the tests are complete, the server is stopped | |||
(using <code><wlstop></code> in this example), allowing both threads to | |||
complete. The <code><parallel></code> task will also complete at this time and the build will | |||
then continue.</p> | |||
<pre> | |||
<parallel> | |||
<wlrun ... > | |||
@@ -145,15 +155,14 @@ from Ant. By using <code><daemons></code> such servers do not halt the bui | |||
<wlstop/> | |||
</sequential> | |||
</parallel></pre> | |||
<p>This example represents a typical pattern for testing a server application. In one thread the | |||
server is started (the <code><wlrun></code> task). The other thread consists of a three tasks | |||
which are performed in sequence. The <code><sleep></code> task is used to give the server time | |||
to come up. Another task which is capable of validating that the server is available could be used | |||
in place of the <code><sleep></code> task. The <code><junit></code> test harness then | |||
runs, again in its own JVM. Once the tests are complete, the server is stopped | |||
(using <code><wlstop></code> in this example), allowing both threads to complete. The | |||
<code><parallel></code> task will also complete at this time and the build will then | |||
continue.</p> | |||
<p>Here, two independent tasks run to achieve better resource utilization during the build. In this | |||
instance, some servlets are being compiled in one thread and a set of JSPs is being precompiled in | |||
another. Developers need to be careful that the two tasks are independent, both in terms of their | |||
dependencies and in terms of their potential interactions in Ant's external environment. Here we | |||
set <var>fork</var>=<q>true</q> for the <code><javac></code> task, so that it runs in a new | |||
process; if the <code><wljspc></code> task used the <kbd>javac</kbd> compiler in-VM (it may), | |||
concurrency problems may arise.</p> | |||
<pre> | |||
<parallel> | |||
@@ -161,13 +170,12 @@ continue.</p> | |||
<wljspc ...> <!-- precompile JSPs --> | |||
</parallel></pre> | |||
<p>This example shows two independent tasks being run to achieve better resource utilization during | |||
the build. In this instance, some servlets are being compiled in one thread and a set of JSPs is | |||
being precompiled in another. Developers need to be careful that the two tasks are independent, both | |||
in terms of their dependencies and in terms of their potential interactions in Ant's external | |||
environment. Here we set <var>fork</var>=<q>true</q> for the <code><javac></code> task, so | |||
that it runs in a new process; if the <code><wljspc></code> task used the <kbd>javac</kbd> | |||
compiler in-VM (it may), concurrency problems may arise.</p> | |||
<p>This example represents a typical need for use of the <var>threadCount</var> | |||
and <var>threadsPerProcessor</var> attributes. Spinning up all 40 of those tasks could cripple the | |||
system for memory and CPU time. By limiting the number of concurrent executions you can reduce | |||
contention for CPU, memory and disk IO, and so actually finish faster. This is also a good candidate | |||
for use of <var>threadCount</var> (and possibly <var>threadsPerProcessor</var>) because each task is | |||
independent (every new JVM is forked) and has no dependencies on the other tasks.</p> | |||
<pre> | |||
<macrodef name="dbpurge"> | |||
@@ -191,12 +199,5 @@ compiler in-VM (it may), concurrency problems may arise.</p> | |||
<!-- repeated about 40 times --> | |||
</parallel></pre> | |||
<p>This example represents a typical need for use of the <var>threadCount</var> | |||
and <var>threadsPerProcessor</var> attributes. Spinning up all 40 of those tasks could cripple the | |||
system for memory and CPU time. By limiting the number of concurrent executions you can reduce | |||
contention for CPU, memory and disk IO, and so actually finish faster. This is also a good | |||
candidate for use of <var>threadCount</var> (and possibly <var>threadsPerProcessor</var>) because | |||
each task is independent (every new JVM is forked) and has no dependencies on the other tasks.</p> | |||
</body> | |||
</html> |
@@ -88,16 +88,18 @@ | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><patch patchfile="module.1.0-1.1.patch"/></pre> | |||
<p>applies the diff included in <samp>module.1.0-1.1.patch</samp> to the files in base directory | |||
<p>Apply the diff included in <samp>module.1.0-1.1.patch</samp> to the files in base directory | |||
guessing the filename(s) from the diff output.</p> | |||
<pre><patch patchfile="module.1.0-1.1.patch"/></pre> | |||
<p>Here, one leading directory part will be removed:</p> | |||
<pre><patch patchfile="module.1.0-1.1.patch" strip="1"/></pre> | |||
<p>like above but one leading directory part will be removed. i.e. if the diff output looked | |||
like</p> | |||
<p>i.e. if the diff output looked like</p> | |||
<pre> | |||
--- a/mod1.0/A Mon Jun 5 17:28:41 2000 | |||
+++ a/mod1.1/A Mon Jun 5 17:28:49 2000</pre> | |||
the leading <samp>a/</samp> will be stripped. | |||
<p>the leading <samp>a/</samp> will be stripped.</p> | |||
</body> | |||
</html> |
@@ -126,6 +126,7 @@ specified to perform any of various filename transformations (<em>since Ant 1.6. | |||
value <samp>d:\weblogic</samp>, and <samp>${wl.home.unix}</samp> has the | |||
value <samp>/weblogic</samp>.</p> | |||
<h4>Example 1</h4> | |||
<p>Here, the task</p> | |||
<pre> | |||
<path id="wl.path"> | |||
<pathelement location="${wl.home}/lib/weblogicaux.jar"/> | |||
@@ -157,23 +158,24 @@ named <code>wl.path.unix</code>.</p> | |||
<pre class="output">/usr/local/ant/lib/njavac.jar:/usr/local/ant/lib/xproperty.jar</pre> | |||
<h4>Example 3</h4> | |||
<p>Here, the names of files determined by the fileset (all files ending in <samp>.java</samp>) are | |||
joined separated by comma, and the resulting list is placed into the | |||
property <code>javafiles</code>. The directory separator is not specified, so it defaults to the | |||
appropriate character for the current platform. Such a list could then be used in another task, | |||
like <code>javadoc</code>, that requires a comma separated list of files.</p> | |||
<pre> | |||
<fileset dir="${src.dir}" id="src.files"> | |||
<include name="**/*.java"/> | |||
</fileset> | |||
<pathconvert pathsep="," property="javafiles" refid="src.files"/></pre> | |||
<p>This example takes the set of files determined by the fileset (all files ending | |||
in <samp>.java</samp>), joins them together separated by commas, and places the resulting list into | |||
the property <code>javafiles</code>. The directory separator is not specified, so it defaults to | |||
the appropriate character for the current platform. Such a list could then be used in another task, | |||
like <code>javadoc</code>, that requires a comma separated list of files.</p> | |||
<h4>Example 4</h4> | |||
<p>This task sets the property <code>prop</code> to <q>def|ghi</q> on Windows and on Unix.</p> | |||
<pre> | |||
<pathconvert property="prop" dirsep="|"> | |||
<map from="${basedir}/abc/" to=""/> | |||
<path location="abc/def/ghi"/> | |||
</pathconvert></pre> | |||
<p>This example sets the property <code>prop</code> to <q>def|ghi</q> on Windows and on Unix.</p> | |||
</body> | |||
</html> |
@@ -205,57 +205,56 @@ a <a href="../using.html#path">path-like structure</a> and can also be set via a | |||
nested <code>classpath</code> element.</p> | |||
<h3>Examples</h3> | |||
<p>Set the property <code>foo.dist</code> to the value <q>dist</q>.</p> | |||
<pre><property name="foo.dist" value="dist"/></pre> | |||
<p>sets the property <code>foo.dist</code> to the value <q>dist</q>.</p> | |||
<p>Set the property <code>foo.dist</code> to the value <q>dist</q>.</p> | |||
<pre><property name="foo.dist">dist</property></pre> | |||
<p>sets the property <code>foo.dist</code> to the value <q>dist</q>.</p> | |||
<p>Read a set of properties from a file called <samp>foo.properties</samp>.</p> | |||
<pre><property file="foo.properties"/></pre> | |||
<p>reads a set of properties from a file called <samp>foo.properties</samp>.</p> | |||
<pre><property url="http://www.mysite.com/bla/props/foo.properties"/></pre> | |||
<p>reads a set of properties from the | |||
<p>Read a set of properties from the | |||
address <samp>http://www.mysite.com/bla/props/foo.properties</samp>.</p> | |||
<pre><property url="http://www.mysite.com/bla/props/foo.properties"/></pre> | |||
<p>Read a set of properties from a resource called <samp>foo.properties</samp>.</p> | |||
<pre><property resource="foo.properties"/></pre> | |||
<p>reads a set of properties from a resource called <samp>foo.properties</samp>.</p> | |||
<p>Note that you can reference a global properties file for all of your Ant builds using the | |||
following:</p> | |||
<pre><property file="${user.home}/.ant-global.properties"/></pre> | |||
<p>since the <code>user.home</code> property is defined by JVM to be your home directory. Where | |||
<p>since the <code>user.home</code> property is defined by JVM to be your home directory. Where | |||
the <code>user.home</code> property resolves to in the file system depends on the operating system | |||
version and the JVM implementation. On Unix based systems, this will map to the user's home | |||
directory. On modern Windows variants, this will most likely resolve to the user's directory in | |||
the <samp>Documents and Settings</samp> or <samp>Users</samp> folder. Older Windows variants such as | |||
Windows 98/ME are less predictable, as are other operating system/JVM combinations.</p> | |||
<p>Read the system environment variables and stores them in properties, prefixed | |||
with <q>env</q>. Note that this only works on <em>select</em> operating systems. Two of the values | |||
are shown being echoed.</p> | |||
<pre> | |||
<property environment="env"/> | |||
<echo message="Number of Processors = ${env.NUMBER_OF_PROCESSORS}"/> | |||
<echo message="ANT_HOME is set to = ${env.ANT_HOME}"/></pre> | |||
<p>reads the system environment variables and stores them in properties, prefixed with <q>env</q>. | |||
Note that this only works on <em>select</em> operating systems. Two of the values are shown being | |||
echoed. | |||
</p> | |||
<pre> | |||
<property environment="env"/> | |||
<property file="${user.name}.properties"/> | |||
<property file="${env.STAGE}.properties"/> | |||
<property file="build.properties"/></pre> | |||
<p>This buildfile uses the properties defined in <samp>build.properties</samp>. Regarding to the | |||
environment variable <code>STAGE</code> some or all values could be overwritten, | |||
e.g. having <code>STAGE=test</code> and a <samp>test.properties</samp> you have special values for | |||
that (like another name for the test server). Finally all these values could be overwritten by | |||
personal settings with a file per user.</p> | |||
<pre> | |||
<property environment="env"/> | |||
<property file="${user.name}.properties"/> | |||
<property file="${env.STAGE}.properties"/> | |||
<property file="build.properties"/></pre> | |||
<p>Store the relative path in <code>foo</code>: <samp>../my/file.txt</samp></p> | |||
<pre><property name="foo" location="my/file.txt" relative="true" basedir=".."/></pre> | |||
<p>Stores the relative path in <code>foo</code>: <samp>../my/file.txt</samp></p> | |||
<p>Store the relative path in <code>foo</code>: <samp>cvs/my/file.txt</samp></p> | |||
<pre><property name="foo" location="my/file.txt" relative="true" basedir="cvs"/></pre> | |||
<p>Stores the relative path in <code>foo</code>: <samp>cvs/my/file.txt</samp></p> | |||
<h3>Property files</h3> | |||
@@ -53,11 +53,12 @@ | |||
</tr> | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><rename src="foo.jar" dest="${name}-${version}.jar"/></pre> | |||
<p>Renames the file <samp>foo.jar</samp> to <samp>${name}-${version}.jar</samp> | |||
<p>Rename the file <samp>foo.jar</samp> to <samp>${name}-${version}.jar</samp> | |||
(assuming <code>name</code> and <code>version</code> being predefined properties). If a file | |||
named <samp>${name}-${version}.jar</samp> already exists, it will be removed prior to | |||
renaming <samp>foo.jar</samp>.</p> | |||
<pre><rename src="foo.jar" dest="${name}-${version}.jar"/></pre> | |||
</body> | |||
</html> |
@@ -201,6 +201,10 @@ the <code><replace></code> attribute <var>value</var> 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> | |||
<p>In file <samp>configure.sh</samp>, replace all instances of <q>@token1@</q> | |||
with <q>defaultvalue</q>, all instances of <q>@token2@</q> with <q>value2</q>, and all instances | |||
of <q>@token3@</q> with the value of the property <code>property.key</code>, as it appears in | |||
property file <samp>src/name.properties</samp>.</p> | |||
<pre> | |||
<replace file="configure.sh" | |||
value="defaultvalue" | |||
@@ -215,10 +219,6 @@ these options, the token is replaced with an empty string.</p> | |||
<replacevalue>value4</replacevalue> | |||
</replacefilter> | |||
</replace></pre> | |||
<p>In file <samp>configure.sh</samp>, replace all instances of <q>@token1@</q> | |||
with <q>defaultvalue</q>, all instances of <q>@token2@</q> with <q>value2</q>, and all instances | |||
of <q>@token3@</q> with the value of the property <code>property.key</code>, as it appears in | |||
property file <samp>src/name.properties</samp>.</p> | |||
<p><strong>Note</strong>: It is possible to use either | |||
the <var>token</var>/<code><replacetoken></code> | |||
and <var>value</var>/<code><replacevalue></code> attributes/elements, the | |||
@@ -123,6 +123,9 @@ instance.</p> | |||
<h3>Examples</h3> | |||
<p>Replace occurrences of the property name <q>OldProperty</q> with <q>NewProperty</q> in a | |||
properties file, preserving the existing value, in all files ending in <samp>.properties</samp> in | |||
the current directory:</p> | |||
<pre> | |||
<replaceregexp byline="true"> | |||
<regexp pattern="OldProperty=(.*)"/> | |||
@@ -131,42 +134,37 @@ instance.</p> | |||
<include name="*.properties"/> | |||
</fileset> | |||
</replaceregexp></pre> | |||
<p>replaces occurrences of the property name <q>OldProperty</q> with <q>NewProperty</q> in a | |||
properties file, preserving the existing value, in all files ending in <samp>.properties</samp> in | |||
the current directory</p> | |||
<p>Replace all whitespaces (blanks, tabs, etc) by one blank remaining the line separator:</p> | |||
<pre> | |||
<replaceregexp match="\s+" replace=" " flags="g" byline="true"> | |||
<fileset dir="${html.dir}" includes="**/*.html"/> | |||
</replaceregexp></pre> | |||
<p>replaces all whitespaces (blanks, tabs, etc) by one blank remaining the line separator. So with | |||
input</p> | |||
<p>Then, input</p> | |||
<pre> | |||
<html> <body> | |||
<<TAB>><h1> T E S T </h1> <<TAB>> | |||
<<TAB>> </body></html></pre> | |||
<p>would converted to</p> | |||
<p>is converted to</p> | |||
<pre> | |||
<html> <body> | |||
<h1> T E S T </h1> </body></html></pre> | |||
<br/><!-- small distance from code of the previous example --> | |||
<p>The task</p> | |||
<pre> | |||
<replaceregexp match="\\n" replace="${line.separator}" flags="g" byline="true"> | |||
<fileset dir="${dir}"/> | |||
</replaceregexp></pre> | |||
<p>replaces all <q>\n</q> markers (beware the quoting of the backslash) by a line break. So with | |||
<p>replaces all <q>\n</q> markers (beware the quoting of the backslash) by a line break. Then, | |||
input</p> | |||
<pre>one\ntwo\nthree</pre> | |||
<p>would converted to</p> | |||
<p>is converted to</p> | |||
<pre> | |||
one | |||
two | |||
three</pre> | |||
<p>Beware that inserting line breaks could break file syntax. For example in xml:</p> | |||
<p>Beware that inserting line breaks could break file syntax. For example in XML:</p> | |||
<pre> | |||
<root> | |||
<text>line breaks \n should work in text</text> | |||
@@ -74,13 +74,16 @@ a <code>condition</code>.</p> | |||
via a nested element or the <var>refid</var> attribute.</p> | |||
<h3>Examples</h3> | |||
<p>Store the number of resources in the specified filelist (two files) in the property | |||
named <samp>count.foo</samp>.</p> | |||
<pre> | |||
<resourcecount property="count.foo"> | |||
<filelist dir="." files="foo,bar"/> | |||
</resourcecount></pre> | |||
<p>Stores the number of resources in the specified filelist (two) in the property | |||
named <samp>count.foo</samp>.</p> | |||
<p>Store the number of lines of the current buildfile in the | |||
property <code>file.lines</code>. Requires Ant 1.7.1+ as <code><concat></code> has to be a | |||
resource.</p> | |||
<pre> | |||
<project> | |||
<property name="file" value="${ant.file}"/> | |||
@@ -98,8 +101,6 @@ named <samp>count.foo</samp>.</p> | |||
</resourcecount> | |||
<echo>The file '${file}' has ${file.lines} lines.</echo> | |||
</project></pre> | |||
<p>Stores the number of lines of the current buildfile in the property <code>file.lines</code>. | |||
Requires Ant 1.7.1+ as <code><concat></code> has to be a resource.</p> | |||
</body> | |||
</html> |
@@ -51,12 +51,12 @@ a <code>BuildException</code> is thrown.</p> | |||
<p>Any valid Ant task may be embedded within the retry task.</p> | |||
<h3>Example</h3> | |||
<p>This example shows how to use <code><retry></code> to wrap a task which must interact with | |||
an unreliable network resource.</p> | |||
<pre> | |||
<retry retrycount="3"> | |||
<get src="http://www.unreliable-server.com/unreliable.tar.gz" | |||
dest="/home/retry/unreliable.tar.gz"/> | |||
</retry></pre> | |||
<p>This example shows how to use <code><retry></code> to wrap a task which must interact with | |||
an unreliable network resource.</p> | |||
</body> | |||
</html> |
@@ -297,13 +297,15 @@ using one of the built-in compilers.</p> | |||
can be used as an alternative to the <var>compiler</var> attribute.</p> | |||
<h3>Examples</h3> | |||
<pre><rmic classname="com.xyz.FooBar" base="${build}/classes"/></pre> | |||
<p>runs the <kbd>rmic</kbd> compiler for the class <code>com.xyz.FooBar</code>. The compiled files | |||
<p>Run the <kbd>rmic</kbd> compiler for the class <code>com.xyz.FooBar</code>. The compiled files | |||
will be stored in the directory <samp>${build}/classes</samp>.</p> | |||
<pre><rmic base="${build}/classes" includes="**/Remote*.class"/></pre> | |||
<p>runs the <kbd>rmic</kbd> compiler for all classes with <samp>.class</samp> files | |||
<pre><rmic classname="com.xyz.FooBar" base="${build}/classes"/></pre> | |||
<p>Run the <kbd>rmic</kbd> compiler for all classes with <samp>.class</samp> files | |||
below <samp>${build}/classes</samp> whose classname starts with <code>Remote</code>. The compiled | |||
files will be stored in the directory <samp>${build}/classes</samp>.</p> | |||
<pre><rmic base="${build}/classes" includes="**/Remote*.class"/></pre> | |||
<p>If you want to use a custom RmicAdapter <code>org.example.MyAdapter</code> you can either use | |||
the <var>compiler</var> attribute:</p> | |||
@@ -216,11 +216,17 @@ properties</a>. Properties can be used to set the schema used to validate the XM | |||
</table> | |||
<h3>Examples</h3> | |||
<p>Validate a document against an XML schema. The document does not declare any schema itself, which | |||
is why the <var>noNamespaceFile</var> is needed.</p> | |||
<pre> | |||
<schemavalidate noNamespaceFile="document.xsd" | |||
file="xml/endpiece.xml"/></pre> | |||
<p>Validate a document against an XML schema. The document does not declare any schema itself, which | |||
is why the <var>noNamespaceFile</var> is needed.</p> | |||
<p>Declare a new preset task, <code><validate-soap></code>, that validates XSD and WSDL | |||
documents against the relevant specifications. To validate XSD documents, you also | |||
need <samp>XMLSchema.dtd</samp> and <samp>datatypes.dtd</samp> in the same directory | |||
as <samp>XMLSchema.xsd</samp>, or pointed to via the catalog. All these files can be fetched | |||
from <a href="https://www.w3.org/2001/XMLSchema" target="_top">W3C</a>.</p> | |||
<pre> | |||
<presetdef name="validate-soap"> | |||
<schemavalidate> | |||
@@ -234,13 +240,9 @@ is why the <var>noNamespaceFile</var> is needed.</p> | |||
file="${soap.dir}/XMLSchema.xsd"/> | |||
</schemavalidate> | |||
</presetdef></pre> | |||
<p>Declare a new preset task, <code><validate-soap></code>, that validates XSD and WSDL | |||
documents against the relevant specifications. To validate XSD documents, you also | |||
need <samp>XMLSchema.dtd</samp> and <samp>datatypes.dtd</samp> in the same directory | |||
as <samp>XMLSchema.xsd</samp>, or pointed to via the catalog. All these files can be fetched | |||
from <a href="https://www.w3.org/2001/XMLSchema" target="_top">W3C</a>.</p> | |||
<pre><validate-soap file="xml/test.xsd"/></pre> | |||
<p>Use the preset task defined above to validate an XML Schema document.</p> | |||
<pre><validate-soap file="xml/test.xsd"/></pre> | |||
</body> | |||
</html> |
@@ -210,39 +210,41 @@ set.</p> | |||
<p>Prior to Ant 1.9.7 only <code><fileset></code> has been supported as a nested element.</p> | |||
<h3>Examples</h3> | |||
<p><strong>Copy a single local file to a remote machine</strong></p> | |||
<p>Copy a single local file to a remote machine:</p> | |||
<pre><scp file="myfile.txt" todir="user:password@somehost:/home/chuck"/></pre> | |||
<p><strong>Copy a single local file to a remote machine with separate <var>password</var> | |||
attribute</strong></p> | |||
<p>Copy a single local file to a remote machine with separate <var>password</var> | |||
attribute:</p> | |||
<pre><scp file="myfile.txt" todir="user@somehost:/home/chuck" password="password"/></pre> | |||
<p><strong>Copy a single local file to a remote machine using key base authentication.</strong></p> | |||
<p>Copy a single local file to a remote machine using key base authentication:</p> | |||
<pre> | |||
<scp file="myfile.txt" | |||
todir="user@somehost:/home/chuck" | |||
keyfile="${user.home}/.ssh/id_dsa" | |||
passphrase="my extremely secret passphrase"/></pre> | |||
<p><strong>Copy a single remote file to a local directory</strong></p> | |||
<p>Copy a single remote file to a local directory:</p> | |||
<pre><scp file="user:password@somehost:/home/chuck/myfile.txt" todir="../some/other/dir"/></pre> | |||
<p><strong>Copy a remote directory to a local directory</strong></p> | |||
<p>Copy a remote directory to a local directory:</p> | |||
<pre><scp file="user:password@somehost:/home/chuck/*" todir="/home/sara"/></pre> | |||
<p><strong>Copy a local directory to a remote directory</strong></p> | |||
<p>Copy a local directory to a remote directory:</p> | |||
<pre> | |||
<scp todir="user:password@somehost:/home/chuck/"> | |||
<fileset dir="src_dir"/> | |||
</scp></pre> | |||
<p><strong>Copy a set of files to a directory</strong></p> | |||
<p>Copy a set of files to a directory:</p> | |||
<pre> | |||
<scp todir="user:password@somehost:/home/chuck"> | |||
<fileset dir="src_dir"> | |||
<include name="**/*.java"/> | |||
</fileset> | |||
</scp></pre> | |||
<p><strong>Copy a set of files to a remote directory in reverse last-modified order</strong></p> | |||
<p>Copy a set of files to a remote directory in reverse last-modified order:</p> | |||
<pre> | |||
<scp todir="user:password@somehost:/home/chuck"> | |||
<sort> | |||
@@ -259,6 +261,7 @@ attribute</strong></p> | |||
can be a serious security hole. Consider using variable substitution and include the password on | |||
the command line. For example:</p> | |||
<pre><scp todir="${username}:${password}@host:/dir" ...></pre> | |||
<p>Invoking Ant with the following command line:</p> | |||
<pre class="input">ant -Dusername=me -Dpassword=mypassword target1 target2</pre> | |||
<p>is slightly better, but the username/password is exposed to all users on an Unix system (via | |||
@@ -183,10 +183,8 @@ file.</p> | |||
</classpath> | |||
System.out.println("Hello world"); | |||
</script></pre> | |||
<p> | |||
The following script uses JavaScript to create a number of | |||
<code>echo</code> tasks and execute them. | |||
</p> | |||
<p>The following script uses JavaScript to create a number of <code>echo</code> tasks and execute | |||
them.</p> | |||
<pre> | |||
<project name="squares" default="main" basedir="."> | |||
<target name="main"> | |||
@@ -267,17 +265,17 @@ of all files a <code><fileset/></code> caught.</p> | |||
import. Rhino knows two different methods for import statements: one for packages and one for a | |||
single class. By default only the <code>java</code> packages are available, | |||
so <code class="code">java.lang.System</code> can be directly imported | |||
with <code>importClass/importPackage</code>. For other packages you have to prefix the full | |||
classified name with <strong>Packages</strong>. For example Ant's <code>FileUtils</code> class can | |||
be imported | |||
with <code>importClass</code>/<code>importPackage</code>. For other packages you have to prefix the | |||
full classified name with <strong>Packages</strong>. For example | |||
Ant's <code class="code">FileUtils</code> class can be imported | |||
with <code class="code">importClass(<strong>Packages</strong>.org.apache.tools.ant.util.FileUtils)</code><br/> | |||
The <code><script></code> task populates the Project instance under the | |||
name <code>project</code>, so we can use that reference. Another way is to use its given name or | |||
getting its reference from the task itself.<br/> The Project provides methods for accessing and | |||
setting properties, creating DataTypes and Tasks and much more.<br/> After creating a FileSet | |||
object we initialize that by calling its set-methods. Then we can use that object like a normal Ant | |||
task (<code><copy></code> for example).<br/> For getting the size of a file we instantiate | |||
a <code class="code">java.io.File</code>. So we are using normal Java API here.<br/> Finally we use | |||
getting its reference from the task itself.<br/>The Project provides methods for accessing and | |||
setting properties, creating DataTypes and Tasks and much more.<br/>After creating a FileSet object | |||
we initialize that by calling its set-methods. Then we can use that object like a normal Ant task | |||
(<code><copy></code> for example).<br/>For getting the size of a file we instantiate | |||
a <code class="code">java.io.File</code>. So we are using normal Java API here.<br/>Finally we use | |||
the <code><echo></code> task for producing the output. The task is not executed by | |||
its <code class="code">execute()</code> method, because the <code class="code">perform()</code> | |||
method (implemented in Task itself) does the appropriate logging before and after | |||
@@ -261,8 +261,8 @@ self.log("text: " +self.text) | |||
<s:echo>nested text</s:echo> | |||
</target></pre> | |||
<p>The next example shows the use of <code><classpath></code> | |||
and <var>loaderref</var> to get access to the beanshell jar.</p> | |||
<p>The next example shows the use of <code><classpath></code> and <var>loaderref</var> to get | |||
access to the beanshell jar.</p> | |||
<pre> | |||
<scriptdef name="b1" language="beanshell" | |||
loaderref="beanshell-ref"> | |||
@@ -34,6 +34,9 @@ execution of a subset of tasks within the <a href="parallel.html">parallel</a> t | |||
from Ant tasks. Any valid Ant task may be embedded within the sequential task.</p> | |||
<h3>Example</h3> | |||
<p>This example shows how the <code>sequential</code> task is used to execute three tasks in | |||
sequence, while another task is being executed in a separate thread.</p> | |||
<pre> | |||
<parallel> | |||
<wlrun ... > | |||
@@ -43,8 +46,6 @@ from Ant tasks. Any valid Ant task may be embedded within the sequential task.</ | |||
<wlstop/> | |||
</sequential> | |||
</parallel></pre> | |||
<p>This example shows how the <code>sequential</code> task is used to execute three tasks in | |||
sequence, while another task is being executed in a separate thread.</p> | |||
</body> | |||
</html> |
@@ -79,18 +79,21 @@ different sets of permissions to apply to either type of resource.</p> | |||
<h4>any resource collection</h4> | |||
<p><a href="../Types/resources.html#collection">resource collections</a> are used to select groups | |||
of resources.</p> | |||
<h3>Examples</h3> | |||
<p>Make the <samp>start.sh</samp> file readable and executable for anyone and in addition writable | |||
by the owner.</p> | |||
<pre> | |||
<setpermissions mode="755"> | |||
<file file="${dist}/start.sh"/> | |||
</setpermissions></pre> | |||
<p>makes the <samp>start.sh</samp> file readable and executable for anyone and in addition writable | |||
<p>Make the <samp>start.sh</samp> file readable and executable for anyone and in addition writable | |||
by the owner.</p> | |||
<pre> | |||
<setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE"> | |||
<file file="${dist}/start.sh"/> | |||
</setpermissions></pre> | |||
<p>makes the <samp>start.sh</samp> file readable and executable for anyone and in addition writable | |||
by the owner.</p> | |||
</body> | |||
</html> |
@@ -85,14 +85,27 @@ FTP proxy, or a SOCKS server, reset the server settings, or do nothing at all.</ | |||
</table> | |||
<h3>Examples</h3> | |||
<pre><setproxy/></pre> do nothing | |||
<pre><setproxy proxyhost="firewall"/></pre> set the proxy to firewall:80 | |||
<pre><setproxy proxyhost="firewall" proxyport="81"/></pre> set the proxy to <samp>firewall:81</samp> | |||
<pre><setproxy proxyhost=""/></pre> stop using HTTP proxy; don't change SOCKS settings | |||
<pre><setproxy socksproxyhost="socksy"/></pre> use SOCKS via socksy:1080 | |||
<pre><setproxy socksproxyhost=""/></pre> stop using the SOCKS server. | |||
<p>You can set a username and password for http with the <var>proxyHost</var> | |||
and <var>proxyPassword</var> attributes. On Java 1.4 and above these can also be used against SOCKS | |||
<p>Do nothing</p> | |||
<pre><setproxy/></pre> | |||
<p>Set the proxy to <samp>firewall:80</samp></p> | |||
<pre><setproxy proxyhost="firewall"/></pre> | |||
<p>Set the proxy to <samp>firewall:81</samp></p> | |||
<pre><setproxy proxyhost="firewall" proxyport="81"/></pre> | |||
<p>Stop using HTTP proxy; don't change SOCKS settings</p> | |||
<pre><setproxy proxyhost=""/></pre> | |||
<p>Use SOCKS via <samp>socksy:1080</samp></p> | |||
<pre><setproxy socksproxyhost="socksy"/></pre> | |||
<p>Stop using the SOCKS server</p> | |||
<pre><setproxy socksproxyhost=""/></pre> | |||
<p>You can set a username and password for HTTP with the <var>proxyHost</var> | |||
and <var>proxyPassword</var> attributes. On Java 1.4 and above, these can also be used against SOCKS | |||
5 servers.</p> | |||
</body> | |||
@@ -213,11 +213,16 @@ place.</p> | |||
<p>For instructions on generating a code signing certificate, see | |||
the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/keytool.html" | |||
target="_top">keytool documentation</a> and/or instructions from your certificate authority.</p> | |||
<p>Sign the <samp>ant.jar</samp> with alias <q>apache-group</q> accessing the keystore and private | |||
key via <q>secret</q> password.</p> | |||
<pre> | |||
<signjar jar="${dist}/lib/ant.jar" | |||
alias="apache-group" storepass="secret"/></pre> | |||
<p>signs the <samp>ant.jar</samp> with alias <q>apache-group</q> accessing the keystore and private | |||
key via <q>secret</q> password.</p> | |||
<p>Sign all JAR files matching the <samp>dist/**/*.jar</samp> pattern, copying them to the | |||
directory <samp>signed</samp> afterwards. The flatten mapper means that they will all be copied to | |||
this directory, not to subdirectories.</p> | |||
<pre> | |||
<signjar destDir="signed" | |||
alias="testonly" keystore="testkeystore" | |||
@@ -228,9 +233,9 @@ key via <q>secret</q> password.</p> | |||
</path> | |||
<flattenmapper/> | |||
</signjar></pre> | |||
<p>Sign all JAR files matching the <samp>dist/**/*.jar</samp> pattern, copying them to the | |||
directory <samp>signed</samp> afterwards. The flatten mapper means that they will all be copied to | |||
this directory, not to subdirectories.</p> | |||
<p>Sign all the JAR files in <samp>dist/**/*.jar</samp> <em>in-situ</em>. Lazy signing is used, so | |||
the files will only be signed if they are not already signed.</p> | |||
<pre> | |||
<signjar alias="testonly" keystore="testkeystore" | |||
storepass="apacheant" | |||
@@ -239,8 +244,11 @@ this directory, not to subdirectories.</p> | |||
<fileset dir="dist" includes="**/*.jar"/> | |||
</path> | |||
</signjar></pre> | |||
<p>Sign all the JAR files in <samp>dist/**/*.jar</samp> <em>in-situ</em>. Lazy signing is used, so | |||
the files will only be signed if they are not already signed.</p> | |||
<p>Sign all the JAR files in <samp>dist/**/*.jar</samp> using the digest algorithm SHA1 and the | |||
signature algorithm MD5withRSA. This is especially useful when you want to use the JDK | |||
7 <kbd>jarsigner</kbd> (which uses SHA256 and SHA256withRSA as default) to create signed jars that | |||
will be deployed on platforms not supporting SHA256 and SHA256withRSA.</p> | |||
<pre> | |||
<signjar alias="testonly" keystore="testkeystore" | |||
storepass="apacheant" | |||
@@ -250,10 +258,7 @@ the files will only be signed if they are not already signed.</p> | |||
<fileset dir="dist" includes="**/*.jar"/> | |||
</path> | |||
</signjar></pre> | |||
<p>Sign all the JAR files in <samp>dist/**/*.jar</samp> using the digest algorithm SHA1 and the | |||
signature algorithm MD5withRSA. This is especially useful when you want to use the JDK | |||
7 <kbd>jarsigner</kbd> (which uses SHA256 and SHA256withRSA as default) to create signed jars that | |||
will be deployed on platforms not supporting SHA256 and SHA256withRSA.</p> | |||
<h3>About timestamp signing</h3> | |||
<p>Timestamps record the date and time that a signature took place, allowing the signature to be | |||
@@ -67,14 +67,17 @@ negative value can be supplied to any of them provided the total sleep time is p | |||
may either be ignored or rounded up to a minimum timeslice. Note also that the system clocks often | |||
have a fairly low granularity too, which complicates measuring how long a sleep actually took.</p> | |||
<h3>Examples</h3> | |||
<pre><sleep milliseconds="10"/></pre> | |||
<p>Sleep for about 10 ms.</p> | |||
<pre><sleep seconds="2"/></pre> | |||
<pre><sleep milliseconds="10"/></pre> | |||
<p>Sleep for about 2 seconds.</p> | |||
<pre><sleep hours="1" minutes="-59" seconds="-58"/></pre> | |||
<pre><sleep seconds="2"/></pre> | |||
<p>Sleep for one hour less 59:58, or two seconds again.</p> | |||
<pre><sleep/></pre> | |||
<pre><sleep hours="1" minutes="-59" seconds="-58"/></pre> | |||
<p>Sleep for no time at all. This may yield the CPU time to another thread or process.</p> | |||
<pre><sleep/></pre> | |||
</body> | |||
</html> |
@@ -174,6 +174,11 @@ Linux, Solaris & Windows 2000.</p> | |||
<h3>Example</h3> | |||
<p>Connect to a SourceOffsite server on <samp>192.168.10.6:8888</samp> | |||
with <q>build</q>, <q>build</q> as the username & password. The SourceSafe database resides on | |||
the same box as the SOS server & the VSS database is at <samp>d:\vss\srcsafe.ini</samp>. Do a | |||
recursive <var>GetProject</var> on <samp>$/SourceRoot/project1</samp>, using <samp>tmp</samp> as the | |||
working directory.</p> | |||
<pre> | |||
<sosget verbose="true" | |||
recursive="true" | |||
@@ -183,11 +188,6 @@ Linux, Solaris & Windows 2000.</p> | |||
projectpath="$/SourceRoot/project1" | |||
sosserverpath="192.168.10.6:8888" | |||
vssserverpath="d:\vss\srcsafe.ini"/></pre> | |||
<p>Connects to a SourceOffsite server on <samp>192.168.10.6:8888</samp> | |||
with <q>build</q>, <q>build</q> as the username & password. The SourceSafe database resides on | |||
the same box as the SOS server & the VSS database is at <samp>d:\vss\srcsafe.ini</samp>. Does a | |||
recursive <var>GetProject</var> on <samp>$/SourceRoot/project1</samp>, using <samp>tmp</samp> as the | |||
working directory.</p> | |||
<hr/> | |||
<h2 id="SOSLabel">SOSLabel</h2> | |||
@@ -254,6 +254,11 @@ working directory.</p> | |||
</table> | |||
<h3>Example</h3> | |||
<p>Connect to a SourceOffsite server on <samp>192.168.10.6:8888</samp> | |||
with <q>build</q>, <q>build</q> as the username & password. The SourceSafe database resides on | |||
the same box as the SOS server & the VSS database is at <samp>d:\vss\srcsafe.ini</samp>. Label | |||
the <samp>$/SourceRoot/project1</samp> project with <q>test label</q>.</p> | |||
<pre> | |||
<soslabel username="build" | |||
password="build" | |||
@@ -261,10 +266,6 @@ working directory.</p> | |||
projectpath="$/SourceRoot/project1" | |||
sosserverpath="192.168.10.6:8888" | |||
vssserverpath="d:\vss\srcsafe.ini"/></pre> | |||
<p>Connects to a SourceOffsite server on <samp>192.168.10.6:8888</samp> | |||
with <q>build</q>, <q>build</q> as the username & password. The SourceSafe database resides on | |||
the same box as the SOS server & the VSS database is at <samp>d:\vss\srcsafe.ini</samp>. Labels | |||
the <samp>$/SourceRoot/project1</samp> project with <q>test label</q>.</p> | |||
<hr/> | |||
<h2 id="SOSCheckIn">SOSCheckIn</h2> | |||
@@ -356,6 +357,12 @@ the <samp>$/SourceRoot/project1</samp> project with <q>test label</q>.</p> | |||
</table> | |||
<h3>Example</h3> | |||
<p>Connect to a SourceOffsite server on <samp>server1:8888</samp> with <q>build</q>, <q>build</q> as | |||
the username & password. The SourceSafe database resides on a different box | |||
(<samp>server2</samp>) & the VSS database is on a share called <samp>vss</samp>. Check-in only | |||
the <samp>foobar.txt</samp> file adding a comment of <q>comment abc</q>. Extra status messages will | |||
be displayed on screen.</p> | |||
<pre> | |||
<soscheckin username="build" | |||
password="build" | |||
@@ -366,12 +373,6 @@ the <samp>$/SourceRoot/project1</samp> project with <q>test label</q>.</p> | |||
sosserverpath="server1:8888" | |||
vssserverpath="\\server2\vss\srcsafe.ini"/></pre> | |||
<p>Connects to a SourceOffsite server on <samp>server1:8888</samp> with <q>build</q>, <q>build</q> | |||
as the username & password. The SourceSafe database resides on a different box | |||
(<samp>server2</samp>) & the VSS database is on a share called <samp>vss</samp>. Checks-in only | |||
the <samp>foobar.txt</samp> file adding a comment of <q>comment abc</q>. Extra status messages will | |||
be displayed on screen.</p> | |||
<hr/> | |||
<h2 id="SOSCheckOut">SOSCheckOut</h2> | |||
@@ -458,6 +459,13 @@ be displayed on screen.</p> | |||
</table> | |||
<h3>Example</h3> | |||
<p>Connect to a SourceOffsite server on <samp>server1:8888</samp> with <q>build</q>, <q>build</q> as | |||
the username & password. The SourceSafe database resides on a different box | |||
(<samp>server2</samp>) & the VSS database is on a share | |||
called <samp>vss</samp>. Check-out <q>project1</q>, only the <samp>project1</samp> directory will be | |||
locked as the recursive option was not set. Extra status messages will be displayed on | |||
screen. The <code>soscmd(.exe)</code> file to be used resides in <samp>/usr/local/bin</samp>.</p> | |||
<pre> | |||
<soscheckout soscmd="/usr/local/bin" | |||
verbose="true" | |||
@@ -466,12 +474,6 @@ be displayed on screen.</p> | |||
projectpath="$/SourceRoot/project1" | |||
sosserverpath="192.168.10.6:8888" | |||
vssserverpath="\\server2\vss\srcsafe.ini"/></pre> | |||
<p>Connects to a SourceOffsite server on <samp>server1:8888</samp> with <q>build</q>, <q>build</q> | |||
as the username & password. The SourceSafe database resides on a different box | |||
(<samp>server2</samp>) & the VSS database is on a share | |||
called <samp>vss</samp>. Checks-out <q>project1</q>, only the <samp>project1</samp> directory will | |||
be locked as the recursive option was not set. Extra status messages will be displayed on | |||
screen. The <code>soscmd(.exe)</code> file to be used resides in <samp>/usr/local/bin</samp>.</p> | |||
</body> | |||
</html> |
@@ -74,6 +74,10 @@ and <code><fail></code> elements:</p> | |||
<h3>Examples</h3> | |||
<p>Play the <samp>bell.wav</samp> sound file if the build succeeded, or the <samp>ohno.wav</samp> | |||
sound file if the build failed, three times, if the <code>fun</code> property is set to <q>true</q>. | |||
If the target 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.</p> | |||
<pre> | |||
<target name="fun" if="fun" unless="fun.done"> | |||
<sound> | |||
@@ -82,10 +86,8 @@ and <code><fail></code> elements:</p> | |||
</sound> | |||
<property name="fun.done" value="true"/> | |||
</target></pre> | |||
<p>plays the <samp>bell.wav</samp> sound file if the build succeeded, or the <samp>ohno.wav</samp> | |||
sound file if the build failed, three times, if the <code>fun</code> property is set to <q>true</q>. | |||
If the target 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.</p> | |||
<p>Randomly select a sound file to play when the build succeeds or fails.</p> | |||
<pre> | |||
<target name="fun" if="fun" unless="fun.done"> | |||
<sound> | |||
@@ -95,7 +97,6 @@ the <code>fun.done</code> property prevents the target from being executed more | |||
<property name="fun.done" value="true"/> | |||
</target> | |||
</pre> | |||
<p>randomly selects a sound file to play when the build succeeds or fails.</p> | |||
</body> | |||
</html> |