You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 117 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant</title>
  5. </head>
  6. <body>
  7. <h1>Ant User Manual</h1>
  8. <p>by</p>
  9. <!-- Names are in alphabetical order, on last name -->
  10. <ul>
  11. <li>Jacques Bergeron (<a href="mailto:jacques.bergeron@dogico.com">jacques.bergeron@dogico.com</a>)</li>
  12. <li>Stefan Bodewig (<a href="mailto:stefan.bodewig@megabit.net">stefan.bodewig@megabit.net</a>)</li>
  13. <li>James Duncan Davison (<a href="mailto:duncan@x180.com">duncan@x180.com</a>)</li>
  14. <li>Tom Dimock (<a href="mailto:tad1@cornell.edu">tad1@cornell.edu</a>)</li>
  15. <li>Bill Kelly (<a href="mailto:bill.kelly@softwired-inc.com">bill.kelly@softwired-inc.com</a>)</li>
  16. <li>Arnout J. Kuiper (<a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>)</li>
  17. <li>Stefano Mazzocchi (<a href="mailto:stefano@apache.org">stefano@apache.org</a>)</li>
  18. <li>Sam Ruby (<a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>)</li>
  19. </ul>
  20. <p>Version 1.0.8.1 - 2000/06/13</p>
  21. <hr>
  22. <h2>Table of Contents</h2>
  23. <ul>
  24. <li><a href="#introduction">Introduction</a></li>
  25. <li><a href="#getting">Getting Ant</a></li>
  26. <li><a href="#buildingant">Building Ant</a></li>
  27. <li><a href="#installing">Installing Ant</a></li>
  28. <li><a href="#running">Running Ant</a></li>
  29. <li><a href="#buildfile">Writing a simple buildfile</a>
  30. <li><a href="#directorybasedtasks">Directory based tasks</a></li>
  31. <li><a href="#tasks">Built in Tasks</a>
  32. <li><a href="#optionaltasks">Optional Tasks</a>
  33. <li><a href="#writingowntask">Writing your own task</a></li>
  34. <li><a href="#license">License</a></li>
  35. <li><a href="#feedback">Feedback</a></li>
  36. </ul>
  37. <hr>
  38. <h2><a name="introduction">Introduction</a></h2>
  39. <p>Ant is a Java based build tool. In theory it is kind of like make without
  40. make's wrinkles.</p>
  41. <h3>Why?</h3>
  42. <p>Why another build tool when there is already make, gnumake, nmake, jam, and
  43. others? Because all of those tools have limitations that its original author
  44. couldn't live with when developing software across multiple platforms. Make like
  45. tools are inherently shell based. They evaluate a set of dependencies and then
  46. execute commands not unlike what you would issue on a shell. This means that you
  47. can easily extend these tools by using or writing any program for the OS that
  48. you are working on. However, this also means that you limit yourself to the OS,
  49. or at least the OS type such as Unix, that you are working on.</p>
  50. <p>Makefiles are inherently evil as well. Anybody who has worked on them for any
  51. time has run into the dreaded tab problem. &quot;Is my command not executing
  52. because I have a space in front of my tab!!!&quot; said the original author of
  53. Ant way too many times. Tools like Jam took care of this to a great degree, but
  54. still use yet another format to use and remember.</p>
  55. <p>Ant is different. Instead a model where it is extended with shell based
  56. commands, it is extended using Java classes. Instead of writing shell commands,
  57. the configuration files are XML based calling out a target tree where various
  58. tasks get executed. Each task is run by an object which implements a particular
  59. Task interface.</p>
  60. <p>Granted, this removes some of the expressive power that is inherent by being
  61. able to construct a shell command such as `find . -name foo -exec rm {}` but it
  62. gives you the ability to be cross platform. To work anywhere and everywhere. And
  63. hey, if you really need to execute a shell command, Ant has an exec rule that
  64. allows different commands to be executed based on the OS that it is executing
  65. on.</p>
  66. <hr>
  67. <h2><a name="getting">Getting Ant</a></h2>
  68. <h3>Binary edition</h3>
  69. <p>The latest stable version of Ant can be downloaded from <a
  70. href="http://jakarta.apache.org/builds/tomcat/release/v3.0/ant.zip">http://jakarta.apache.org/builds/tomcat/release/v3.0/ant.zip</a>.
  71. If you like living on the edge, you can download the latest version from <a
  72. href="http://jakarta.apache.org/builds/tomcat/nightly/ant.zip">http://jakarta.apache.org/builds/tomcat/nightly/ant.zip</a>.</p>
  73. <h3>Source edition</h3>
  74. <p>If you prefer the source edition, you can download Ant from <a
  75. href="http://jakarta.apache.org/builds/tomcat/release/v3.0/src/jakarta-tools.src.zip">http://jakarta.apache.org/builds/tomcat/release/v3.0/src/jakarta-tools.src.zip</a>
  76. (latest stable) or from <a
  77. href="http://jakarta.apache.org/from-cvs/jakarta-tools/">http://jakarta.apache.org/from-cvs/jakarta-ant/</a>
  78. (current). See the section <a href="#buildingant">Building Ant</a> on how to
  79. build Ant from the source code.</p>
  80. <hr>
  81. <h2><a name="buildingant">Building Ant</a></h2>
  82. <p>
  83. Download and install the Java API for XML Parsing kit from
  84. <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>.
  85. Make sure the "jaxp.jar" and "parser.jar" files are in your class
  86. path.
  87. </p>
  88. <p>Go to the directory <code>jakarta-ant</code>.</p>
  89. <p>Make sure the JDK is in you path.</p>
  90. <p>Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
  91. to build a bootstrap version of Ant.</p>
  92. <p>When finished, use</p>
  93. <blockquote>
  94. <p><code>build.bat -Dant.dist.dir=&lt;directory to install Ant&gt; dist</code></p>
  95. </blockquote>
  96. <p>for Windows, and</p>
  97. <blockquote>
  98. <p><code>build.sh -Dant.dist.dir=&lt;directory to install Ant&gt; dist</code></p>
  99. </blockquote>
  100. <p>for UNIX, to create a binary distribution of Ant. This distribution can be
  101. found in the directory you specified.</p>
  102. <hr>
  103. <h2><a name="installing">Installing Ant</a></h2>
  104. <p>The binary distribution of Ant consists of three directories: <code>bin</code>,
  105. <code>docs</code> and <code>lib</code>. Only the <code>bin</code> and <code>lib</code>
  106. directory are crucial for running Ant. To run Ant, the following must be done:</p>
  107. <ul>
  108. <li>Add the <code>bin</code> directory to your path.</li>
  109. <li>Set the ANT_HOME environment variable. This should be set to the directory
  110. which contains the <code>bin</code> and <code>lib</code> directory.</li>
  111. <li>Set the JAVA_HOME environment variable. This should be set to the
  112. directory where the JDK is installed.</li>
  113. </ul>
  114. <h3>Windows</h3>
  115. <p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the
  116. environment:</p>
  117. <pre>set ANT_HOME=c:\ant
  118. set JAVA_HOME=c:\jdk1.2.2
  119. set PATH=%PATH%;%ANT_HOME%\bin</pre>
  120. <h3>Unix (bash)</h3>
  121. <p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up
  122. the environment:</p>
  123. <pre>export ANT_HOME=/usr/local/ant
  124. export JAVA_HOME=/usr/local/jdk-1.2.2
  125. export PATH=${PATH}:${ANT_HOME}/bin</pre>
  126. <h3>Advanced</h3>
  127. <p>There are lots of variants that can be used to run Ant. What you need is at
  128. least the following:</p>
  129. <p>The classpath for Ant must contain <code>ant.jar</code> and <code>xml.jar</code>.</p>
  130. <p>When you need JDK functionality (like a <a href="#javac">javac</a> task, or a
  131. <a href="#rmic">rmic</a> task), then for JDK 1.1, the <code>classes.zip</code>
  132. file of the JDK must be added to the classpath; for JDK 1.2, <code>tools.jar</code>
  133. must be added.</p>
  134. <p>When you are executing platform specific applications (like the <a
  135. href="#exec">exec</a> task, or the <a href="#cvs">cvs</a> task), the property <code>ant.home</code>
  136. must be set to the directory containing a bin directory, which contains the <code>antRun</code> shell script necessary to run execs on Unix.</p>
  137. <hr>
  138. <h2><a name="running">Running Ant</a></h2>
  139. <p>Running Ant is simple, when you installed it as described in the previous
  140. section. Just type <code>ant</code>.</p>
  141. <p>When nothing is specified, Ant looks for a <code>build.xml</code> file in the
  142. current directory. When found, it uses that file as a buildfile. To make Ant use
  143. another buildfile, use the commandline option <i>-buildfile &lt;file&gt;</i>,
  144. where <i>&lt;file&gt;</i> is the buildfile you want to use.</p>
  145. <p>You can also set properties which override properties specified in the
  146. buildfile (see the <a href="#property">property task</a>).
  147. This can be done with the <i>-D&lt;property&gt;=&lt;value&gt;</i>
  148. option, where <i>&lt;property&gt;</i> is the name of the property and <i>&lt;value&gt;</i>
  149. the value.</p>
  150. <p>To more options are <i>-quiet</i> which instructs Ant to print less
  151. information on the console when running. The option <i>-verbose</i> on the other
  152. hand makes Ant print more information on the console.</p>
  153. <p>It is also possible to specify the target that should be executed. Default
  154. the target that is mentioned in the <i>default</i> attribute of the project is
  155. used. This can be overridden by adding the target name to the end of the
  156. commandline.</p>
  157. <p>Commandline option summary:</p>
  158. <pre>ant [options] [target]
  159. Options:
  160. -help print this message
  161. -quiet be extra quiet
  162. -verbose be extra verbose
  163. -logfile &lt;file&gt; use given file for log
  164. -buildfile &lt;file&gt; use given buildfile
  165. -D&lt;property&gt;=&lt;value&gt; use value for given property</pre>
  166. <h3>Examples</h3>
  167. <blockquote>
  168. <pre>ant</pre>
  169. </blockquote>
  170. <p>runs Ant using the <code>build.xml</code> file in the current directory, on
  171. the default target.</p>
  172. <blockquote>
  173. <pre>ant -buildfile test.xml</pre>
  174. </blockquote>
  175. <p>runs Ant using the <code>test.xml</code> file in the current directory, on
  176. the default target.</p>
  177. <blockquote>
  178. <pre>ant -buildfile test.xml dist</pre>
  179. </blockquote>
  180. <p>runs Ant using the <code>test.xml</code> file in the current directory, on a
  181. target called <code>dist</code>.</p>
  182. <blockquote>
  183. <pre>ant -buildfile test.xml -Dbuild=build/classes dist</pre>
  184. </blockquote>
  185. <p>runs Ant using the <code>test.xml</code> file in the current directory, on a
  186. target called <code>dist</code>. It also sets the <i>build</i> property to the
  187. value <i>build/classes</i>.</p>
  188. <h3>Running Ant by hand</h3>
  189. <p>When you have installed Ant in the do-it-yourself way, Ant can be started
  190. with:</p>
  191. <blockquote>
  192. <pre>set CLASSPATH=c:\ant\lib\ant.jar;c:\ant\lib\xml.jar;c:\jdk1.2.2\lib\tools.jar
  193. java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]</pre>
  194. </blockquote>
  195. <p>These instructions actually do exactly the same as the <code>ant</code>
  196. command. The options and target are the same as when running Ant with the <code>ant</code>
  197. command.</p>
  198. <hr>
  199. <h2><a name="buildfile">Writing a simple buildfile</a></h2>
  200. <p>The buildfile is written in XML. Each buildfile contains one project.</p>
  201. <h3>Projects</h3>
  202. <p>A project has three attributes:</p>
  203. <table border="1" cellpadding="2" cellspacing="0">
  204. <tr>
  205. <td valign="top"><b>Attribute</b></td>
  206. <td valign="top"><b>Description</b></td>
  207. <td align="center" valign="top"><b>Required</b></td>
  208. </tr>
  209. <tr>
  210. <td valign="top">name</td>
  211. <td valign="top">the name of the project.</td>
  212. <td align="center" valign="top">Yes</td>
  213. </tr>
  214. <tr>
  215. <td valign="top">default</td>
  216. <td valign="top">the default target to use when no target is supplied.</td>
  217. <td align="center" valign="top">Yes</td>
  218. </tr>
  219. <tr>
  220. <td valign="top">basedir</td>
  221. <td valign="top">the base directory from which all path calculations are
  222. done. This attribute might be overridden by setting the &quot;basedir&quot;
  223. property on forehand. When this is done, it might be ommitted in the
  224. project tag.</td>
  225. <td align="center" valign="top">Yes</td>
  226. </tr>
  227. </table>
  228. <p>Each project defines one or more targets. A target is a set of tasks you want
  229. to be executed. When starting Ant, you can select which target you want to have
  230. executed. When no target is given, the project's default is used.</p>
  231. <h3>Targets</h3>
  232. <p>A target can depend on other targets. You might have a target for compiling,
  233. for instance, and a target for creating a distributable. You can only build a
  234. distributable when you have compiled first, so the distribute target depends on
  235. the compile target. Ant resolves all these dependencies.</p>
  236. <p>Ant tries to execute the targets in the <i>depends</i> attribute in the order
  237. they appear (from left to right). Keep in mind that it is possible that a target
  238. can get executed earlier when an earlier target depends on it:</p>
  239. <blockquote>
  240. <pre>&lt;target name=&quot;A&quot;/&gt;
  241. &lt;target name=&quot;B&quot; depends=&quot;A&quot;/&gt;
  242. &lt;target name=&quot;C&quot; depends=&quot;B&quot;/&gt;
  243. &lt;target name=&quot;D&quot; depends=&quot;C,B,A&quot;/&gt;</pre>
  244. </blockquote>
  245. <p>Suppose we want to execute target D. From its <i>depends</i> attribute, you
  246. might think that first target C, then B and then A is executed. Wrong! C depends
  247. on B, and B depends on A, so first A is executed, then B, then C, and finally D.</p>
  248. <p>A target gets executed only once. Even when more targets depend on it (see
  249. the previous example).</p>
  250. <p>A target has also the ability to perform its execution if a property has been
  251. set. This allows, for example, better control on the building process depending
  252. on the state of the system (java version, OS, command line properties, etc...).
  253. To make target <i>sense</i> this property you should add the <i>if</i> attribute
  254. with the name of the property that the target should react to, for example</p>
  255. <blockquote>
  256. <pre>&lt;target name=&quot;build-module-A&quot; if=&quot;module-A-present&quot;/&gt;</pre>
  257. </blockquote>
  258. <p>If no <i>if</i> attribute is present, the target will always be executed.</p>
  259. <p>It is a good practice to place your <a href="#property">property</a> and <a
  260. href="#tstamp">tstamp</a> tasks in a so called initialization target, on which
  261. all other targets depend. Make sure that that target is always the first one in
  262. the depends list of the other targets. In this manual, most initialization targets
  263. have the name "init".</p>
  264. <p>A target has the following attributes:</p>
  265. <table border="1" cellpadding="2" cellspacing="0">
  266. <tr>
  267. <td valign="top"><b>Attribute</b></td>
  268. <td valign="top"><b>Description</b></td>
  269. <td align="center" valign="top"><b>Required</b></td>
  270. </tr>
  271. <tr>
  272. <td valign="top">name</td>
  273. <td valign="top">the name of the project.</td>
  274. <td align="center" valign="top">Yes</td>
  275. </tr>
  276. <tr>
  277. <td valign="top">depends</td>
  278. <td valign="top">a comma separated list of names of targets on which this
  279. target depends.</td>
  280. <td align="center" valign="top">No</td>
  281. </tr>
  282. <tr>
  283. <td valign="top">if</td>
  284. <td valign="top">the name of the property that must be set in order for this
  285. target to execute.</td>
  286. <td align="center" valign="top">No</td>
  287. </tr>
  288. </table>
  289. <h3>Tasks</h3>
  290. <p>A task is a piece of code that can be executed.</p>
  291. <p>A task can have multiple attributes (or arguments if you prefer). The value
  292. of an attribute might contain references to a property. These references will be
  293. resolved before the task is executed.</p>
  294. <p>Tasks have a common structure:</p>
  295. <blockquote>
  296. <pre>&lt;name attribute1=&quot;value1&quot; attribute2=&quot;value2&quot; ... /&gt;</pre>
  297. </blockquote>
  298. <p>where name is the name of the task, attribute-x the attribute name, and
  299. value-x the value of this attribute.</p>
  300. <p>There is a set of <a href="#tasks">built in tasks</a>, but it is also very
  301. easy to <a href="#writingowntask">write your own</a>.</p>
  302. <h3>Properties</h3>
  303. <p>A project can have a set of properties. These might be set in the buildfile
  304. by the <a href="#property">property task</a>, or might be set outside Ant. A
  305. property has a name and a value. Properties might be used in in the value of
  306. task attributes. This is done by placing the property name between
  307. &quot;${&quot; and &quot;}&quot; in the attribute value.</p>
  308. <p>If there is a property called &quot;builddir&quot; with the value
  309. &quot;build&quot;, then this could be used in an attribute like this: &quot;${builddir}/classes&quot;.
  310. This is resolved as &quot;build/classes&quot;.</p>
  311. <h3>Token Filters</h3>
  312. <p>A project can have a set of tokens that might be automatically expanded if
  313. found when a file is copied, when the filtering-copy behavior is selected in the
  314. tasks that support this. These might be set in the buildfile
  315. by the <a href="#filter">filter task</a>.&nbsp;</p>
  316. <p>Since this can be a very harmful behavior, the tokens in the files <b>must</b>
  317. be of the form<i> @token@</i> where <i>token</i> is the token name that is set
  318. in the filter task. This token syntax matches the syntax of other build systems
  319. that perform such filtering and remains sufficiently orthogonal to most
  320. programming and scripting languages, as well with documentation systems.</p>
  321. <p>Note: in case a token with the format @token@ if found in a file but no
  322. filter is associated with that token, no changes take place. So, no escaping
  323. method is present, but as long as you choose appropriate names for your tokens,
  324. this should not cause problems.</p>
  325. <h3>Examples</h3>
  326. <blockquote>
  327. <pre>&lt;project name=&quot;foo&quot; default=&quot;dist&quot; basedir=&quot;.&quot;&gt;
  328. &lt;target name=&quot;init&quot;&gt;
  329. &lt;tstamp/&gt;
  330. &lt;property name=&quot;build&quot; value=&quot;build&quot; /&gt;
  331. &lt;property name=&quot;dist&quot; value=&quot;dist&quot; /&gt;
  332. &lt;filter token=&quot;version&quot; value=&quot;1.0.3&quot; /&gt;
  333. &lt;filter token=&quot;year&quot; value=&quot;2000&quot; /&gt;
  334. &lt;/target&gt;
  335. &lt;target name=&quot;prepare&quot; depends=&quot;init&quot;&gt;
  336. &lt;mkdir dir=&quot;${build}&quot; /&gt;
  337. &lt;/target&gt;
  338. &lt;target name=&quot;compile&quot; depends=&quot;prepare&quot;&gt;
  339. &lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot; filtering=&quot;on&quot;/&gt;
  340. &lt;/target&gt;
  341. &lt;target name=&quot;dist&quot; depends=&quot;compile&quot;&gt;
  342. &lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;
  343. &lt;jar jarfile=&quot;${dist}/lib/foo${DSTAMP}.jar&quot;
  344. basedir=&quot;${build}&quot; items=&quot;com&quot;/&gt;
  345. &lt;/target&gt;
  346. &lt;target name=&quot;clean&quot; depends=&quot;init&quot;&gt;
  347. &lt;deltree dir=&quot;${build}&quot; /&gt;
  348. &lt;deltree dir=&quot;${dist}&quot; /&gt;
  349. &lt;/target&gt;
  350. &lt;/project&gt;
  351. </pre>
  352. </blockquote>
  353. <hr>
  354. <h2><a name="directorybasedtasks">Directory based tasks</a></h2>
  355. <p>Some tasks use directory trees for the task they perform. For instance, the <a
  356. href="#javac">Javac task</a> which works upon a directory tree with .java files.
  357. Sometimes it can be very useful to work on a subset of that directory tree. This
  358. section describes how you can select a subset of such a directory tree.</p>
  359. <p>Ant gives you two ways to create a subset, which both can be used at the same
  360. time:</p>
  361. <ul>
  362. <li>Only include files/directories that match at least one pattern of a set of
  363. patterns</li>
  364. <li>Exclude files/directories that match at least one pattern a set of
  365. patterns</li>
  366. </ul>
  367. <p>When both inclusion and exclusion are used, only files/directories that match
  368. the include patterns, and don't match the exclude patterns are used.</p>
  369. <h3>Patterns</h3>
  370. <p>As described earlier, patterns are used for the inclusion and exclusion.
  371. These patterns look very much like the patterns used in DOS and UNIX:</p>
  372. <p>'*' matches zero or more characters, '?' matches one character.</p>
  373. <p>Examples:</p>
  374. <p>'*.java' matches '.java', 'x.java' and 'FooBar.java', but not 'FooBar.xml'
  375. (does not end with '.java').</p>
  376. <p>'?.java' matches 'x.java', 'A.java', but not '.java' or 'xyz.java' (both
  377. don't have one character before '.java').</p>
  378. <p>Combinations of '*'s and '?'s are allowed.</p>
  379. <p>Matching is done per-directory. This means that first the first directory in
  380. the pattern is matched against the first directory in the path to match. Then
  381. the second directories are matched, and so on. E.g. when we have the pattern '/?abc/*/*.java'
  382. and the path '/xabc/foobar/test.java', then first '?abc' is matched with 'xabc',
  383. then '*' is matched with 'foobar' and finally '*.java' is matched with 'test.java'.
  384. They all match so the path matches the pattern.</p>
  385. <p>Too make things a bit more flexible, we add one extra feature, which makes it
  386. possible to match multiple directory levels. This can be used to match a
  387. complete directory tree, or a file anywhere in the directory tree. To do this, '**'
  388. must be used as the name of a directory. When '**' is used as the name of a
  389. directory in the pattern, it matches zero or more directories. For instance:
  390. '/test/**' matches all files/directories under '/test/', such as '/test/x.java',
  391. or '/test/foo/bar/xyz.html', but not '/xyz.xml'.</p>
  392. <p>There is one &quot;shorthand&quot;, if a pattern ends with '/' or '\', then '**'
  393. is appended. E.g. &quot;mypackage/test/&quot; is interpreted as were it &quot;mypackage/test/**&quot;.</p>
  394. <p>Examples:</p>
  395. <table border="1" cellpadding="2" cellspacing="0">
  396. <tr>
  397. <td valign="top">**/CVS/*</td>
  398. <td valign="top">Matches all files in CVS directories, that can be located
  399. anywhere in the directory tree.
  400. <p>Matches:</p>
  401. <p>CVS/Repository<br>
  402. org/apache/CVS/Entries<br>
  403. org/apache/jakarta/tools/ant/CVS/Entries</p>
  404. <p>But not:</p>
  405. <p>org/apache/CVS/foo/bar/Entries ('foo/bar/' part does not match)</td>
  406. </tr>
  407. <tr>
  408. <td valign="top">org/apache/jakarta/**</td>
  409. <td valign="top">Matches all files in the org/apache/jakarta directory tree.
  410. <p>Matches:</p>
  411. <p>org/apache/jakarta/tools/ant/docs/index.html<br>
  412. org/apache/jakarta/test.xml</p>
  413. <p>But not:</p>
  414. <p>org/apache/xyz.java ('jakarta'/' part is missing)</td>
  415. </tr>
  416. <tr>
  417. <td valign="top">org/apache/**/CVS/*</td>
  418. <td valign="top">Matches all files in CVS directories, that are located
  419. anywhere in the directory tree under org/apache.
  420. <p>Matches:</p>
  421. <p>org/apache/CVS/Entries<br>
  422. org/apache/jakarta/tools/ant/CVS/Entries</p>
  423. <p>But not:</p>
  424. <p>org/apache/CVS/foo/bar/Entries ('foo/bar/' part does not match)</td>
  425. </tr>
  426. <tr>
  427. <td valign="top">**/test/**</td>
  428. <td valign="top">Matches all files which have a directory 'test' in their
  429. path, including 'test' as a filename.</td>
  430. </tr>
  431. </table>
  432. <p>When these patterns are used in inclusion and exclusion, you have a powerful
  433. way to select just the files you want.</p>
  434. <h3>Examples</h3>
  435. <pre> &lt;copydir src=&quot;${src}&quot;
  436. dest=&quot;${dist}&quot;
  437. includes=&quot;**/images/*&quot;
  438. excludes=&quot;**/*.gif&quot; /&gt;</pre>
  439. <p>This copies all files in directories called &quot;images&quot;, that are
  440. located in the directory tree &quot;${src}&quot; to the destination &quot;${dist}&quot;,
  441. but excludes all &quot;*.gif&quot; files from the copy.</p>
  442. <h3>Default Excludes</h3>
  443. <p>There are a set of definitions which are excluded by default from all directory based tasks.
  444. They are:
  445. <pre> &quot;**/*~&quot;,
  446. &quot;**/#*#&quot;,
  447. &quot;**/%*%&quot;,
  448. &quot;**/CVS&quot;,
  449. &quot;**/CVS/*&quot;,
  450. &quot;**/.cvsignore&quot;
  451. </pre>
  452. If you do not want these default excludes applied, you may disable them with the
  453. <code>defaultexcludes=&quot;no&quot;</code> attribute.</p>
  454. <hr>
  455. <h2><a name="tasks">Built in tasks</a></h2>
  456. <ul>
  457. <li><a href="#ant">Ant</a></li>
  458. <li><a href="#available">Available</a></li>
  459. <li><a href="#chmod">Chmod</a></li>
  460. <li><a href="#copydir">Copydir</a></li>
  461. <li><a href="#copyfile">Copyfile</a></li>
  462. <li><a href="#cvs">Cvs</a></li>
  463. <li><a href="#delete">Delete</a></li>
  464. <li><a href="#deltree">Deltree</a></li>
  465. <li><a href="#echo">Echo</a></li>
  466. <li><a href="#exec">Exec</a></li>
  467. <li><a href="#expand">Expand</a></li>
  468. <li><a href="#filter">Filter</a></li>
  469. <li><a href="#get">Get</a></li>
  470. <li><a href="#gunzip">GUnzip</a></li>
  471. <li><a href="#gzip">GZip</a></li>
  472. <li><a href="#fixcrlf">FixCRLF</a></li>
  473. <li><a href="#jar">Jar</a></li>
  474. <li><a href="#java">Java</a></li>
  475. <li><a href="#javac">Javac</a></li>
  476. <li><a href="#javadoc">Javadoc/Javadoc2</a></li>
  477. <li><a href="#keysubst">KeySubst</a></li>
  478. <li><a href="#mkdir">Mkdir</a></li>
  479. <li><a href="#patch">Patch</a></li>
  480. <li><a href="#property">Property</a></li>
  481. <li><a href="#rename">Rename</a></li>
  482. <li><a href="#replace">Replace</a></li>
  483. <li><a href="#rmic">Rmic</a></li>
  484. <li><a href="#tar">Tar</a></li>
  485. <li><a href="#taskdef">Taskdef</a></li>
  486. <li><a href="#tstamp">Tstamp</a></li>
  487. <li><a href="#style">Style</a></li>
  488. <li><a href="#untar">Untar</a></li>
  489. <li><a href="#zip">Zip</a></li>
  490. </ul>
  491. <hr>
  492. <h2><a name="ant">Ant</a></h2>
  493. <h3><b>Description:</b></h3>
  494. <p>Runs Ant on a supplied buildfile. This can be used to build subprojects.</p>
  495. <p>When the <i>antfile</i> attribute is omitted, the file &quot;build.xml&quot;
  496. in the supplied directory (<i>dir</i> attribute) is used.</p>
  497. <p>If no target attribute is supplied, the default target of the new project is
  498. used.</p>
  499. <p>The properties of the current project will be available in the new project.
  500. These properties will override the properties that are set in the new project.
  501. (See also the <a href="#property">properties task</a>).</p>
  502. <h3>Parameters:</h3>
  503. <table border="1" cellpadding="2" cellspacing="0">
  504. <tr>
  505. <td valign="top"><b>Attribute</b></td>
  506. <td valign="top"><b>Description</b></td>
  507. <td align="center" valign="top"><b>Required</b></td>
  508. </tr>
  509. <tr>
  510. <td valign="top">antfile</td>
  511. <td valign="top">the buildfile to use.</td>
  512. <td valign="top" align="center">No</td>
  513. </tr>
  514. <tr>
  515. <td valign="top">dir</td>
  516. <td valign="top">the directory to use as a basedir for the new Ant project.</td>
  517. <td valign="top" align="center">Yes</td>
  518. </tr>
  519. <tr>
  520. <td valign="top">target</td>
  521. <td valign="top">the target of the new Ant project that should be executed.</td>
  522. <td valign="top" align="center">No</td>
  523. </tr>
  524. <tr>
  525. <td valign="top">output</td>
  526. <td valign="top">Filename to write the ant output to.
  527. </td>
  528. <td align="center" valign="top">No</td>
  529. </tr>
  530. </table>
  531. <h3>Examples</h3>
  532. <blockquote>
  533. <p><code>&lt;ant antfile=&quot;subproject/subbuild.xml&quot; dir=&quot;subproject&quot;
  534. target=&quot;compile&quot; /&gt;</code></p>
  535. <p><code>&lt;ant dir=&quot;subproject&quot; /&gt;</code></p>
  536. </blockquote>
  537. <hr>
  538. <h2><a name="available">Available</a></h2>
  539. <h3>Description</h3>
  540. <p>Sets a property if a resource is available at runtime. This resource can be a
  541. file resource, a class in classpath or a JVM system resource.</p>
  542. <p>The value part of the properties being set is <i>true</i> if the resource is
  543. present, otherwise, the property is not set.</p>
  544. <p>Normally, this task is used to set properties that are useful to avoid target
  545. execution depending on system parameters.</p>
  546. <h3>Parameters</h3>
  547. <table border="1" cellpadding="2" cellspacing="0">
  548. <tr>
  549. <td valign="top"><b>Attribute</b></td>
  550. <td valign="top"><b>Description</b></td>
  551. <td align="center" valign="top"><b>Required</b></td>
  552. </tr>
  553. <tr>
  554. <td valign="top">property</td>
  555. <td valign="top">the name of the property to set.</td>
  556. <td valign="top" align="center">Yes</td>
  557. </tr>
  558. <tr>
  559. <td valign="top">classname</td>
  560. <td valign="top">the class to look for in classpath.</td>
  561. <td valign="middle" align="center" rowspan="3">Yes</td>
  562. </tr>
  563. <tr>
  564. <td valign="top">resource</td>
  565. <td valign="top">the resource to look for in the JVM</td>
  566. </tr>
  567. <tr>
  568. <td valign="top">file</td>
  569. <td valign="top">the file to look for.</td>
  570. </tr>
  571. </table>
  572. <h3>Examples</h3>
  573. <pre> &lt;available classname=&quot;org.whatever.Myclass&quot; property=&quot;Myclass.present&quot; /&gt;</pre>
  574. <p>sets the property <code><i>Myclass.present</i></code> to the value &quot;true&quot;
  575. if the <i>org.whatever.Myclass</i> is found in Ant's classpath.</p>
  576. <hr>
  577. <h2><a name="chmod">Chmod</a></h2>
  578. <h3>Description</h3>
  579. <p>Changes the permissions of a file. Right now it has efect only under Unix.
  580. The permissions are also UNIX style, like the argument for the chmod command.</p>
  581. <h3>Parameters</h3>
  582. <table border="1" cellpadding="2" cellspacing="0">
  583. <tr>
  584. <td valign="top"><b>Attribute</b></td>
  585. <td valign="top"><b>Description</b></td>
  586. <td align="center" valign="top"><b>Required</b></td>
  587. </tr>
  588. <tr>
  589. <td valign="top">src</td>
  590. <td valign="top">the file of which the permissions must be changed.</td>
  591. <td valign="top" align="center">Yes</td>
  592. </tr>
  593. <tr>
  594. <td valign="top">perm</td>
  595. <td valign="top">the new permissions.</td>
  596. <td valign="top" align="center">Yes</td>
  597. </tr>
  598. </table>
  599. <h3>Examples</h3>
  600. <blockquote>
  601. <p><code>&lt;chmod src=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;
  602. /&gt;</code></p>
  603. </blockquote>
  604. <p>makes the &quot;start.sh&quot; file readable and executable for anyone on a
  605. UNIX system.</p>
  606. <hr>
  607. <h2><a name="copydir">Copydir</a></h2>
  608. <h3>Description</h3>
  609. <p>Copies a directory tree from the source to the destination.</p>
  610. <p>It is possible to refine the set of files that are being copied. This can be
  611. done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  612. attributes. With the <i>includes</i> attribute you specify the files you want to
  613. have included by using patterns. The <i>exclude</i> attribute is used to specify
  614. the files you want to have excluded. This is also done with patterns. And
  615. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  616. want to use default exclusions or not. See the section on <a
  617. href="#directorybasedtasks">directory based tasks</a>, on how the
  618. inclusion/exclusion of files works, and how to write patterns. The patterns are
  619. relative to the <i>src</i> directory.</p>
  620. <p>The <i>ignore</i> attribute contains the names of the files/directories that
  621. must be excluded from the copy. The names specified in the <i>ignore</i>
  622. attribute are just names, they do not contain any path information! Note that
  623. this attribute has been replaced by the <i>excludes</i> attribute.</p>
  624. <h3>Parameters</h3>
  625. <table border="1" cellpadding="2" cellspacing="0">
  626. <tr>
  627. <td valign="top"><b>Attribute</b></td>
  628. <td valign="top"><b>Description</b></td>
  629. <td align="center" valign="top"><b>Required</b></td>
  630. </tr>
  631. <tr>
  632. <td valign="top">src</td>
  633. <td valign="top">the directory to copy.</td>
  634. <td valign="top" align="center">Yes</td>
  635. </tr>
  636. <tr>
  637. <td valign="top">dest</td>
  638. <td valign="top">the directory to copy to.</td>
  639. <td valign="top" align="center">Yes</td>
  640. </tr>
  641. <tr>
  642. <td valign="top">ignore</td>
  643. <td valign="top">comma separated list of filenames/directorynames to ignore.
  644. No files (except default excludes) are excluded when omitted. (<b>deprecated</b>,
  645. use <i>excludes</i> instead).</td>
  646. <td valign="top" align="center">No</td>
  647. </tr>
  648. <tr>
  649. <td valign="top">includes</td>
  650. <td valign="top">comma separated list of patterns of files that must be
  651. included. All files are included when omitted.</td>
  652. <td valign="top" align="center">No</td>
  653. </tr>
  654. <tr>
  655. <td valign="top">excludes</td>
  656. <td valign="top">comma separated list of patterns of files that must be
  657. excluded. No files (except default excludes) are excluded when omitted.</td>
  658. <td valign="top" align="center">No</td>
  659. </tr>
  660. <tr>
  661. <td valign="top">defaultexcludes</td>
  662. <td valign="top">indicates whether default excludes should be used or not
  663. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  664. <td valign="top" align="center">No</td>
  665. </tr>
  666. <tr>
  667. <td valign="top">filtering</td>
  668. <td valign="top">indicates whether token filtering should take place during
  669. the copy</td>
  670. <td valign="top" align="center">No</td>
  671. </tr>
  672. </table>
  673. <h3>Examples</h3>
  674. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  675. dest=&quot;${dist}&quot;
  676. /&gt;</pre>
  677. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>.</p>
  678. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  679. dest=&quot;${dist}&quot;
  680. includes=&quot;**/*.java&quot;
  681. excludes=&quot;**/Test.java&quot;
  682. /&gt;</pre>
  683. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  684. recursively. All java files are copied, except for files with the name <code>Test.java</code>.</p>
  685. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  686. dest=&quot;${dist}&quot;
  687. includes=&quot;**/*.java&quot;
  688. excludes=&quot;mypackage/test/**&quot; /&gt;</pre>
  689. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  690. recursively. All java files are copied, except for the files under the <code>mypackage/test</code>
  691. directory.</p>
  692. <hr>
  693. <h2><a name="copyfile">Copyfile</a></h2>
  694. <h3>Description</h3>
  695. <p>Copies a file from the source to the destination. The file is only copied if
  696. the source file is newer than the destination file, or when the destination file
  697. does not exist.</p>
  698. <h3>Parameters</h3>
  699. <table border="1" cellpadding="2" cellspacing="0">
  700. <tr>
  701. <td valign="top"><b>Attribute</b></td>
  702. <td valign="top"><b>Description</b></td>
  703. <td align="center" valign="top"><b>Required</b></td>
  704. </tr>
  705. <tr>
  706. <td valign="top">src</td>
  707. <td valign="top">the filename of the file to copy.</td>
  708. <td valign="top" align="center">Yes</td>
  709. </tr>
  710. <tr>
  711. <td valign="top">dest</td>
  712. <td valign="top">the filename of the file where to copy to.</td>
  713. <td valign="top" align="center">Yes</td>
  714. </tr>
  715. <tr>
  716. <td valign="top">filtering</td>
  717. <td valign="top">indicates whether token filtering should take place during
  718. the copy</td>
  719. <td valign="top" align="center">No</td>
  720. </tr>
  721. </table>
  722. <h3>Examples</h3>
  723. <blockquote>
  724. <p><code>&lt;copyfile src=&quot;test.java&quot; dest=&quot;subdir/test.java&quot;
  725. /&gt;</code></p>
  726. <p><code>&lt;copyfile src=&quot;${src}/index.html&quot; dest=&quot;${dist}/help/index.html&quot;
  727. /&gt;</code></p>
  728. </blockquote>
  729. <hr>
  730. <h2><a name="cvs">Cvs</a></h2>
  731. <h3>Description</h3>
  732. <p>Handles packages/modules retrieved from a
  733. <a href="http://www.cyclic.com/">CVS</a> repository.</p>
  734. <p>When doing automated builds, the <a href="#get">get task</a> should be
  735. preferred over the <i>checkout</i> command, because of speed.</p>
  736. <h3>Parameters</h3>
  737. <table border="1" cellpadding="2" cellspacing="0">
  738. <tr>
  739. <td valign="top"><b>Attribute</b></td>
  740. <td valign="top"><b>Description</b></td>
  741. <td align="center" valign="top"><b>Required</b></td>
  742. </tr>
  743. <tr>
  744. <td valign="top">command</td>
  745. <td valign="top">the CVS command to execute.</td>
  746. <td align="center" valign="top">No, default &quot;checkout&quot;</td>
  747. </tr>
  748. <tr>
  749. <td valign="top">cvsRoot</td>
  750. <td valign="top">the CVSROOT variable.</td>
  751. <td align="center" valign="top">No</td>
  752. </tr>
  753. <tr>
  754. <td valign="top">dest</td>
  755. <td valign="top">the directory where the checked out files should be placed.</td>
  756. <td align="center" valign="top">Yes</td>
  757. </tr>
  758. <tr>
  759. <td valign="top">package</td>
  760. <td valign="top">the package/module to check out.</td>
  761. <td align="center" valign="top">No</td>
  762. </tr>
  763. <tr>
  764. <td valign="top">tag</td>
  765. <td valign="top">the tag of the package/module to check out.</td>
  766. <td align="center" valign="top">No</td>
  767. </tr>
  768. <tr>
  769. <td valign="top">date</td>
  770. <td valign="top">Use the most recent revision no later than the given date</td>
  771. <td align="center" valign="top">No</td>
  772. </tr>
  773. <tr>
  774. <td valign="top">quiet</td>
  775. <td valign="top">supress informational messages.</td>
  776. <td align="center" valign="top">No, default &quot;false&quot;</td>
  777. </tr>
  778. <tr>
  779. <td valign="top">noexec</td>
  780. <td valign="top">report only, don't change any files.</td>
  781. <td align="center" valign="top">No, default &quot;false&quot;</td>
  782. </tr>
  783. </table>
  784. <h3>Examples</h3>
  785. <pre> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@jakarta.apache.org:/home/cvspublic&quot;
  786. package=&quot;jakarta-tools&quot;
  787. dest=&quot;${ws.dir}&quot;
  788. /&gt;</pre>
  789. <p>checks out the package/module &quot;jakarta-tools&quot; from the CVS
  790. repository pointed to by the cvsRoot attribute, and stores the files in &quot;${ws.dir}&quot;.</p>
  791. <pre> &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot; /&gt;</pre>
  792. <p>updates the package/module that has previously been checked out into
  793. &quot;${ws.dir}&quot;.</p>
  794. <hr>
  795. <h2><a name="delete">Delete</a></h2>
  796. <h3>Description</h3>
  797. <p>Deletes either a single file or
  798. all files in a specified directory and its sub-directories.</p>
  799. <p>It is possible to refine the set of files that are being deleted. This can be
  800. done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  801. attributes. With the <i>includes</i> attribute you specify the files you want to
  802. have included in the deletion process by using patterns. The <i>exclude</i> attribute is used to specify
  803. the files you want to have excluded from the deletion process. This is also done with patterns. And
  804. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  805. want to use default exclusions or not. See the section on <a
  806. href="#directorybasedtasks">directory based tasks</a>, on how the
  807. inclusion/exclusion of files works, and how to write patterns. The patterns are
  808. relative to the <i>dir</i> directory.</p>
  809. <h3>Parameters</h3>
  810. <table border="1" cellpadding="2" cellspacing="0">
  811. <tr>
  812. <td valign="top"><b>Attribute</b></td>
  813. <td valign="top"><b>Description</b></td>
  814. <td align="center" valign="top"><b>Required</b></td>
  815. </tr>
  816. <tr>
  817. <td valign="top">file</td>
  818. <td valign="top">The file to delete.</td>
  819. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  820. </tr>
  821. <tr>
  822. <td valign="top">dir</td>
  823. <td valign="top">The directory to delete files from.</td>
  824. </tr>
  825. <tr>
  826. <td valign="top">includes</td>
  827. <td valign="top">Comma separated list of patterns of files that must be
  828. deleted. All files are in the current directory
  829. and any sub-directories are deleted when omitted.</td>
  830. <td valign="top" align="center">No</td>
  831. </tr>
  832. <tr>
  833. <td valign="top">excludes</td>
  834. <td valign="top">Comma separated list of patterns of files that must be
  835. excluded from the deletion list. No files (except default excludes) are excluded when omitted.</td>
  836. <td valign="top" align="center">No</td>
  837. </tr>
  838. <tr>
  839. <td valign="top">defaultexcludes</td>
  840. <td valign="top">Indicates whether default excludes should be used or not
  841. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  842. <td valign="top" align="center">No</td>
  843. </tr>
  844. <tr>
  845. <td valign="top">verbose</td>
  846. <td valign="top">Show name of each deleted file (&quot;true&quot;/&quot;false&quot;). Default is "false" when omitted.</td>
  847. <td align="center" valign="top">No</td>
  848. </tr>
  849. </table>
  850. <h3>Examples</h3>
  851. <pre> &lt;delete file=&quot;/lib/ant.jar&quot; /&gt;</pre>
  852. <p>deletes the file <code>/lib/ant.jar</code>.</p>
  853. <pre> &lt;delete dir=&quot;lib&quot; /&gt;</pre>
  854. <p>deletes all files in the <code>/lib</code> directory.</p>
  855. <pre> &lt;delete dir=&quot;.&quot;
  856. include=&quot;**/*.bak&quot;
  857. /&gt;
  858. </pre>
  859. <p>deletes all files with the extension &quot;<code>.bak</code>&quot from the current directory
  860. and any sub-directories.</p>
  861. <h2><a name="deltree">Deltree</a></h2>
  862. <h3>Description</h3>
  863. <p>Deletes a directory with all its files and subdirectories.</p>
  864. <h3>Parameters</h3>
  865. <table border="1" cellpadding="2" cellspacing="0">
  866. <tr>
  867. <td valign="top"><b>Attribute</b></td>
  868. <td valign="top"><b>Description</b></td>
  869. <td align="center" valign="top"><b>Required</b></td>
  870. </tr>
  871. <tr>
  872. <td valign="top">dir</td>
  873. <td valign="top">the directory to delete.</td>
  874. <td valign="top" align="center">Yes</td>
  875. </tr>
  876. </table>
  877. <h3>Examples</h3>
  878. <pre> &lt;deltree dir=&quot;dist&quot; /&gt;</pre>
  879. <p>deletes the directory <code>dist</code>, including its files and
  880. subdirectories.</p>
  881. <pre> &lt;deltree dir=&quot;${dist}&quot; /&gt;</pre>
  882. <p>deletes the directory <code>${dist}</code>, including its files and
  883. subdirectories.</p>
  884. <hr>
  885. <h2><a name="echo">Echo</a></h2>
  886. <h3>Description</h3>
  887. <p>Echoes a message to System.out.</p>
  888. <h3>Parameters</h3>
  889. <table border="1" cellpadding="2" cellspacing="0">
  890. <tr>
  891. <td valign="top"><b>Attribute</b></td>
  892. <td valign="top"><b>Description</b></td>
  893. <td align="center" valign="top"><b>Required</b></td>
  894. </tr>
  895. <tr>
  896. <td valign="top">message</td>
  897. <td valign="top">the message to echo.</td>
  898. <td valign="top" align="center">Yes</td>
  899. </tr>
  900. </table>
  901. <h3>Examples</h3>
  902. <pre> &lt;echo message=&quot;Hello world&quot; /&gt;</pre>
  903. <hr>
  904. <h2><a name="exec">Exec</a></h2>
  905. <h3>Description</h3>
  906. <p>Executes a system command. When the <i>os</i> attribute is specified, then
  907. the command is only executed when Ant is run on one of the specified operating
  908. systems.</p>
  909. <h3>Parameters</h3>
  910. <table border="1" cellpadding="2" cellspacing="0">
  911. <tr>
  912. <td valign="top"><b>Attribute</b></td>
  913. <td valign="top"><b>Description</b></td>
  914. <td align="center" valign="top"><b>Required</b></td>
  915. </tr>
  916. <tr>
  917. <td valign="top">command</td>
  918. <td valign="top">the command to execute.</td>
  919. <td align="center" valign="top">Yes</td>
  920. </tr>
  921. <tr>
  922. <td valign="top">dir</td>
  923. <td valign="top">the directory in which the command should be executed.</td>
  924. <td align="center" valign="top">Yes</td>
  925. </tr>
  926. <tr>
  927. <td valign="top">os</td>
  928. <td valign="top">list of Operating Systems on which the command may be
  929. executed.</td>
  930. <td align="center" valign="top">No</td>
  931. </tr>
  932. <tr>
  933. <td valign="top">output</td>
  934. <td valign="top">the file to which the output of the command should be
  935. redirected.</td>
  936. <td align="center" valign="top">Yes</td>
  937. </tr>
  938. </table>
  939. <h3>Examples</h3>
  940. <blockquote>
  941. <p><code>&lt;exec dir=&quot;${src}&quot; command=&quot;dir&quot; os=&quot;windows&quot;
  942. output=&quot;dir.txt&quot; /&gt;</code></p>
  943. </blockquote>
  944. <hr>
  945. <h2><a name="expand">Expand</a></h2>
  946. <h3>Description</h3>
  947. <p>Unzips a zipfile.</p>
  948. <h3>Parameters</h3>
  949. <table border="1" cellpadding="2" cellspacing="0">
  950. <tr>
  951. <td valign="top"><b>Attribute</b></td>
  952. <td valign="top"><b>Description</b></td>
  953. <td align="center" valign="top"><b>Required</b></td>
  954. </tr>
  955. <tr>
  956. <td valign="top">src</td>
  957. <td valign="top">zipfile to expand.</td>
  958. <td align="center" valign="top">Yes</td>
  959. </tr>
  960. <tr>
  961. <td valign="top">dest</td>
  962. <td valign="top">directory where to store the expanded files.</td>
  963. <td align="center" valign="top">Yes</td>
  964. </tr>
  965. </table>
  966. <h3>Examples</h3>
  967. <blockquote>
  968. <p><code>&lt;expand src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;
  969. /&gt;</code></p>
  970. </blockquote>
  971. <hr>
  972. <h2><a name="filter">Filter</a></h2>
  973. <h3>Description</h3>
  974. <p>Sets a token filter for this project. Token filters are used by all tasks
  975. that perform file copying operations through the Project commodity methods.</p>
  976. <p>Note: the token string must not contain the separators chars (@).</p>
  977. <h3>Parameters</h3>
  978. <table border="1" cellpadding="2" cellspacing="0">
  979. <tr>
  980. <td valign="top"><b>Attribute</b></td>
  981. <td valign="top"><b>Description</b></td>
  982. <td align="center" valign="top"><b>Required</b></td>
  983. </tr>
  984. <tr>
  985. <td valign="top">token</td>
  986. <td valign="top">the token string without @</td>
  987. <td align="center" valign="top">Yes</td>
  988. </tr>
  989. <tr>
  990. <td valign="top">value</td>
  991. <td valign="top">the string that should be put to replace the token when the
  992. file is copied</td>
  993. <td align="center" valign="top">Yes</td>
  994. </tr>
  995. </table>
  996. <h3>Examples</h3>
  997. <pre> &lt;filter token=&quot;year&quot; value=&quot;2000&quot; /&gt;
  998. &lt;copydir src=&quot;${src.dir}&quot; dest=&quot;${dest.dir}&quot;/&gt;</pre>
  999. <p>will copy recursively all the files from the <i>src.dir</i> directory into
  1000. the <i>dest.dir</i> directory replacing all the occurencies of the string <i>@year@</i>
  1001. with <i>2000.</i></p>
  1002. <hr>
  1003. <h2><a name="fixcrlf">FixCRLF</a></h2>
  1004. <h3>Description</h3>
  1005. <p>Adjusts a text file to local.</p>
  1006. <p>The <i>basedir</i> attribute is the reference directory from where to jar.</p>
  1007. <h3>Parameters</h3>
  1008. <table border="1" cellpadding="2" cellspacing="0">
  1009. <tr>
  1010. <td valign="top"><b>Attribute</b></td>
  1011. <td valign="top"><b>Description</b></td>
  1012. <td align="center" valign="top"><b>Required</b></td>
  1013. </tr>
  1014. <tr>
  1015. <td valign="top">srcDir</td>
  1016. <td valign="top">Where to find the files to be fixed up.</td>
  1017. <td valign="top" align="center">Yes</td>
  1018. </tr>
  1019. <tr>
  1020. <td valign="top">destDir</td>
  1021. <td valign="top">Where to place the corrected files. Defaults to
  1022. srcDir (replacing the original file)</td>
  1023. <td valign="top" align="center">No</td>
  1024. </tr>
  1025. <tr>
  1026. <td valign="top">includes</td>
  1027. <td valign="top">comma separated list of patterns of files that must be
  1028. included. All files are included when omitted.</td>
  1029. <td valign="top" align="center">No</td>
  1030. </tr>
  1031. <tr>
  1032. <td valign="top">excludes</td>
  1033. <td valign="top">comma separated list of patterns of files that must be
  1034. excluded. No files (except default excludes) are excluded when omitted.</td>
  1035. <td valign="top" align="center">No</td>
  1036. </tr>
  1037. <tr>
  1038. <td valign="top">defaultexcludes</td>
  1039. <td valign="top">indicates whether default excludes should be used or not
  1040. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1041. <td valign="top" align="center">No</td>
  1042. </tr>
  1043. <tr>
  1044. <td valign="top">cr</td>
  1045. <td valign="top">Specifies how carriage return (CR) characters are to
  1046. be handled. Valid values for this property are:
  1047. <ul>
  1048. <li>add: ensure that there is a CR before every LF
  1049. <li>asis: leave CR characters alone
  1050. <li>remove: remove all CR characters
  1051. </ul>
  1052. Default is based on the platform on which you are running this task.
  1053. For Unix platforms, the default is remove. For DOS based systems
  1054. (including Windows), the default is add.
  1055. <p>
  1056. Note: Unless this property is specified as "asis", extra CR characters
  1057. which do not preceed a LF will be removed.
  1058. </td>
  1059. <td valign="top" align="center">No</td>
  1060. </tr>
  1061. <tr>
  1062. <td valign="top">tab</td>
  1063. <td valign="top">Specifies how tab characters are to be handled. Valid
  1064. values for this property are:
  1065. <ul>
  1066. <li>add: convert sequences of spaces which span a tab stop to tabs
  1067. <li>asis: leave tab and space characters alone
  1068. <li>remove: convert tabs to spaces
  1069. </ul>
  1070. Default for this parameter is "asis".
  1071. <p>
  1072. Note: Unless this property is specified as "asis", extra spaces and
  1073. tabs after the last non-whitespace character on the line will be removed.
  1074. </td>
  1075. <td valign="top" align="center">No</td>
  1076. </tr>
  1077. <tr>
  1078. <td valign="top">eof</td>
  1079. <td valign="top">Specifies how DOS end of file (control-Z) characters are
  1080. to be handled. Valid values for this property are:
  1081. <ul>
  1082. <li>add: ensure that there is an EOF character at the end of the file
  1083. <li>asis: leave EOF characters alone
  1084. <li>remove: remove any EOF character found at the end
  1085. </ul>
  1086. Default is based on the platform on which you are running this task.
  1087. For Unix platforms, the default is remove. For DOS based systems
  1088. (including Windows), the default is asis.
  1089. </td>
  1090. <td valign="top" align="center">No</td>
  1091. </tr>
  1092. </table>
  1093. <h3>Examples</h3>
  1094. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1095. cr=&quot;remove&quot; eof=&quot;remove&quot;
  1096. includes=&quot;**/*.sh&quot;
  1097. /&gt;</pre>
  1098. <p>Removes carriage return and eof characters from the shell scripts. Tabs and
  1099. spaces are left as is.
  1100. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1101. cr=&quot;add&quot;
  1102. includes=&quot;**/*.bat&quot;
  1103. /&gt;</pre>
  1104. <p>Ensures that there are carriage return characters prior to evey line feed.
  1105. Tabs and spaces are left as is.
  1106. EOF characters are left alone if run on
  1107. DOS systems, and are removed if run on Unix systems.</p>
  1108. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1109. tabs=&quot;add&quot;
  1110. includes=&quot;**/Makefile&quot;
  1111. /&gt;</pre>
  1112. <p>Adds or removes CR characters to match local OS conventions, and
  1113. converts spaces to tabs when appropriate. EOF characters are left alone if
  1114. run on DOS systems, and are removed if run on Unix systems.
  1115. Many versions of make require tabs prior to commands.</p>
  1116. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1117. tabs=&quot;remove&quot;
  1118. includes=&quot;**/README*&quot;
  1119. /&gt;</pre>
  1120. <p>Adds or removes CR characters to match local OS conventions, and
  1121. converts all tabs to spaces. EOF characters are left alone if run on
  1122. DOS systems, and are removed if run on Unix systems.
  1123. You never know what editor a user will use to browse README's.</p>
  1124. <hr>
  1125. <h2><a name="get">Get</a></h2>
  1126. <h3>Description</h3>
  1127. <p>Gets a file from an URL. When the verbose option is &quot;on&quot;, this task
  1128. displays a '.' for every 100 Kb retrieved.</p>
  1129. <p>This task should be preferred above the <a href="#cvs">CVS task</a> when
  1130. doing automated builds. CVS is significant slower than loading a compressed
  1131. archive with http/ftp.</p>
  1132. <h3>Parameters</h3>
  1133. <table border="1" cellpadding="2" cellspacing="0">
  1134. <tr>
  1135. <td valign="top"><b>Attribute</b></td>
  1136. <td valign="top"><b>Description</b></td>
  1137. <td align="center" valign="top"><b>Required</b></td>
  1138. </tr>
  1139. <tr>
  1140. <td valign="top">src</td>
  1141. <td valign="top">the URL from which to retrieve a file.</td>
  1142. <td align="center" valign="top">Yes</td>
  1143. </tr>
  1144. <tr>
  1145. <td valign="top">dest</td>
  1146. <td valign="top">the file where to store the retrieved file.</td>
  1147. <td align="center" valign="top">Yes</td>
  1148. </tr>
  1149. <tr>
  1150. <td valign="top">verbose</td>
  1151. <td valign="top">show verbose information (&quot;on&quot;/&quot;off&quot;).</td>
  1152. <td align="center" valign="top">No</td>
  1153. </tr>
  1154. <tr>
  1155. <td valign="top">ignoreerrors</td>
  1156. <td valign="top">Log errors but don't treat as fatal.</td>
  1157. <td align="center" valign="top">No</td>
  1158. </tr>
  1159. </table>
  1160. <h3>Examples</h3>
  1161. <pre> &lt;get src=&quot;http://jakarta.apache.org/&quot; dest=&quot;help/index.html&quot; /&gt;</pre>
  1162. <p>gets the index page of http://jakarta.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
  1163. <hr>
  1164. <h2><a name="gunzip">GUnzip</a></h2>
  1165. <h3>Description</h3>
  1166. <p>Expands a GZip file.</p>
  1167. <p>If <i>dest</i> is a directory the name of the destination file is
  1168. the same as <i>src</i> (with the &quot;.gz&quot; extension removed if
  1169. present). If <i>dest</i> is ommited, the parent dir of <i>src</i> is
  1170. taken. The file is only expanded if the source file is newer than the
  1171. destination file, or when the destination file does not exist.</p>
  1172. <h3>Parameters</h3>
  1173. <table border="1" cellpadding="2" cellspacing="0">
  1174. <tr>
  1175. <td valign="top"><b>Attribute</b></td>
  1176. <td valign="top"><b>Description</b></td>
  1177. <td align="center" valign="top"><b>Required</b></td>
  1178. </tr>
  1179. <tr>
  1180. <td valign="top">src</td>
  1181. <td valign="top">the file to expand.</td>
  1182. <td align="center" valign="top">Yes</td>
  1183. </tr>
  1184. <tr>
  1185. <td valign="top">dest</td>
  1186. <td valign="top">the destination file or directory.</td>
  1187. <td align="center" valign="top">No</td>
  1188. </tr>
  1189. </table>
  1190. <h3>Examples</h3>
  1191. <blockquote>
  1192. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot;/&gt;</code></p>
  1193. </blockquote>
  1194. <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
  1195. <blockquote>
  1196. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;</code></p>
  1197. </blockquote>
  1198. <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
  1199. <blockquote>
  1200. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;subdir&quot;/&gt;</code></p>
  1201. </blockquote>
  1202. <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
  1203. subdir is a directory).</p>
  1204. <hr>
  1205. <h2><a name="gzip">GZip</a></h2>
  1206. <h3>Description</h3>
  1207. <p>GZips a file.</p>
  1208. <h3>Parameters</h3>
  1209. <table border="1" cellpadding="2" cellspacing="0">
  1210. <tr>
  1211. <td valign="top"><b>Attribute</b></td>
  1212. <td valign="top"><b>Description</b></td>
  1213. <td align="center" valign="top"><b>Required</b></td>
  1214. </tr>
  1215. <tr>
  1216. <td valign="top">src</td>
  1217. <td valign="top">the file to gzip.</td>
  1218. <td align="center" valign="top">Yes</td>
  1219. </tr>
  1220. <tr>
  1221. <td valign="top">zipfile</td>
  1222. <td valign="top">the destination file.</td>
  1223. <td align="center" valign="top">Yes</td>
  1224. </tr>
  1225. </table>
  1226. <h3>Examples</h3>
  1227. <blockquote>
  1228. <p><code>&lt;gzip src=&quot;test.tar&quot; zipfile=&quot;test.tar.gz&quot;
  1229. /&gt;</code></p>
  1230. </blockquote>
  1231. <hr>
  1232. <h2><a name="jar">Jar</a></h2>
  1233. <h3>Description</h3>
  1234. <p>Jars a set of files.</p>
  1235. <p>The <i>basedir</i> attribute is the reference directory from where to jar.</p>
  1236. <p>It is possible to refine the set of files that are being jarred. This can be
  1237. done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  1238. attributes. With the <i>includes</i> attribute you specify the files you want to
  1239. have included by using patterns. The <i>exclude</i> attribute is used to specify
  1240. the files you want to have excluded. This is also done with patterns. And
  1241. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1242. want to use default exclusions or not. See the section on <a
  1243. href="#directorybasedtasks">directory based tasks</a>, on how the
  1244. inclusion/exclusion of files works, and how to write patterns. The patterns are
  1245. relative to the <i>basedir</i> directory.</p>
  1246. <p>The <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i> attributes
  1247. replace the <i>items</i> and <i>ignore</i> attributes. The following explains
  1248. how the deprecated <i>items</i> and <i>ignore</i> attribute behave.</p>
  1249. <p>When &quot;*&quot; is used for <i>items</i>, all files in the basedir, and
  1250. its subdirectories, will be jarred. Otherwise all the files and directories
  1251. mentioned in the items list will jarred. When a directory is specified, then all
  1252. files within it are also jarred.</p>
  1253. <p>With the <i>ignore</i> attribute, you can specify files or directories to
  1254. ignore. These files will not be jarred. The items in the <i>ignore</i> attribute
  1255. override the items in the <i>items</i> attribute. The names specified in the <i>ignore</i>
  1256. attribute are just names, they do not contain any path information!</p>
  1257. <h3>Parameters</h3>
  1258. <table border="1" cellpadding="2" cellspacing="0">
  1259. <tr>
  1260. <td valign="top"><b>Attribute</b></td>
  1261. <td valign="top"><b>Description</b></td>
  1262. <td align="center" valign="top"><b>Required</b></td>
  1263. </tr>
  1264. <tr>
  1265. <td valign="top">jarfile</td>
  1266. <td valign="top">the jar-file to create.</td>
  1267. <td valign="top" align="center">Yes</td>
  1268. </tr>
  1269. <tr>
  1270. <td valign="top">basedir</td>
  1271. <td valign="top">the directory from which to jar the files.</td>
  1272. <td valign="top" align="center">Yes</td>
  1273. </tr>
  1274. <tr>
  1275. <td valign="top">compress</td>
  1276. <td valign="top">Not only store data but also compress them, defaults to true</td>
  1277. <td align="center" valign="top">No</td>
  1278. </tr>
  1279. <tr>
  1280. <td valign="top">items</td>
  1281. <td valign="top">a comma separated list of the files/directories to jar. All
  1282. files are included when omitted. (<b>deprecated</b>, use <i>includes</i>
  1283. instead).</td>
  1284. <td valign="top" align="center">No</td>
  1285. </tr>
  1286. <tr>
  1287. <td valign="top">ignore</td>
  1288. <td valign="top">comma separated list of filenames/directorynames to exclude
  1289. from the jar. No files (except default excludes) are excluded when
  1290. omitted. (<b>deprecated</b>, use <i>excludes</i> instead).</td>
  1291. <td valign="top" align="center">No</td>
  1292. </tr>
  1293. <tr>
  1294. <td valign="top">includes</td>
  1295. <td valign="top">comma separated list of patterns of files that must be
  1296. included. All files are included when omitted.</td>
  1297. <td valign="top" align="center">No</td>
  1298. </tr>
  1299. <tr>
  1300. <td valign="top">excludes</td>
  1301. <td valign="top">comma separated list of patterns of files that must be
  1302. excluded. No files (except default excludes) are excluded when omitted.</td>
  1303. <td valign="top" align="center">No</td>
  1304. </tr>
  1305. <tr>
  1306. <td valign="top">defaultexcludes</td>
  1307. <td valign="top">indicates whether default excludes should be used or not
  1308. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1309. <td valign="top" align="center">No</td>
  1310. </tr>
  1311. <tr>
  1312. <td valign="top">manifest</td>
  1313. <td valign="top">the manifest file to use.</td>
  1314. <td valign="top" align="center">No</td>
  1315. </tr>
  1316. </table>
  1317. <h3>Examples</h3>
  1318. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; /&gt;</pre>
  1319. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1320. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p>
  1321. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
  1322. basedir=&quot;${build}/classes&quot;
  1323. excludes=&quot;**/Test.class&quot;
  1324. /&gt;</pre>
  1325. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1326. called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files
  1327. with the name <code>Test.class</code> are excluded.</p>
  1328. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
  1329. basedir=&quot;${build}/classes&quot;
  1330. includes=&quot;mypackage/test/**&quot;
  1331. excludes=&quot;**/Test.class&quot;
  1332. /&gt;</pre>
  1333. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1334. called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only
  1335. files under the directory <code>mypackage/test</code> are used, and files with
  1336. the name <code>Test.class</code> are excluded.</p>
  1337. <h3>Deprecated examples</h3>
  1338. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; items=&quot;*&quot; /&gt;</pre>
  1339. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1340. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p>
  1341. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; items=&quot;*&quot; ignore=&quot;Test.class&quot; /&gt;</pre>
  1342. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1343. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.
  1344. Files/directories with the name <code>Test.class</code> are excluded.</p>
  1345. <hr>
  1346. <h2><a name="java">Java</a></h2>
  1347. <h3>Description</h3>
  1348. <p>Executes a Java class within the running (Ant) VM or forks another VM if
  1349. specified.</p>
  1350. <p>Be careful that the executed class doesn't call System.exit(), because it
  1351. will terminate the VM and thus Ant. In case this happens, it's highly suggested
  1352. that you set the fork attribute so that System.exit() stops the other VM and not
  1353. the one that is currently running Ant.</p>
  1354. <h3>Parameters</h3>
  1355. <table border="1" cellpadding="2" cellspacing="0">
  1356. <tr>
  1357. <td valign="top"><b>Attribute</b></td>
  1358. <td valign="top"><b>Description</b></td>
  1359. <td align="center" valign="top"><b>Required</b></td>
  1360. </tr>
  1361. <tr>
  1362. <td valign="top">classname</td>
  1363. <td valign="top">the Java class to execute.</td>
  1364. <td align="center" valign="top">Yes</td>
  1365. </tr>
  1366. <tr>
  1367. <td valign="top">args</td>
  1368. <td valign="top">the arguments for the class that is executed.</td>
  1369. <td align="center" valign="top">No</td>
  1370. </tr>
  1371. <tr>
  1372. <td valign="top">classpath</td>
  1373. <td valign="top">the classpath to use.</td>
  1374. <td align="center" valign="top">No</td>
  1375. </tr>
  1376. <tr>
  1377. <td valign="top">fork</td>
  1378. <td valign="top">if enabled triggers the class execution in another VM
  1379. (disabled by default)</td>
  1380. <td align="center" valign="top">No</td>
  1381. </tr>
  1382. <tr>
  1383. <td valign="top">jvm</td>
  1384. <td valign="top">the command used to invoke the Java Virtual Machine,
  1385. default is 'java'. The command is resolved by java.lang.Runtime.exec().
  1386. Ignored if fork is disabled.
  1387. </td>
  1388. <td align="center" valign="top">No</td>
  1389. </tr>
  1390. <tr>
  1391. <td valign="top">jvmargs</td>
  1392. <td valign="top">the arguments to pass to the forked VM (ignored if fork is
  1393. disabled)</td>
  1394. <td align="center" valign="top">No</td>
  1395. </tr>
  1396. </table>
  1397. <h3>Examples</h3>
  1398. <pre> &lt;java classname=&quot;test.Main&quot; /&gt;</pre>
  1399. <pre> &lt;java classname=&quot;test.Main&quot; args=&quot;-h&quot; /&gt;</pre>
  1400. <pre> &lt;java classname=&quot;test.Main&quot;
  1401. args=&quot;-h&quot;
  1402. fork=&quot;yes&quot;
  1403. jvmargs=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;
  1404. /&gt;</pre>
  1405. <hr>
  1406. <h2><a name="javac">Javac</a></h2>
  1407. <h3>Description</h3>
  1408. <p>Compiles a source tree within the running (Ant) VM.</p>
  1409. <p>The source and destination directory will be recursively scanned for Java
  1410. source files to compile. Only Java files that have no corresponding class file
  1411. or where the class file is older than the java file will be compiled.</p>
  1412. <p>Files in the source tree, that are no java files, are copied to the
  1413. destination directory, allowing support files to be located properly in the
  1414. classpath.</p>
  1415. <p>The directory structure of the source tree should follow the package
  1416. hierarchy.</p>
  1417. <p>It is possible to refine the set of files that are being compiled/copied.
  1418. This can be done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  1419. attributes. With the <i>includes</i> attribute you specify the files you want to
  1420. have included by using patterns. The <i>exclude</i> attribute is used to specify
  1421. the files you want to have excluded. This is also done with patterns. And
  1422. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1423. want to use default exclusions or not. See the section on <a
  1424. href="#directorybasedtasks">directory based tasks</a>, on how the
  1425. inclusion/exclusion of files works, and how to write patterns. The patterns are
  1426. relative to the <i>srcdir</i> directory.</p>
  1427. <p>It is possible to use different compilers. This can be selected with the
  1428. &quot;build.compiler&quot; property. There are three choices:</p>
  1429. <ul>
  1430. <li>classic (the standard compiler of JDK 1.1/1.2)</li>
  1431. <li>modern (the new compiler of JDK 1.3)</li>
  1432. <li>jikes (the <a
  1433. href="http://oss.software.ibm.com/developerworks/opensource/jikes/project">Jikes</a>
  1434. compiler)</li>
  1435. </ul>
  1436. <p>For JDK 1.1/1.2 is classic the default. For JDK 1.3 is modern the default.</p>
  1437. <h3>Parameters</h3>
  1438. <table border="1" cellpadding="2" cellspacing="0">
  1439. <tr>
  1440. <td valign="top"><b>Attribute</b></td>
  1441. <td valign="top"><b>Description</b></td>
  1442. <td align="center" valign="top"><b>Required</b></td>
  1443. </tr>
  1444. <tr>
  1445. <td valign="top">srcdir</td>
  1446. <td valign="top">location of the java files.</td>
  1447. <td align="center" valign="top">Yes</td>
  1448. </tr>
  1449. <tr>
  1450. <td valign="top">destdir</td>
  1451. <td valign="top">location where to store the class files.</td>
  1452. <td align="center" valign="top">Yes</td>
  1453. </tr>
  1454. <tr>
  1455. <td valign="top">includes</td>
  1456. <td valign="top">comma separated list of patterns of files that must be
  1457. included. All files are included when omitted.</td>
  1458. <td valign="top" align="center">No</td>
  1459. </tr>
  1460. <tr>
  1461. <td valign="top">excludes</td>
  1462. <td valign="top">comma separated list of patterns of files that must be
  1463. excluded. No files (except default excludes) are excluded when omitted.</td>
  1464. <td valign="top" align="center">No</td>
  1465. </tr>
  1466. <tr>
  1467. <td valign="top">defaultexcludes</td>
  1468. <td valign="top">indicates whether default excludes should be used or not
  1469. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1470. <td valign="top" align="center">No</td>
  1471. </tr>
  1472. <tr>
  1473. <td valign="top">classpath</td>
  1474. <td valign="top">the classpath to use.</td>
  1475. <td align="center" valign="top">No</td>
  1476. </tr>
  1477. <tr>
  1478. <td valign="top">bootclasspath</td>
  1479. <td valign="top">location of bootstrap class files.</td>
  1480. <td align="center" valign="top">No</td>
  1481. </tr>
  1482. <tr>
  1483. <td valign="top">extdirs</td>
  1484. <td valign="top">location of installed extensions.</td>
  1485. <td align="center" valign="top">No</td>
  1486. </tr>
  1487. <tr>
  1488. <td valign="top">debug</td>
  1489. <td valign="top">indicates whether there should be compiled with debug
  1490. information (&quot;on&quot;).</td>
  1491. <td align="center" valign="top">No</td>
  1492. </tr>
  1493. <tr>
  1494. <td valign="top">optimize</td>
  1495. <td valign="top">indicates whether there should be compiled with
  1496. optimization (&quot;on&quot;).</td>
  1497. <td align="center" valign="top">No</td>
  1498. </tr>
  1499. <tr>
  1500. <td valign="top">deprecation</td>
  1501. <td valign="top">indicates whether there should be compiled with deprecation
  1502. information (&quot;on&quot;).</td>
  1503. <td align="center" valign="top">No</td>
  1504. </tr>
  1505. <tr>
  1506. <td valign="top">filtering</td>
  1507. <td valign="top">indicates whether token filtering should take place</td>
  1508. <td valign="top" align="center">No</td>
  1509. </tr>
  1510. <tr>
  1511. <td valign="top">target</td>
  1512. <td valign="top">Generate class files for specific VM version, e.g. "1.1" or "1.2".</td>
  1513. <td align="center" valign="top">No</td>
  1514. </tr>
  1515. </table>
  1516. <h3>Examples</h3>
  1517. <pre> &lt;javac srcdir=&quot;${src}&quot;
  1518. destdir=&quot;${build}&quot;
  1519. classpath=&quot;xyz.jar&quot;
  1520. debug=&quot;on&quot;
  1521. /&gt;</pre>
  1522. <p>compiles all .java files under the directory <code>${src}</code>, and stores
  1523. the .class files in the directory <code>${build}</code>. It also copies the non-java
  1524. files from the tree under <code>${src}</code> to the tree under <code>${build}</code>.
  1525. The classpath used contains <code>xyz.jar</code>, and debug information is on.</p>
  1526. <pre> &lt;javac srcdir=&quot;${src}&quot;
  1527. destdir=&quot;${build}&quot;
  1528. includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
  1529. excludes=&quot;mypackage/p1/testpackage/**&quot;
  1530. classpath=&quot;xyz.jar&quot;
  1531. debug=&quot;on&quot;
  1532. /&gt;</pre>
  1533. <p>compiles .java files under the directory <code>${src}</code>, and stores the
  1534. .class files in the directory <code>${build}</code>. It also copies the non-java
  1535. files from the tree under <code>${src}</code> to the tree under <code>${build}</code>.
  1536. The classpath used contains <code>xyz.jar</code>, and debug information is on.
  1537. Only files under <code>mypackage/p1</code> and <code>mypackage/p2</code> are
  1538. used. Files in the <code>mypackage/p1/testpackage</code> directory are excluded
  1539. form compilation and copy.</p>
  1540. <hr>
  1541. <h2><a name="javadoc">Javadoc/Javadoc2</a></h2>
  1542. <h3>Description</h3>
  1543. <p>Generates code documentation using the javadoc tool.</p>
  1544. <p>The source directory will be recursively scanned for Java source files to but
  1545. only those matching the inclusion rules will be passed to the javadoc tool. This
  1546. allows wildcards to be used to choose between package names, reducing verbosity
  1547. and management costs over time. This task, however, has no notion of
  1548. &quot;changed&quot; files, unlike the <a href="#javac">javac</a> task, but it's
  1549. not used so frequently.</p>
  1550. <p>This task works seamlessly between different javadoc versions (1.1 and 1.2),
  1551. with the obvious restriction that the 1.2 attributes will be ignored if run in a
  1552. 1.1 VM.</p>
  1553. <p>NOTE: since javadoc calls System.exit(), we cannot run javadoc inside the
  1554. same VM without breaking functionality. For this reason, this task always forks
  1555. the VM. But this is not a performance penalty since javadoc is normally a heavy
  1556. application and must be called just once.</p>
  1557. <p>DEPRECATION: the javadoc2 task simply points to the javadoc task and it's
  1558. there for back compatibility reasons. Since this task will be removed in future
  1559. versions, you are strongly encouraged to use <a href="#javadoc">javadoc</a>
  1560. instead.</p>
  1561. <h3>Parameters</h3>
  1562. <table border="1" cellpadding="2" cellspacing="0">
  1563. <tr>
  1564. <td valign="top"><b>Attribute</b></td>
  1565. <td valign="top"><b>Description</b></td>
  1566. <td align="center" valign="top"><b>Availability</b></td>
  1567. <td align="center" valign="top"><b>Required</b></td>
  1568. </tr>
  1569. <tr>
  1570. <td valign="top">sourcepath</td>
  1571. <td valign="top">Specify where to find source files</td>
  1572. <td align="center" valign="top">all</td>
  1573. <td align="center" valign="top">Yes</td>
  1574. </tr>
  1575. <tr>
  1576. <td valign="top">destdir</td>
  1577. <td valign="top">Destination directory for output files</td>
  1578. <td align="center" valign="top">all</td>
  1579. <td align="center" valign="top">Yes</td>
  1580. </tr>
  1581. <tr>
  1582. <td valign="top">sourcefiles</td>
  1583. <td valign="top">Space separated list of source files</td>
  1584. <td align="center" valign="top">all</td>
  1585. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  1586. </tr>
  1587. <tr>
  1588. <td valign="top">packagenames</td>
  1589. <td valign="top">Space separated list of package files (with terminating
  1590. wildcard)</td>
  1591. <td align="center" valign="top">all</td>
  1592. </tr>
  1593. <tr>
  1594. <td valign="top">Classpath</td>
  1595. <td valign="top">Specify where to find user class files</td>
  1596. <td align="center" valign="top">all</td>
  1597. <td align="center" valign="top">No</td>
  1598. </tr>
  1599. <tr>
  1600. <td valign="top">Bootclasspath</td>
  1601. <td valign="top">Override location of class files loaded by the bootstrap
  1602. class loader</td>
  1603. <td align="center" valign="top">1.2</td>
  1604. <td align="center" valign="top">No</td>
  1605. </tr>
  1606. <tr>
  1607. <td valign="top">Extdirs</td>
  1608. <td valign="top">Override location of installed extensions</td>
  1609. <td align="center" valign="top">1.2</td>
  1610. <td align="center" valign="top">No</td>
  1611. </tr>
  1612. <tr>
  1613. <td valign="top">Overview</td>
  1614. <td valign="top">Read overview documentation from HTML file</td>
  1615. <td align="center" valign="top">1.2</td>
  1616. <td align="center" valign="top">No</td>
  1617. </tr>
  1618. <tr>
  1619. <td valign="top">Public</td>
  1620. <td valign="top">Show only public classes and members</td>
  1621. <td align="center" valign="top">all</td>
  1622. <td align="center" valign="top">No</td>
  1623. </tr>
  1624. <tr>
  1625. <td valign="top">Protected</td>
  1626. <td valign="top">Show protected/public classes and members (default)</td>
  1627. <td align="center" valign="top">all</td>
  1628. <td align="center" valign="top">No</td>
  1629. </tr>
  1630. <tr>
  1631. <td valign="top">Package</td>
  1632. <td valign="top">Show package/protected/public classes and members</td>
  1633. <td align="center" valign="top">all</td>
  1634. <td align="center" valign="top">No</td>
  1635. </tr>
  1636. <tr>
  1637. <td valign="top">Private</td>
  1638. <td valign="top">Show all classes and members</td>
  1639. <td align="center" valign="top">all</td>
  1640. <td align="center" valign="top">No</td>
  1641. </tr>
  1642. <tr>
  1643. <td valign="top">Old</td>
  1644. <td valign="top">Generate output using JDK 1.1 emulating doclet</td>
  1645. <td align="center" valign="top">1.2</td>
  1646. <td align="center" valign="top">No</td>
  1647. </tr>
  1648. <tr>
  1649. <td valign="top">Verbose</td>
  1650. <td valign="top">Output messages about what Javadoc is doing</td>
  1651. <td align="center" valign="top">1.2</td>
  1652. <td align="center" valign="top">No</td>
  1653. </tr>
  1654. <tr>
  1655. <td valign="top">Locale</td>
  1656. <td valign="top">Locale to be used, e.g. en_US or en_US_WIN</td>
  1657. <td align="center" valign="top">1.2</td>
  1658. <td align="center" valign="top">No</td>
  1659. </tr>
  1660. <tr>
  1661. <td valign="top">Encoding</td>
  1662. <td valign="top">Source file encoding name</td>
  1663. <td align="center" valign="top">all</td>
  1664. <td align="center" valign="top">No</td>
  1665. </tr>
  1666. <tr>
  1667. <td valign="top">Version</td>
  1668. <td valign="top">Include @version paragraphs</td>
  1669. <td align="center" valign="top">all</td>
  1670. <td align="center" valign="top">No</td>
  1671. </tr>
  1672. <tr>
  1673. <td valign="top">Use</td>
  1674. <td valign="top">Create class and package usage pages</td>
  1675. <td align="center" valign="top">1.2</td>
  1676. <td align="center" valign="top">No</td>
  1677. </tr>
  1678. <tr>
  1679. <td valign="top">Author</td>
  1680. <td valign="top">Include @author paragraphs</td>
  1681. <td align="center" valign="top">all</td>
  1682. <td align="center" valign="top">No</td>
  1683. </tr>
  1684. <tr>
  1685. <td valign="top">Splitindex</td>
  1686. <td valign="top">Split index into one file per letter</td>
  1687. <td align="center" valign="top">1.2</td>
  1688. <td align="center" valign="top">No</td>
  1689. </tr>
  1690. <tr>
  1691. <td valign="top">Windowtitle</td>
  1692. <td valign="top">Browser window title for the documenation (text)</td>
  1693. <td align="center" valign="top">1.2</td>
  1694. <td align="center" valign="top">No</td>
  1695. </tr>
  1696. <tr>
  1697. <td valign="top">Doctitle</td>
  1698. <td valign="top">Include title for the package index(first) page (html-code)</td>
  1699. <td align="center" valign="top">1.2</td>
  1700. <td align="center" valign="top">No</td>
  1701. </tr>
  1702. <tr>
  1703. <td valign="top">Header</td>
  1704. <td valign="top">Include header text for each page (html-code)</td>
  1705. <td align="center" valign="top">1.2</td>
  1706. <td align="center" valign="top">No</td>
  1707. </tr>
  1708. <tr>
  1709. <td valign="top">Footer</td>
  1710. <td valign="top">Include footer text for each page (html-code)</td>
  1711. <td align="center" valign="top">1.2</td>
  1712. <td align="center" valign="top">No</td>
  1713. </tr>
  1714. <tr>
  1715. <td valign="top">bottom</td>
  1716. <td valign="top">Include bottom text for each page (html-code)</td>
  1717. <td align="center" valign="top">1.2</td>
  1718. <td align="center" valign="top">No</td>
  1719. </tr>
  1720. <tr>
  1721. <td valign="top">link</td>
  1722. <td valign="top">Create links to javadoc output at the given URL</td>
  1723. <td align="center" valign="top">1.2</td>
  1724. <td align="center" valign="top">No</td>
  1725. </tr>
  1726. <tr>
  1727. <td valign="top">linkoffline</td>
  1728. <td valign="top">Link to docs at &lt;url&gt; using package list at
  1729. &lt;url2&gt;</td>
  1730. <td align="center" valign="top">1.2</td>
  1731. <td align="center" valign="top">No</td>
  1732. </tr>
  1733. <tr>
  1734. <td valign="top">group</td>
  1735. <td valign="top">Group specified packages together in overview page</td>
  1736. <td align="center" valign="top">1.2</td>
  1737. <td align="center" valign="top">No</td>
  1738. </tr>
  1739. <tr>
  1740. <td valign="top">nodeprecated</td>
  1741. <td valign="top">Do not include @deprecated information</td>
  1742. <td align="center" valign="top">all</td>
  1743. <td align="center" valign="top">No</td>
  1744. </tr>
  1745. <tr>
  1746. <td valign="top">nodeprecatedlist</td>
  1747. <td valign="top">Do not generate deprecated list</td>
  1748. <td align="center" valign="top">1.2</td>
  1749. <td align="center" valign="top">No</td>
  1750. </tr>
  1751. <tr>
  1752. <td valign="top">notree</td>
  1753. <td valign="top">Do not generate class hierarchy</td>
  1754. <td align="center" valign="top">all</td>
  1755. <td align="center" valign="top">No</td>
  1756. </tr>
  1757. <tr>
  1758. <td valign="top">noindex</td>
  1759. <td valign="top">Do not generate index</td>
  1760. <td align="center" valign="top">all</td>
  1761. <td align="center" valign="top">No</td>
  1762. </tr>
  1763. <tr>
  1764. <td valign="top">nohelp</td>
  1765. <td valign="top">Do not generate help link</td>
  1766. <td align="center" valign="top">1.2</td>
  1767. <td align="center" valign="top">No</td>
  1768. </tr>
  1769. <tr>
  1770. <td valign="top">nonavbar</td>
  1771. <td valign="top">Do not generate navigation bar</td>
  1772. <td align="center" valign="top">1.2</td>
  1773. <td align="center" valign="top">No</td>
  1774. </tr>
  1775. <tr>
  1776. <td valign="top">serialwarn</td>
  1777. <td valign="top">FUTURE: Generate warning about @serial tag</td>
  1778. <td align="center" valign="top">1.2</td>
  1779. <td align="center" valign="top">No</td>
  1780. </tr>
  1781. <tr>
  1782. <td valign="top">helpfile</td>
  1783. <td valign="top">FUTURE: Specifies the HTML help file to use</td>
  1784. <td align="center" valign="top">1.2</td>
  1785. <td align="center" valign="top">No</td>
  1786. </tr>
  1787. <tr>
  1788. <td valign="top">stylesheetfile</td>
  1789. <td valign="top">Specifies the CSS stylesheet to use</td>
  1790. <td align="center" valign="top">1.2</td>
  1791. <td align="center" valign="top">No</td>
  1792. </tr>
  1793. <tr>
  1794. <td valign="top">charset</td>
  1795. <td valign="top">FUTURE: Charset for cross-platform viewing of generated
  1796. documentation</td>
  1797. <td align="center" valign="top">1.2</td>
  1798. <td align="center" valign="top">No</td>
  1799. </tr>
  1800. <tr>
  1801. <td valign="top">docencoding</td>
  1802. <td valign="top">Output file encoding name</td>
  1803. <td align="center" valign="top">1.1</td>
  1804. <td align="center" valign="top">No</td>
  1805. </tr>
  1806. <tr>
  1807. <td valign="top">doclet</td>
  1808. <td valign="top">Specifies the class file that starts the doclet used in generating the documentation.</td>
  1809. <td align="center" valign="top">No</td>
  1810. </tr>
  1811. <tr>
  1812. <td valign="top">docletpath</td>
  1813. <td valign="top">Specifies the path to the doclet class file that is specified with the -doclet option.</td>
  1814. <td align="center" valign="top">No</td>
  1815. </tr>
  1816. </table>
  1817. <h3>Example</h3>
  1818. <pre> &lt;javadoc packagenames=&quot;com.dummy.test.*&quot;
  1819. sourcepath=&quot;src&quot;
  1820. destdir=&quot;docs/api&quot;
  1821. author=&quot;true&quot;
  1822. version=&quot;true&quot;
  1823. use=&quot;true&quot;
  1824. windowtitle=&quot;Test API&quot;
  1825. doctitle=&quot;&lt;h1&gt;Test&lt;/h1&gt;&quot;
  1826. bottom=&quot;&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;&quot;
  1827. /&gt;</pre>
  1828. <hr>
  1829. <h2><a name="keysubst">KeySubst</a></h2>
  1830. <h3>Description</h3>
  1831. <p>Performs keyword substitution in the source file, and writes the result to
  1832. the destination file.</p>
  1833. <p>Keys in the source file are of the form ${keyname}. The <i>keys</i> attribute
  1834. contains key/value pairs. When a key is found in the <i>keys</i> attribute, then
  1835. &quot;${keyname}&quot; is replaced by the corresponding value.</p>
  1836. <p>The <i>keys</i> attribute is of the form
  1837. &quot;name1=value1*name2=value2*name3=value3&quot;. The '*' is called the
  1838. separator, which might we changed with the <i>sep</i> attribute.</p>
  1839. <p>Note: the source file and destination file may not be the same.</p>
  1840. <h3>Parameters</h3>
  1841. <table border="1" cellpadding="2" cellspacing="0">
  1842. <tr>
  1843. <td valign="top"><b>Attribute</b></td>
  1844. <td valign="top"><b>Description</b></td>
  1845. <td align="center" valign="top"><b>Required</b></td>
  1846. </tr>
  1847. <tr>
  1848. <td valign="top">src</td>
  1849. <td valign="top">the source file.</td>
  1850. <td align="center" valign="top">Yes</td>
  1851. </tr>
  1852. <tr>
  1853. <td valign="top">dest</td>
  1854. <td valign="top">the destination file.</td>
  1855. <td align="center" valign="top">Yes</td>
  1856. </tr>
  1857. <tr>
  1858. <td valign="top">sep</td>
  1859. <td valign="top">the separator for the name/value pairs.</td>
  1860. <td align="center" valign="top">No</td>
  1861. </tr>
  1862. <tr>
  1863. <td valign="top">keys</td>
  1864. <td valign="top">name/value pairs for replacement.</td>
  1865. <td align="center" valign="top">Yes</td>
  1866. </tr>
  1867. </table>
  1868. <h3>Examples</h3>
  1869. <pre> &lt;keysubst src=&quot;abc.txt&quot; dest=&quot;def.txt&quot; keys=&quot;VERSION=1.0.3*DATE=2000-01-10&quot; /&gt;</pre>
  1870. <hr>
  1871. <h2><a name="mkdir">Mkdir</a></h2>
  1872. <h3>Description</h3>
  1873. <p>Creates a directory. Also non-existent parent directories are created, when
  1874. necessary.</p>
  1875. <h3>Parameters</h3>
  1876. <table border="1" cellpadding="2" cellspacing="0">
  1877. <tr>
  1878. <td valign="top"><b>Attribute</b></td>
  1879. <td valign="top"><b>Description</b></td>
  1880. <td align="center" valign="top"><b>Required</b></td>
  1881. </tr>
  1882. <tr>
  1883. <td valign="top">dir</td>
  1884. <td valign="top">the directory to create.</td>
  1885. <td align="center" valign="top">Yes</td>
  1886. </tr>
  1887. </table>
  1888. <h3>Examples</h3>
  1889. <pre>&lt;mkdir dir=&quot;${dist}&quot; /&gt;</pre>
  1890. <p>creates a directory <code>${dist}</code>.</p>
  1891. <pre>&lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;</pre>
  1892. <p>creates a directory <code>${dist}/lib</code>.</p>
  1893. <hr>
  1894. <h2><a name="patch">Patch</a></h2>
  1895. <h3>Description</h3>
  1896. <p>Applies a diff file to originals.
  1897. <h3>Parameters</h3>
  1898. <table border="1" cellpadding="2" cellspacing="0">
  1899. <tr>
  1900. <td valign="top"><b>Attribute</b></td>
  1901. <td valign="top"><b>Description</b></td>
  1902. <td align="center" valign="top"><b>Required</b></td>
  1903. </tr>
  1904. <tr>
  1905. <td valign="top">dir</td>
  1906. <td valign="top">the directory in which the command should be executed.</td>
  1907. <td align="center" valign="top">Yes</td>
  1908. </tr>
  1909. <tr>
  1910. <td valign="top">os</td>
  1911. <td valign="top">list of Operating Systems on which the command may be
  1912. executed.</td>
  1913. <td align="center" valign="top">No</td>
  1914. </tr>
  1915. <tr>
  1916. <td valign="top">output</td>
  1917. <td valign="top">the file to which the output of the patch command
  1918. should be redirected.</td>
  1919. <td align="center" valign="top">No</td>
  1920. </tr>
  1921. <tr>
  1922. <td valign="top">patchfile</td>
  1923. <td valign="top">the file that includes the diff output</td>
  1924. <td align="center" valign="top">Yes</td>
  1925. </tr>
  1926. <tr>
  1927. <td valign="top">originalfile</td>
  1928. <td valign="top">the file to patch</td>
  1929. <td align="center" valign="top">No, tries to guess it from the diff
  1930. file</td>
  1931. </tr>
  1932. <tr>
  1933. <td valign="top">backups</td>
  1934. <td valign="top">Keep backups of the unpatched files</td>
  1935. <td align="center" valign="top">No</td>
  1936. </tr>
  1937. <tr>
  1938. <td valign="top">quiet</td>
  1939. <td valign="top">Work silently unless an error occurs</td>
  1940. <td align="center" valign="top">No</td>
  1941. </tr>
  1942. <tr>
  1943. <td valign="top">reverse</td>
  1944. <td valign="top">Assume patch was created with old and new files
  1945. swapped.</td>
  1946. <td align="center" valign="top">No</td>
  1947. </tr>
  1948. <tr>
  1949. <td valign="top">ignorewhitespace</td>
  1950. <td valign="top">Ignore whitespace differences.</td>
  1951. <td align="center" valign="top">No</td>
  1952. </tr>
  1953. <tr>
  1954. <td valign="top">strip</td>
  1955. <td valign="top">Strip the smallest prefix containing <i>num</i> leading
  1956. slashes from filenames.</td>
  1957. <td align="center" valign="top">No</td>
  1958. </tr>
  1959. </table>
  1960. <h3>Examples</h3>
  1961. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; /&gt;</pre>
  1962. <p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
  1963. files in base directory guessing the filename(s) from the diff output.
  1964. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip="1" /&gt;</pre>
  1965. <p>like above but one leading directory part will be removed. i.e. if
  1966. the diff output looked like
  1967. <pre>
  1968. --- a/mod1.0/A Mon Jun 5 17:28:41 2000
  1969. +++ a/mod1.1/A Mon Jun 5 17:28:49 2000
  1970. </pre>
  1971. the leading <i>a/</i> will be stripped.
  1972. <h2><a name="property">Property</a></h2>
  1973. <h3>Description</h3>
  1974. <p>Sets a property (by name and value), or set of properties (from file or
  1975. resource) in the project.</p>
  1976. <p>When a property was set by the user, or was a property in a parent project
  1977. (that started this project with the <a href="#ant">ant task</a>), then this
  1978. property cannot be set, and will be ignored. This means that properties set
  1979. outside the current project always override the properties of the current
  1980. project.</p>
  1981. <p>There are three ways to set properties:</p>
  1982. <ul>
  1983. <li>By supplying both the <i>name</i> and <i>value</i> attribute.</li>
  1984. <li>By setting the <i>file</i> attribute with the filename of the property
  1985. file to load. This property file has the format as defined by the file used
  1986. in the class java.util.Properties.</li>
  1987. <li>By setting the <i>resource</i> attribute with the resource name of the
  1988. property file to load. This property file has the format as defined by the
  1989. file used in the class java.util.Properties.</li>
  1990. </ul>
  1991. <p>Although combinations of the three ways are possible, only one should be used
  1992. at a time. Problems might occur with the order in which properties are set, for
  1993. instance.</p>
  1994. <p>The value part of the properties being set, might contain references to other
  1995. properties. These references are resolved at the time these properties are set.
  1996. This also holds for properties loaded from a property file.</p>
  1997. <h3>Parameters</h3>
  1998. <table border="1" cellpadding="2" cellspacing="0">
  1999. <tr>
  2000. <td valign="top"><b>Attribute</b></td>
  2001. <td valign="top"><b>Description</b></td>
  2002. <td align="center" valign="top"><b>Required</b></td>
  2003. </tr>
  2004. <tr>
  2005. <td valign="top">name</td>
  2006. <td valign="top">the name of the property to set.</td>
  2007. <td valign="top" align="center">Yes</td>
  2008. </tr>
  2009. <tr>
  2010. <td valign="top">value</td>
  2011. <td valign="top">the value of the property.</td>
  2012. <td valign="middle" align="center" rowspan="3">Yes</td>
  2013. </tr>
  2014. <tr>
  2015. <td valign="top">resource</td>
  2016. <td valign="top">the resource name of the property file.</td>
  2017. </tr>
  2018. <tr>
  2019. <td valign="top">file</td>
  2020. <td valign="top">the filename of the property file .</td>
  2021. </tr>
  2022. </table>
  2023. <h3>Examples</h3>
  2024. <pre> &lt;property name=&quot;foo.dist&quot; value=&quot;dist&quot; /&gt;</pre>
  2025. <p>sets the property <code>foo.dist</code> to the value &quot;dist&quot;.</p>
  2026. <pre> &lt;property file=&quot;foo.properties&quot; /&gt;</pre>
  2027. <p>reads a set of properties from a file called &quot;foo.properties&quot;.</p>
  2028. <pre> &lt;property resource=&quot;foo.properties&quot; /&gt;</pre>
  2029. <p>reads a set of properties from a resource called &quot;foo.properties&quot;.</p>
  2030. <p>Note that you can reference a global properties file for all of your Ant
  2031. builds using the following:
  2032. <pre> &lt;property file=&quot;${user.home}/.ant-global.properties&quot; /&gt;</pre>
  2033. <p>since the &quot;user.home&quot; property is defined by the Java virtual machine
  2034. to be your home directory. This technique is more appropriate for Unix than
  2035. Windows since the notion of a home directory doesn't exist on Windows. On the
  2036. JVM that I tested, the home directory on Windows is &quot;C:\&quot;. Different JVM
  2037. implementations may use other values for the home directory on Windows.
  2038. <hr>
  2039. <h2><a name="rename">Rename</a></h2>
  2040. <h3>Description</h3>
  2041. <p>Renames a given file.</p>
  2042. <h3>Parameters</h3>
  2043. <table border="1" cellpadding="2" cellspacing="0">
  2044. <tr>
  2045. <td valign="top"><b>Attribute</b></td>
  2046. <td valign="top"><b>Description</b></td>
  2047. <td align="center" valign="top"><b>Required</b></td>
  2048. </tr>
  2049. <tr>
  2050. <td valign="top">src</td>
  2051. <td valign="top">file to rename.</td>
  2052. <td valign="top" align="center">Yes</td>
  2053. </tr>
  2054. <tr>
  2055. <td valign="top">dest</td>
  2056. <td valign="top">new name of the file.</td>
  2057. <td valign="top" align="center">Yes</td>
  2058. </tr>
  2059. <tr>
  2060. <td valign="top">replace</td>
  2061. <td valign="top">Enable replacing of existing file (default: on).</td>
  2062. <td valign="top" align="center">No</td>
  2063. </tr>
  2064. </table>
  2065. <h3>Examples</h3>
  2066. <pre> &lt;rename src=&quot;foo.jar&quot; dest=&quot;${name}-${version}.jar&quot; /&gt;</pre>
  2067. <p>Renames the file <code>foo.jar</code> to <code>${name}-${version}.jar</code> (assuming <code>name</code>
  2068. and <code>version</code> being predefined properties). If a file named <code>${name}-${version}.jar</code>
  2069. already exists, it will be removed prior to renameing <code>foo.jar</code>.</p>
  2070. <hr>
  2071. <h2><a name="replace">Replace</a></h2>
  2072. <h3>Description</h3>
  2073. <p>Replaces the occurrence of a given string with another string in a file.</p>
  2074. <h3>Parameters</h3>
  2075. <table border="1" cellpadding="2" cellspacing="0">
  2076. <tr>
  2077. <td valign="top"><b>Attribute</b></td>
  2078. <td valign="top"><b>Description</b></td>
  2079. <td align="center" valign="top"><b>Required</b></td>
  2080. </tr>
  2081. <tr>
  2082. <td valign="top">file</td>
  2083. <td valign="top">file for which the token should be replaced.</td>
  2084. <td valign="top" align="center">Yes</td>
  2085. </tr>
  2086. <tr>
  2087. <td valign="top">token</td>
  2088. <td valign="top">the token which must be replaced.</td>
  2089. <td valign="top" align="center">Yes</td>
  2090. </tr>
  2091. <tr>
  2092. <td valign="top">value</td>
  2093. <td valign="top">the new value for the token. When omitted, an empty string
  2094. (&quot;&quot;) is used.</td>
  2095. <td valign="top" align="center">No</td>
  2096. </tr>
  2097. </table>
  2098. <h3>Examples</h3>
  2099. <pre> &lt;replace file=&quot;${src}/index.html&quot; token=&quot;@@@&quot; value=&quot;wombat&quot; /&gt;</pre>
  2100. <p>replaces occurrences of the string &quot;@@@&quot; with the string
  2101. &quot;wombat&quot;, in the file <code>${src}/index.html</code>.</p>
  2102. <hr>
  2103. <h2><a name="rmic">Rmic</a></h2>
  2104. <h3>Description</h3>
  2105. <p>Runs the rmic compiler for a certain class.</p>
  2106. <h3>Parameters</h3>
  2107. <table border="1" cellpadding="2" cellspacing="0">
  2108. <tr>
  2109. <td valign="top"><b>Attribute</b></td>
  2110. <td valign="top"><b>Description</b></td>
  2111. <td align="center" valign="top"><b>Required</b></td>
  2112. </tr>
  2113. <tr>
  2114. <td valign="top">base</td>
  2115. <td valign="top">the location to store the compiled files.</td>
  2116. <td valign="top" align="center">Yes</td>
  2117. </tr>
  2118. <tr>
  2119. <td valign="top">classname</td>
  2120. <td valign="top">the class for which to run <code>rmic</code>.</td>
  2121. <td valign="top" align="center">Yes</td>
  2122. </tr>
  2123. <tr>
  2124. <td valign="top">filtering</td>
  2125. <td valign="top">indicates whether token filtering should take place</td>
  2126. <td valign="top" align="center">No</td>
  2127. </tr>
  2128. <tr>
  2129. <td valign="top">sourcebase</td>
  2130. <td valign="top">Pass the "-keepgenerated" flag to rmic and
  2131. move the generated source file to the base directory.</td>
  2132. <td align="center" valign="top">No</td>
  2133. </tr>
  2134. <tr>
  2135. <td valign="top">stubversion</td>
  2136. <td valign="top">Specify the JDK version for the generated stub code.
  2137. Specify "1.1" to pass the "-v1.1" option to rmic.</td>
  2138. <td align="center" valign="top">No</td>
  2139. </tr>
  2140. <tr>
  2141. <td valign="top">classpath</td>
  2142. <td valign="top">The classpath to use during compilation</td>
  2143. <td align="center" valign="top">No</td>
  2144. </tr>
  2145. </table>
  2146. <h3>Examples</h3>
  2147. <pre> &lt;rmic classname=&quot;com.xyz.FooBar&quot; base=&quot;${build}/classes&quot; /&gt;</pre>
  2148. <p>runs the rmic compiler for the class <code>com.xyz.FooBar</code>. The
  2149. compiled files will be stored in the directory <code>${build}/classes</code>.</p>
  2150. <hr>
  2151. <h2><a name="tar">Tar</a></h2>
  2152. <h3>Description</h3>
  2153. <p>Creates a tar archive.</p>
  2154. <p>The <i>basedir</i> attribute is the reference directory from where to tar.</p>
  2155. <p>It is possible to refine the set of files that are being tarred. This can be
  2156. done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  2157. attributes. With the <i>includes</i> attribute you specify the files you want to
  2158. have included by using patterns. The <i>exclude</i> attribute is used to specify
  2159. the files you want to have excluded. This is also done with patterns. And
  2160. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2161. want to use default exclusions or not. See the section on <a
  2162. href="#directorybasedtasks">directory based tasks</a>, on how the
  2163. inclusion/exclusion of files works, and how to write patterns. The patterns are
  2164. relative to the <i>basedir</i> directory.</p>
  2165. <p>The <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i> attributes
  2166. replace the <i>items</i> and <i>ignore</i> attributes. The following explains
  2167. how the deprecated <i>items</i> and <i>ignore</i> attribute behave.</p>
  2168. <p>When &quot;*&quot; is used for <i>items</i>, all files in the basedir, and
  2169. its subdirectories, will be tarred. Otherwise all the files and directories
  2170. mentioned in the items list will tarred. When a directory is specified, then all
  2171. files within it are also tarred.</p>
  2172. <p>With the <i>ignore</i> attribute, you can specify files or directories to
  2173. ignore. These files will not be tarred. The items in the <i>ignore</i> attribute
  2174. override the items in the <i>items</i> attribute. The names specified in the <i>ignore</i>
  2175. attribute are just names, they do not contain any path information!</p>
  2176. <p>Note that this task does not perform compression. You might want to use the <a href="#gzip">GZip</a>
  2177. task to come up with a .tar.gz package.</p>
  2178. <h3>Parameters</h3>
  2179. <table border="1" cellpadding="2" cellspacing="0">
  2180. <tr>
  2181. <td valign="top"><b>Attribute</b></td>
  2182. <td valign="top"><b>Description</b></td>
  2183. <td valign="top" align="center"><b>Required</b></td>
  2184. </tr>
  2185. <tr>
  2186. <td valign="top">tarfile</td>
  2187. <td valign="top">the tar-file to create.</td>
  2188. <td align="center" valign="top">Yes</td>
  2189. </tr>
  2190. <tr>
  2191. <td valign="top">basedir</td>
  2192. <td valign="top">the directory from which to zip the files.</td>
  2193. <td align="center" valign="top">Yes</td>
  2194. </tr>
  2195. <tr>
  2196. <td valign="top">includes</td>
  2197. <td valign="top">comma separated list of patterns of files that must be
  2198. included. All files are included when omitted.</td>
  2199. <td valign="top" align="center">No</td>
  2200. </tr>
  2201. <tr>
  2202. <td valign="top">excludes</td>
  2203. <td valign="top">comma separated list of patterns of files that must be
  2204. excluded. No files (except default excludes) are excluded when omitted.</td>
  2205. <td valign="top" align="center">No</td>
  2206. </tr>
  2207. <tr>
  2208. <td valign="top">defaultexcludes</td>
  2209. <td valign="top">indicates whether default excludes should be used or not
  2210. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2211. <td valign="top" align="center">No</td>
  2212. </tr>
  2213. </table>
  2214. <h3>Examples</h3>
  2215. <pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot; basedir=&quot;htdocs/manual&quot; /&gt;
  2216. &lt;gzip zipfile=&quot;${dist}/manual.tar.gz&quot; src=&quot;${dist}/manual.tar&quot; /&gt;</pre>
  2217. <p>tars all files in the <code>htdocs/manual</code> directory in a file called <code>manual.tar</code>
  2218. in the <code>${dist}</code> directory, then applies the gzip task to compress
  2219. it.</p>
  2220. <pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot;
  2221. basedir=&quot;htdocs/manual&quot;
  2222. excludes=&quot;mydocs/**, **/todo.html&quot;
  2223. /&gt;</pre>
  2224. <p>tars all files in the <code>htdocs/manual</code> directory in a file called <code>manual.tar</code>
  2225. in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
  2226. or files with the name <code>todo.html</code> are excluded.</p>
  2227. <hr>
  2228. <h2><a name="taskdef">Taskdef</a></h2>
  2229. <h3>Description</h3>
  2230. <p>Adds a task definition to the current project, such that this new task can be
  2231. used in the current project. Two attributes are needed, the name that identifies
  2232. this task uniquely, and the full name of the class (including the packages) that
  2233. implements this task.</p>
  2234. <p>Taskdef should be used to add your own tasks to the system. See also &quot;<a
  2235. href="#writingowntask">Writing your own task</a>&quot;.</p>
  2236. <h3>Parameters</h3>
  2237. <table border="1" cellpadding="2" cellspacing="0">
  2238. <tr>
  2239. <td valign="top"><b>Attribute</b></td>
  2240. <td valign="top"><b>Description</b></td>
  2241. <td align="center" valign="top"><b>Required</b></td>
  2242. </tr>
  2243. <tr>
  2244. <td valign="top">name</td>
  2245. <td valign="top">the name of the task</td>
  2246. <td valign="top" align="center">Yes</td>
  2247. </tr>
  2248. <tr>
  2249. <td valign="top">classname</td>
  2250. <td valign="top">the full class name implementing the task</td>
  2251. <td valign="top" align="center">Yes</td>
  2252. </tr>
  2253. </table>
  2254. <h3>Examples</h3>
  2255. <pre> &lt;taskdef name=&quot;myjavadoc&quot; classname=&quot;com.mydomain.JavadocTask&quot; /&gt;</pre>
  2256. <p>makes a task called <code>myjavadoc</code> available to Ant. The class <code>com.mydomain.JavadocTask</code>
  2257. implements the task.</p>
  2258. <hr>
  2259. <h2><a name="tstamp">Tstamp</a></h2>
  2260. <h3>Description</h3>
  2261. <p>Sets the DSTAMP, TSTAMP and TODAY properties in the current project. The
  2262. DSTAMP is in the &quot;yyyymmdd&quot; format, the TSTAMP is in the &quot;hhmm&quot;
  2263. format and TODAY is &quot;month day year&quot;.</p>
  2264. <p>These properties can be used in the buildfile, for instance, to create
  2265. timestamped filenames or used to replace placeholder tags inside documents to
  2266. indicate, for example, the release date. The best place for this task is in your
  2267. initialization target.</p>
  2268. <h3>Parameters</h3>
  2269. <table border="1" cellpadding="2" cellspacing="0">
  2270. <tr>
  2271. <td valign="top"><b>Attribute</b></td>
  2272. <td valign="top"><b>Description</b></td>
  2273. <td align="center" valign="top"><b>Required</b></td>
  2274. </tr>
  2275. </table>
  2276. <h3>Examples</h3>
  2277. <pre> &lt;tstamp/&gt;</pre>
  2278. <hr>
  2279. <h2><a name="style">Style</a></h2>
  2280. <h3>Description</h3>
  2281. <p>Process a set of documents via XSLT.</p>
  2282. <p>This is useful for building views of XML based documentation,
  2283. or in generating code.</p>
  2284. <p>It is possible to refine the set of files that are being copied. This can be
  2285. done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  2286. attributes. With the <i>includes</i> attribute you specify the files you want to
  2287. have included by using patterns. The <i>exclude</i> attribute is used to specify
  2288. the files you want to have excluded. This is also done with patterns. And
  2289. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2290. want to use default exclusions or not. See the section on <a
  2291. href="#directorybasedtasks">directory based tasks</a>, on how the
  2292. inclusion/exclusion of files works, and how to write patterns. The patterns are
  2293. relative to the <i>basedir</i> directory.</p>
  2294. <h3>Parameters</h3>
  2295. <table border="1" cellpadding="2" cellspacing="0">
  2296. <tr>
  2297. <td valign="top"><b>Attribute</b></td>
  2298. <td valign="top"><b>Description</b></td>
  2299. <td align="center" valign="top"><b>Required</b></td>
  2300. </tr>
  2301. <tr>
  2302. <td valign="top">basedir</td>
  2303. <td valign="top">where to find the source xml file.</td>
  2304. <td align="center" valign="top">Yes</td>
  2305. </tr>
  2306. <tr>
  2307. <td valign="top">destdir</td>
  2308. <td valign="top">directory where to store the results.</td>
  2309. <td align="center" valign="top">Yes</td>
  2310. </tr>
  2311. <tr>
  2312. <td valign="top">extention</td>
  2313. <td valign="top">desired file extension to be used for the targets.
  2314. If not specified, the default is "html".</td>
  2315. <td align="center" valign="top">No</td>
  2316. </tr>
  2317. <tr>
  2318. <td valign="top">style</td>
  2319. <td valign="top">name of the stylesheet to use.</td>
  2320. <td align="center" valign="top">Yes</td>
  2321. </tr>
  2322. <tr>
  2323. <td valign="top">processor</td>
  2324. <td valign="top">name of the XSLT processor to use. Permissable
  2325. values are "xslp" for the XSL:P processor, "xalan" for the Apache XML Xalan
  2326. processor, or the name of an arbitrary XSLTLiaison class.
  2327. Defaults to xslp or xalan (in that order), if one is found in your
  2328. class path</td>
  2329. <td align="center" valign="top">No</td>
  2330. </tr>
  2331. </table>
  2332. <h3>Examples</h3>
  2333. <blockquote>
  2334. <p><pre>
  2335. &lt;style basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  2336. extension=&quot;html&quot; style=&quot;style/apache.xml&quot;/&gt;
  2337. </pre></p>
  2338. </blockquote>
  2339. <hr>
  2340. <h2><a name="untar">Untar</a></h2>
  2341. <h3>Description</h3>
  2342. <p>Untars a tarfile.</p>
  2343. <p>For JDK 1.1 "last modified time" field is set to current time instead of being
  2344. carried from tarfile.</p>
  2345. <h3>Parameters</h3>
  2346. <table border="1" cellpadding="2" cellspacing="0">
  2347. <tr>
  2348. <td valign="top"><b>Attribute</b></td>
  2349. <td valign="top"><b>Description</b></td>
  2350. <td align="center" valign="top"><b>Required</b></td>
  2351. </tr>
  2352. <tr>
  2353. <td valign="top">src</td>
  2354. <td valign="top">tarfile to expand.</td>
  2355. <td align="center" valign="top">Yes</td>
  2356. </tr>
  2357. <tr>
  2358. <td valign="top">dest</td>
  2359. <td valign="top">directory where to store the expanded files.</td>
  2360. <td align="center" valign="top">Yes</td>
  2361. </tr>
  2362. </table>
  2363. <h3>Examples</h3>
  2364. <blockquote>
  2365. <p><code>
  2366. &lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
  2367. &lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
  2368. </code></p>
  2369. </blockquote>
  2370. <hr>
  2371. <h2><a name="zip">Zip</a></h2>
  2372. <h3>Description</h3>
  2373. <p>Creates a zipfile.</p>
  2374. <p>The <i>basedir</i> attribute is the reference directory from where to zip.</p>
  2375. <p>It is possible to refine the set of files that are being zipped. This can be
  2376. done with the <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i>
  2377. attributes. With the <i>includes</i> attribute you specify the files you want to
  2378. have included by using patterns. The <i>exclude</i> attribute is used to specify
  2379. the files you want to have excluded. This is also done with patterns. And
  2380. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2381. want to use default exclusions or not. See the section on <a
  2382. href="#directorybasedtasks">directory based tasks</a>, on how the
  2383. inclusion/exclusion of files works, and how to write patterns. The patterns are
  2384. relative to the <i>basedir</i> directory.</p>
  2385. <p>The <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i> attributes
  2386. replace the <i>items</i> and <i>ignore</i> attributes. The following explains
  2387. how the deprecated <i>items</i> and <i>ignore</i> attribute behave.</p>
  2388. <p>When &quot;*&quot; is used for <i>items</i>, all files in the basedir, and
  2389. its subdirectories, will be zipped. Otherwise all the files and directories
  2390. mentioned in the items list will zipped. When a directory is specified, then all
  2391. files within it are also zipped.</p>
  2392. <p>With the <i>ignore</i> attribute, you can specify files or directories to
  2393. ignore. These files will not be zipped. The items in the <i>ignore</i> attribute
  2394. override the items in the <i>items</i> attribute. The names specified in the <i>ignore</i>
  2395. attribute are just names, they do not contain any path information!</p>
  2396. <h3>Parameters</h3>
  2397. <table border="1" cellpadding="2" cellspacing="0">
  2398. <tr>
  2399. <td valign="top"><b>Attribute</b></td>
  2400. <td valign="top"><b>Description</b></td>
  2401. <td valign="top" align="center"><b>Required</b></td>
  2402. </tr>
  2403. <tr>
  2404. <td valign="top">zipfile</td>
  2405. <td valign="top">the zip-file to create.</td>
  2406. <td align="center" valign="top">Yes</td>
  2407. </tr>
  2408. <tr>
  2409. <td valign="top">basedir</td>
  2410. <td valign="top">the directory from which to zip the files.</td>
  2411. <td align="center" valign="top">Yes</td>
  2412. </tr>
  2413. <tr>
  2414. <td valign="top">compress</td>
  2415. <td valign="top">Not only store data but also compress them, defaults to true</td>
  2416. <td align="center" valign="top">No</td>
  2417. </tr>
  2418. <tr>
  2419. <td valign="top">items</td>
  2420. <td valign="top">a comma separated list of the files/directories to zip. All
  2421. files are included when omitted. (<b>deprecated</b>, use <i>includes</i>
  2422. instead).</td>
  2423. <td valign="top" align="center">No</td>
  2424. </tr>
  2425. <tr>
  2426. <td valign="top">ignore</td>
  2427. <td valign="top">comma separated list of filenames/directorynames to exclude
  2428. from the zip. No files (except default excludes) are excluded when
  2429. omitted. (<b>deprecated</b>, use <i>excludes</i> instead).</td>
  2430. <td valign="top" align="center">No</td>
  2431. </tr>
  2432. <tr>
  2433. <td valign="top">includes</td>
  2434. <td valign="top">comma separated list of patterns of files that must be
  2435. included. All files are included when omitted.</td>
  2436. <td valign="top" align="center">No</td>
  2437. </tr>
  2438. <tr>
  2439. <td valign="top">excludes</td>
  2440. <td valign="top">comma separated list of patterns of files that must be
  2441. excluded. No files (except default excludes) are excluded when omitted.</td>
  2442. <td valign="top" align="center">No</td>
  2443. </tr>
  2444. <tr>
  2445. <td valign="top">defaultexcludes</td>
  2446. <td valign="top">indicates whether default excludes should be used or not
  2447. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2448. <td valign="top" align="center">No</td>
  2449. </tr>
  2450. </table>
  2451. <h3>Examples</h3>
  2452. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2453. basedir=&quot;htdocs/manual&quot;
  2454. /&gt;</pre>
  2455. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2456. in the <code>${dist}</code> directory.</p>
  2457. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2458. basedir=&quot;htdocs/manual&quot;
  2459. excludes=&quot;mydocs/**, **/todo.html&quot;
  2460. /&gt;</pre>
  2461. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2462. in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
  2463. or files with the name <code>todo.html</code> are excluded.</p>
  2464. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2465. basedir=&quot;htdocs/manual&quot;
  2466. includes=&quot;api/**/*.html&quot;
  2467. excludes=&quot;**/todo.html&quot;
  2468. /&gt;</pre>
  2469. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2470. in the <code>${dist}</code> directory. Only html files under the directory <code>api</code>
  2471. are zipped, and files with the name <code>todo.html</code> are excluded.</p>
  2472. <h3>Deprecated examples</h3>
  2473. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2474. basedir=&quot;htdocs/manual&quot;
  2475. items=&quot;*&quot;
  2476. /&gt;</pre>
  2477. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2478. in the <code>${dist}</code> directory.</p>
  2479. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2480. basedir=&quot;htdocs/manual&quot;
  2481. items=&quot;*&quot;
  2482. ignore=&quot;mydocs, todo.html&quot;
  2483. /&gt;</pre>
  2484. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2485. in the <code>${dist}</code> directory. Files/directories with the names <code>mydocs</code>
  2486. and <code>todo.html</code> are excluded.</p>
  2487. <hr>
  2488. <h2><a name="writingowntask">Writing your own task</a></h2>
  2489. <p>It is very easy to write your own task:</p>
  2490. <ol>
  2491. <li>Create a Java class that extends <code>org.apache.tools.ant.Task</code>.</li>
  2492. <li>For each attribute, write a setter method. The setter method must be a <code>public
  2493. void</code> method that takes one <code>String</code> as an argument. The
  2494. name of the method must begin with &quot;set&quot;, followed by the
  2495. attribute name, with the first character in uppercase, and the rest in
  2496. lowercase.</li>
  2497. <li>Write a <code>public void execute</code> method, with no arguments, that
  2498. throws a <code>BuildException</code>. This method implements the task
  2499. itself.</li>
  2500. </ol>
  2501. <p>It is important to know that Ant first calls the setters for the attributes
  2502. it encounters for a specific task in the buildfile, before it executes is.</p>
  2503. <p>Let's write our own task, that prints a message on the System.out stream. The
  2504. task has one attribute called &quot;message&quot;.</p>
  2505. <blockquote>
  2506. <pre>package com.mydomain;
  2507. import org.apache.tools.ant.BuildException;
  2508. import org.apache.tools.ant.Task;
  2509. public class MyVeryOwnTask extends Task {
  2510. private String msg;
  2511. // The method executing the task
  2512. public void execute() throws BuildException {
  2513. System.out.println(msg);
  2514. }
  2515. // The setter for the &quot;message&quot; attribute
  2516. public void setMessage(String msg) {
  2517. this.msg = msg;
  2518. }
  2519. }</pre>
  2520. </blockquote>
  2521. <p>It's really this simple;-)</p>
  2522. <p>Adding your task to the system is rather simple too:</p>
  2523. <ol>
  2524. <li>Make sure the class that implements your task is in the classpath when
  2525. starting Ant.</li>
  2526. <li>In your initialization target, add a <i>taskdef</i> task. This actually adds
  2527. your task to the system.</li>
  2528. <li>Use your task in the rest of the buildfile.</li>
  2529. </ol>
  2530. <h3>Example</h3>
  2531. <blockquote>
  2532. <pre>&lt;?xml version=&quot;1.0&quot;?&gt;
  2533. &lt;project name=&quot;OwnTaskExample&quot; default=&quot;main&quot; basedir=&quot;.&quot;&gt;
  2534. &lt;target name=&quot;init&quot;&gt;
  2535. &lt;taskdef name=&quot;mytask&quot; classname=&quot;com.mydomain.MyVeryOwnTask&quot;/&gt;
  2536. &lt;/target&gt;
  2537. &lt;target name=&quot;main&quot; depends=&quot;init&quot;&gt;
  2538. &lt;mytask message=&quot;Hello World! MyVeryOwnTask works!&quot; /&gt;
  2539. &lt;/target&gt;
  2540. &lt;/project&gt;
  2541. </pre>
  2542. </blockquote>
  2543. <p>Another way to add a task (more permanently), is to add the task name and
  2544. implementing class name to the <code>default.properties</code> file in the <code>org.apache.tools.ant.taskdefs</code>
  2545. package. Then you can use it as if it were a built in task.</p>
  2546. <hr>
  2547. <h2><a name="feedback">Feedback</a></h2>
  2548. <p>To provide feedback on this software, please subscribe to the Ant Development
  2549. Mail List <a href="mailto:(ant-dev-subscribe@jakarta.apache.org">(ant-dev-subscribe@jakarta.apache.org</a>)</p>
  2550. <hr>
  2551. <p align="center">Copyright � 2000 Apache Software Foundation. All rights
  2552. Reserved.</p>
  2553. <h2><a name="optionaltasks">Optional tasks</a></h2>
  2554. <ul>
  2555. <li><a href="#netrexxc">NetRexxC</a></li>
  2556. <li><a href="#renameexts">RenameExtensions</a></li>
  2557. <li><a href="#script">Script</a></li>
  2558. </ul>
  2559. <hr>
  2560. <h2><a name="netrexxc">NetRexxC</a></h2>
  2561. <h3><b>Description:</b></h3>
  2562. <p>Compiles a <a href="http://www2.hursley.ibm.com/netrexx">NetRexx</a>
  2563. source tree within the running (Ant) VM.</p>
  2564. <p>The source and destination directory will be recursively scanned for
  2565. NetRexx source files to compile. Only NetRexx files that have no corresponding
  2566. class file or where the class file is older than the java file will be compiled.</p>
  2567. <p>Files in the source tree are copied to the destination directory,
  2568. allowing support files to be located properly in the classpath. The source
  2569. files are copied because the NetRexx compiler cannot produce class files in a
  2570. specific directory via parameters</p>
  2571. <p>The directory structure of the source tree should follow the package
  2572. hierarchy.</p>
  2573. <p>It is possible to refine the set of files that are being compiled/copied.
  2574. This can be done with the <i>includes</i>, <i>excludes</i> and
  2575. <i>defaultexcludes</i> attributes. With the <i>includes</i> attribute you
  2576. specify the files you want to have included by using patterns. The
  2577. <i>exclude</i> attribute is used to specify the files you want to have
  2578. excluded. This is also done with patterns. And finally with the
  2579. <i>defaultexcludes</i> attribute, you can specify whether you
  2580. want to use default exclusions or not. See the section on <a
  2581. href="#directorybasedtasks">directory based tasks</a>, on how the
  2582. inclusion/exclusion of files works, and how to write patterns. The
  2583. patterns are relative to the <i>srcDir</i> directory.</p>
  2584. <h3>Parameters:</h3>
  2585. <table border="1" cellpadding="2" cellspacing="0">
  2586. <tr>
  2587. <td valign="top"><b>Attribute</b></td>
  2588. <td valign="top"><b>Description</b></td>
  2589. <td align="center" valign="top"><b>Required</b></td>
  2590. </tr>
  2591. <tr>
  2592. <td valign="top">binary</td>
  2593. <td valign="top">Whether literals are treated as the java binary
  2594. type rather than the NetRexx types</td>
  2595. <td valign="top" align="center">No</td>
  2596. </tr>
  2597. <tr>
  2598. <td valign="top">classpath</td>
  2599. <td valign="top">The classpath to use during compilation</td>
  2600. <td valign="top" align="center">No</td>
  2601. </tr>
  2602. <tr>
  2603. <td valign="top">comments</td>
  2604. <td valign="top">Whether comments are passed through to the
  2605. generated java source</td>
  2606. <td valign="top" align="center">No</td>
  2607. </tr>
  2608. <tr>
  2609. <td valign="top">compact</td>
  2610. <td valign="top">Whether error messages come out in compact or
  2611. verbose format</td>
  2612. <td valign="top" align="center">No</td>
  2613. </tr>
  2614. <tr>
  2615. <td valign="top">compile</td>
  2616. <td valign="top">Whether the NetRexx compiler should compile the
  2617. generated java code</td>
  2618. <td valign="top" align="center">No</td>
  2619. </tr>
  2620. <tr>
  2621. <td valign="top">console</td>
  2622. <td valign="top">Whether or not messages should be displayed on the
  2623. 'console'</td>
  2624. <td valign="top" align="center">No</td>
  2625. </tr>
  2626. <tr>
  2627. <td valign="top">crossref</td>
  2628. <td valign="top">Whether variable cross references are generated</td>
  2629. <td valign="top" align="center">No</td>
  2630. </tr>
  2631. <tr>
  2632. <td valign="top">decimal</td>
  2633. <td valign="top">Whether decimal arithmetic should be used for the
  2634. NetRexx code</td>
  2635. <td valign="top" align="center">No</td>
  2636. </tr>
  2637. <tr>
  2638. <td valign="top">defaultexcludes</td>
  2639. <td valign="top">indicates whether default excludes should be used or not
  2640. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  2641. omitted.</td>
  2642. <td valign="top" align="center">No</td>
  2643. </tr>
  2644. <tr>
  2645. <td valign="top">destDir</td>
  2646. <td valign="top">the destination directory into which the NetRexx
  2647. source files should be copied and then compiled</td>
  2648. <td valign="top" align="center">Yes</td>
  2649. </tr>
  2650. <tr>
  2651. <td valign="top">diag</td>
  2652. <td valign="top">Whether diagnostic information about the compile is
  2653. generated</td>
  2654. <td valign="top" align="center">No</td>
  2655. </tr>
  2656. <tr>
  2657. <td valign="top">excludes</td>
  2658. <td valign="top">comma separated list of patterns of files that must be
  2659. excluded. No files (except default excludes) are excluded when
  2660. omitted.</td>
  2661. <td valign="top" align="center">No</td>
  2662. </tr>
  2663. <tr>
  2664. <td valign="top">explicit</td>
  2665. <td valign="top">Whether variables must be declared explicitly
  2666. before use</td>
  2667. <td valign="top" align="center">No</td>
  2668. </tr>
  2669. <tr>
  2670. <td valign="top">format</td>
  2671. <td valign="top">Whether the generated java code is formatted nicely
  2672. or left to match NetRexx line numbers for call stack debugging</td>
  2673. <td valign="top" align="center">No</td>
  2674. </tr>
  2675. <tr>
  2676. <td valign="top">includes</td>
  2677. <td valign="top">comma separated list of patterns of files that must be
  2678. included. All files are included when omitted.</td>
  2679. <td valign="top" align="center">No</td>
  2680. </tr>
  2681. <tr>
  2682. <td valign="top">java</td>
  2683. <td valign="top">Whether the generated java code is produced</td>
  2684. <td valign="top" align="center">No</td>
  2685. </tr>
  2686. <tr>
  2687. <td valign="top">keep</td>
  2688. <td valign="top">Sets whether the generated java source file should be kept
  2689. after compilation. The generated files will have an extension of
  2690. .java.keep, <b>not</b> .java</td>
  2691. <td valign="top" align="center">No</td>
  2692. </tr>
  2693. <tr>
  2694. <td valign="top">logo</td>
  2695. <td valign="top">Whether the compiler text logo is displayed when
  2696. compiling</td>
  2697. <td valign="top" align="center">No</td>
  2698. </tr>
  2699. <tr>
  2700. <td valign="top">replace</td>
  2701. <td valign="top">Whether the generated .java file should be replaced
  2702. when compiling</td>
  2703. <td valign="top" align="center">No</td>
  2704. </tr>
  2705. <tr>
  2706. <td valign="top">savelog</td>
  2707. <td valign="top">Whether the compiler messages will be written to
  2708. NetRexxC.log as well as to the console</td>
  2709. <td valign="top" align="center">No</td>
  2710. </tr>
  2711. <tr>
  2712. <td valign="top">sourcedir</td>
  2713. <td valign="top">Tells the NetRexx compiler to store the class files in the
  2714. same directory as the source files. The alternative is the working
  2715. directory</td>
  2716. <td valign="top" align="center">No</td>
  2717. </tr>
  2718. <tr>
  2719. <td valign="top">srcDir</td>
  2720. <td valign="top">Set the source dir to find the source Netrexx
  2721. files</td>
  2722. <td valign="top" align="center">Yes</td>
  2723. </tr>
  2724. <tr>
  2725. <td valign="top">strictargs</td>
  2726. <td valign="top">Tells the NetRexx compiler that method calls always
  2727. need parentheses, even if no arguments are needed, e.g.
  2728. <code>aStringVar.getBytes</code> vs.
  2729. <code>aStringVar.getBytes()</code></td>
  2730. <td valign="top" align="center">No</td>
  2731. </tr>
  2732. <tr>
  2733. <td valign="top">strictassign</td>
  2734. <td valign="top">Tells the NetRexx compile that assignments must
  2735. match exactly on type</td>
  2736. <td valign="top" align="center">No</td>
  2737. </tr>
  2738. <tr>
  2739. <td valign="top">strictcase</td>
  2740. <td valign="top">Specifies whether the NetRexx compiler should be
  2741. case sensitive or not</td>
  2742. <td valign="top" align="center">No</td>
  2743. </tr>
  2744. <tr>
  2745. <td valign="top">strictimport</td>
  2746. <td valign="top">Whether classes need to be imported explicitly using an
  2747. <code>import</code> statement. By default the NetRexx compiler will
  2748. import certain packages automatically</td>
  2749. <td valign="top" align="center">No</td>
  2750. </tr>
  2751. <tr>
  2752. <td valign="top">strictprops</td>
  2753. <td valign="top">Whether local properties need to be qualified
  2754. explicitly using <code>this</code></td>
  2755. <td valign="top" align="center">No</td>
  2756. </tr>
  2757. <tr>
  2758. <td valign="top">strictsignal</td>
  2759. <td valign="top">Whether the compiler should force catching of
  2760. exceptions by explicitly named types</td>
  2761. <td valign="top" align="center">No</td>
  2762. </tr>
  2763. <tr>
  2764. <td valign="top">symbols</td>
  2765. <td valign="top">Whether debug symbols should be generated into the
  2766. class file</td>
  2767. <td valign="top" align="center">No</td>
  2768. </tr>
  2769. <tr>
  2770. <td valign="top">time</td>
  2771. <td valign="top">Asks the NetRexx compiler to print compilation
  2772. times to the console</td>
  2773. <td valign="top" align="center">No</td>
  2774. </tr>
  2775. <tr>
  2776. <td valign="top">trace</td>
  2777. <td valign="top">Turns on or off tracing and directs the resultant
  2778. trace output</td>
  2779. <td valign="top" align="center">No</td>
  2780. </tr>
  2781. <tr>
  2782. <td valign="top">utf8</td>
  2783. <td valign="top">Tells the NetRexx compiler that the source is in UTF8</td>
  2784. <td valign="top" align="center">No</td>
  2785. </tr>
  2786. <tr>
  2787. <td valign="top">verbose</td>
  2788. <td valign="top">Whether lots of warnings and error messages should
  2789. be generated</td>
  2790. <td valign="top" align="center">Yes</td>
  2791. </tr>
  2792. </table>
  2793. <h3>Examples</h3>
  2794. <blockquote>
  2795. <p><code>&lt;netrexxc srcDir=&quot;/source/project&quot;
  2796. includes=&quot;vnr/util/*&quot;
  2797. destDir=&quot;/source/project/build&quot;
  2798. classpath=&quot;/source/project2/proj.jar&quot;
  2799. comments=&quot;true&quot;
  2800. crossref=&quot;false&quot; replace=&quot;true&quot;
  2801. keep=&quot;true&quot; /&gt;</code>
  2802. </p>
  2803. </blockquote>
  2804. <hr>
  2805. <h2><a name="renameexts">RenameExtensions</a></h2>
  2806. <h3><b>Description:</b></h3>
  2807. <p>Renames files in the <code>srcDir</code> directory ending with the
  2808. <code>fromExtension</code> string so that they end with the
  2809. <code>toExtension</code> string. Files are only replaced if
  2810. <code>replace</code> is true
  2811. </p>
  2812. <p>See the section on
  2813. <a href="#directorybasedtasks">directory based tasks</a>, on how the
  2814. inclusion/exclusion of files works, and how to write patterns. The
  2815. patterns are relative to the <i>srcDir</i> directory.</p>
  2816. <h3>Parameters:</h3>
  2817. <table border="1" cellpadding="2" cellspacing="0">
  2818. <tr>
  2819. <td valign="top"><b>Attribute</b></td>
  2820. <td valign="top"><b>Description</b></td>
  2821. <td align="center" valign="top"><b>Required</b></td>
  2822. </tr>
  2823. <tr>
  2824. <td valign="top">defaultexcludes</td>
  2825. <td valign="top">indicates whether default excludes should be used or not
  2826. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  2827. omitted.</td>
  2828. <td valign="top" align="center">No</td>
  2829. </tr>
  2830. <tr>
  2831. <td valign="top">excludes</td>
  2832. <td valign="top">comma separated list of patterns of files that must be
  2833. excluded. No files (except default excludes) are excluded when
  2834. omitted.</td>
  2835. <td valign="top" align="center">No</td>
  2836. </tr>
  2837. <tr>
  2838. <td valign="top">fromExtention</td>
  2839. <td valign="top">The string that files must end in to be renamed</td>
  2840. <td valign="top" align="center">Yes</td>
  2841. </tr>
  2842. <tr>
  2843. <td valign="top">includes</td>
  2844. <td valign="top">comma separated list of patterns of files that must be
  2845. included. All files are included when omitted.</td>
  2846. <td valign="top" align="center">No</td>
  2847. </tr>
  2848. <tr>
  2849. <td valign="top">replace</td>
  2850. <td valign="top">Whether the file being renamed to should be
  2851. replaced if it already exists</td>
  2852. <td valign="top" align="center">No</td>
  2853. </tr>
  2854. <tr>
  2855. <td valign="top">srcDir</td>
  2856. <td valign="top">The starting directory for files to search in</td>
  2857. <td valign="top" align="center">Yes</td>
  2858. </tr>
  2859. <tr>
  2860. <td valign="top">toExtension</td>
  2861. <td valign="top">The string that renamed files will end with on
  2862. completion</td>
  2863. <td valign="top" align="center">Yes</td>
  2864. </tr>
  2865. </table>
  2866. <h3>Examples</h3>
  2867. <blockquote>
  2868. <p><code>&lt;renameext srcDir=&quot;/source/project1&quot;
  2869. includes=&quot;**&quot;
  2870. excludes=&quot;**/samples/*&quot;
  2871. fromExtension=&quot;.java.keep&quot;
  2872. toExtension=&quot;.java&quot;
  2873. replace=&quot;true&quot; /&gt;
  2874. </code>
  2875. </p>
  2876. </blockquote>
  2877. <hr>
  2878. <h2><a name="script">Script</a></h2>
  2879. <h3><b>Description:</b></h3>
  2880. <p>Execute a script in a
  2881. <a href="http://www.alphaworks.ibm.com/tech/bsf">BSF</a> supported language.
  2882. <p>All items (tasks, targets, etc) of the running project are accessible
  2883. from the script.
  2884. <h3>Parameters:</h3>
  2885. <table border="1" cellpadding="2" cellspacing="0">
  2886. <tr>
  2887. <td valign="top"><b>Attribute</b></td>
  2888. <td valign="top"><b>Description</b></td>
  2889. <td align="center" valign="top"><b>Required</b></td>
  2890. </tr>
  2891. <tr>
  2892. <td valign="top">language</td>
  2893. <td valign="top">The programming language the script is written in.
  2894. Must be a supported BSF language</td>
  2895. <td valign="top" align="center">No</td>
  2896. </tr>
  2897. <tr>
  2898. <td valign="top">src</td>
  2899. <td valign="top">The location of the script as a file, if not inline</td>
  2900. <td valign="top" align="center">No</td>
  2901. </tr>
  2902. </table>
  2903. <h3>Examples</h3>
  2904. <blockquote>
  2905. <p>None yet available</p>
  2906. </blockquote>
  2907. </body>
  2908. </html>