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

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