From: peter r. <pet...@us...> - 2003-10-20 15:45:38
|
Update of /cvsroot/ant-contrib/ant-contrib/manual/tasks In directory sc8-pr-cvs1:/tmp/cvs-serv24342 Modified Files: toc.html Added Files: for.html Log Message: manual page for <for> --- NEW FILE: for.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Ant-contrib Tasks: For</title> </head> <body> <h1>For</h1> <p>The for task iterates over a list, a list of paths, or both. If both, list and paths, are specified, the list will be evaluated first. Nested paths are evaluated in the order they appear in the task.</p> <p> This task is the same as the <foreach> task, except that it uses a nested sequential for each iteration. </p> <p><em> This task only works for ant version greater than or equal to ant 1.6beta2. </em> </p> <h2>Parameters</h2> <table border="1" cellpadding="2" cellspacing="0"> <tr> <th>Attribute</th> <th>Description</th> <th>Required</th> </tr> <tr> <td valign="top">list</td> <td valign="top">The list of values to process, with the delimiter character, indicated by the "delimiter" attribute, separating each value.</td> <td align="center" valign="top">Yes, unless a nested path has been specified.</td> </tr> <tr> <td valign="top">param</td> <td valign="top">Name of the parameter to pass the tokens or files in as to the sequential.</td> <td align="center" valign="top">Yes</td> </tr> <tr> <td valign="top">delimiter</td> <td valign="top">The delimiter string that separates the values in the "list" attribute.</td> <td align="center" valign="top">No, defaults to ",".</td> </tr> <tr> <td valign="top">trim</td> <td valign="top">If <code>true</code>, any leading or trailing whitespace will be removed from the list item before it is passed to the sequential. </td> <td align="center" valign="top">No. Defaults to false.</td> </tr> </table> <h2>Parameters specified as nested elements</h2> <a name="path"><h3>path</h3></a> <p><a href="http://ant.apache.org/manual/using.html#path">Path</a>s are used to select sets of files or directories to iterate over.</p> <p>Using a path allows you to determine the order by which files are considered by using <a href="http://ant.apache.org/manual/CoreTypes/filelist.html">filelist</a>s or explicit <code>pathelements</code>. You also can specify whether you want to iterate over files or directories by chosing either filesets or <a href="http://ant.apache.org/manual/CoreTypes/dirset.html">dirset</a>s.</p> <a name="seqential"><h3>sequential</h3></a> This is the list of tasks to be run for each iteration of the list. <h3>Example</h3> <p> To print out the first five letters of the latin alphabet: </p> <blockquote> <pre> <echo message="The first five letters of the alphabet are:"/> <for list="a,b,c,d,e" param="letter"> <sequential> <echo>Letter ${letter}</echo> </sequential> </for> </pre> </blockquote> <p> A more complicated example to to iterate over a set of c++ source files and invoke the cc task on them: </p> <blockquote> <pre> <for param="file"> <path> <fileset dir="${test.dir}/mains" includes="*.cpp"/> </path> <sequential> <propertyregex override="yes" property="program" input="${file}" regexp=".*/([^\.]*)\.cpp" replace="\1"/> <mkdir dir="${obj.dir}/${program}"/> <mkdir dir="${build.bin.dir}"/> <cc link="executable" objdir="${obj.dir}/${program}" outfile="${build.bin.dir}/${program}"> <compiler refid="compiler.options"/> <fileset file="${file}"/> <linker refid="linker-libs"/> </cc> </sequential> </for> </pre> </blockquote> <hr> <p align="center">Copyright © 2003 Ant-Contrib Project. All rights Reserved.</p> </body> </html> Index: toc.html =================================================================== RCS file: /cvsroot/ant-contrib/ant-contrib/manual/tasks/toc.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** toc.html 17 Oct 2003 21:25:05 -0000 1.16 --- toc.html 20 Oct 2003 15:27:35 -0000 1.17 *************** *** 12,15 **** --- 12,16 ---- <li><a href="assert_task.html" target="mainFrame">Assert</a></li> <li><a href="foreach.html" target="mainFrame">Foreach</a></li> + <li><a href="for.html" target="mainFrame">For</a></li> <li><a href="if.html" target="mainFrame">If</a></li> <li><a href="outofdate.html" target="mainFrame">Outoutdate</a></li> |