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 155 kB

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