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

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