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

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