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 138 KiB

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