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

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