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

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