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 219 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586
  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@epost.de">stefan.bodewig@epost.de</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>Erik Meade (<a href="mailto:emeade@geekfarm.org">emeade@geekfarm.org</a>)</li>
  21. <li>Sam Ruby (<a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>)</li>
  22. <li>Nico Seessle (<a href="mailto:nico@seessle.de">nico@seessle.de</a>)</li>
  23. <li>Roger Vaughn (<a href="mailto:rvaughn@seaconinc.com">rvaughn@seaconinc.com</a>)</li>
  24. <li>Dave Walend (<a href="mailto:dwalend@cs.tufts.edu">dwalend@cs.tufts.edu</a>)</li>
  25. </ul>
  26. <p>Version 1.3 - 2000/11/14</p>
  27. <hr>
  28. <h2>Table of Contents</h2>
  29. <ul>
  30. <li><a href="#introduction">Introduction</a></li>
  31. <li><a href="#getting">Getting Ant</a></li>
  32. <li><a href="#sysrequirements">System Requirements</a></li>
  33. <li><a href="#buildingant">Building Ant</a></li>
  34. <li><a href="#installing">Installing Ant</a></li>
  35. <li><a href="#running">Running Ant</a></li>
  36. <li><a href="#buildfile">Writing a simple buildfile</a>
  37. <li><a href="#directorybasedtasks">Directory based tasks</a></li>
  38. <li><a href="#tasks">Built in Tasks</a>
  39. <li><a href="#optionaltasks">Optional Tasks</a>
  40. <li><a href="#buildevents">Build Events</a>
  41. <li><a href="#writingowntask">Writing your own task</a></li>
  42. <li><a href="#faq">FAQ, DTD, external resources</a>
  43. <li><a href="../LICENSE">License</a></li>
  44. <li><a href="#feedback">Feedback</a></li>
  45. </ul>
  46. <hr>
  47. <h2><a name="introduction">Introduction</a></h2>
  48. <p>Ant is a Java based build tool. In theory it is kind of like make without
  49. make's wrinkles.</p>
  50. <h3>Why?</h3>
  51. <p>Why another build tool when there is already make, gnumake, nmake, jam, and
  52. others? Because all of those tools have limitations that its original author
  53. couldn't live with when developing software across multiple platforms. Make like
  54. tools are inherently shell based. They evaluate a set of dependencies and then
  55. execute commands not unlike what you would issue on a shell. This means that you
  56. can easily extend these tools by using or writing any program for the OS that
  57. you are working on. However, this also means that you limit yourself to the OS,
  58. or at least the OS type such as Unix, that you are working on.</p>
  59. <p>Makefiles are inherently evil as well. Anybody who has worked on them for any
  60. time has run into the dreaded tab problem. &quot;Is my command not executing
  61. because I have a space in front of my tab!!!&quot; said the original author of
  62. Ant way too many times. Tools like Jam took care of this to a great degree, but
  63. still use yet another format to use and remember.</p>
  64. <p>Ant is different. Instead a model where it is extended with shell based
  65. commands, it is extended using Java classes. Instead of writing shell commands,
  66. the configuration files are XML based calling out a target tree where various
  67. tasks get executed. Each task is run by an object which implements a particular
  68. Task interface.</p>
  69. <p>Granted, this removes some of the expressive power that is inherent by being
  70. able to construct a shell command such as `find . -name foo -exec rm {}` but it
  71. gives you the ability to be cross platform. To work anywhere and everywhere. And
  72. hey, if you really need to execute a shell command, Ant has an exec rule that
  73. allows different commands to be executed based on the OS that it is executing
  74. on.</p>
  75. <hr>
  76. <h2><a name="getting">Getting Ant</a></h2>
  77. <h3>Binary edition</h3>
  78. <p>The latest stable version of Ant can be downloaded from <a
  79. href="http://jakarta.apache.org/builds/ant/release/v1.2/bin/">
  80. http://jakarta.apache.org/builds/ant/release/v1.2/bin/</a>.
  81. If you like living on the edge, you can download the latest version from <a
  82. href="http://jakarta.apache.org/builds/ant/nightly/">http://jakarta.apache.org/builds/ant/nightly/</a>.</p>
  83. <h3>Source edition</h3>
  84. <p>If you prefer the source edition, you can download Ant from <a
  85. href="http://jakarta.apache.org/builds/ant/release/v1.2/src/">
  86. http://jakarta.apache.org/builds/ant/release/v1.2/src/</a>
  87. (latest stable) or from <a
  88. href="http://jakarta.apache.org/from-cvs/jakarta-tools/">http://jakarta.apache.org/from-cvs/jakarta-ant/</a>
  89. (current). See the section <a href="#buildingant">Building Ant</a> on how to
  90. build Ant from the source code.</p>
  91. <hr>
  92. <h2><a name="sysrequirements">System Requirements</a></h2>
  93. <p>
  94. To build and use ant you must have a JAXP compliant XML parser installed and available on your classpath.
  95. <p>
  96. If you do not have a JAXP compliant XML parse installed, you may use the reference implementation
  97. available from Sun. It is available from <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>.
  98. Once installed make sure the &quot;jaxp.jar&quot; and &quot;parser.jar&quot; files are in your classpath.
  99. <p>
  100. You will also need the JDK installed on your system, version 1.1 or later.
  101. </p>
  102. <hr>
  103. <h2><a name="buildingant">Building Ant</a></h2>
  104. <p>Go to the directory <code>jakarta-ant</code>.</p>
  105. <p>Make sure the JDK is in you path.</p>
  106. <p>Set the JAVA_HOME environment variable. This should be set to the
  107. directory where the JDK is installed. See <a href="#installing">Installing Ant</a>
  108. for examples on how to do this for your operating system.</p>
  109. <p>Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
  110. to build a bootstrap version of Ant.</p>
  111. <p>When finished, use</p>
  112. <blockquote>
  113. <p><code>build.bat -Dant.dist.dir=&lt;directory to install Ant&gt; dist</code></p>
  114. </blockquote>
  115. <p>for Windows, and</p>
  116. <blockquote>
  117. <p><code>build.sh -Dant.dist.dir=&lt;directory to install Ant&gt; dist</code></p>
  118. </blockquote>
  119. <p>for UNIX, to create a binary distribution of Ant. This distribution can be
  120. found in the directory you specified.</p>
  121. <hr>
  122. <h2><a name="installing">Installing Ant</a></h2>
  123. <p>The binary distribution of Ant consists of three directories: <code>bin</code>,
  124. <code>docs</code> and <code>lib</code>. Only the <code>bin</code> and <code>lib</code>
  125. directory are crucial for running Ant. To run Ant, the following must be done:</p>
  126. <ul>
  127. <li>Add the <code>bin</code> directory to your path.</li>
  128. <li>Set the ANT_HOME environment variable. This should be set to the directory
  129. which contains the <code>bin</code> and <code>lib</code> directory.</li>
  130. <li>Set the JAVA_HOME environment variable. This should be set to the
  131. directory where the JDK is installed.</li>
  132. </ul>
  133. <h3>Windows</h3>
  134. <p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the
  135. environment:</p>
  136. <pre>set ANT_HOME=c:\ant
  137. set JAVA_HOME=c:\jdk1.2.2
  138. set PATH=%PATH%;%ANT_HOME%\bin</pre>
  139. <h3>Unix (bash)</h3>
  140. <p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up
  141. the environment:</p>
  142. <pre>export ANT_HOME=/usr/local/ant
  143. export JAVA_HOME=/usr/local/jdk-1.2.2
  144. export PATH=${PATH}:${ANT_HOME}/bin</pre>
  145. <h3>Advanced</h3>
  146. <p>There are lots of variants that can be used to run Ant. What you need is at
  147. least the following:</p>
  148. <p>The classpath for Ant must contain <code>ant.jar</code> and any jars/classes
  149. needed for your chosen JAXP compliant XML parser.</p>
  150. <p>When you need JDK functionality (like a <a href="#javac">javac</a> task, or a
  151. <a href="#rmic">rmic</a> task), then for JDK 1.1, the <code>classes.zip</code>
  152. file of the JDK must be added to the classpath; for JDK 1.2 or JDK 1.3, <code>tools.jar</code>
  153. must be added. The scripts supplied with ant, in the bin directory, will add
  154. <code>tools.jar</code> automatically if the JAVA_HOME environment variable is set.</p>
  155. <p>When you are executing platform specific applications (like the <a
  156. href="#exec">exec</a> task, or the <a href="#cvs">cvs</a> task), the property <code>ant.home</code>
  157. must be set to the directory containing a bin directory, which contains the <code>antRun</code>
  158. shell script necessary to run execs on Unix.</p>
  159. <hr>
  160. <h2><a name="running">Running Ant</a></h2>
  161. <p>Running Ant is simple, when you installed it as described in the previous
  162. section. Just type <code>ant</code>.</p>
  163. <p>When nothing is specified, Ant looks for a <code>build.xml</code>
  164. file in the current directory. When found, it uses that file as a
  165. buildfile, otherwise it searches in the parent directory and so on
  166. until the root of the filesystem has been reached. To make Ant use
  167. another buildfile, use the commandline option <i>-buildfile
  168. &lt;file&gt;</i>, where <i>&lt;file&gt;</i> is the buildfile you want
  169. to use.</p>
  170. <p>You can also set properties which override properties specified in the
  171. buildfile (see the <a href="#property">property task</a>).
  172. This can be done with the <i>-D&lt;property&gt;=&lt;value&gt;</i>
  173. option, where <i>&lt;property&gt;</i> is the name of the property and <i>&lt;value&gt;</i>
  174. the value. This can also be used (and is the only way since Java can not access them)
  175. to have access to your environment variables, just pass -DMYVAR=%MYVAR% (Windows) or
  176. -DMYVAR=$MYVAR (Unix) to Ant, you can then access these variables inside your build-file
  177. as ${MYVAR}.</p>
  178. <p>Two more options are <i>-quiet</i> which instructs Ant to print less
  179. information on the console when running. The option <i>-verbose</i> on the other
  180. hand makes Ant print more information on the console.</p>
  181. <p>It is also possible to specify one or more targets that should be executed. When omitted the target that is mentioned in the <i>default</i> attribute of the project is
  182. used.</p>
  183. <p>The <i>-projecthelp</i> option gives a list of this projects targets. First those with a description and then those without one.</p>
  184. <p>Commandline option summary:</p>
  185. <pre>ant [options] [target [target2 [target3] ...]]
  186. Options:
  187. -help print this message
  188. -projecthelp print project help information
  189. -version print the version information and exit
  190. -quiet be extra quiet
  191. -verbose be extra verbose
  192. -debug print debugging information
  193. -emacs produce logging information without adornments
  194. -logfile &lt;file&gt; use given file for log
  195. -logger &lt;classname&gt; the class which is to perform logging
  196. -listener &lt;classname&gt; add an instance of class as a project listener
  197. -buildfile &lt;file&gt; use given buildfile
  198. -find &lt;file&gt; search for buildfile towards the root of the filesystem and use it
  199. -D&lt;property&gt;=&lt;value&gt; use value for given property</pre>
  200. <h3>Examples</h3>
  201. <blockquote>
  202. <pre>ant</pre>
  203. </blockquote>
  204. <p>runs Ant using the <code>build.xml</code> file in the current directory, on
  205. the default target.</p>
  206. <blockquote>
  207. <pre>ant -buildfile test.xml</pre>
  208. </blockquote>
  209. <p>runs Ant using the <code>test.xml</code> file in the current directory, on
  210. the default target.</p>
  211. <blockquote>
  212. <pre>ant -buildfile test.xml dist</pre>
  213. </blockquote>
  214. <p>runs Ant using the <code>test.xml</code> file in the current directory, on a
  215. target called <code>dist</code>.</p>
  216. <blockquote>
  217. <pre>ant -buildfile test.xml -Dbuild=build/classes dist</pre>
  218. </blockquote>
  219. <p>runs Ant using the <code>test.xml</code> file in the current directory, on a
  220. target called <code>dist</code>. It also sets the <i>build</i> property to the
  221. value <i>build/classes</i>.</p>
  222. <h3>Running Ant by hand</h3>
  223. <p>When you have installed Ant in the do-it-yourself way, Ant can be started
  224. with:</p>
  225. <blockquote>
  226. <pre>java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]</pre>
  227. </blockquote>
  228. <p>These instructions actually do exactly the same as the <code>ant</code>
  229. command. The options and target are the same as when running Ant with the <code>ant</code>
  230. command. This example assumes you have set up your classpath to include
  231. <ul>
  232. <li>ant.jar
  233. <li>jars/classes for your XML parser
  234. <li>the JDK's tools.jar
  235. </ul>
  236. <hr>
  237. <h2><a name="buildfile">Writing a simple buildfile</a></h2>
  238. <p>The buildfile is written in XML. Each buildfile contains one project.</p>
  239. <p>Each element of the buildfile can have an <code>id</code> attribute and
  240. can later be referred to by the value supplied to this. The value has
  241. to be unique.</p>
  242. <h3>Projects</h3>
  243. <p>A project has three attributes:</p>
  244. <table border="1" cellpadding="2" cellspacing="0">
  245. <tr>
  246. <td valign="top"><b>Attribute</b></td>
  247. <td valign="top"><b>Description</b></td>
  248. <td align="center" valign="top"><b>Required</b></td>
  249. </tr>
  250. <tr>
  251. <td valign="top">name</td>
  252. <td valign="top">the name of the target.</td>
  253. <td align="center" valign="top">Yes</td>
  254. </tr>
  255. <tr>
  256. <td valign="top">default</td>
  257. <td valign="top">the default target to use when no target is supplied.</td>
  258. <td align="center" valign="top">Yes</td>
  259. </tr>
  260. <tr>
  261. <td valign="top">basedir</td>
  262. <td valign="top">the base directory from which all path calculations are
  263. done. This attribute might be overridden by setting the &quot;basedir&quot;
  264. property on forehand. When this is done, it might be omitted in the
  265. project tag.</td>
  266. <td align="center" valign="top">Yes</td>
  267. </tr>
  268. </table>
  269. <p>Each project defines one or more targets. A target is a set of tasks you want
  270. to be executed. When starting Ant, you can select which target you want to have
  271. executed. When no target is given, the project's default is used.</p>
  272. <h3>Targets</h3>
  273. <p>A target can depend on other targets. You might have a target for compiling,
  274. for instance, and a target for creating a distributable. You can only build a
  275. distributable when you have compiled first, so the distribute target depends on
  276. the compile target. Ant resolves all these dependencies.</p>
  277. <p>Ant tries to execute the targets in the <i>depends</i> attribute in the order
  278. they appear (from left to right). Keep in mind that it is possible that a target
  279. can get executed earlier when an earlier target depends on it:</p>
  280. <blockquote>
  281. <pre>&lt;target name=&quot;A&quot;/&gt;
  282. &lt;target name=&quot;B&quot; depends=&quot;A&quot;/&gt;
  283. &lt;target name=&quot;C&quot; depends=&quot;B&quot;/&gt;
  284. &lt;target name=&quot;D&quot; depends=&quot;C,B,A&quot;/&gt;</pre>
  285. </blockquote>
  286. <p>Suppose we want to execute target D. From its <i>depends</i> attribute, you
  287. might think that first target C, then B and then A is executed. Wrong! C depends
  288. on B, and B depends on A, so first A is executed, then B, then C, and finally D.</p>
  289. <p>A target gets executed only once. Even when more targets depend on it (see
  290. the previous example).</p>
  291. <p>A target has also the ability to perform its execution if (or
  292. unless) a property has been set. This allows, for example, better
  293. control on the building process depending on the state of the system
  294. (java version, OS, command line properties, etc...). To make target
  295. <i>sense</i> this property you should add the <i>if</i> (or
  296. <i>unless</i>) attribute with the name of the property that the target
  297. should react to, for example</p>
  298. <blockquote>
  299. <pre>&lt;target name=&quot;build-module-A&quot; if=&quot;module-A-present&quot;/&gt;</pre>
  300. <pre>&lt;target name=&quot;build-own-fake-module-A&quot; unless=&quot;module-A-present&quot;/&gt;</pre>
  301. </blockquote>
  302. <p>If no <i>if</i> and no <i>unless</i> attribute is present, the target will
  303. always be executed.</p>
  304. <p>It is a good practice to place your <a
  305. href="#tstamp">tstamp</a> tasks in a so called initialization target, on which
  306. all other targets depend. Make sure that target is always the first one in
  307. the depends list of the other targets. In this manual, most initialization targets
  308. have the name &quot;init&quot;.</p>
  309. <p>The optional <i>description</i> attribute can be used to provide a one line description of this target that is printed by the <i>-projecthelp</i> commandline option.</p>
  310. <p>A target has the following attributes:</p>
  311. <table border="1" cellpadding="2" cellspacing="0">
  312. <tr>
  313. <td valign="top"><b>Attribute</b></td>
  314. <td valign="top"><b>Description</b></td>
  315. <td align="center" valign="top"><b>Required</b></td>
  316. </tr>
  317. <tr>
  318. <td valign="top">name</td>
  319. <td valign="top">the name of the target.</td>
  320. <td align="center" valign="top">Yes</td>
  321. </tr>
  322. <tr>
  323. <td valign="top">depends</td>
  324. <td valign="top">a comma separated list of names of targets on which this
  325. target depends.</td>
  326. <td align="center" valign="top">No</td>
  327. </tr>
  328. <tr>
  329. <td valign="top">if</td>
  330. <td valign="top">the name of the property that must be set in order for this
  331. target to execute.</td>
  332. <td align="center" valign="top">No</td>
  333. </tr>
  334. <tr>
  335. <td valign="top">unless</td>
  336. <td valign="top">the name of the property that must not be set in order
  337. for this target to execute.</td>
  338. <td align="center" valign="top">No</td>
  339. </tr>
  340. <tr>
  341. <td valign="top">description</td>
  342. <td valign="top">a short description of this targets function.</td>
  343. <td align="center" valign="top">No</td>
  344. </tr>
  345. </table>
  346. <h3>Tasks</h3>
  347. <p>A task is a piece of code that can be executed.</p>
  348. <p>A task can have multiple attributes (or arguments if you prefer). The value
  349. of an attribute might contain references to a property. These references will be
  350. resolved before the task is executed.</p>
  351. <p>Tasks have a common structure:</p>
  352. <blockquote>
  353. <pre>&lt;name attribute1=&quot;value1&quot; attribute2=&quot;value2&quot; ... /&gt;</pre>
  354. </blockquote>
  355. <p>where name is the name of the task, attribute-x the attribute name, and
  356. value-x the value of this attribute.</p>
  357. <p>There is a set of <a href="#tasks">built in tasks</a>, but it is also very
  358. easy to <a href="#writingowntask">write your own</a>.</p>
  359. <p>All tasks share a <code>taskname</code> attribute. The value of
  360. this attribute will be used in the logging messages generated by
  361. Ant.</p>
  362. <h3>Properties</h3>
  363. <p>A project can have a set of properties. These might be set in the buildfile
  364. by the <a href="#property">property task</a>, or might be set outside Ant. A
  365. property has a name and a value. Properties might be used in in the value of
  366. task attributes. This is done by placing the property name between
  367. &quot;${&quot; and &quot;}&quot; in the attribute value.</p>
  368. <p>If there is a property called &quot;builddir&quot; with the value
  369. &quot;build&quot;, then this could be used in an attribute like this: &quot;${builddir}/classes&quot;.
  370. This is resolved as &quot;build/classes&quot;.</p>
  371. <h3>Built in Properties</h3>
  372. <p>Ant provides access to all system properties as if they had been
  373. defined using a property task, for example ${os.name} expands to the
  374. name of the operating system.</p>
  375. <p>In addition Ant knows some built in properties:</p>
  376. <ul>
  377. <li>basedir - the absolute path of the project's basedir (as set
  378. with the basedir attribute of &lt;project&gt;).</li>
  379. <li>ant.file - the absolute path of the build file.</li>
  380. <li>ant.java.version - the JVM version Ant detected. Currently it
  381. can hold the values &quot;1.1&quot;, &quot;1.2&quot; and
  382. &quot;1.3&quot;.</li>
  383. </ul>
  384. <h3>Example</h3>
  385. <blockquote>
  386. <pre>
  387. &lt;project name=&quot;MyProject&quot; default=&quot;dist&quot; basedir=&quot;.&quot;&gt;
  388. &lt;!-- set global properties for this build --&gt;
  389. &lt;property name=&quot;src&quot; value=&quot;.&quot; /&gt;
  390. &lt;property name=&quot;build&quot; value=&quot;build&quot; /&gt;
  391. &lt;property name=&quot;dist&quot; value=&quot;dist&quot; /&gt;
  392. &lt;target name=&quot;prepare&quot;&gt;
  393. &lt;!-- Create the time stamp --&gt;
  394. &lt;tstamp/&gt;
  395. &lt;!-- Create the build directory structure used by compile --&gt;
  396. &lt;mkdir dir=&quot;${build}&quot; /&gt;
  397. &lt;/target&gt;
  398. &lt;target name=&quot;compile&quot; depends=&quot;prepare&quot;&gt;
  399. &lt;!-- Compile the java code from ${src} into ${build} --&gt;
  400. &lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot; /&gt;
  401. &lt;/target&gt;
  402. &lt;target name=&quot;dist&quot; depends=&quot;compile&quot;&gt;
  403. &lt;!-- Create the ${dist}/lib directory --&gt;
  404. &lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;
  405. &lt;!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --&gt;
  406. &lt;jar jarfile=&quot;${dist}/lib/MyProject-${DSTAMP}.jar&quot; basedir=&quot;${build}&quot; /&gt;
  407. &lt;/target&gt;
  408. &lt;target name=&quot;clean&quot;&gt;
  409. &lt;!-- Delete the ${build} and ${dist} directory trees --&gt;
  410. &lt;delete dir=&quot;${build}&quot; /&gt;
  411. &lt;delete dir=&quot;${dist}&quot; /&gt;
  412. &lt;/target&gt;
  413. &lt;/project&gt;
  414. </pre>
  415. </blockquote>
  416. <h3>Token Filters</h3>
  417. <p>A project can have a set of tokens that might be automatically expanded if
  418. found when a file is copied, when the filtering-copy behavior is selected in the
  419. tasks that support this. These might be set in the buildfile
  420. by the <a href="#filter">filter task</a>.&nbsp;</p>
  421. <p>Since this can be a very harmful behavior, the tokens in the files <b>must</b>
  422. be of the form<i> @token@</i> where <i>token</i> is the token name that is set
  423. in the filter task. This token syntax matches the syntax of other build systems
  424. that perform such filtering and remains sufficiently orthogonal to most
  425. programming and scripting languages, as well with documentation systems.</p>
  426. <p>Note: in case a token with the format @token@ is found in a file but no
  427. filter is associated with that token, no changes take place. So, no escaping
  428. method is present, but as long as you choose appropriate names for your tokens,
  429. this should not cause problems.</p>
  430. <h3><a name="path">PATH like structures</a></h3>
  431. <p>You can specify PATH and CLASSPATH variables using both
  432. &quot;:&quot; and &quot;;&quot; as separator characters, Ant will
  433. convert it to the correct character of the current operating
  434. system.</p>
  435. <p>Wherever PATH like values need to be specified a nested element can
  436. be used. This takes the general form of</p>
  437. <pre>
  438. &lt;classpath&gt;
  439. &lt;pathelement path=&quot;${classpath}&quot; /&gt;
  440. &lt;pathelement location=&quot;lib/helper.jar&quot; /&gt;
  441. &lt;/classpath&gt;
  442. </pre>
  443. <p>The <code>location</code> attribute specifies a single file or
  444. directory relative to the project's base directory (or an absolute
  445. filename), while the <code>path</code> attribute accepts &quot;:&quot;
  446. or &quot;;&quot; separated lists of locations. The <code>path</code>
  447. attribute is intended to be used with predefined paths - in any other
  448. case multiple elements with <code>location</code> attributes should be
  449. preferred.</p>
  450. <p>As a shortcut the surrounding PATH element supports path and
  451. location attributes of its own, so</p>
  452. <pre>
  453. &lt;classpath&gt;
  454. &lt;pathelement path=&quot;${classpath}&quot; /&gt;
  455. &lt;/classpath&gt;
  456. </pre>
  457. <p>can be abreviated to</p>
  458. <pre>
  459. &lt;classpath path=&quot;${classpath}&quot; /&gt;
  460. </pre>
  461. <p>In addition, <a href="#fileset">FileSet</a>s can be specified via
  462. nested <code>&lt;fileset&gt;</code> elements. The order in which the files
  463. building up FileSet are added to the PATH like structure is not
  464. defined.</p>
  465. <pre>
  466. &lt;classpath&gt;
  467. &lt;pathelement path=&quot;${classpath}&quot; /&gt;
  468. &lt;fileset dir=&quot;lib&quot;&gt;
  469. &lt;include name=&quot;**/*.jar&quot; /&gt;
  470. &lt;/fileset;&gt;
  471. &lt;pathelement location=&quot;classes&quot; /&gt;
  472. &lt;/classpath&gt;
  473. </pre>
  474. <p>Builds a PATH which holds the value of <code>${classpath}</code>
  475. followed by all JAR files in the <code>lib</code> directory, followed
  476. by the <code>classes</code> directory.</p>
  477. <p>If you want to use the same PATH like structure for several tasks,
  478. you can define them with a <code>&lt;path&gt;</code> element at the
  479. same level as <em>target</em>s and reference them via their
  480. <em>id</em> attribute - see <a href="#references">References</a> for an
  481. example.</p>
  482. <p>A PATH like structure can include a reference to another PATH like
  483. structure via a nested <code>&lt;path&gt;</code> elements.</p>
  484. <pre>
  485. &lt;path id=&quot;base.path&quot;&gt;
  486. &lt;pathelement path=&quot;${classpath}&quot; /&gt;
  487. &lt;fileset dir=&quot;lib&quot;&gt;
  488. &lt;include name=&quot;**/*.jar&quot; /&gt;
  489. &lt;/fileset;&gt;
  490. &lt;pathelement location=&quot;classes&quot; /&gt;
  491. &lt;/path&gt;
  492. &lt;path id=&quot;tests.path&quot;&gt;
  493. &lt;path refid=&quot;base.path&quot; /&gt;
  494. &lt;pathelement location=&quot;testclasses&quot; /&gt;
  495. &lt;/path&gt;
  496. </pre>
  497. <h3><a name="arg">Command line arguments</a></h3>
  498. <p>Several tasks take arguments that shall be passed to another
  499. process on the command line. To make it easier to specify arguments
  500. that contain space characters, nested elements can be used.</p>
  501. <table border="1" cellpadding="2" cellspacing="0">
  502. <tr>
  503. <td width="12%" valign="top"><b>Attribute</b></td>
  504. <td width="78%" valign="top"><b>Description</b></td>
  505. <td width="10%" valign="top"><b>Required</b></td>
  506. </tr>
  507. <tr>
  508. <td valign="top">value</td>
  509. <td valign="top">a single command line argument, can contain space
  510. characters.</td>
  511. <td align="center" rowspan="4">Exactly one of these.</td>
  512. </tr>
  513. <tr>
  514. <td valign="top">line</td>
  515. <td valign="top">a space delimited list of command line arguments.</td>
  516. </tr>
  517. <tr>
  518. <td valign="top">file</td>
  519. <td valign="top">The name of a file as a single command line
  520. argument. Will be replaced with the absolute filename of the file
  521. by Ant.</td>
  522. </tr>
  523. <tr>
  524. <td valign="top">path</td>
  525. <td valign="top">A string that shall be treated as a PATH like
  526. string as a single command line argument. You can use ; or : as
  527. path separators and Ant will convert it to the platform's local
  528. conventions.</td>
  529. </tr>
  530. </table>
  531. <h4>Examples</h4>
  532. <blockquote><pre>
  533. &lt;arg value=&quot;-l -a&quot; /&gt;
  534. </pre></blockquote>
  535. <p>is a single command line argument containing a space character.</p>
  536. <blockquote><pre>
  537. &lt;arg line=&quot;-l -a&quot; /&gt;
  538. </pre></blockquote>
  539. <p>stands for two separate command line arguments.</p>
  540. <blockquote><pre>
  541. &lt;arg path=&quot;/dir;/dir2:\dir3&quot; /&gt;
  542. </pre></blockquote>
  543. <p>is a single command line argument with value
  544. <code>\dir;\dir2;\dir3</code> on DOS based systems and
  545. <code>/dir:/dir2:/dir3</code> on Unix like systems.</p>
  546. <h3><a name="references">References</a></h3>
  547. <p>The <code>id</code> attribute of the buildfile's elements can be
  548. used to refer to them. This can useful if you are going to replicate
  549. the same snippet of XML over and over again - using a
  550. <code>&lt;classpath&gt;</code> structure more than once for
  551. example.</p>
  552. <p>The following example</p>
  553. <blockquote><pre>
  554. &lt;project ... &gt;
  555. &lt;target ... &gt;
  556. &lt;rmic ...&gt;
  557. &lt;classpath&gt;
  558. &lt;pathelement location=&quot;lib/&quot; /&gt;
  559. &lt;pathelement path=&quot;${java.class.path}/&quot; /&gt;
  560. &lt;pathelement path=&quot;${additional.path}&quot; /&gt;
  561. &lt;/classpath&gt;
  562. &lt;/rmic&gt;
  563. &lt;/target&gt;
  564. &lt;target ... &gt;
  565. &lt;javac ...&gt;
  566. &lt;classpath&gt;
  567. &lt;pathelement location=&quot;lib/&quot; /&gt;
  568. &lt;pathelement path=&quot;${java.class.path}/&quot; /&gt;
  569. &lt;pathelement path=&quot;${additional.path}&quot; /&gt;
  570. &lt;/classpath&gt;
  571. &lt;/javac&gt;
  572. &lt;/target&gt;
  573. &lt;/project&gt;
  574. </pre></blockquote>
  575. <p>could be rewritten as</p>
  576. <blockquote><pre>
  577. &lt;project ... &gt;
  578. &lt;path id=&quot;project.class.path&quot;&gt;
  579. &lt;pathelement location=&quot;lib/&quot; /&gt;
  580. &lt;pathelement path=&quot;${java.class.path}/&quot; /&gt;
  581. &lt;pathelement path=&quot;${additional.path}&quot; /&gt;
  582. &lt;/path&gt;
  583. &lt;target ... &gt;
  584. &lt;rmic ...&gt;
  585. &lt;classpath refid=&quot;project.class.path&quot; /&gt;
  586. &lt;/rmic&gt;
  587. &lt;/target&gt;
  588. &lt;target ... &gt;
  589. &lt;javac ...&gt;
  590. &lt;classpath refid=&quot;project.class.path&quot; /&gt;
  591. &lt;/javac&gt;
  592. &lt;/target&gt;
  593. &lt;/project&gt;
  594. </pre></blockquote>
  595. <p>All tasks that use nested elements for <a
  596. href="#patternset">PatternSet</a>s, <a href="#fileset">FileSet</a>s or
  597. <a href="#path">PATH like structures</a> accept references to these
  598. structures as well.</p>
  599. <hr>
  600. <h2><a name="directorybasedtasks">Directory based tasks</a></h2>
  601. <p>Some tasks use directory trees for the task they perform. For instance, the <a
  602. href="#javac">Javac task</a> which works upon a directory tree with .java files.
  603. Sometimes it can be very useful to work on a subset of that directory tree. This
  604. section describes how you can select a subset of such a directory tree.</p>
  605. <p>Ant gives you two ways to create a subset, both of which can be used at the same
  606. time:</p>
  607. <ul>
  608. <li>Only include files/directories that match at least one pattern of a set of
  609. patterns</li>
  610. <li>Exclude files/directories that match at least one pattern a set of
  611. patterns</li>
  612. </ul>
  613. <p>When both inclusion and exclusion are used, only files/directories that match
  614. the include patterns, and don't match the exclude patterns are used.</p>
  615. <p>Patterns can be specified inside the buildfile via task attributes or
  616. nested elements and via external files. Each line of the external file
  617. is taken as pattern that is added to the list of include or exclude
  618. patterns.</p>
  619. <h3>Patterns</h3>
  620. <p>As described earlier, patterns are used for the inclusion and exclusion.
  621. These patterns look very much like the patterns used in DOS and UNIX:</p>
  622. <p>'*' matches zero or more characters, '?' matches one character.</p>
  623. <p>Examples:</p>
  624. <p>'*.java' matches '.java', 'x.java' and 'FooBar.java', but not 'FooBar.xml'
  625. (does not end with '.java').</p>
  626. <p>'?.java' matches 'x.java', 'A.java', but not '.java' or 'xyz.java' (both
  627. don't have one character before '.java').</p>
  628. <p>Combinations of '*'s and '?'s are allowed.</p>
  629. <p>Matching is done per-directory. This means that first the first directory in
  630. the pattern is matched against the first directory in the path to match. Then
  631. the second directories are matched, and so on. E.g. when we have the pattern '/?abc/*/*.java'
  632. and the path '/xabc/foobar/test.java', then first '?abc' is matched with 'xabc',
  633. then '*' is matched with 'foobar' and finally '*.java' is matched with 'test.java'.
  634. They all match so the path matches the pattern.</p>
  635. <p>Too make things a bit more flexible, we add one extra feature, which makes it
  636. possible to match multiple directory levels. This can be used to match a
  637. complete directory tree, or a file anywhere in the directory tree. To do this, '**'
  638. must be used as the name of a directory. When '**' is used as the name of a
  639. directory in the pattern, it matches zero or more directories. For instance:
  640. '/test/**' matches all files/directories under '/test/', such as '/test/x.java',
  641. or '/test/foo/bar/xyz.html', but not '/xyz.xml'.</p>
  642. <p>There is one &quot;shorthand&quot;, if a pattern ends with '/' or '\', then '**'
  643. is appended. E.g. &quot;mypackage/test/&quot; is interpreted as were it &quot;mypackage/test/**&quot;.</p>
  644. <p>Examples:</p>
  645. <table border="1" cellpadding="2" cellspacing="0">
  646. <tr>
  647. <td valign="top">**/CVS/*</td>
  648. <td valign="top">Matches all files in CVS directories, that can be located
  649. anywhere in the directory tree.
  650. <p>Matches:</p>
  651. <p>CVS/Repository<br>
  652. org/apache/CVS/Entries<br>
  653. org/apache/jakarta/tools/ant/CVS/Entries</p>
  654. <p>But not:</p>
  655. <p>org/apache/CVS/foo/bar/Entries ('foo/bar/' part does not match)</td>
  656. </tr>
  657. <tr>
  658. <td valign="top">org/apache/jakarta/**</td>
  659. <td valign="top">Matches all files in the org/apache/jakarta directory tree.
  660. <p>Matches:</p>
  661. <p>org/apache/jakarta/tools/ant/docs/index.html<br>
  662. org/apache/jakarta/test.xml</p>
  663. <p>But not:</p>
  664. <p>org/apache/xyz.java ('jakarta'/' part is missing)</td>
  665. </tr>
  666. <tr>
  667. <td valign="top">org/apache/**/CVS/*</td>
  668. <td valign="top">Matches all files in CVS directories, that are located
  669. anywhere in the directory tree under org/apache.
  670. <p>Matches:</p>
  671. <p>org/apache/CVS/Entries<br>
  672. org/apache/jakarta/tools/ant/CVS/Entries</p>
  673. <p>But not:</p>
  674. <p>org/apache/CVS/foo/bar/Entries ('foo/bar/' part does not match)</td>
  675. </tr>
  676. <tr>
  677. <td valign="top">**/test/**</td>
  678. <td valign="top">Matches all files which have a directory 'test' in their
  679. path, including 'test' as a filename.</td>
  680. </tr>
  681. </table>
  682. <p>When these patterns are used in inclusion and exclusion, you have a powerful
  683. way to select just the files you want.</p>
  684. <h3>Examples</h3>
  685. <pre>
  686. &lt;copy todir=&quot;${dist}&quot; >
  687. &lt;fileset dir=&quot;${src}&quot;
  688. includes=&quot;**/images/*&quot;
  689. excludes=&quot;**/*.gif&quot;
  690. /&gt;
  691. &lt;/copy&gt;</pre>
  692. <p>This copies all files in directories called &quot;images&quot;, that are
  693. located in the directory tree &quot;${src}&quot; to the destination &quot;${dist}&quot;,
  694. but excludes all &quot;*.gif&quot; files from the copy.</p>
  695. <p> This example can also be expressed using nested elements as
  696. <pre>
  697. &lt;copy todir=&quot;${dist}&quot; >
  698. &lt;fileset dir=&quot;${src}&quot; /&gt;
  699. &lt;include name=&quot;**/images/*&quot;/&gt;
  700. &lt;exclude name=&quot;**/*.gif&quot; /&gt;
  701. &lt;/fileset&gt;
  702. &lt;/copy&gt;
  703. </pre>
  704. <h3>Default Excludes</h3>
  705. <p>There are a set of definitions which are excluded by default from all directory based tasks.
  706. They are:
  707. <pre> &quot;**/*~&quot;,
  708. &quot;**/#*#&quot;,
  709. &quot;**/%*%&quot;,
  710. &quot;**/CVS&quot;,
  711. &quot;**/CVS/**&quot;,
  712. &quot;**/.cvsignore&quot;
  713. </pre>
  714. If you do not want these default excludes applied, you may disable them with the
  715. <code>defaultexcludes=&quot;no&quot;</code> attribute.
  716. <h3><a name="patternset">PatternSets</a></h3>
  717. <p>Patterns can be grouped to sets and later be referenced by their id
  718. attribute. They are defined via a <code>patternset</code> element -
  719. which can appear nested into a <a href="#fileset">FileSet</a> or a
  720. directory based task that constitutes an implicit FileSet. In addition
  721. <code>patternset</code>s can be defined at the same level as
  722. <code>target</code> - i.e. as children of <code>project</code></p>
  723. <p>Patterns can be specified by nested <code>&lt;include&gt;</code> or
  724. <code>&lt;exclude&gt;</code> elements or the following attributes.</p>
  725. <table border="1" cellpadding="2" cellspacing="0">
  726. <tr>
  727. <td valign="top"><b>Attribute</b></td>
  728. <td valign="top"><b>Description</b></td>
  729. </tr>
  730. <tr>
  731. <td valign="top">includes</td>
  732. <td valign="top">comma separated list of patterns of files that must be
  733. included. All files are included when omitted.</td>
  734. </tr>
  735. <tr>
  736. <td valign="top">includesfile</td>
  737. <td valign="top">the name of a file. Each line of this file is
  738. taken to be an include pattern</td>
  739. </tr>
  740. <tr>
  741. <td valign="top">excludes</td>
  742. <td valign="top">comma separated list of patterns of files that must be
  743. excluded. No files (except default excludes) are excluded when omitted.</td>
  744. </tr>
  745. <tr>
  746. <td valign="top">excludesfile</td>
  747. <td valign="top">the name of a file. Each line of this file is
  748. taken to be an exclude pattern</td>
  749. </tr>
  750. </table>
  751. <h4>Examples</h4>
  752. <blockquote><pre>
  753. &lt;patternset id=&quot;non.test.sources&quot; &gt;
  754. &lt;include name=&quot;**/*.java&quot; /&gt;
  755. &lt;exclude name=&quot;**/*Test*&quot; /&gt;
  756. &lt;/patternset&gt;
  757. </pre></blockquote>
  758. <p>Builds a set of patterns, that matches all <code>.java</code> files
  759. that do not contain the text <code>Test</code> in their name. This set
  760. can be <a href="#references">referred</a> to via
  761. <code>&lt;patternset refid=&quot;non.test.sources&quot;
  762. /&gt;</code> by tasks that support this feature or by FileSets.</p>
  763. <p>Note that while the includes and excludes attributes accept
  764. multiple elements separated by commas or spaces, the nested
  765. &lt;include&gt; and &lt;exclude&gt; elements expect their name
  766. attribute to hold a single pattern.</p>
  767. <h3><a name="fileset">FileSets</a></h3>
  768. <p>FileSets are groups of files. These files can be found in a
  769. directory tree starting in a base directory and are matched by
  770. patterns taken from a number of <a
  771. href="#patternset">PatternSets</a>. FileSets can appear inside task
  772. that support this feature or at the same level as <code>target</code>
  773. - i.e. as children of <code>project</code>.</p>
  774. <p>PatternSets can be specified as nested
  775. <code>&lt;patternset&gt;</code>
  776. elements. In addition FileSet holds an implicit PatternSet and
  777. supports the nested <code>&lt;include&gt;</code> and
  778. <code>&lt;exclude&gt;</code> elements of PatternSet directly as well
  779. as PatternSet's attributes.</p>
  780. <table border="1" cellpadding="2" cellspacing="0">
  781. <tr>
  782. <td valign="top"><b>Attribute</b></td>
  783. <td valign="top"><b>Description</b></td>
  784. <td align="center" valign="top"><b>Required</b></td>
  785. </tr>
  786. <tr>
  787. <td valign="top">dir</td>
  788. <td valign="top">The root of the directory tree of this FileSet.</td>
  789. <td valign="top" align="center">Yes</td>
  790. </tr>
  791. <tr>
  792. <td valign="top">defaultexcludes</td>
  793. <td valign="top">indicates whether default excludes should be used or not
  794. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  795. <td valign="top" align="center">No</td>
  796. </tr>
  797. <tr>
  798. <td valign="top">includes</td>
  799. <td valign="top">comma separated list of patterns of files that must be
  800. included. All files are included when omitted.</td>
  801. <td valign="top" align="center">No</td>
  802. </tr>
  803. <tr>
  804. <td valign="top">includesfile</td>
  805. <td valign="top">the name of a file. Each line of this file is
  806. taken to be an include pattern</td>
  807. <td valign="top" align="center">No</td>
  808. </tr>
  809. <tr>
  810. <td valign="top">excludes</td>
  811. <td valign="top">comma separated list of patterns of files that must be
  812. excluded. No files (except default excludes) are excluded when omitted.</td>
  813. <td valign="top" align="center">No</td>
  814. </tr>
  815. <tr>
  816. <td valign="top">excludesfile</td>
  817. <td valign="top">the name of a file. Each line of this file is
  818. taken to be an exclude pattern</td>
  819. <td valign="top" align="center">No</td>
  820. </tr>
  821. </table>
  822. <h4>Examples</h4>
  823. <blockquote><pre>
  824. &lt;fileset dir=&quot;${server.src}&quot; &gt;
  825. &lt;patternset id=&quot;non.test.sources&quot; &gt;
  826. &lt;include name=&quot;**/*.java&quot; /&gt;
  827. &lt;exclude name=&quot;**/*Test*&quot; /&gt;
  828. &lt;/patternset&gt;
  829. &lt;/fileset&gt;
  830. </pre></blockquote>
  831. <p>Groups all files in directory <code>${server.src}</code> that are Java
  832. source files and don't have the text <code>Test</code> in their
  833. name.</p>
  834. <blockquote><pre>
  835. &lt;fileset dir=&quot;${client.src}&quot; &gt;
  836. &lt;patternset refid=&quot;non.test.sources&quot; /&gt;
  837. &lt;/fileset&gt;
  838. </pre></blockquote>
  839. <p>Groups all files in directory <code>${client.src}</code> using the
  840. same patterns as the example before.</p>
  841. <hr>
  842. <h2><a name="tasks">Built in tasks</a></h2>
  843. <ul>
  844. <li><a href="#ant">Ant</a></li>
  845. <li><a href="#antcall">AntCall</a></li>
  846. <li><a href="#antstructure">AntStructure</a></li>
  847. <li><a href="#available">Available</a></li>
  848. <li><a href="#chmod">Chmod</a></li>
  849. <li><a href="#copy">Copy</a></li>
  850. <li><a href="#copydir">Copydir</a></li>
  851. <li><a href="#copyfile">Copyfile</a></li>
  852. <li><a href="#cvs">Cvs</a></li>
  853. <li><a href="#delete">Delete</a></li>
  854. <li><a href="#deltree">Deltree</a></li>
  855. <li><a href="#echo">Echo</a></li>
  856. <li><a href="#exec">Exec</a></li>
  857. <li><a href="#execon">ExecOn</a></li>
  858. <li><a href="#fail">Fail</a></li>
  859. <li><a href="#filter">Filter</a></li>
  860. <li><a href="#fixcrlf">FixCRLF</a></li>
  861. <li><a href="#genkey">GenKey</a></li>
  862. <li><a href="#get">Get</a></li>
  863. <li><a href="#gunzip">GUnzip</a></li>
  864. <li><a href="#gzip">GZip</a></li>
  865. <li><a href="#jar">Jar</a></li>
  866. <li><a href="#java">Java</a></li>
  867. <li><a href="#javac">Javac</a></li>
  868. <li><a href="#javadoc">Javadoc/Javadoc2</a></li>
  869. <li><a href="#mail">Mail</a></li>
  870. <li><a href="#mkdir">Mkdir</a></li>
  871. <li><a href="#move">Move</a></li>
  872. <li><a href="#patch">Patch</a></li>
  873. <li><a href="#property">Property</a></li>
  874. <li><a href="#rename">Rename</a></li>
  875. <li><a href="#replace">Replace</a></li>
  876. <li><a href="#rmic">Rmic</a></li>
  877. <li><a href="#signjar">SignJar</a></li>
  878. <li><a href="sql.html">Sql</a></li>
  879. <li><a href="#style">Style</a></li>
  880. <li><a href="#tar">Tar</a></li>
  881. <li><a href="#taskdef">Taskdef</a></li>
  882. <li><a href="#touch">Touch</a></li>
  883. <li><a href="#tstamp">Tstamp</a></li>
  884. <li><a href="#unzip">Unjar</a></li>
  885. <li><a href="#untar">Untar</a></li>
  886. <li><a href="#unzip">Unwar</a></li>
  887. <li><a href="#unzip">Unzip</a></li>
  888. <li><a href="#uptodate">Uptodate</a></li>
  889. <li><a href="#war">War</a></li>
  890. <li><a href="#zip">Zip</a></li>
  891. </ul>
  892. <hr>
  893. <h2><a name="ant">Ant</a></h2>
  894. <h3>Description</h3>
  895. <p>Runs Ant on a supplied buildfile. This can be used to build subprojects.</p>
  896. <p>When the <i>antfile</i> attribute is omitted, the file &quot;build.xml&quot;
  897. in the supplied directory (<i>dir</i> attribute) is used.</p>
  898. <p>If no target attribute is supplied, the default target of the new project is
  899. used.</p>
  900. <p>The properties of the current project will be available in the new project.
  901. These properties will override the properties that are set in the new project.
  902. (See also the <a href="#property">properties task</a>). You can set properties
  903. in the new project from the old project by using nested property tags. This
  904. allows you to parameterize your subprojects.</p>
  905. <h3>Parameters</h3>
  906. <table border="1" cellpadding="2" cellspacing="0">
  907. <tr>
  908. <td valign="top"><b>Attribute</b></td>
  909. <td valign="top"><b>Description</b></td>
  910. <td align="center" valign="top"><b>Required</b></td>
  911. </tr>
  912. <tr>
  913. <td valign="top">antfile</td>
  914. <td valign="top">the buildfile to use. Defaults to &quot;build.xml&quot;.</td>
  915. <td valign="top" align="center">No</td>
  916. </tr>
  917. <tr>
  918. <td valign="top">dir</td>
  919. <td valign="top">the directory to use as a basedir for the new Ant project.
  920. Defaults to the current directory.</td>
  921. <td valign="top" align="center">No</td>
  922. </tr>
  923. <tr>
  924. <td valign="top">target</td>
  925. <td valign="top">the target of the new Ant project that should be executed.</td>
  926. <td valign="top" align="center">No</td>
  927. </tr>
  928. <tr>
  929. <td valign="top">output</td>
  930. <td valign="top">Filename to write the ant output to.
  931. </td>
  932. <td align="center" valign="top">No</td>
  933. </tr>
  934. </table>
  935. <h3>Examples</h3>
  936. <pre>
  937. &lt;ant antfile=&quot;subproject/subbuild.xml&quot; dir=&quot;subproject&quot; target=&quot;compile&quot; /&gt;
  938. &lt;ant dir=&quot;subproject&quot; /&gt;
  939. &lt;ant antfile=&quot;subproject/property_based_subbuild.xml&quot;&gt;
  940. &lt;property name=&quot;param1&quot; value=&quot;version 1.x&quot; /&gt;
  941. &lt;property file=&quot;config/subproject/default.properties&quot; /&gt;
  942. &lt;/ant&gt;
  943. </pre>
  944. <hr>
  945. <h2><a name="antcall">AntCall</a></h2>
  946. <h3>Description</h3>
  947. <p>Call another target within the same build-file optionally specifying some
  948. properties (param's in this context)</p>
  949. <h3>Parameters</h3>
  950. <table border="1" cellpadding="2" cellspacing="0">
  951. <tr>
  952. <td valign="top"><b>Attribute</b></td>
  953. <td valign="top"><b>Description</b></td>
  954. <td align="center" valign="top"><b>Required</b></td>
  955. </tr>
  956. <tr>
  957. <td valign="top">target</td>
  958. <td valign="top">The target to execute.</td>
  959. <td valign="top" align="center">Yes</td>
  960. </tr>
  961. </table>
  962. <h3>Parameters specified as nested elements</h3>
  963. <h4>param</h4>
  964. <p>Specifies the properties to set before running the specified target. See <a
  965. href="#property">property</a> for usage guidelines.</p>
  966. <h3>Examples</h3>
  967. <pre>
  968. &lt;target name=&quot;default&quot;&gt;
  969. &lt;antcall target=&quot;doSomethingElse&quot;&gt;
  970. &lt;param name=&quot;param1&quot; value=&quot;value&quot;/&gt;
  971. &lt;/antcall&gt;
  972. &lt;/target&gt;
  973. &lt;target name=&quot;doSomethingElse&quot;&gt;
  974. &lt;echo message=&quot;param1=${param1}&quot;/&gt;
  975. &lt;/target&gt;
  976. </pre>
  977. <p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p>
  978. <hr>
  979. <h2><a name="antstructure">AntStructure</a></h2>
  980. <h3>Description</h3>
  981. <p>Generates a DTD for Ant build files which contains information
  982. about all tasks currently known to Ant.</p>
  983. <p>Note that the DTD generated by this task is incomplete, you can
  984. always add XML entities using <a
  985. href="#taskdef"><code>&lt;taskdef&gt;</code></a>. See <a
  986. href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html">here</a> for
  987. a way to get around this problem.</p>
  988. <p>This task doesn't know about required attributes, all will be
  989. listed as <code>#IMPLIED</code>.</p>
  990. <h3>Parameters</h3>
  991. <table border="1" cellpadding="2" cellspacing="0">
  992. <tr>
  993. <td valign="top"><b>Attribute</b></td>
  994. <td valign="top"><b>Description</b></td>
  995. <td align="center" valign="top"><b>Required</b></td>
  996. </tr>
  997. <tr>
  998. <td valign="top">output</td>
  999. <td valign="top">file to write the DTD to.</td>
  1000. <td valign="top" align="center">Yes</td>
  1001. </tr>
  1002. </table>
  1003. <h3>Examples</h3>
  1004. <blockquote><pre>
  1005. &lt;antstructure output=&quot;project.dtd&quot; /&gt;
  1006. </pre></blockquote>
  1007. <hr>
  1008. <h2><a name="available">Available</a></h2>
  1009. <h3>Description</h3>
  1010. <p>Sets a property if a resource is available at runtime. This resource can be a
  1011. file resource, a class in classpath or a JVM system resource.</p>
  1012. <p>If the resource is present, the property value is set to true by
  1013. default, otherwise the property is not set. You can set the value to
  1014. something specific by using the value attribute.</p>
  1015. <p>Normally, this task is used to set properties that are useful to avoid target
  1016. execution depending on system parameters.</p>
  1017. <h3>Parameters</h3>
  1018. <table border="1" cellpadding="2" cellspacing="0">
  1019. <tr>
  1020. <td valign="top"><b>Attribute</b></td>
  1021. <td valign="top"><b>Description</b></td>
  1022. <td align="center" valign="top"><b>Required</b></td>
  1023. </tr>
  1024. <tr>
  1025. <td valign="top">property</td>
  1026. <td valign="top">the name of the property to set.</td>
  1027. <td valign="top" align="center">Yes</td>
  1028. </tr>
  1029. <tr>
  1030. <td valign="top">value</td>
  1031. <td valign="top">the value to set the property to. Defaults to &quot;true&quot;.</td>
  1032. <td valign="top" align="center">No</td>
  1033. </tr>
  1034. <tr>
  1035. <td valign="top">classname</td>
  1036. <td valign="top">the class to look for in classpath.</td>
  1037. <td valign="middle" align="center" rowspan="3">Yes</td>
  1038. </tr>
  1039. <tr>
  1040. <td valign="top">resource</td>
  1041. <td valign="top">the resource to look for in the JVM</td>
  1042. </tr>
  1043. <tr>
  1044. <td valign="top">file</td>
  1045. <td valign="top">the file to look for.</td>
  1046. </tr>
  1047. <tr>
  1048. <td valign="top">classpath</td> <td valign="top">the classpath to
  1049. use when looking up <code>classname</code>.</td> <td
  1050. align="center" valign="top">No</td>
  1051. </tr>
  1052. </table>
  1053. <h3>Parameters specified as nested elements</h3>
  1054. <h4>classpath</h4>
  1055. <p><code>Available</code>'s <em>classpath</em> attribute is a <a
  1056. href="#path">PATH like structure</a> and can also be set via a nested
  1057. <em>classpath</em> element.</p>
  1058. <h3>Examples</h3>
  1059. <pre> &lt;available classname=&quot;org.whatever.Myclass&quot; property=&quot;Myclass.present&quot; /&gt;</pre>
  1060. <p>sets the property <code><i>Myclass.present</i></code> to the value &quot;true&quot;
  1061. if the <i>org.whatever.Myclass</i> is found in Ant's classpath.</p>
  1062. <hr>
  1063. <h2><a name="chmod">Chmod</a></h2>
  1064. <h3>Description</h3>
  1065. <p>Changes the permissions of a file or all files inside specified directories. Right now it has effect only under Unix.
  1066. The permissions are also UNIX style, like the argument for the chmod command.</p>
  1067. <p>See the section on <a href="#directorybasedtasks">directory based
  1068. tasks</a>, on how the inclusion/exclusion of files works, and how to
  1069. write patterns.</p>
  1070. <p>This task holds an implicit <a href="#fileset">FileSet</a> and
  1071. supports all of FileSet's attributes and nested elements
  1072. directly. More FileSets can be specified using nested
  1073. <code>&lt;fileset&gt;</code> elements.</p>
  1074. <h3>Parameters</h3>
  1075. <table border="1" cellpadding="2" cellspacing="0">
  1076. <tr>
  1077. <td valign="top"><b>Attribute</b></td>
  1078. <td valign="top"><b>Description</b></td>
  1079. <td align="center" valign="top"><b>Required</b></td>
  1080. </tr>
  1081. <tr>
  1082. <td valign="top">file</td>
  1083. <td valign="top">the file or single directory of which the permissions
  1084. must be changed.</td>
  1085. <td valign="top" valign="middle" rowspan="2">exactly one of the two or nested <code>&lt;fileset&gt;</code> elements.</td>
  1086. </tr>
  1087. <tr>
  1088. <td valign="top">dir</td>
  1089. <td valign="top">the directory which holds the files whose permissions
  1090. must be changed.</td>
  1091. </tr>
  1092. <tr>
  1093. <td valign="top">perm</td>
  1094. <td valign="top">the new permissions.</td>
  1095. <td valign="top" align="center">Yes</td>
  1096. </tr>
  1097. <tr>
  1098. <td valign="top">includes</td>
  1099. <td valign="top">comma separated list of patterns of files that must be
  1100. included. All files are included when omitted.</td>
  1101. <td valign="top" align="center">No</td>
  1102. </tr>
  1103. <tr>
  1104. <td valign="top">includesfile</td>
  1105. <td valign="top">the name of a file. Each line of this file is
  1106. taken to be an include pattern</td>
  1107. <td valign="top" align="center">No</td>
  1108. </tr>
  1109. <tr>
  1110. <td valign="top">excludes</td>
  1111. <td valign="top">comma separated list of patterns of files that must be
  1112. excluded. No files (except default excludes) are excluded when omitted.</td>
  1113. <td valign="top" align="center">No</td>
  1114. </tr>
  1115. <tr>
  1116. <td valign="top">excludesfile</td>
  1117. <td valign="top">the name of a file. Each line of this file is
  1118. taken to be an exclude pattern</td>
  1119. <td valign="top" align="center">No</td>
  1120. </tr>
  1121. <tr>
  1122. <td valign="top">defaultexcludes</td>
  1123. <td valign="top">indicates whether default excludes should be used or not
  1124. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1125. <td valign="top" align="center">No</td>
  1126. </tr>
  1127. <tr>
  1128. <td valign="top">parallel</td>
  1129. <td valign="top">process all specified files using a single
  1130. <code>chmod</code> command. Defaults to true.</td>
  1131. <td valign="top" align="center">No</td>
  1132. </tr>
  1133. <tr>
  1134. <td valign="top">type</td>
  1135. <td valign="top">One of <em>file</em>, <em>dir</em> or
  1136. <em>both</em>. If set to <em>file</em>, only the permissions of
  1137. plain files are going to be changed. If set to <em>dir</em>, only
  1138. the directories are considered.</td>
  1139. <td align="center" valign="top">No, default is <em>file</em></td>
  1140. </tr>
  1141. </table>
  1142. <h3>Examples</h3>
  1143. <blockquote>
  1144. <p><code>&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;
  1145. /&gt;</code></p>
  1146. </blockquote>
  1147. <p>makes the &quot;start.sh&quot; file readable and executable for anyone on a
  1148. UNIX system.</p>
  1149. <blockquote>
  1150. <pre>
  1151. &lt;chmod dir=&quot;${dist}/bin&quot; perm=&quot;ugo+rx&quot; includes=&quot;**/*.sh&quot; /&gt;
  1152. </pre>
  1153. </blockquote>
  1154. <p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
  1155. readable and executable for anyone on a UNIX system.</p>
  1156. <blockquote>
  1157. <pre>
  1158. &lt;chmod perm=&quot;g+w&quot; /&gt;
  1159. &lt;fileset dir=&quot;shared/sources1&quot; &gt;
  1160. &lt;exclude name=&quot;**/trial/**&quot; /&gt;
  1161. &lt;/fileset&gt;
  1162. &lt;fileset refid=&quot;other.shared.sources&quot; /&gt;
  1163. &lt;/chmod&gt;
  1164. </pre>
  1165. </blockquote>
  1166. <p>makes all files below <code>shared/sources1</code> (except those
  1167. below any directory named trial) writable for members of the same
  1168. group on a UNIX system. In addition all files belonging to a FileSet
  1169. with <code>id</code> <code>other.shared.sources</code> get the same
  1170. permissions.</p>
  1171. <hr>
  1172. <h2><a name="copy">Copy</a></h2>
  1173. <h3>Description</h3>
  1174. <p>Copies a file or Fileset to a new file or directory. Files are
  1175. only copied if the source file is newer than the destination file,
  1176. or when the destination file does not exist. However, you can explicitly
  1177. overwrite files with the <var>overwrite</var> attribute.</p>
  1178. <p><a href="#fileset">FileSet</a>s are used to select files to copy.
  1179. To use a fileset, the <var>todir</var> attribute must be set.</p>
  1180. <h3>Parameters</h3>
  1181. <table border="1" cellpadding="2" cellspacing="0">
  1182. <tr>
  1183. <td valign="top"><b>Attribute</b></td>
  1184. <td valign="top"><b>Description</b></td>
  1185. <td align="center" valign="top"><b>Required</b></td>
  1186. </tr>
  1187. <tr>
  1188. <td valign="top">file</td>
  1189. <td valign="top">The file to copy.</td>
  1190. <td valign="top" align="center">One of either <var>file</var> or
  1191. at least one nested fileset element.</td>
  1192. </tr>
  1193. <tr>
  1194. <td valign="top">tofile</td>
  1195. <td valign="top">The file to copy to.</td>
  1196. <td valign="top" align="center" rowspan="2">With the <var>file</var> attribute,
  1197. either <var>tofile</var> or <var>todir</var> can be used. With nested filesets,
  1198. only <var>todir</var> is allowed.</td>
  1199. </tr>
  1200. <tr>
  1201. <td valign="top">todir</td>
  1202. <td valign="top">The directory to copy to.</td>
  1203. </tr>
  1204. <tr>
  1205. <td valign="top">overwrite</td>
  1206. <td valign="top">Overwrite existing files even if the destination
  1207. files are newer. Defaults to &quot;no&quot;.</td>
  1208. <td valign="top" align="center">No</td>
  1209. </tr>
  1210. <tr>
  1211. <td valign="top">filtering</td>
  1212. <td valign="top">Indicates whether token filtering should take place during
  1213. the copy. Defaults to &quot;no&quot;.</td>
  1214. <td valign="top" align="center">No</td>
  1215. </tr>
  1216. <tr>
  1217. <td valign="top">flatten</td>
  1218. <td valign="top">Ignore directory structure of source directory,
  1219. copy all files into a single directory, specified by the <var>todir</var>
  1220. attribute. Defaults to &quot;no&quot;.</td>
  1221. <td valign="top" align="center">No</td>
  1222. </tr>
  1223. <tr>
  1224. <td valign="top">includeEmptyDirs</td>
  1225. <td valign="top">Copy empty directories included with the nested FileSet(s).
  1226. Defaults to &quot;yes&quot;.</td>
  1227. <td valign="top" align="center">No</td>
  1228. </tr>
  1229. </table>
  1230. <h3>Examples</h3>
  1231. <p><b>Copy a single file</b></p>
  1232. <pre>
  1233. &lt;copy file=&quot;myfile.txt&quot; tofile=&quot;mycopy.txt&quot; /&gt;
  1234. </pre>
  1235. <p><b>Copy a file to a directory</b></p>
  1236. <pre>
  1237. &lt;copy file=&quot;myfile.txt&quot; todir=&quot;../some/dir/tree&quot; /&gt;
  1238. </pre>
  1239. <p><b>Copy a directory to another directory</b></p>
  1240. <pre>
  1241. &lt;copy todir=&quot;../new/dir&quot;&gt;
  1242. &lt;fileset dir=&quot;src_dir&quot;/&gt;
  1243. &lt;/copy&gt;
  1244. </pre>
  1245. <p><b>Copy a set of files to a directory</b></p>
  1246. <pre>
  1247. &lt;copy todir=&quot;../dest/dir&quot; &gt;
  1248. &lt;fileset dir=&quot;src_dir&quot &gt;
  1249. &lt;exclude name=&quot;**/*.java&quot; /&gt;
  1250. &lt;/fileset&gt;
  1251. &lt;/copy&gt;
  1252. &lt;copy todir=&quot;../dest/dir&quot; &gt;
  1253. &lt;fileset dir=&quot;src_dir&quot excludes=&quot;**/*.java&quot; /&gt;
  1254. &lt;/copy&gt;
  1255. </pre>
  1256. <hr>
  1257. <h2><a name="copydir">Copydir</a></h2>
  1258. <h3><i>Deprecated</i></h3>
  1259. <p><i>This task has been deprecated. Use the Copy task instead.</i></p>
  1260. <h3>Description</h3>
  1261. <p>Copies a directory tree from the source to the destination.</p>
  1262. <p>It is possible to refine the set of files that are being copied. This can be
  1263. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  1264. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  1265. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  1266. the files you want to have excluded. This is also done with patterns. And
  1267. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1268. want to use default exclusions or not. See the section on <a
  1269. href="#directorybasedtasks">directory based tasks</a>, on how the
  1270. inclusion/exclusion of files works, and how to write patterns.</p>
  1271. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  1272. supports all attributes of <code>&lt;fileset&gt;</code>
  1273. (<code>dir</code> becomes <code>src</code>) as well as the nested
  1274. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  1275. <code>&lt;patternset&gt;</code> elements.</p>
  1276. <h3>Parameters</h3>
  1277. <table border="1" cellpadding="2" cellspacing="0">
  1278. <tr>
  1279. <td valign="top"><b>Attribute</b></td>
  1280. <td valign="top"><b>Description</b></td>
  1281. <td align="center" valign="top"><b>Required</b></td>
  1282. </tr>
  1283. <tr>
  1284. <td valign="top">src</td>
  1285. <td valign="top">the directory to copy.</td>
  1286. <td valign="top" align="center">Yes</td>
  1287. </tr>
  1288. <tr>
  1289. <td valign="top">dest</td>
  1290. <td valign="top">the directory to copy to.</td>
  1291. <td valign="top" align="center">Yes</td>
  1292. </tr>
  1293. <tr>
  1294. <td valign="top">includes</td>
  1295. <td valign="top">comma separated list of patterns of files that must be
  1296. included. All files are included when omitted.</td>
  1297. <td valign="top" align="center">No</td>
  1298. </tr>
  1299. <tr>
  1300. <td valign="top">includesfile</td>
  1301. <td valign="top">the name of a file. Each line of this file is
  1302. taken to be an include pattern</td>
  1303. <td valign="top" align="center">No</td>
  1304. </tr>
  1305. <tr>
  1306. <td valign="top">excludes</td>
  1307. <td valign="top">comma separated list of patterns of files that must be
  1308. excluded. No files (except default excludes) are excluded when omitted.</td>
  1309. <td valign="top" align="center">No</td>
  1310. </tr>
  1311. <tr>
  1312. <td valign="top">excludesfile</td>
  1313. <td valign="top">the name of a file. Each line of this file is
  1314. taken to be an exclude pattern</td>
  1315. <td valign="top" align="center">No</td>
  1316. </tr>
  1317. <tr>
  1318. <td valign="top">defaultexcludes</td>
  1319. <td valign="top">indicates whether default excludes should be used or not
  1320. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1321. <td valign="top" align="center">No</td>
  1322. </tr>
  1323. <tr>
  1324. <td valign="top">filtering</td>
  1325. <td valign="top">indicates whether token filtering should take place during
  1326. the copy</td>
  1327. <td valign="top" align="center">No</td>
  1328. </tr>
  1329. <tr>
  1330. <td valign="top">flatten</td>
  1331. <td valign="top">ignore directory structure of source directory,
  1332. copy all files into a single directory - specified by the dest
  1333. attribute (default is false).</td>
  1334. <td valign="top" align="center">No</td>
  1335. </tr>
  1336. <tr>
  1337. <td valign="top">forceoverwrite</td>
  1338. <td valign="top">overwrite existing files even if the destination
  1339. files are newer (default is false).</td>
  1340. <td valign="top" align="center">No</td>
  1341. </tr>
  1342. </table>
  1343. <h3>Examples</h3>
  1344. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  1345. dest=&quot;${dist}&quot;
  1346. /&gt;</pre>
  1347. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>.</p>
  1348. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  1349. dest=&quot;${dist}&quot;
  1350. includes=&quot;**/*.java&quot;
  1351. excludes=&quot;**/Test.java&quot;
  1352. /&gt;</pre>
  1353. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  1354. recursively. All java files are copied, except for files with the name <code>Test.java</code>.</p>
  1355. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  1356. dest=&quot;${dist}&quot;
  1357. includes=&quot;**/*.java&quot;
  1358. excludes=&quot;mypackage/test/**&quot; /&gt;</pre>
  1359. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  1360. recursively. All java files are copied, except for the files under the <code>mypackage/test</code>
  1361. directory.</p>
  1362. <hr>
  1363. <h2><a name="copyfile">Copyfile</a></h2>
  1364. <h3><i>Deprecated</i></h3>
  1365. <p><i>This task has been deprecated. Use the Copy task instead.</i></p>
  1366. <h3>Description</h3>
  1367. <p>Copies a file from the source to the destination. The file is only copied if
  1368. the source file is newer than the destination file, or when the destination file
  1369. does not exist.</p>
  1370. <h3>Parameters</h3>
  1371. <table border="1" cellpadding="2" cellspacing="0">
  1372. <tr>
  1373. <td valign="top"><b>Attribute</b></td>
  1374. <td valign="top"><b>Description</b></td>
  1375. <td align="center" valign="top"><b>Required</b></td>
  1376. </tr>
  1377. <tr>
  1378. <td valign="top">src</td>
  1379. <td valign="top">the filename of the file to copy.</td>
  1380. <td valign="top" align="center">Yes</td>
  1381. </tr>
  1382. <tr>
  1383. <td valign="top">dest</td>
  1384. <td valign="top">the filename of the file where to copy to.</td>
  1385. <td valign="top" align="center">Yes</td>
  1386. </tr>
  1387. <tr>
  1388. <td valign="top">filtering</td>
  1389. <td valign="top">indicates whether token filtering should take place during
  1390. the copy</td>
  1391. <td valign="top" align="center">No</td>
  1392. </tr>
  1393. <tr>
  1394. <td valign="top">forceoverwrite</td>
  1395. <td valign="top">overwrite existing files even if the destination
  1396. files are newer (default is false).</td>
  1397. <td valign="top" align="center">No</td>
  1398. </tr>
  1399. </table>
  1400. <h3>Examples</h3>
  1401. <blockquote>
  1402. <p><code>&lt;copyfile src=&quot;test.java&quot; dest=&quot;subdir/test.java&quot;
  1403. /&gt;</code></p>
  1404. <p><code>&lt;copyfile src=&quot;${src}/index.html&quot; dest=&quot;${dist}/help/index.html&quot;
  1405. /&gt;</code></p>
  1406. </blockquote>
  1407. <hr>
  1408. <h2><a name="cvs">Cvs</a></h2>
  1409. <h3>Description</h3>
  1410. <p>Handles packages/modules retrieved from a
  1411. <a href="http://www.cvshome.org/">CVS</a> repository.</p>
  1412. <p>When doing automated builds, the <a href="#get">get task</a> should be
  1413. preferred over the <i>checkout</i> command, because of speed.</p>
  1414. <h3>Parameters</h3>
  1415. <table border="1" cellpadding="2" cellspacing="0">
  1416. <tr>
  1417. <td valign="top"><b>Attribute</b></td>
  1418. <td valign="top"><b>Description</b></td>
  1419. <td align="center" valign="top"><b>Required</b></td>
  1420. </tr>
  1421. <tr>
  1422. <td valign="top">command</td>
  1423. <td valign="top">the CVS command to execute.</td>
  1424. <td align="center" valign="top">No, default &quot;checkout&quot;</td>
  1425. </tr>
  1426. <tr>
  1427. <td valign="top">cvsRoot</td>
  1428. <td valign="top">the CVSROOT variable.</td>
  1429. <td align="center" valign="top">No</td>
  1430. </tr>
  1431. <tr>
  1432. <td valign="top">dest</td>
  1433. <td valign="top">the directory where the checked out files should be placed.</td>
  1434. <td align="center" valign="top">No, default is project's basedir.</td>
  1435. </tr>
  1436. <tr>
  1437. <td valign="top">package</td>
  1438. <td valign="top">the package/module to check out.</td>
  1439. <td align="center" valign="top">No</td>
  1440. </tr>
  1441. <tr>
  1442. <td valign="top">tag</td>
  1443. <td valign="top">the tag of the package/module to check out.</td>
  1444. <td align="center" valign="top">No</td>
  1445. </tr>
  1446. <tr>
  1447. <td valign="top">date</td>
  1448. <td valign="top">Use the most recent revision no later than the given date</td>
  1449. <td align="center" valign="top">No</td>
  1450. </tr>
  1451. <tr>
  1452. <td valign="top">quiet</td>
  1453. <td valign="top">suppress informational messages.</td>
  1454. <td align="center" valign="top">No, default &quot;false&quot;</td>
  1455. </tr>
  1456. <tr>
  1457. <td valign="top">noexec</td>
  1458. <td valign="top">report only, don't change any files.</td>
  1459. <td align="center" valign="top">No, default &quot;false&quot;</td>
  1460. </tr>
  1461. <tr>
  1462. <td valign="top">output</td>
  1463. <td valign="top">the file to direct standard output from the command.</td>
  1464. <td align="center" valign="top">No, default output to ANT Log as MSG_INFO.</td>
  1465. </tr>
  1466. <tr>
  1467. <td valign="top">error</td>
  1468. <td valign="top">the file to direct standard error from the command.</td>
  1469. <td align="center" valign="top">No, default error to ANT Log as MSG_WARN.</td>
  1470. </tr>
  1471. </table>
  1472. <h3>Examples</h3>
  1473. <pre> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@jakarta.apache.org:/home/cvspublic&quot;
  1474. package=&quot;jakarta-tools&quot;
  1475. dest=&quot;${ws.dir}&quot;
  1476. /&gt;</pre>
  1477. <p>checks out the package/module &quot;jakarta-tools&quot; from the CVS
  1478. repository pointed to by the cvsRoot attribute, and stores the files in &quot;${ws.dir}&quot;.</p>
  1479. <pre> &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot; /&gt;</pre>
  1480. <p>updates the package/module that has previously been checked out into
  1481. &quot;${ws.dir}&quot;.</p>
  1482. <pre> &lt;cvs command=&quot;-q diff -u -N&quot; output="patch.txt"/&gt;</pre>
  1483. <p>silently (-q) creates a file called patch.txt which contains a unified (-u) diff which includes new files added via &quot;cvs add&quot; (-N) and can be used as input to patch.</p>
  1484. <pre> &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
  1485. <p>Updates from the head of repository ignoring sticky bits (-A) and creating any new directories as necessary (-d).</p>
  1486. <p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any cvs options should appear before the command, and any command options should appear after the command as in the diff example above. See <a href="http://www.cvshome.org/docs/manual/index.html">the cvs manual</a> for details, specifically the <a href="http://www.cvshome.org/docs/manual/cvs_16.html">Guide to CVS commands</a></p>
  1487. <hr>
  1488. <h2><a name="delete">Delete</a></h2>
  1489. <h3>Description</h3>
  1490. <p>Deletes either a single file, all files in a specified directory and its
  1491. sub-directories, or a set of files specified by one or more <a href="#fileset">FileSet</a>s.
  1492. When specifying a set of files, empty directories are <em>not</em> removed.</p>
  1493. <h3>Parameters</h3>
  1494. <table border="1" cellpadding="2" cellspacing="0">
  1495. <tr>
  1496. <td valign="top"><b>Attribute</b></td>
  1497. <td valign="top"><b>Description</b></td>
  1498. <td align="center" valign="top"><b>Required</b></td>
  1499. </tr>
  1500. <tr>
  1501. <td valign="top">file</td>
  1502. <td valign="top">The file to delete.</td>
  1503. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  1504. </tr>
  1505. <tr>
  1506. <td valign="top">dir</td>
  1507. <td valign="top">The directory to delete files from.</td>
  1508. </tr>
  1509. <tr>
  1510. <td valign="top">verbose</td>
  1511. <td valign="top">Show name of each deleted file (&quot;true&quot;/&quot;false&quot;).
  1512. Default is &quot;false&quot; when omitted.</td>
  1513. <td align="center" valign="top">No</td>
  1514. </tr>
  1515. <tr>
  1516. <td valign="top">includes</td>
  1517. <td valign="top"><i>Deprecated.</i> Comma separated list of patterns of files that must be
  1518. deleted. All files are in the current directory
  1519. and any sub-directories are deleted when omitted.</td>
  1520. <td valign="top" align="center">No</td>
  1521. </tr>
  1522. <tr>
  1523. <td valign="top">includesfile</td>
  1524. <td valign="top"><i>Deprecated.</i> The name of a file. Each line of this file is
  1525. taken to be an include pattern</td>
  1526. <td valign="top" align="center">No</td>
  1527. </tr>
  1528. <tr>
  1529. <td valign="top">excludes</td>
  1530. <td valign="top"><i>Deprecated.</i> Comma separated list of patterns of files that must be
  1531. excluded from the deletion list. No files (except default excludes) are excluded when omitted.</td>
  1532. <td valign="top" align="center">No</td>
  1533. </tr>
  1534. <tr>
  1535. <td valign="top">excludesfile</td>
  1536. <td valign="top"><i>Deprecated.</i> The name of a file. Each line of this file is
  1537. taken to be an exclude pattern</td>
  1538. <td valign="top" align="center">No</td>
  1539. </tr>
  1540. <tr>
  1541. <td valign="top">defaultexcludes</td>
  1542. <td valign="top"><i>Deprecated.</i> Indicates whether default excludes should be used or not
  1543. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1544. <td valign="top" align="center">No</td>
  1545. </tr>
  1546. </table>
  1547. <h3>Examples</h3>
  1548. <pre> &lt;delete file=&quot;/lib/ant.jar&quot; /&gt;</pre>
  1549. <p>deletes the file <code>/lib/ant.jar</code>.</p>
  1550. <pre> &lt;delete dir=&quot;lib&quot; /&gt;</pre>
  1551. <p>deletes all files in the <code>/lib</code> directory.</p>
  1552. <pre> &lt;delete&gt;
  1553. &lt;fileset dir=&quot;.&quot; includes=&quot;**/*.bak&quot; /&gt;
  1554. &lt;/delete&gt;
  1555. </pre>
  1556. <p>deletes all files with the extension &quot;<code>.bak</code>&quot from the current directory
  1557. and any sub-directories.</p>
  1558. <hr>
  1559. <h2><a name="deltree">Deltree</a></h2>
  1560. <h3><i>Deprecated</i></h3>
  1561. <p><i>This task has been deprecated. Use the Delete task instead.</i></p>
  1562. <h3>Description</h3>
  1563. <p>Deletes a directory with all its files and subdirectories.</p>
  1564. <h3>Parameters</h3>
  1565. <table border="1" cellpadding="2" cellspacing="0">
  1566. <tr>
  1567. <td valign="top"><b>Attribute</b></td>
  1568. <td valign="top"><b>Description</b></td>
  1569. <td align="center" valign="top"><b>Required</b></td>
  1570. </tr>
  1571. <tr>
  1572. <td valign="top">dir</td>
  1573. <td valign="top">the directory to delete.</td>
  1574. <td valign="top" align="center">Yes</td>
  1575. </tr>
  1576. </table>
  1577. <h3>Examples</h3>
  1578. <pre> &lt;deltree dir=&quot;dist&quot; /&gt;</pre>
  1579. <p>deletes the directory <code>dist</code>, including its files and
  1580. subdirectories.</p>
  1581. <pre> &lt;deltree dir=&quot;${dist}&quot; /&gt;</pre>
  1582. <p>deletes the directory <code>${dist}</code>, including its files and
  1583. subdirectories.</p>
  1584. <hr>
  1585. <h2><a name="echo">Echo</a></h2>
  1586. <h3>Description</h3>
  1587. <p>Echoes a message to System.out or a file.</p>
  1588. <h3>Parameters</h3>
  1589. <table border="1" cellpadding="2" cellspacing="0">
  1590. <tr>
  1591. <td valign="top"><b>Attribute</b></td>
  1592. <td valign="top"><b>Description</b></td>
  1593. <td align="center" valign="top"><b>Required</b></td>
  1594. </tr>
  1595. <tr>
  1596. <td valign="top">message</td>
  1597. <td valign="top">the message to echo.</td>
  1598. <td valign="top" align="center">Yes, unless data is included in a
  1599. character section within this element.</td>
  1600. </tr>
  1601. <tr>
  1602. <td valign="top">file</td>
  1603. <td valign="top">the file to write the message to.</td>
  1604. <td valign="top" align="center">No</td>
  1605. </tr>
  1606. <tr>
  1607. <td valign="top">append</td>
  1608. <td valign="top">Append to an existing file?</td>
  1609. <td valign="top" align="center">No - default is false.</td>
  1610. </tr>
  1611. </table>
  1612. <h3>Examples</h3>
  1613. <pre> &lt;echo message=&quot;Hello world&quot; /&gt;</pre>
  1614. <pre>
  1615. &lt;echo&gt;
  1616. This is a longer message stretching over
  1617. two lines.
  1618. &lt;/echo&gt;
  1619. </pre>
  1620. <hr>
  1621. <h2><a name="exec">Exec</a></h2>
  1622. <h3>Description</h3>
  1623. <p>Executes a system command. When the <i>os</i> attribute is specified, then
  1624. the command is only executed when Ant is run on one of the specified operating
  1625. systems.</p>
  1626. <h3>Parameters</h3>
  1627. <table border="1" cellpadding="2" cellspacing="0">
  1628. <tr>
  1629. <td valign="top"><b>Attribute</b></td>
  1630. <td valign="top"><b>Description</b></td>
  1631. <td align="center" valign="top"><b>Required</b></td>
  1632. </tr>
  1633. <tr>
  1634. <td valign="top">command</td>
  1635. <td valign="top">the command to execute with all command line
  1636. arguments. <b>deprecated, use executable and nested
  1637. <code>&lt;arg&gt;</code> elements instead</b>.</td>
  1638. <td align="center" rowspan="2">Exactly one of the two.</td>
  1639. </tr>
  1640. <tr>
  1641. <td valign="top">executable</td>
  1642. <td valign="top">the command to execute without any command line
  1643. arguments.</td>
  1644. </tr>
  1645. <tr>
  1646. <td valign="top">dir</td>
  1647. <td valign="top">the directory in which the command should be executed.</td>
  1648. <td align="center" valign="top">No</td>
  1649. </tr>
  1650. <tr>
  1651. <td valign="top">os</td>
  1652. <td valign="top">list of Operating Systems on which the command may be
  1653. executed.</td>
  1654. <td align="center" valign="top">No</td>
  1655. </tr>
  1656. <tr>
  1657. <td valign="top">output</td>
  1658. <td valign="top">the file to which the output of the command should be
  1659. redirected.</td>
  1660. <td align="center" valign="top">No</td>
  1661. </tr>
  1662. <tr>
  1663. <td valign="top">timeout</td>
  1664. <td valign="top">Stop the command if it doesn't finish within the
  1665. specified time (given in milliseconds).</td>
  1666. <td align="center" valign="top">No</td>
  1667. </tr>
  1668. <tr>
  1669. <td valign="top">failonerror</td>
  1670. <td valign="top">Stop the buildprocess if the command exits with a
  1671. returncode other than 0.</td>
  1672. <td align="center" valign="top">No</td>
  1673. </tr>
  1674. </table>
  1675. <h3>Examples</h3>
  1676. <blockquote>
  1677. <p><code>&lt;exec dir=&quot;${src}&quot; executable=&quot;dir&quot; os=&quot;windows&quot;
  1678. output=&quot;dir.txt&quot; /&gt;</code></p>
  1679. </blockquote>
  1680. <h3>Parameters specified as nested elements</h3>
  1681. <h4>arg</h4>
  1682. <p>Command line arguments should be specified as nested
  1683. <code>&lt;arg&gt;</code> elements. See <a
  1684. href="index.html#arg">Command line arguments</a>.</p>
  1685. <h4><a name="env">env</a></h4>
  1686. <p>It is possible to specify environment variables to pass to the
  1687. system command via nested <code>&lt;env&gt;</code> elements.</p>
  1688. <p>Please note that the environment of the current Ant process is
  1689. <b>not</b> passed to the system command if you specify variables using
  1690. <code>&lt;env&gt;</code>.</p>
  1691. <table border="1" cellpadding="2" cellspacing="0">
  1692. <tr>
  1693. <td valign="top"><b>Attribute</b></td>
  1694. <td valign="top"><b>Description</b></td>
  1695. <td align="center" valign="top"><b>Required</b></td>
  1696. </tr>
  1697. <tr>
  1698. <td valign="top">key</td>
  1699. <td valign="top">The name of the environment variable.</td>
  1700. <td align="center" valign="top">Yes</td>
  1701. </tr>
  1702. <tr>
  1703. <td valign="top">value</td>
  1704. <td valign="top">The literal value for the environment variable.</td>
  1705. <td align="center" rowspan="3">Exactly one of these.</td>
  1706. </tr>
  1707. <tr>
  1708. <td valign="top">path</td>
  1709. <td valign="top">The value for a PATH like environment
  1710. variable. You can use ; or : as path separators and Ant will
  1711. convert it to the platform's local conventions.</td>
  1712. </tr>
  1713. <tr>
  1714. <td valign="top">file</td>
  1715. <td valign="top">The value for the environment variable. Will be
  1716. replaced by the absolute filename of the file by Ant.</td>
  1717. </tr>
  1718. </table>
  1719. <h5>Examples</h5>
  1720. <blockquote><pre>
  1721. &lt;exec executable=&quot;emacs&quot; &gt;
  1722. &lt;env key=&quot;DISPLAY&quot; value=&quot;:1.0&quot; /&gt;
  1723. &lt;/exec&gt;
  1724. </pre></blockquote>
  1725. <p>starts <code>emacs</code> on display 1 of the X Window System.</p>
  1726. <blockquote><pre>
  1727. &lt;exec ... &gt;
  1728. &lt;env key=&quot;PATH&quot; path=&quot;${java.library.path}:${basedir}/bin&quot; /&gt;
  1729. &lt;/exec&gt;
  1730. </pre></blockquote>
  1731. <p>adds <code>${basedir}/bin</code> to the <code>PATH</code> of the
  1732. system command.</p>
  1733. <p><b>Note:</b> Although it may work for you to specify arguments using
  1734. a simple arg-element and seperate them by spaces it may fail if you switch to
  1735. a newer version of the JDK. JDK &lt; 1.2 will pass these as separate arguments
  1736. to the program you are calling, JDK &gt;= 1.2 will pass them as a single
  1737. argument and cause most calls to fail.</p>
  1738. <p><b>Note2:</b> If you are using Ant on Windows and a new DOS-Window pops up
  1739. for every command which is excuted this may be a problem of the JDK you are using.
  1740. This problem may occur with all JDK's &lt; 1.2.</p>
  1741. <hr>
  1742. <h2><a name="execon">ExecOn</a></h2>
  1743. <h3>Description</h3>
  1744. <p>Executes a system command. When the <i>os</i> attribute is specified, then
  1745. the command is only executed when Ant is run on one of the specified operating
  1746. systems.</p>
  1747. <p>The files and/or directories of a number of <a
  1748. href="#fileset">FileSet</a>s are passed as arguments to the system
  1749. command. At least one nested <code>&lt;fileset&gt;</code> is required.</p>
  1750. <h3>Parameters</h3>
  1751. <table border="1" cellpadding="2" cellspacing="0">
  1752. <tr>
  1753. <td valign="top"><b>Attribute</b></td>
  1754. <td valign="top"><b>Description</b></td>
  1755. <td align="center" valign="top"><b>Required</b></td>
  1756. </tr>
  1757. <tr>
  1758. <td valign="top">executable</td>
  1759. <td valign="top">the command to execute without any command line
  1760. arguments.</td>
  1761. <td align="center" valign="top">Yes</td>
  1762. </tr>
  1763. <tr>
  1764. <td valign="top">dir</td>
  1765. <td valign="top">the directory in which the command should be executed.</td>
  1766. <td align="center" valign="top">No</td>
  1767. </tr>
  1768. <tr>
  1769. <td valign="top">os</td>
  1770. <td valign="top">list of Operating Systems on which the command may be
  1771. executed.</td>
  1772. <td align="center" valign="top">No</td>
  1773. </tr>
  1774. <tr>
  1775. <td valign="top">output</td>
  1776. <td valign="top">the file to which the output of the command should be
  1777. redirected.</td>
  1778. <td align="center" valign="top">No</td>
  1779. </tr>
  1780. <tr>
  1781. <td valign="top">timeout</td>
  1782. <td valign="top">Stop the command if it doesn't finish within the
  1783. specified time (given in milliseconds).</td>
  1784. <td align="center" valign="top">No</td>
  1785. </tr>
  1786. <tr>
  1787. <td valign="top">failonerror</td>
  1788. <td valign="top">Stop the buildprocess if the command exits with a
  1789. returncode other than 0.</td>
  1790. <td align="center" valign="top">No</td>
  1791. </tr>
  1792. <tr>
  1793. <td valign="top">parallel</td>
  1794. <td valign="top">Run the command only once, appending all files as
  1795. arguments. Defaults to true. If false, command will be executed
  1796. once for every file.</td>
  1797. <td align="center" valign="top">No</td>
  1798. </tr>
  1799. <tr>
  1800. <td valign="top">type</td>
  1801. <td valign="top">One of <em>file</em>, <em>dir</em> or
  1802. <em>both</em>. If set to <em>file</em>, only the names of plain
  1803. files will be sent to the command. If set to <em>dir</em>, only
  1804. the names of directories are considered.</td>
  1805. <td align="center" valign="top">No, default is <em>file</em></td>
  1806. </tr>
  1807. </table>
  1808. <h3>Parameters specified as nested elements</h3>
  1809. <h4>fileset</h4>
  1810. <p>You can use any number of nested <code>&lt;fileset&gt;</code>
  1811. elements to define the files for this task and refer to
  1812. <code>&lt;fileset&gt;</code>s defined elsewhere.</p>
  1813. <h4>arg</h4>
  1814. <p>Command line arguments should be specified as nested
  1815. <code>&lt;arg&gt;</code> elements. See <a
  1816. href="index.html#arg">Command line arguments</a>.</p>
  1817. <h4>env</h4>
  1818. <p>It is possible to specify environment variables to pass to the
  1819. system command via nested <code>&lt;env&gt;</code> elements. See the
  1820. description in the section about <a href="#env">exec</a></p>
  1821. <p>Please note that the environment of the current Ant process is
  1822. <b>not</b> passed to the system command if you specify variables using
  1823. <code>&lt;env&gt;</code>.</p>
  1824. <h3>Examples</h3>
  1825. <blockquote><pre>
  1826. &lt;execon executable=&quot;ls&quot; &gt;
  1827. &lt;arg value=&quot;-l&quot; /&gt;
  1828. &lt;fileset dir=&quot;/tmp&quot;&gt;
  1829. &lt;patternset&gt;
  1830. &lt;exclude name=&quot;**/*.txt&quot; /&gt;
  1831. &lt;/patternset&gt;
  1832. &lt;/fileset&gt;
  1833. &lt;fileset refid=&quot;other.files&quot; /&gt;
  1834. &lt;/execon&gt;
  1835. </pre></blockquote>
  1836. <p>invokes <code>ls -l</code>, adding the absolute filenames of all
  1837. files below <code>/tmp</code> not ending in <code>.txt</code> and all
  1838. files of the FileSet with <code>id</code> <code>other.files</code> to
  1839. the command line.</p>
  1840. <hr>
  1841. <h2><a name="fail">Fail</a></h2>
  1842. <h3>Description</h3>
  1843. <p>Exits the current build (just throwing a BuildException), optionally printing additional information.</p>
  1844. <h3>Parameters</h3>
  1845. <table border="1" cellpadding="2" cellspacing="0">
  1846. <tr>
  1847. <td valign="top"><b>Attribute</b></td>
  1848. <td valign="top"><b>Description</b></td>
  1849. <td align="center" valign="top"><b>Required</b></td>
  1850. </tr>
  1851. <tr>
  1852. <td valign="top">message</td>
  1853. <td valign="top">A message giving further information on why the build exited</td>
  1854. <td align="center" valign="top">No</td>
  1855. </tr>
  1856. </table>
  1857. <h3>Examples</h3>
  1858. <pre> &lt;fail/&gt;</pre>
  1859. <p>will exit the current build with no further information given.
  1860. <pre>
  1861. BUILD FAILED
  1862. build.xml:4: No message
  1863. </pre>
  1864. <pre> &lt;fail message=&quot;Something wrong here.&quot;/&gt;</pre>
  1865. <p>will exit the current build and print something like the following to whereever
  1866. your output goes:
  1867. <pre>
  1868. BUILD FAILED
  1869. build.xml:4: Something wrong here.
  1870. </pre>
  1871. <hr>
  1872. <h2><a name="filter">Filter</a></h2>
  1873. <h3>Description</h3>
  1874. <p>Sets a token filter for this project or read multiple token filter from
  1875. an input file and sets these as filters.
  1876. Token filters are used by all tasks that perform file copying operations
  1877. through the Project commodity methods.</p>
  1878. <p>Note 1: the token string must not contain the separators chars (@).<br>
  1879. Note 2: Either token and value attributes must be provided, or only the
  1880. filterfile attribute.</p>
  1881. <h3>Parameters</h3>
  1882. <table border="1" cellpadding="2" cellspacing="0">
  1883. <tr>
  1884. <td valign="top"><b>Attribute</b></td>
  1885. <td valign="top"><b>Description</b></td>
  1886. <td align="center" valign="top"><b>Required</b></td>
  1887. </tr>
  1888. <tr>
  1889. <td valign="top">token</td>
  1890. <td valign="top">the token string without @</td>
  1891. <td align="center" valign="top">Yes*</td>
  1892. </tr>
  1893. <tr>
  1894. <td valign="top">value</td>
  1895. <td valign="top">the string that should be put to replace the token when the
  1896. file is copied</td>
  1897. <td align="center" valign="top">Yes*</td>
  1898. </tr>
  1899. <tr>
  1900. <td valign="top">filtersfile</td>
  1901. <td valign="top">The file from which the filters must be read. This file must be a formatted as a property file. </td>
  1902. <td align="center" valign="top">Yes*</td>
  1903. </tr>
  1904. </table>
  1905. <p>* see notes 1 and 2 above parameters table.</p>
  1906. <h3>Examples</h3>
  1907. <pre> &lt;filter token=&quot;year&quot; value=&quot;2000&quot; /&gt;
  1908. &lt;copy todir=&quot;${dest.dir}&quot;&gt;
  1909. &lt;fileset dir=&quot;${src.dir}&quot; /&gt;
  1910. &lt;/copy&gt;</pre>
  1911. <p>will copy recursively all the files from the <i>src.dir</i> directory into
  1912. the <i>dest.dir</i> directory replacing all the occurencies of the string <i>@year@</i>
  1913. with <i>2000.</i></p>
  1914. <pre> &lt;filter filterfile=&quot;deploy_env.properties&quot; /&gt;</pre>
  1915. will read all property entries from the <i>deploy_env.properties</i> file
  1916. and set these as filters.
  1917. <hr>
  1918. <h2><a name="fixcrlf">FixCRLF</a></h2>
  1919. <h3>Description</h3>
  1920. <p>Adjusts a text file to local.</p>
  1921. <p>It is possible to refine the set of files that are being adjusted. This can be
  1922. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  1923. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  1924. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  1925. the files you want to have excluded. This is also done with patterns. And
  1926. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1927. want to use default exclusions or not. See the section on <a
  1928. href="#directorybasedtasks">directory based tasks</a>, on how the
  1929. inclusion/exclusion of files works, and how to write patterns.</p>
  1930. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  1931. supports all attributes of <code>&lt;fileset&gt;</code>
  1932. (<code>dir</code> becomes <code>srcdir</code>) as well as the nested
  1933. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  1934. <code>&lt;patternset&gt;</code> elements.</p>
  1935. <h3>Parameters</h3>
  1936. <table border="1" cellpadding="2" cellspacing="0">
  1937. <tr>
  1938. <td valign="top"><b>Attribute</b></td>
  1939. <td valign="top"><b>Description</b></td>
  1940. <td align="center" valign="top"><b>Required</b></td>
  1941. </tr>
  1942. <tr>
  1943. <td valign="top">srcDir</td>
  1944. <td valign="top">Where to find the files to be fixed up.</td>
  1945. <td valign="top" align="center">Yes</td>
  1946. </tr>
  1947. <tr>
  1948. <td valign="top">destDir</td>
  1949. <td valign="top">Where to place the corrected files. Defaults to
  1950. srcDir (replacing the original file)</td>
  1951. <td valign="top" align="center">No</td>
  1952. </tr>
  1953. <tr>
  1954. <td valign="top">includes</td>
  1955. <td valign="top">comma separated list of patterns of files that must be
  1956. included. All files are included when omitted.</td>
  1957. <td valign="top" align="center">No</td>
  1958. </tr>
  1959. <tr>
  1960. <td valign="top">includesfile</td>
  1961. <td valign="top">the name of a file. Each line of this file is
  1962. taken to be an include pattern</td>
  1963. <td valign="top" align="center">No</td>
  1964. </tr>
  1965. <tr>
  1966. <td valign="top">excludes</td>
  1967. <td valign="top">comma separated list of patterns of files that must be
  1968. excluded. No files (except default excludes) are excluded when omitted.</td>
  1969. <td valign="top" align="center">No</td>
  1970. </tr>
  1971. <tr>
  1972. <td valign="top">excludesfile</td>
  1973. <td valign="top">the name of a file. Each line of this file is
  1974. taken to be an exclude pattern</td>
  1975. <td valign="top" align="center">No</td>
  1976. </tr>
  1977. <tr>
  1978. <td valign="top">defaultexcludes</td>
  1979. <td valign="top">indicates whether default excludes should be used or not
  1980. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1981. <td valign="top" align="center">No</td>
  1982. </tr>
  1983. <tr>
  1984. <td valign="top">cr</td>
  1985. <td valign="top">Specifies how carriage return (CR) characters are to
  1986. be handled. Valid values for this property are:
  1987. <ul>
  1988. <li>add: ensure that there is a CR before every LF
  1989. <li>asis: leave CR characters alone
  1990. <li>remove: remove all CR characters
  1991. </ul>
  1992. Default is based on the platform on which you are running this task.
  1993. For Unix platforms, the default is remove. For DOS based systems
  1994. (including Windows), the default is add.
  1995. <p>
  1996. Note: Unless this property is specified as &quot;asis&quot;, extra CR characters
  1997. which do not precede a LF will be removed.
  1998. </td>
  1999. <td valign="top" align="center">No</td>
  2000. </tr>
  2001. <tr>
  2002. <td valign="top">tab</td>
  2003. <td valign="top">Specifies how tab characters are to be handled. Valid
  2004. values for this property are:
  2005. <ul>
  2006. <li>add: convert sequences of spaces which span a tab stop to tabs
  2007. <li>asis: leave tab and space characters alone
  2008. <li>remove: convert tabs to spaces
  2009. </ul>
  2010. Default for this parameter is &quot;asis&quot;.
  2011. <p>
  2012. Note: Unless this property is specified as &quot;asis&quot;, extra spaces and
  2013. tabs after the last non-whitespace character on the line will be removed.
  2014. </td>
  2015. <td valign="top" align="center">No</td>
  2016. </tr>
  2017. <tr>
  2018. <td valign="top">tablength</td>
  2019. <td valign="top">The number of characters a TAB stop corresponds to.
  2020. Must be a positive power of 2, default for this parameter is 8.</td>
  2021. <td valign="top" align="center">No</td>
  2022. </tr>
  2023. <tr>
  2024. <td valign="top">eof</td>
  2025. <td valign="top">Specifies how DOS end of file (control-Z) characters are
  2026. to be handled. Valid values for this property are:
  2027. <ul>
  2028. <li>add: ensure that there is an EOF character at the end of the file
  2029. <li>asis: leave EOF characters alone
  2030. <li>remove: remove any EOF character found at the end
  2031. </ul>
  2032. Default is based on the platform on which you are running this task.
  2033. For Unix platforms, the default is remove. For DOS based systems
  2034. (including Windows), the default is asis.
  2035. </td>
  2036. <td valign="top" align="center">No</td>
  2037. </tr>
  2038. </table>
  2039. <h3>Examples</h3>
  2040. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  2041. cr=&quot;remove&quot; eof=&quot;remove&quot;
  2042. includes=&quot;**/*.sh&quot;
  2043. /&gt;</pre>
  2044. <p>Removes carriage return and eof characters from the shell scripts. Tabs and
  2045. spaces are left as is.
  2046. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  2047. cr=&quot;add&quot;
  2048. includes=&quot;**/*.bat&quot;
  2049. /&gt;</pre>
  2050. <p>Ensures that there are carriage return characters prior to evey line feed.
  2051. Tabs and spaces are left as is.
  2052. EOF characters are left alone if run on
  2053. DOS systems, and are removed if run on Unix systems.</p>
  2054. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  2055. tabs=&quot;add&quot;
  2056. includes=&quot;**/Makefile&quot;
  2057. /&gt;</pre>
  2058. <p>Adds or removes CR characters to match local OS conventions, and
  2059. converts spaces to tabs when appropriate. EOF characters are left alone if
  2060. run on DOS systems, and are removed if run on Unix systems.
  2061. Many versions of make require tabs prior to commands.</p>
  2062. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  2063. tabs=&quot;remove&quot;
  2064. includes=&quot;**/README*&quot;
  2065. /&gt;</pre>
  2066. <p>Adds or removes CR characters to match local OS conventions, and
  2067. converts all tabs to spaces. EOF characters are left alone if run on
  2068. DOS systems, and are removed if run on Unix systems.
  2069. You never know what editor a user will use to browse README's.</p>
  2070. <hr>
  2071. <h2><a name="genkey">GenKey</a></h2>
  2072. <h3>Description</h3>
  2073. <p>Generates a key in keystore.</p>
  2074. <h3>Parameters</h3>
  2075. <table border="1" cellpadding="2" cellspacing="0">
  2076. <tr>
  2077. <td valign="top"><b>Attribute</b></td>
  2078. <td valign="top"><b>Description</b></td>
  2079. <td align="center" valign="top"><b>Required</b></td>
  2080. </tr>
  2081. <tr>
  2082. <td valign="top">alias</td>
  2083. <td valign="top">the alias to add under</td>
  2084. <td valign="top" align="center">Yes.</td>
  2085. </tr>
  2086. <tr>
  2087. <td valign="top">storepass</td>
  2088. <td valign="top">password for keystore integrity.</td>
  2089. <td valign="top" align="center">Yes.</td>
  2090. </tr>
  2091. <tr>
  2092. <td valign="top">keystore</td>
  2093. <td valign="top">keystore location</td>
  2094. <td valign="top" align="center">No</td>
  2095. </tr>
  2096. <tr>
  2097. <td valign="top">storetype</td>
  2098. <td valign="top">keystore type</td>
  2099. <td valign="top" align="center">No</td>
  2100. </tr>
  2101. <tr>
  2102. <td valign="top">keypass</td>
  2103. <td valign="top">password for private key (if different)</td>
  2104. <td valign="top" align="center">No</td>
  2105. </tr>
  2106. <tr>
  2107. <td valign="top">sigalg</td>
  2108. <td valign="top">the algorithm to use in signing</td>
  2109. <td valign="top" align="center">No</td>
  2110. </tr>
  2111. <tr>
  2112. <td valign="top">keyalg</td>
  2113. <td valign="top">the method to use when generating name-value pair</td>
  2114. <td valign="top" align="center">No</td>
  2115. </tr>
  2116. <tr>
  2117. <td valign="top">verbose</td>
  2118. <td valign="top">(true | false) verbose output when signing</td>
  2119. <td valign="top" align="center">No</td>
  2120. </tr>
  2121. <tr>
  2122. <td valign="top">dname</td>
  2123. <td valign="top">The distinguished name for entity</td>
  2124. <td valign="top" align="center">Yes if dname element unspecified</td>
  2125. </tr>
  2126. <tr>
  2127. <td valign="top">validity</td>
  2128. <td valign="top">(integer) indicates how many days certificate is valid</td>
  2129. <td valign="top" align="center">No</td>
  2130. </tr>
  2131. <tr>
  2132. <td valign="top">keysize</td>
  2133. <td valign="top">(integer) indicates the size of key generated</td>
  2134. <td valign="top" align="center">No</td>
  2135. </tr>
  2136. </table>
  2137. <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
  2138. <p>The following two examples are identical: </p>
  2139. <h3>Examples</h3>
  2140. <blockquote>
  2141. <p><code>&lt;genkey alias=&quot;apache-group&quot; storepass=&quot;secret&quot;
  2142. dname=&quot;CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US&quot; /&gt;</code></p>
  2143. </blockquote>
  2144. <blockquote>
  2145. <pre><code>&lt;genkey alias=&quot;apache-group&quot; storepass=&quot;secret&quot; &gt;
  2146. &lt;dname&gt;
  2147. &lt;param name=&quot;CN&quot; value=&quot;Ant Group&quot;/&gt;
  2148. &lt;param name=&quot;OU&quot; value=&quot;Jakarta Division&quot;/&gt;
  2149. &lt;param name=&quot;O&quot; value=&quot;Apache.Org&quot;/&gt;
  2150. &lt;param name=&quot;C&quot; value=&quot;US&quot;/&gt;
  2151. &lt;/dname&gt;
  2152. &lt;/genkey&gt;</code></pre>
  2153. </blockquote>
  2154. <hr>
  2155. <h2><a name="get">Get</a></h2>
  2156. <h3>Description</h3>
  2157. <p>Gets a file from a URL. When the verbose option is &quot;on&quot;, this task
  2158. displays a '.' for every 100 Kb retrieved.</p>
  2159. <p>This task should be preferred above the <a href="#cvs">CVS task</a> when
  2160. doing automated builds. CVS is significantly slower than loading a compressed
  2161. archive with http/ftp.</p>
  2162. The <i>usetimestamps</i> option enables you to control downloads so that the remote file is
  2163. only fetched if newer than the local copy. If there is no local copy, the download always takes
  2164. place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
  2165. if the JVM is Java1.2 or later.
  2166. NB: This timestamp facility only works on downloads using the HTTP protocol.
  2167. <h3>Parameters</h3>
  2168. <table border="1" cellpadding="2" cellspacing="0">
  2169. <tr>
  2170. <td valign="top"><b>Attribute</b></td>
  2171. <td valign="top"><b>Description</b></td>
  2172. <td align="center" valign="top"><b>Required</b></td>
  2173. </tr>
  2174. <tr>
  2175. <td valign="top">src</td>
  2176. <td valign="top">the URL from which to retrieve a file.</td>
  2177. <td align="center" valign="top">Yes</td>
  2178. </tr>
  2179. <tr>
  2180. <td valign="top">dest</td>
  2181. <td valign="top">the file where to store the retrieved file.</td>
  2182. <td align="center" valign="top">Yes</td>
  2183. </tr>
  2184. <tr>
  2185. <td valign="top">verbose</td>
  2186. <td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
  2187. <td align="center" valign="top">No</td>
  2188. </tr>
  2189. <tr>
  2190. <td valign="top">ignoreerrors</td>
  2191. <td valign="top">Log errors but don't treat as fatal.</td>
  2192. <td align="center" valign="top">No</td>
  2193. </tr>
  2194. <tr>
  2195. <td valign="top">usetimestamps</td>
  2196. <td valign="top">conditionally download a file based on the timestamp of the local copy.
  2197. HTTP only</td>
  2198. <td align="center" valign="top">No</td>
  2199. </tr>
  2200. </table>
  2201. <h3>Examples</h3>
  2202. <pre> &lt;get src=&quot;http://jakarta.apache.org/&quot; dest=&quot;help/index.html&quot; /&gt;</pre>
  2203. <p>Gets the index page of http://jakarta.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
  2204. <pre> &lt;get src=&quot;http://jakarta.apache.org/builds/tomcat/nightly/ant.zip&quot;
  2205. dest=&quot;optional.jar&quot;
  2206. verbose=&quot;true&quot;
  2207. usetimestamps=&quot;true&quot;/&gt;</pre>
  2208. <p>
  2209. Gets the nightly ant build from the tomcat distribution, if the local copy
  2210. is missing or out of date. Uses the verbose option
  2211. for progress information.
  2212. </p>
  2213. <hr>
  2214. <h2><a name="gunzip">GUnzip</a></h2>
  2215. <h3>Description</h3>
  2216. <p>Expands a GZip file.</p>
  2217. <p>If <i>dest</i> is a directory the name of the destination file is
  2218. the same as <i>src</i> (with the &quot;.gz&quot; extension removed if
  2219. present). If <i>dest</i> is omitted, the parent dir of <i>src</i> is
  2220. taken. The file is only expanded if the source file is newer than the
  2221. destination file, or when the destination file does not exist.</p>
  2222. <h3>Parameters</h3>
  2223. <table border="1" cellpadding="2" cellspacing="0">
  2224. <tr>
  2225. <td valign="top"><b>Attribute</b></td>
  2226. <td valign="top"><b>Description</b></td>
  2227. <td align="center" valign="top"><b>Required</b></td>
  2228. </tr>
  2229. <tr>
  2230. <td valign="top">src</td>
  2231. <td valign="top">the file to expand.</td>
  2232. <td align="center" valign="top">Yes</td>
  2233. </tr>
  2234. <tr>
  2235. <td valign="top">dest</td>
  2236. <td valign="top">the destination file or directory.</td>
  2237. <td align="center" valign="top">No</td>
  2238. </tr>
  2239. </table>
  2240. <h3>Examples</h3>
  2241. <blockquote>
  2242. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot;/&gt;</code></p>
  2243. </blockquote>
  2244. <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
  2245. <blockquote>
  2246. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;</code></p>
  2247. </blockquote>
  2248. <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
  2249. <blockquote>
  2250. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;subdir&quot;/&gt;</code></p>
  2251. </blockquote>
  2252. <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
  2253. subdir is a directory).</p>
  2254. <hr>
  2255. <h2><a name="gzip">GZip</a></h2>
  2256. <h3>Description</h3>
  2257. <p>GZips a file.</p>
  2258. <h3>Parameters</h3>
  2259. <table border="1" cellpadding="2" cellspacing="0">
  2260. <tr>
  2261. <td valign="top"><b>Attribute</b></td>
  2262. <td valign="top"><b>Description</b></td>
  2263. <td align="center" valign="top"><b>Required</b></td>
  2264. </tr>
  2265. <tr>
  2266. <td valign="top">src</td>
  2267. <td valign="top">the file to gzip.</td>
  2268. <td align="center" valign="top">Yes</td>
  2269. </tr>
  2270. <tr>
  2271. <td valign="top">zipfile</td>
  2272. <td valign="top">the destination file.</td>
  2273. <td align="center" valign="top">Yes</td>
  2274. </tr>
  2275. </table>
  2276. <h3>Examples</h3>
  2277. <blockquote>
  2278. <p><code>&lt;gzip src=&quot;test.tar&quot; zipfile=&quot;test.tar.gz&quot;
  2279. /&gt;</code></p>
  2280. </blockquote>
  2281. <hr>
  2282. <h2><a name="jar">Jar</a></h2>
  2283. <h3>Description</h3>
  2284. <p>Jars a set of files.</p>
  2285. <p>The <i>basedir</i> attribute is the reference directory from where to jar.</p>
  2286. <p>Note that file permissions will not be stored in the resulting jarfile.</p>
  2287. <p>It is possible to refine the set of files that are being jarred. This can be
  2288. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  2289. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  2290. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  2291. the files you want to have excluded. This is also done with patterns. And
  2292. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2293. want to use default exclusions or not. See the section on <a
  2294. href="#directorybasedtasks">directory based tasks</a>, on how the
  2295. inclusion/exclusion of files works, and how to write patterns.</p>
  2296. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  2297. supports all attributes of <code>&lt;fileset&gt;</code>
  2298. (<code>dir</code> becomes <code>basedir</code>) as well as the nested
  2299. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  2300. <code>&lt;patternset&gt;</code> elements.</p>
  2301. <p>You can also use nested file sets for more flexibility, and specify
  2302. multiple ones to merge together different trees of files into one JAR.
  2303. See the <a href="#zip">Zip</a> task for more details and examples.</p>
  2304. <p>If the manifest is omitted, a simple one will be supplied by Ant.
  2305. You should not include <samp>META-INF/MANIFEST.MF</samp> in your set of files.
  2306. <p>The <code>whenempty</code> parameter controls what happens when no files match.
  2307. If <code>create</code> (the default), the JAR is created anyway with only a manifest.
  2308. If <code>skip</code>, the JAR is not created and a warning is issued.
  2309. If <code>fail</code>, the JAR is not created and the build is halted with an error.
  2310. </p>
  2311. <h3>Parameters</h3>
  2312. <table border="1" cellpadding="2" cellspacing="0">
  2313. <tr>
  2314. <td valign="top"><b>Attribute</b></td>
  2315. <td valign="top"><b>Description</b></td>
  2316. <td align="center" valign="top"><b>Required</b></td>
  2317. </tr>
  2318. <tr>
  2319. <td valign="top">jarfile</td>
  2320. <td valign="top">the jar-file to create.</td>
  2321. <td valign="top" align="center">Yes</td>
  2322. </tr>
  2323. <tr>
  2324. <td valign="top">basedir</td>
  2325. <td valign="top">the directory from which to jar the files.</td>
  2326. <td valign="top" align="center">No</td>
  2327. </tr>
  2328. <tr>
  2329. <td valign="top">compress</td>
  2330. <td valign="top">Not only store data but also compress them, defaults to true</td>
  2331. <td align="center" valign="top">No</td>
  2332. </tr>
  2333. <tr>
  2334. <td valign="top">includes</td>
  2335. <td valign="top">comma separated list of patterns of files that must be
  2336. included. All files are included when omitted.</td>
  2337. <td valign="top" align="center">No</td>
  2338. </tr>
  2339. <tr>
  2340. <td valign="top">includesfile</td>
  2341. <td valign="top">the name of a file. Each line of this file is
  2342. taken to be an include pattern</td>
  2343. <td valign="top" align="center">No</td>
  2344. </tr>
  2345. <tr>
  2346. <td valign="top">excludes</td>
  2347. <td valign="top">comma separated list of patterns of files that must be
  2348. excluded. No files (except default excludes) are excluded when omitted.</td>
  2349. <td valign="top" align="center">No</td>
  2350. </tr>
  2351. <tr>
  2352. <td valign="top">excludesfile</td>
  2353. <td valign="top">the name of a file. Each line of this file is
  2354. taken to be an exclude pattern</td>
  2355. <td valign="top" align="center">No</td>
  2356. </tr>
  2357. <tr>
  2358. <td valign="top">defaultexcludes</td>
  2359. <td valign="top">indicates whether default excludes should be used or not
  2360. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2361. <td valign="top" align="center">No</td>
  2362. </tr>
  2363. <tr>
  2364. <td valign="top">manifest</td>
  2365. <td valign="top">the manifest file to use.</td>
  2366. <td valign="top" align="center">No</td>
  2367. </tr>
  2368. <tr>
  2369. <td valign="top">whenempty</td>
  2370. <td valign="top">Behavior to use if no files match.</td>
  2371. <td valign="top" align="center">No</td>
  2372. </tr>
  2373. </table>
  2374. <h3>Examples</h3>
  2375. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; /&gt;</pre>
  2376. <p>jars all files in the <code>${build}/classes</code> directory in a file
  2377. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p>
  2378. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
  2379. basedir=&quot;${build}/classes&quot;
  2380. excludes=&quot;**/Test.class&quot;
  2381. /&gt;</pre>
  2382. <p>jars all files in the <code>${build}/classes</code> directory in a file
  2383. called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files
  2384. with the name <code>Test.class</code> are excluded.</p>
  2385. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
  2386. basedir=&quot;${build}/classes&quot;
  2387. includes=&quot;mypackage/test/**&quot;
  2388. excludes=&quot;**/Test.class&quot;
  2389. /&gt;</pre>
  2390. <p>jars all files in the <code>${build}/classes</code> directory in a file
  2391. called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only
  2392. files under the directory <code>mypackage/test</code> are used, and files with
  2393. the name <code>Test.class</code> are excluded.</p>
  2394. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;&gt;
  2395. &lt;fileset dir=&quot;${build}/classes&quot;
  2396. excludes=&quot;**/Test.class&quot;
  2397. /&gt;
  2398. &lt;fileset dir=&quot;${src}/resources&quot;/&gt;
  2399. &lt;/jar&gt;</pre>
  2400. <p>jars all files in the <code>${build}/classes</code> directory and also
  2401. in the <code>${src}/resources</code> directory together in a file
  2402. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.
  2403. Files with the name <code>Test.class</code> are excluded.
  2404. If there are files such as <code>${build}/classes/mypackage/MyClass.class</code>
  2405. and <code>${src}/resources/mypackage/image.gif</code>, they will appear
  2406. in the same directory in the JAR (and thus be considered in the same package
  2407. by Java).</p>
  2408. <hr>
  2409. <h2><a name="java">Java</a></h2>
  2410. <h3>Description</h3>
  2411. <p>Executes a Java class within the running (Ant) VM or forks another VM if
  2412. specified.</p>
  2413. <p>Be careful that the executed class doesn't call System.exit(), because it
  2414. will terminate the VM and thus Ant. In case this happens, it's highly suggested
  2415. that you set the fork attribute so that System.exit() stops the other VM and not
  2416. the one that is currently running Ant.</p>
  2417. <h3>Parameters</h3>
  2418. <table border="1" cellpadding="2" cellspacing="0">
  2419. <tr>
  2420. <td valign="top"><b>Attribute</b></td>
  2421. <td valign="top"><b>Description</b></td>
  2422. <td align="center" valign="top"><b>Required</b></td>
  2423. </tr>
  2424. <tr>
  2425. <td valign="top">classname</td>
  2426. <td valign="top">the Java class to execute.</td>
  2427. <td align="center" valign="top">Yes</td>
  2428. </tr>
  2429. <tr>
  2430. <td valign="top">args</td>
  2431. <td valign="top">the arguments for the class that is
  2432. executed. <b>deprecated, use nested <code>&lt;arg&gt;</code>
  2433. elements instead.</b></td>
  2434. <td align="center" valign="top">No</td>
  2435. </tr>
  2436. <tr>
  2437. <td valign="top">classpath</td>
  2438. <td valign="top">the classpath to use.</td>
  2439. <td align="center" valign="top">No</td>
  2440. </tr>
  2441. <tr>
  2442. <td valign="top">classpathref</td>
  2443. <td valign="top">the classpath to use, given as <a
  2444. href="#references">reference</a> to a PATH defined elsewhere.</td>
  2445. <td align="center" valign="top">No</td>
  2446. </tr>
  2447. <tr>
  2448. <td valign="top">fork</td>
  2449. <td valign="top">if enabled triggers the class execution in another VM
  2450. (disabled by default)</td>
  2451. <td align="center" valign="top">No</td>
  2452. </tr>
  2453. <tr>
  2454. <td valign="top">jvm</td>
  2455. <td valign="top">the command used to invoke the Java Virtual Machine,
  2456. default is 'java'. The command is resolved by java.lang.Runtime.exec().
  2457. Ignored if fork is disabled.
  2458. </td>
  2459. <td align="center" valign="top">No</td>
  2460. </tr>
  2461. <tr>
  2462. <td valign="top">jvmargs</td>
  2463. <td valign="top">the arguments to pass to the forked VM (ignored
  2464. if fork is disabled). <b>deprecated, use nested
  2465. <code>&lt;jvmarg&gt;</code> elements instead.</b></td>
  2466. <td align="center" valign="top">No</td>
  2467. </tr>
  2468. <tr>
  2469. <td valign="top">maxmemory</td>
  2470. <td valign="top">Max amount of memory to allocate to the forked VM
  2471. (ignored if fork is disabled)</td>
  2472. <td align="center" valign="top">No</td>
  2473. </tr>
  2474. <tr>
  2475. <td valign="top">failonerror</td>
  2476. <td valign="top">Stop the buildprocess if the command exits with a
  2477. returncode other than 0. Only available if fork is true.</td>
  2478. <td align="center" valign="top">No</td>
  2479. </tr>
  2480. <tr>
  2481. <td valign="top">dir</td>
  2482. <td valign="top">The directory to invoke the VM in. (ignored if
  2483. fork is disabled)</td>
  2484. <td align="center" valign="top">No</td>
  2485. </tr>
  2486. <tr>
  2487. <td valign="top">output</td>
  2488. <td valign="top">Name of a file to write the output to.</td>
  2489. <td align="center" valign="top">No</td>
  2490. </tr>
  2491. </table>
  2492. <h3>Parameters specified as nested elements</h3>
  2493. <h4>arg and jvmarg</h4>
  2494. <p>Use nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code>
  2495. elements to specify arguments for the or the forked VM. See <a
  2496. href="index.html#arg">Command line arguments</a>.</p>
  2497. <h4>sysproperty</h4>
  2498. <p>Use nested <code>&lt;sysproperty&gt;</code>
  2499. elements to specify system properties required by the class.
  2500. These properties will be made available to the VM during the execution
  2501. of the class (either ANT's VM or the forked VM). The attributes
  2502. for this element are the same as for <a href="index.html#env">environment
  2503. variables</a>.</p>
  2504. <h4>classpath</h4>
  2505. <p><code>Java</code>'s <em>classpath</em> attribute is a <a
  2506. href="#path">PATH like structure</a> and can also be set via a nested
  2507. <em>classpath</em> element.</p>
  2508. <h5>Example</h5>
  2509. <pre>
  2510. &lt;java classname=&quot;test.Main&quot; &gt;
  2511. &lt;arg value=&quot;-h&quot; /&gt;
  2512. &lt;classpath&gt;
  2513. &lt;pathelement location=&quot;\test.jar&quot; /&gt;
  2514. &lt;pathelement path=&quot;${java.class.path}&quot; /&gt;
  2515. &lt;/classpath&gt;
  2516. &lt;/java&gt;
  2517. </pre>
  2518. <h3>Examples</h3>
  2519. <pre> &lt;java classname=&quot;test.Main&quot; /&gt;</pre>
  2520. <pre> &lt;java classname=&quot;test.Main&quot;
  2521. fork=&quot;yes&quot; &gt;
  2522. &lt;sysproperty key=&quot;DEBUG&quot; value=&quot;true&quot; /&gt;
  2523. &lt;arg value=&quot;-h&quot; /&gt;
  2524. &lt;jvmarg value=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot; /&gt;
  2525. &lt;/java&gt;
  2526. </pre>
  2527. <hr>
  2528. <h2><a name="javac">Javac</a></h2>
  2529. <h3>Description</h3>
  2530. <p>Compiles a source tree within the running (Ant) VM.</p>
  2531. <p>The source and destination directory will be recursively scanned for Java
  2532. source files to compile. Only Java files that have no corresponding class file
  2533. or where the class file is older than the java file will be compiled.</p>
  2534. <p>The directory structure of the source tree should follow the package
  2535. hierarchy.</p>
  2536. <p>It is possible to refine the set of files that are being compiled/copied.
  2537. This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  2538. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  2539. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  2540. the files you want to have excluded. This is also done with patterns. And
  2541. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2542. want to use default exclusions or not. See the section on <a
  2543. href="#directorybasedtasks">directory based tasks</a>, on how the
  2544. inclusion/exclusion of files works, and how to write patterns.</p>
  2545. <p>It is possible to use different compilers. This can be selected with the
  2546. &quot;build.compiler&quot; property. There are four choices:</p>
  2547. <ul>
  2548. <li>classic (the standard compiler of JDK 1.1/1.2)</li>
  2549. <li>modern (the new compiler of JDK 1.3)</li>
  2550. <li>jikes (the <a
  2551. href="http://oss.software.ibm.com/developerworks/opensource/jikes/project">Jikes</a>
  2552. compiler)</li>
  2553. <li>jvc (the Command-Line Compiler from Microsoft's SDK for Java /
  2554. Visual J++)</li>
  2555. </ul>
  2556. <p>For JDK 1.1/1.2 is classic the default. For JDK 1.3 is modern the default.</p>
  2557. <h3>Parameters</h3>
  2558. <table border="1" cellpadding="2" cellspacing="0">
  2559. <tr>
  2560. <td valign="top"><b>Attribute</b></td>
  2561. <td valign="top"><b>Description</b></td>
  2562. <td align="center" valign="top"><b>Required</b></td>
  2563. </tr>
  2564. <tr>
  2565. <td valign="top">srcdir</td>
  2566. <td valign="top">location of the java files.</td>
  2567. <td align="center" valign="top">Yes, unless nested <code>&lt;src&gt;</code> elements are present.</td>
  2568. </tr>
  2569. <tr>
  2570. <td valign="top">destdir</td>
  2571. <td valign="top">location where to store the class files.</td>
  2572. <td align="center" valign="top">No</td>
  2573. </tr>
  2574. <tr>
  2575. <td valign="top">includes</td>
  2576. <td valign="top">comma separated list of patterns of files that must be
  2577. included. All files are included when omitted.</td>
  2578. <td valign="top" align="center">No</td>
  2579. </tr>
  2580. <tr>
  2581. <td valign="top">includesfile</td>
  2582. <td valign="top">the name of a file. Each line of this file is
  2583. taken to be an include pattern</td>
  2584. <td valign="top" align="center">No</td>
  2585. </tr>
  2586. <tr>
  2587. <td valign="top">excludes</td>
  2588. <td valign="top">comma separated list of patterns of files that must be
  2589. excluded. No files (except default excludes) are excluded when omitted.</td>
  2590. <td valign="top" align="center">No</td>
  2591. </tr>
  2592. <tr>
  2593. <td valign="top">excludesfile</td>
  2594. <td valign="top">the name of a file. Each line of this file is
  2595. taken to be an exclude pattern</td>
  2596. <td valign="top" align="center">No</td>
  2597. </tr>
  2598. <tr>
  2599. <td valign="top">defaultexcludes</td>
  2600. <td valign="top">indicates whether default excludes should be used or not
  2601. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2602. <td valign="top" align="center">No</td>
  2603. </tr>
  2604. <tr>
  2605. <td valign="top">classpath</td>
  2606. <td valign="top">the classpath to use.</td>
  2607. <td align="center" valign="top">No</td>
  2608. </tr>
  2609. <tr>
  2610. <td valign="top">bootclasspath</td>
  2611. <td valign="top">location of bootstrap class files.</td>
  2612. <td align="center" valign="top">No</td>
  2613. </tr>
  2614. <tr>
  2615. <td valign="top">classpathref</td>
  2616. <td valign="top">the classpath to use, given as <a
  2617. href="#references">reference</a> to a PATH defined elsewhere.</td>
  2618. <td align="center" valign="top">No</td>
  2619. </tr>
  2620. <tr>
  2621. <td valign="top">bootclasspathref</td>
  2622. <td valign="top">location of bootstrap class files, given as by <a
  2623. href="#references">reference</a> to a PATH defined elsewhere.</td>
  2624. <td align="center" valign="top">No</td>
  2625. </tr>
  2626. <tr>
  2627. <td valign="top">extdirs</td>
  2628. <td valign="top">location of installed extensions.</td>
  2629. <td align="center" valign="top">No</td>
  2630. </tr>
  2631. <tr>
  2632. <td valign="top">encoding</td>
  2633. <td valign="top">encoding of source files.</td>
  2634. <td align="center" valign="top">No</td>
  2635. </tr>
  2636. <tr>
  2637. <td valign="top">debug</td>
  2638. <td valign="top">indicates whether there should be compiled with debug
  2639. information (&quot;off&quot;).</td>
  2640. <td align="center" valign="top">No</td>
  2641. </tr>
  2642. <tr>
  2643. <td valign="top">optimize</td>
  2644. <td valign="top">indicates whether there should be compiled with
  2645. optimization (&quot;off&quot;).</td>
  2646. <td align="center" valign="top">No</td>
  2647. </tr>
  2648. <tr>
  2649. <td valign="top">deprecation</td>
  2650. <td valign="top">indicates whether there should be compiled with deprecation
  2651. information (&quot;off&quot;).</td>
  2652. <td align="center" valign="top">No</td>
  2653. </tr>
  2654. <tr>
  2655. <td valign="top">target</td>
  2656. <td valign="top">Generate class files for specific VM version, e.g.
  2657. &quot;1.1&quot; or &quot;1.2&quot;.</td>
  2658. <td align="center" valign="top">No</td>
  2659. </tr>
  2660. <tr>
  2661. <td valign="top">verbose</td>
  2662. <td valign="top">asks the compiler for verbose output.</td>
  2663. <td align="center" valign="top">No</td>
  2664. </tr>
  2665. <tr>
  2666. <td valign="top">depend</td> <td valign="top">enables dependency
  2667. tracking for compilers that support this (jikes and classic)</td>
  2668. <td align="center" valign="top">No</td>
  2669. </tr>
  2670. </table>
  2671. <h3>Parameters specified as nested elements</h3>
  2672. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  2673. supports all attributes of <code>&lt;fileset&gt;</code>
  2674. (<code>dir</code> becomes <code>srcdir</code>) as well as the nested
  2675. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  2676. <code>&lt;patternset&gt;</code> elements.</p>
  2677. <h4>src, classpath, bootclasspath and extdirs</h4>
  2678. <p><code>Javac</code>'s <em>srcdir</em>, <em>classpath</em>,
  2679. <em>bootclasspath</em> and <em>extdirs</em> attributes are <a
  2680. href="#path">PATH like structure</a> and can also be set via nested
  2681. <em>src</em>, <em>classpath</em>, <em>bootclasspath</em> and
  2682. <em>extdirs</em> elements respectively.</p>
  2683. <h3>Examples</h3>
  2684. <pre> &lt;javac srcdir=&quot;${src}&quot;
  2685. destdir=&quot;${build}&quot;
  2686. classpath=&quot;xyz.jar&quot;
  2687. debug=&quot;on&quot;
  2688. /&gt;</pre>
  2689. <p>compiles all .java files under the directory <code>${src}</code>, and stores
  2690. the .class files in the directory <code>${build}</code>.
  2691. The classpath used contains <code>xyz.jar</code>, and debug information is on.</p>
  2692. <pre> &lt;javac srcdir=&quot;${src}&quot;
  2693. destdir=&quot;${build}&quot;
  2694. includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
  2695. excludes=&quot;mypackage/p1/testpackage/**&quot;
  2696. classpath=&quot;xyz.jar&quot;
  2697. debug=&quot;on&quot;
  2698. /&gt;</pre>
  2699. <p>compiles .java files under the directory <code>${src}</code>, and stores the
  2700. .class files in the directory <code>${build}</code>.
  2701. The classpath used contains <code>xyz.jar</code>, and debug information is on.
  2702. Only files under <code>mypackage/p1</code> and <code>mypackage/p2</code> are
  2703. used. Files in the <code>mypackage/p1/testpackage</code> directory are excluded
  2704. form compilation and copy.</p>
  2705. <pre> &lt;javac srcdir=&quot;${src}:${src2}&quot;
  2706. destdir=&quot;${build}&quot;
  2707. includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
  2708. excludes=&quot;mypackage/p1/testpackage/**&quot;
  2709. classpath=&quot;xyz.jar&quot;
  2710. debug=&quot;on&quot;
  2711. /&gt;</pre>
  2712. <p>is the same as the previous example with the addition of a second source path, defined by
  2713. the propery <code>src2</code>. This can also be represented using nested elements as follows
  2714. <pre> &lt;javac destdir=&quot;${build}&quot;
  2715. classpath=&quot;xyz.jar&quot;
  2716. debug=&quot;on&quot;&gt;
  2717. &lt;src path=&quot;${src}&quot; /&gt;
  2718. &lt;src path=&quot;${src2}&quot; /&gt;
  2719. &lt;include name=&quot;mypackage/p1/**&quot; /&gt;
  2720. &lt;include name=&quot;mypackage/p2/**&quot; /&gt;
  2721. &lt;exclude name=&quot;mypackage/p1/testpackage/**&quot; /&gt;
  2722. &lt;/javac&gt;</pre>
  2723. <p><b>Note:</b> If you are using Ant on Windows and a new DOS-Window pops up
  2724. for every use of an external compiler this may be a problem of the JDK you are using.
  2725. This problem may occur with all JDK's &lt; 1.2.</p>
  2726. <hr>
  2727. <h2><a name="javadoc">Javadoc/Javadoc2</a></h2>
  2728. <h3>Description</h3>
  2729. <p>Generates code documentation using the javadoc tool.</p>
  2730. <p>The source directory will be recursively scanned for Java source files to process
  2731. but only those matching the inclusion rules will be passed to the javadoc tool. This
  2732. allows wildcards to be used to choose between package names, reducing verbosity
  2733. and management costs over time. This task, however, has no notion of
  2734. &quot;changed&quot; files, unlike the <a href="#javac">javac</a> task. This means
  2735. all packages will be processed each time this task is run. In general, however,
  2736. this task is used much less frequently.</p>
  2737. <p>This task works seamlessly between different javadoc versions (1.1 and 1.2),
  2738. with the obvious restriction that the 1.2 attributes will be ignored if run in a
  2739. 1.1 VM.</p>
  2740. <p>NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the
  2741. same VM as ant without breaking functionality. For this reason, this task
  2742. always forks the VM. This overhead is not significant since javadoc is normally a heavy
  2743. application and will be called infrequently.</p>
  2744. <p>NOTE: the packagelist attribute allows you to specify the list of packages to
  2745. document outside of the Ant file. It's a much better practice to include everything
  2746. inside the build.xml file. This option was added in order to make it easier to
  2747. migrate from regular makefiles, where you would use this option of javadoc.
  2748. The packages listed in packagelist are not checked, so the task performs even
  2749. if some packages are missing or broken. Use this option if you wish to convert from
  2750. an existing makefile. Once things are running you should then switch to the regular
  2751. notation.
  2752. <p>DEPRECATION: the javadoc2 task simply points to the javadoc task and it's
  2753. there for back compatibility reasons. Since this task will be removed in future
  2754. versions, you are strongly encouraged to use <a href="#javadoc">javadoc</a>
  2755. instead.</p>
  2756. <h3>Parameters</h3>
  2757. <table border="1" cellpadding="2" cellspacing="0">
  2758. <tr>
  2759. <td valign="top"><b>Attribute</b></td>
  2760. <td valign="top"><b>Description</b></td>
  2761. <td align="center" valign="top"><b>Availability</b></td>
  2762. <td align="center" valign="top"><b>Required</b></td>
  2763. </tr>
  2764. <tr>
  2765. <td valign="top">sourcepath</td>
  2766. <td valign="top">Specify where to find source files</td>
  2767. <td align="center" valign="top">all</td>
  2768. <td align="center" rowspan="2">At least one of the two or nested
  2769. <code>&lt;sourcepath&gt;</code></td>
  2770. </tr>
  2771. <tr>
  2772. <td valign="top">sourcepathref</td>
  2773. <td valign="top">Specify where to find source files by <a
  2774. href="#references">reference</a> to a PATH defined elsewhere.</td>
  2775. <td align="center" valign="top">all</td>
  2776. </tr>
  2777. <tr>
  2778. <td valign="top">destdir</td>
  2779. <td valign="top">Destination directory for output files</td>
  2780. <td align="center" valign="top">all</td>
  2781. <td align="center" valign="top">Yes</td>
  2782. </tr>
  2783. <tr>
  2784. <td valign="top">maxmemory</td>
  2785. <td valign="top">Max amount of memory to allocate to the javadoc VM</td>
  2786. <td align="center" valign="top">all</td>
  2787. <td align="center" valign="top">No</td>
  2788. </tr>
  2789. <tr>
  2790. <td valign="top">sourcefiles</td>
  2791. <td valign="top">Space separated list of source files</td>
  2792. <td align="center" valign="top">all</td>
  2793. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  2794. </tr>
  2795. <tr>
  2796. <td valign="top">packagenames</td>
  2797. <td valign="top">Comma separated list of package files (with terminating
  2798. wildcard)</td>
  2799. <td align="center" valign="top">all</td>
  2800. </tr>
  2801. <tr>
  2802. <td valign="top">packageList</td>
  2803. <td valign="top">The name of a file containing the packages to process</td>
  2804. <td align="center" valign="top">all</td>
  2805. <td align="center" valign="top">No</td>
  2806. </tr>
  2807. <tr>
  2808. <td valign="top">classpath</td>
  2809. <td valign="top">Specify where to find user class files</td>
  2810. <td align="center" valign="top">all</td>
  2811. <td align="center" valign="top">No</td>
  2812. </tr>
  2813. <tr>
  2814. <td valign="top">Bootclasspath</td>
  2815. <td valign="top">Override location of class files loaded by the bootstrap
  2816. class loader</td>
  2817. <td align="center" valign="top">1.2</td>
  2818. <td align="center" valign="top">No</td>
  2819. </tr>
  2820. <tr>
  2821. <td valign="top">classpathref</td>
  2822. <td valign="top">Specify where to find user class files by <a
  2823. href="#references">reference</a> to a PATH defined elsewhere.</td>
  2824. <td align="center" valign="top">all</td>
  2825. <td align="center" valign="top">No</td>
  2826. </tr>
  2827. <tr>
  2828. <td valign="top">bootclasspathref</td>
  2829. <td valign="top">Override location of class files loaded by the
  2830. bootstrap class loader by <a href="#references">reference</a> to a
  2831. PATH defined elsewhere.</td>
  2832. <td align="center" valign="top">1.2</td>
  2833. <td align="center" valign="top">No</td>
  2834. </tr>
  2835. <tr>
  2836. <td valign="top">Extdirs</td>
  2837. <td valign="top">Override location of installed extensions</td>
  2838. <td align="center" valign="top">1.2</td>
  2839. <td align="center" valign="top">No</td>
  2840. </tr>
  2841. <tr>
  2842. <td valign="top">Overview</td>
  2843. <td valign="top">Read overview documentation from HTML file</td>
  2844. <td align="center" valign="top">1.2</td>
  2845. <td align="center" valign="top">No</td>
  2846. </tr>
  2847. <tr>
  2848. <td valign="top">Public</td>
  2849. <td valign="top">Show only public classes and members</td>
  2850. <td align="center" valign="top">all</td>
  2851. <td align="center" valign="top">No</td>
  2852. </tr>
  2853. <tr>
  2854. <td valign="top">Protected</td>
  2855. <td valign="top">Show protected/public classes and members (default)</td>
  2856. <td align="center" valign="top">all</td>
  2857. <td align="center" valign="top">No</td>
  2858. </tr>
  2859. <tr>
  2860. <td valign="top">Package</td>
  2861. <td valign="top">Show package/protected/public classes and members</td>
  2862. <td align="center" valign="top">all</td>
  2863. <td align="center" valign="top">No</td>
  2864. </tr>
  2865. <tr>
  2866. <td valign="top">Private</td>
  2867. <td valign="top">Show all classes and members</td>
  2868. <td align="center" valign="top">all</td>
  2869. <td align="center" valign="top">No</td>
  2870. </tr>
  2871. <tr>
  2872. <td valign="top">Old</td>
  2873. <td valign="top">Generate output using JDK 1.1 emulating doclet</td>
  2874. <td align="center" valign="top">1.2</td>
  2875. <td align="center" valign="top">No</td>
  2876. </tr>
  2877. <tr>
  2878. <td valign="top">Verbose</td>
  2879. <td valign="top">Output messages about what Javadoc is doing</td>
  2880. <td align="center" valign="top">1.2</td>
  2881. <td align="center" valign="top">No</td>
  2882. </tr>
  2883. <tr>
  2884. <td valign="top">Locale</td>
  2885. <td valign="top">Locale to be used, e.g. en_US or en_US_WIN</td>
  2886. <td align="center" valign="top">1.2</td>
  2887. <td align="center" valign="top">No</td>
  2888. </tr>
  2889. <tr>
  2890. <td valign="top">Encoding</td>
  2891. <td valign="top">Source file encoding name</td>
  2892. <td align="center" valign="top">all</td>
  2893. <td align="center" valign="top">No</td>
  2894. </tr>
  2895. <tr>
  2896. <td valign="top">Version</td>
  2897. <td valign="top">Include @version paragraphs</td>
  2898. <td align="center" valign="top">all</td>
  2899. <td align="center" valign="top">No</td>
  2900. </tr>
  2901. <tr>
  2902. <td valign="top">Use</td>
  2903. <td valign="top">Create class and package usage pages</td>
  2904. <td align="center" valign="top">1.2</td>
  2905. <td align="center" valign="top">No</td>
  2906. </tr>
  2907. <tr>
  2908. <td valign="top">Author</td>
  2909. <td valign="top">Include @author paragraphs</td>
  2910. <td align="center" valign="top">all</td>
  2911. <td align="center" valign="top">No</td>
  2912. </tr>
  2913. <tr>
  2914. <td valign="top">Splitindex</td>
  2915. <td valign="top">Split index into one file per letter</td>
  2916. <td align="center" valign="top">1.2</td>
  2917. <td align="center" valign="top">No</td>
  2918. </tr>
  2919. <tr>
  2920. <td valign="top">Windowtitle</td>
  2921. <td valign="top">Browser window title for the documentation (text)</td>
  2922. <td align="center" valign="top">1.2</td>
  2923. <td align="center" valign="top">No</td>
  2924. </tr>
  2925. <tr>
  2926. <td valign="top">Doctitle</td>
  2927. <td valign="top">Include title for the package index(first) page (html-code)</td>
  2928. <td align="center" valign="top">1.2</td>
  2929. <td align="center" valign="top">No</td>
  2930. </tr>
  2931. <tr>
  2932. <td valign="top">Header</td>
  2933. <td valign="top">Include header text for each page (html-code)</td>
  2934. <td align="center" valign="top">1.2</td>
  2935. <td align="center" valign="top">No</td>
  2936. </tr>
  2937. <tr>
  2938. <td valign="top">Footer</td>
  2939. <td valign="top">Include footer text for each page (html-code)</td>
  2940. <td align="center" valign="top">1.2</td>
  2941. <td align="center" valign="top">No</td>
  2942. </tr>
  2943. <tr>
  2944. <td valign="top">bottom</td>
  2945. <td valign="top">Include bottom text for each page (html-code)</td>
  2946. <td align="center" valign="top">1.2</td>
  2947. <td align="center" valign="top">No</td>
  2948. </tr>
  2949. <tr>
  2950. <td valign="top">link</td>
  2951. <td valign="top">Create links to javadoc output at the given URL</td>
  2952. <td align="center" valign="top">1.2</td>
  2953. <td align="center" valign="top">No</td>
  2954. </tr>
  2955. <tr>
  2956. <td valign="top">linkoffline</td>
  2957. <td valign="top">Link to docs at &lt;url&gt; using package list at
  2958. &lt;url2&gt;</td>
  2959. <td align="center" valign="top">1.2</td>
  2960. <td align="center" valign="top">No</td>
  2961. </tr>
  2962. <tr>
  2963. <td valign="top">group</td>
  2964. <td valign="top">Group specified packages together in overview page</td>
  2965. <td align="center" valign="top">1.2</td>
  2966. <td align="center" valign="top">No</td>
  2967. </tr>
  2968. <tr>
  2969. <td valign="top">nodeprecated</td>
  2970. <td valign="top">Do not include @deprecated information</td>
  2971. <td align="center" valign="top">all</td>
  2972. <td align="center" valign="top">No</td>
  2973. </tr>
  2974. <tr>
  2975. <td valign="top">nodeprecatedlist</td>
  2976. <td valign="top">Do not generate deprecated list</td>
  2977. <td align="center" valign="top">1.2</td>
  2978. <td align="center" valign="top">No</td>
  2979. </tr>
  2980. <tr>
  2981. <td valign="top">notree</td>
  2982. <td valign="top">Do not generate class hierarchy</td>
  2983. <td align="center" valign="top">all</td>
  2984. <td align="center" valign="top">No</td>
  2985. </tr>
  2986. <tr>
  2987. <td valign="top">noindex</td>
  2988. <td valign="top">Do not generate index</td>
  2989. <td align="center" valign="top">all</td>
  2990. <td align="center" valign="top">No</td>
  2991. </tr>
  2992. <tr>
  2993. <td valign="top">nohelp</td>
  2994. <td valign="top">Do not generate help link</td>
  2995. <td align="center" valign="top">1.2</td>
  2996. <td align="center" valign="top">No</td>
  2997. </tr>
  2998. <tr>
  2999. <td valign="top">nonavbar</td>
  3000. <td valign="top">Do not generate navigation bar</td>
  3001. <td align="center" valign="top">1.2</td>
  3002. <td align="center" valign="top">No</td>
  3003. </tr>
  3004. <tr>
  3005. <td valign="top">serialwarn</td>
  3006. <td valign="top">FUTURE: Generate warning about @serial tag</td>
  3007. <td align="center" valign="top">1.2</td>
  3008. <td align="center" valign="top">No</td>
  3009. </tr>
  3010. <tr>
  3011. <td valign="top">helpfile</td>
  3012. <td valign="top">FUTURE: Specifies the HTML help file to use</td>
  3013. <td align="center" valign="top">1.2</td>
  3014. <td align="center" valign="top">No</td>
  3015. </tr>
  3016. <tr>
  3017. <td valign="top">stylesheetfile</td>
  3018. <td valign="top">Specifies the CSS stylesheet to use</td>
  3019. <td align="center" valign="top">1.2</td>
  3020. <td align="center" valign="top">No</td>
  3021. </tr>
  3022. <tr>
  3023. <td valign="top">charset</td>
  3024. <td valign="top">FUTURE: Charset for cross-platform viewing of generated
  3025. documentation</td>
  3026. <td align="center" valign="top">1.2</td>
  3027. <td align="center" valign="top">No</td>
  3028. </tr>
  3029. <tr>
  3030. <td valign="top">docencoding</td>
  3031. <td valign="top">Output file encoding name</td>
  3032. <td align="center" valign="top">1.1</td>
  3033. <td align="center" valign="top">No</td>
  3034. </tr>
  3035. <tr>
  3036. <td valign="top">doclet</td>
  3037. <td valign="top">Specifies the class file that starts the doclet used in generating the documentation.</td>
  3038. <td align="center" valign="top">1.2</td>
  3039. <td align="center" valign="top">No</td>
  3040. </tr>
  3041. <tr>
  3042. <td valign="top">docletpath</td>
  3043. <td valign="top">Specifies the path to the doclet class file that is specified with the -doclet option.</td>
  3044. <td align="center" valign="top">1.2</td>
  3045. <td align="center" valign="top">No</td>
  3046. </tr>
  3047. <tr>
  3048. <td valign="top">docletpathref</td>
  3049. <td valign="top">Specifies the path to the doclet class file that
  3050. is specified with the -doclet option by <a
  3051. href="#references">reference</a> to a PATH defined elsewhere.</td>
  3052. <td align="center" valign="top">1.2</td>
  3053. <td align="center" valign="top">No</td>
  3054. </tr>
  3055. <tr>
  3056. <td valign="top">additionalparam</td>
  3057. <td valign="top">Lets you add additional parameters to the javadoc command line. Useful for doclets</td>
  3058. <td align="center" valign="top">1.2</td>
  3059. <td align="center" valign="top">No</td>
  3060. </tr>
  3061. <tr>
  3062. <td valign="top">failonerror</td>
  3063. <td valign="top">Stop the buildprocess if the command exits with a
  3064. returncode other than 0.</td>
  3065. <td align="center" valign="top">all</td>
  3066. <td align="center" valign="top">No</td>
  3067. </tr>
  3068. </table>
  3069. <h3>Parameters specified as nested elements</h3>
  3070. <h4>link</h4>
  3071. <p>Create link to javadoc output at the given URL. This performs the
  3072. same role as the link and linkoffline attributes. You can use either
  3073. syntax (or both at once), but with the nested elements you can easily
  3074. specify multiple occurrences of the arguments.</p>
  3075. <h4>Parameters</h4>
  3076. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  3077. <tr>
  3078. <td valign="top"><b>Attribute</b></td>
  3079. <td valign="top"><b>Description</b></td>
  3080. <td align="center" valign="top"><b>Required</b></td>
  3081. </tr>
  3082. <tr>
  3083. <td valign="top">href</td>
  3084. <td valign="top">The URL for the external documentation you wish to link to</td>
  3085. <td align="center" valign="top">Yes</td>
  3086. </tr>
  3087. <tr>
  3088. <td valign="top">offline</td>
  3089. <td valign="top">True if this link is not available online at the time of
  3090. generating the documentation</td>
  3091. <td align="center" valign="top">No</td>
  3092. </tr>
  3093. <tr>
  3094. <td valign="top">packagelistLoc</td>
  3095. <td valign="top">The location to the directory containing the package-list file for
  3096. the external documentation</td>
  3097. <td align="center" valign="top">Only if the offline attribute is true</td>
  3098. </tr>
  3099. </table>
  3100. <h4>groups</h4>
  3101. <p>Separates packages on the overview page into whatever groups you
  3102. specify, one group per table. This performs the same role as the group
  3103. attribute. You can use either syntax (or both at once), but with the
  3104. nested elements you can easily specify multiple occurrences of the
  3105. arguments.</p>
  3106. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  3107. <tr>
  3108. <td valign="top"><b>Attribute</b></td>
  3109. <td valign="top"><b>Description</b></td>
  3110. <td align="center" valign="top"><b>Required</b></td>
  3111. </tr>
  3112. <tr>
  3113. <td valign="top">title</td>
  3114. <td valign="top">Title of the group</td>
  3115. <td align="center" valign="top">Yes</td>
  3116. </tr>
  3117. <tr>
  3118. <td valign="top">packages</td>
  3119. <td valign="top">List of packages to include in that group</td>
  3120. <td align="center" valign="top">Yes</td>
  3121. </tr>
  3122. </table>
  3123. <h4>doclet</h4>
  3124. <p>The doclet nested element is used to specify the doclet that javadoc will
  3125. use to process the input source files. A number of the standard javadoc arguments
  3126. are actually arguments of the standard doclet. If these are specified in the javadoc
  3127. task's attributes, they will be passed to the doclet specified in the
  3128. <code>&lt;doclet&gt;</code> nested element. Such attributes should only be specified,
  3129. therefore, if they can be interpreted by the doclet in use.
  3130. <p>If the doclet requires additional parameters, these can be specified with
  3131. <code>&lt;param&gt;</code> elements within the <code>&lt;doclet&gt;</code>
  3132. element. These paramaters are restricted to simple strings. An example usage
  3133. of the doclet element is shown below:
  3134. <pre> &lt;javadoc ...&gt;
  3135. &lt;doclet name="theDoclet"
  3136. path="path/to/theDoclet"&gt;
  3137. &lt;param name="-foo" value="foovalue"/&gt;
  3138. &lt;param name="-bar" value="barvalue"/&gt;
  3139. &lt;/doclet&gt;
  3140. &lt;/javadoc&gt;
  3141. </pre>
  3142. <h4>sourcepath, classpath and bootclasspath</h4>
  3143. <p><code>Javadoc</code>'s <em>sourcepath</em>, <em>classpath</em> and
  3144. <em>bootclasspath</em> attributes are <a href="#path">PATH like
  3145. structure</a> and can also be set via nested <em>sourcepath</em>,
  3146. <em>classpath</em> and <em>bootclasspath</em> elements
  3147. respectively.</p>
  3148. <h3>Example</h3>
  3149. <pre> &lt;javadoc packagenames=&quot;com.dummy.test.*&quot;
  3150. sourcepath=&quot;src&quot;
  3151. destdir=&quot;docs/api&quot;
  3152. author=&quot;true&quot;
  3153. version=&quot;true&quot;
  3154. use=&quot;true&quot;
  3155. windowtitle=&quot;Test API&quot;
  3156. doctitle=&quot;&lt;h1&gt;Test&lt;/h1&gt;&quot;
  3157. bottom=&quot;&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;&quot;&gt;
  3158. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  3159. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*&quot;/&gt;
  3160. &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;
  3161. &lt;link href=&quot;http://developer.java.sun.com/developer/products/xml/docs/api/&quot;/&gt;
  3162. &lt/javadoc&gt;</pre>
  3163. <hr>
  3164. <h2><a name="mail">Mail</a></h2>
  3165. <h3>Description</h3>
  3166. <p>A task to send SMTP email.</p>
  3167. <h3>Parameters</h3>
  3168. <table border="1" cellpadding="2" cellspacing="0">
  3169. <tr>
  3170. <td valign="top"><b>Attribute</b></td>
  3171. <td valign="top"><b>Description</b></td>
  3172. <td align="center" valign="top"><b>Required</b></td>
  3173. </tr>
  3174. <tr>
  3175. <td valign="top">from</td>
  3176. <td valign="top">Email address of sender.</td>
  3177. <td align="center" valign="top">Yes</td>
  3178. </tr>
  3179. <tr>
  3180. <td valign="top">tolist</td>
  3181. <td valign="top">Comma-separated list of recipients.</td>
  3182. <td align="center" valign="top">Yes</td>
  3183. </tr>
  3184. <tr>
  3185. <td valign="top">message</td>
  3186. <td valign="top">Message to send in the body of the email.</td>
  3187. <td align="center" valign="middle" rowspan="2">Yes</td>
  3188. </tr>
  3189. <tr>
  3190. <td valign="top">files</td>
  3191. <td valign="top">Filename(s) of text to send in the body of the email.
  3192. Multiple files are comma-separated.</td>
  3193. </tr>
  3194. <tr>
  3195. <td valign="top">mailhost</td>
  3196. <td valign="top">Host name of the mail server.</td>
  3197. <td align="center" valign="top">No, default to &quot;localhost&quot;</td>
  3198. </tr>
  3199. <tr>
  3200. <td valign="top">subject</td>
  3201. <td valign="top">Email subject line.</td>
  3202. <td align="center" valign="top">No</td>
  3203. </tr>
  3204. </table>
  3205. <h3>Examples</h3>
  3206. <pre>
  3207. &lt;mail from=&quot;me&quot; tolist=&quot;you&quot; subject=&quot;Results of nightly build&quot;
  3208. files=&quot;build.log&quot;/&gt;</pre>
  3209. <p>Sends an eMail from <i>me</i> to <i>you</i> with a subject of
  3210. <i>Results of nightly build</i> and includes the contents of <i>build.log</i>
  3211. in the body of the message.</p>
  3212. <hr>
  3213. <h2><a name="mkdir">Mkdir</a></h2>
  3214. <h3>Description</h3>
  3215. <p>Creates a directory. Also non-existent parent directories are created, when
  3216. necessary.</p>
  3217. <h3>Parameters</h3>
  3218. <table border="1" cellpadding="2" cellspacing="0">
  3219. <tr>
  3220. <td valign="top"><b>Attribute</b></td>
  3221. <td valign="top"><b>Description</b></td>
  3222. <td align="center" valign="top"><b>Required</b></td>
  3223. </tr>
  3224. <tr>
  3225. <td valign="top">dir</td>
  3226. <td valign="top">the directory to create.</td>
  3227. <td align="center" valign="top">Yes</td>
  3228. </tr>
  3229. </table>
  3230. <h3>Examples</h3>
  3231. <pre>&lt;mkdir dir=&quot;${dist}&quot; /&gt;</pre>
  3232. <p>creates a directory <code>${dist}</code>.</p>
  3233. <pre>&lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;</pre>
  3234. <p>creates a directory <code>${dist}/lib</code>.</p>
  3235. <hr>
  3236. <h2><a name="move">Move</a></h2>
  3237. <h3>Description</h3>
  3238. <p>Moves a file to a new file or directory, or sets of files to
  3239. a new directory. By default, the
  3240. destination file is overwritten if it already exists. When <var>overwrite</var> is
  3241. turned off, then files are only moved if the source file is newer than
  3242. the destination file, or when the destination file does not exist.</p>
  3243. <p><a href="#fileset">FileSet</a>s are used to select sets of files
  3244. to move to the <var>todir</var> directory.</p>
  3245. <h3>Parameters</h3>
  3246. <table border="1" cellpadding="2" cellspacing="0">
  3247. <tr>
  3248. <td valign="top"><b>Attribute</b></td>
  3249. <td valign="top"><b>Description</b></td>
  3250. <td align="center" valign="top"><b>Required</b></td>
  3251. </tr>
  3252. <tr>
  3253. <td valign="top">file</td>
  3254. <td valign="top">the file to move</td>
  3255. <td valign="top" align="center">One of <var>file</var> or
  3256. at least one nested fileset element</td>
  3257. </tr>
  3258. <tr>
  3259. <td valign="top">tofile</td>
  3260. <td valign="top">the file to move to</td>
  3261. <td valign="top" align="center" rowspan="2">With the <var>file</var> attribute,
  3262. either <var>tofile</var> or <var>todir</var> can be used. With a nested fileset,
  3263. only <var>todir</var> is allowed.</td>
  3264. </tr>
  3265. <tr>
  3266. <td valign="top">todir</td>
  3267. <td valign="top">the directory to move to</td>
  3268. </tr>
  3269. <tr>
  3270. <td valign="top">overwrite</td>
  3271. <td valign="top">overwrite existing files even if the destination
  3272. files are newer (default is &quot;true&quot;)</td>
  3273. <td valign="top" align="center">No</td>
  3274. </tr>
  3275. <tr>
  3276. <td valign="top">filtering</td>
  3277. <td valign="top">indicates whether token filtering should take place during
  3278. the move. See the <a href="#filter">filter</a> task for a description of
  3279. how filters work.</td>
  3280. <td valign="top" align="center">No</td>
  3281. </tr>
  3282. <tr>
  3283. <td valign="top">flatten</td>
  3284. <td valign="top">ignore directory structure of source directory,
  3285. copy all files into a single directory, specified by the <var>todir</var>
  3286. attribute (default is &quot;false&quot;).</td>
  3287. <td valign="top" align="center">No</td>
  3288. </tr>
  3289. <tr>
  3290. <td valign="top">includeEmptyDirs</td>
  3291. <td valign="top">Copy empty directories included with the nested FileSet(s).
  3292. Defaults to &quot;yes&quot;.</td>
  3293. <td valign="top" align="center">No</td>
  3294. </tr>
  3295. </table>
  3296. <h3>Examples</h3>
  3297. <p><b>Move a single file (rename a file)</b></p>
  3298. <pre>
  3299. &lt;move file=&quot;file.orig&quot; tofile=&quot;file.moved&quot; /&gt;
  3300. </pre>
  3301. <p><b>Move a single file to a directory</b></p>
  3302. <pre>
  3303. &lt;move file=&quot;file.orig&quot; todir=&quot;dir/to/move/to&quot; /&gt;
  3304. </pre>
  3305. <p><b>Move a directory to a new directory</b></p>
  3306. <pre>
  3307. &lt;move todir=&quot;new/dir/to/move/to&quot;&gt;
  3308. &lt;fileset dir=&quot;src/dir&quot;/&gt;
  3309. &lt;/move&gt;
  3310. </pre>
  3311. <p><b>Move a set of files to a new directory</b></p>
  3312. <pre>
  3313. &lt;move todir=&quot;some/new/dir&quot; &gt;
  3314. &lt;fileset dir=&quot;my/src/dir&quot; &gt;
  3315. &lt;include name=&quot;**/*.jar&quot; /&gt;
  3316. &lt;exclude name=&quot;**/ant.jar&quot; /&gt;
  3317. &lt;/fileset&gt;
  3318. &lt;/move&gt;
  3319. </pre>
  3320. <hr>
  3321. <h2><a name="patch">Patch</a></h2>
  3322. <h3>Description</h3>
  3323. <p>Applies a diff file to originals.</p>
  3324. <h3>Parameters</h3>
  3325. <table border="1" cellpadding="2" cellspacing="0">
  3326. <tr>
  3327. <td valign="top"><b>Attribute</b></td>
  3328. <td valign="top"><b>Description</b></td>
  3329. <td align="center" valign="top"><b>Required</b></td>
  3330. </tr>
  3331. <tr>
  3332. <td valign="top">patchfile</td>
  3333. <td valign="top">the file that includes the diff output</td>
  3334. <td align="center" valign="top">Yes</td>
  3335. </tr>
  3336. <tr>
  3337. <td valign="top">originalfile</td>
  3338. <td valign="top">the file to patch</td>
  3339. <td align="center" valign="top">No, tries to guess it from the diff
  3340. file</td>
  3341. </tr>
  3342. <tr>
  3343. <td valign="top">backups</td>
  3344. <td valign="top">Keep backups of the unpatched files</td>
  3345. <td align="center" valign="top">No</td>
  3346. </tr>
  3347. <tr>
  3348. <td valign="top">quiet</td>
  3349. <td valign="top">Work silently unless an error occurs</td>
  3350. <td align="center" valign="top">No</td>
  3351. </tr>
  3352. <tr>
  3353. <td valign="top">reverse</td>
  3354. <td valign="top">Assume patch was created with old and new files
  3355. swapped.</td>
  3356. <td align="center" valign="top">No</td>
  3357. </tr>
  3358. <tr>
  3359. <td valign="top">ignorewhitespace</td>
  3360. <td valign="top">Ignore whitespace differences.</td>
  3361. <td align="center" valign="top">No</td>
  3362. </tr>
  3363. <tr>
  3364. <td valign="top">strip</td>
  3365. <td valign="top">Strip the smallest prefix containing <i>num</i> leading
  3366. slashes from filenames.</td>
  3367. <td align="center" valign="top">No</td>
  3368. </tr>
  3369. </table>
  3370. <h3>Examples</h3>
  3371. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; /&gt;</pre>
  3372. <p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
  3373. files in base directory guessing the filename(s) from the diff output.
  3374. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip=&quot;1&quot; /&gt;</pre>
  3375. <p>like above but one leading directory part will be removed. i.e. if
  3376. the diff output looked like
  3377. <pre>
  3378. --- a/mod1.0/A Mon Jun 5 17:28:41 2000
  3379. +++ a/mod1.1/A Mon Jun 5 17:28:49 2000
  3380. </pre>
  3381. the leading <i>a/</i> will be stripped.
  3382. <hr>
  3383. <h2><a name="property">Property</a></h2>
  3384. <h3>Description</h3>
  3385. <p>Sets a property (by name and value), or set of properties (from file or
  3386. resource) in the project.</p>
  3387. <p>When a property was set by the user, or was a property in a parent project
  3388. (that started this project with the <a href="#ant">ant task</a>), then this
  3389. property cannot be set, and will be ignored. This means that properties set
  3390. outside the current project always override the properties of the current
  3391. project.</p>
  3392. <p>There are four ways to set properties:</p>
  3393. <ul>
  3394. <li>By supplying both the <i>name</i> and <i>value</i> attribute.</li>
  3395. <li>By supplying both the <i>name</i> and <i>refid</i> attribute.</li>
  3396. <li>By setting the <i>file</i> attribute with the filename of the property
  3397. file to load. This property file has the format as defined by the file used
  3398. in the class java.util.Properties.</li>
  3399. <li>By setting the <i>resource</i> attribute with the resource name of the
  3400. property file to load. This property file has the format as defined by the
  3401. file used in the class java.util.Properties.</li>
  3402. </ul>
  3403. <p>Although combinations of the three ways are possible, only one should be used
  3404. at a time. Problems might occur with the order in which properties are set, for
  3405. instance.</p>
  3406. <p>The value part of the properties being set, might contain references to other
  3407. properties. These references are resolved at the time these properties are set.
  3408. This also holds for properties loaded from a property file.</p>
  3409. <h3>Parameters</h3>
  3410. <table border="1" cellpadding="2" cellspacing="0">
  3411. <tr>
  3412. <td valign="top"><b>Attribute</b></td>
  3413. <td valign="top"><b>Description</b></td>
  3414. <td align="center" valign="top"><b>Required</b></td>
  3415. </tr>
  3416. <tr>
  3417. <td valign="top">name</td>
  3418. <td valign="top">the name of the property to set.</td>
  3419. <td valign="top" align="center">Yes</td>
  3420. </tr>
  3421. <tr>
  3422. <td valign="top">value</td>
  3423. <td valign="top">the value of the property.</td>
  3424. <td valign="middle" align="center" rowspan="5">Yes</td>
  3425. </tr>
  3426. <tr>
  3427. <td valign="top">refid</td>
  3428. <td valign="top"><a href="#references">Reference</a> to an object
  3429. defined elsewhere. Only yields reasonable results for references
  3430. to <a href="#path">PATH like structures</a> or properties.</td>
  3431. </tr>
  3432. <tr>
  3433. <td valign="top">resource</td>
  3434. <td valign="top">the resource name of the property file.</td>
  3435. </tr>
  3436. <tr>
  3437. <td valign="top">file</td>
  3438. <td valign="top">the filename of the property file .</td>
  3439. </tr>
  3440. <tr>
  3441. <td valign="top">location</td>
  3442. <td valign="top">Sets the property to the absolute filename of the
  3443. given file. If the value of this attribute is an absolute path, it
  3444. is left unchanged (with / and \ characters converted to the
  3445. current platforms conventions). Otherwise it is taken as a path
  3446. relative to the project's basedir and expanded.</td>
  3447. </tr>
  3448. </table>
  3449. <h3>Examples</h3>
  3450. <pre> &lt;property name=&quot;foo.dist&quot; value=&quot;dist&quot; /&gt;</pre>
  3451. <p>sets the property <code>foo.dist</code> to the value &quot;dist&quot;.</p>
  3452. <pre> &lt;property file=&quot;foo.properties&quot; /&gt;</pre>
  3453. <p>reads a set of properties from a file called &quot;foo.properties&quot;.</p>
  3454. <pre> &lt;property resource=&quot;foo.properties&quot; /&gt;</pre>
  3455. <p>reads a set of properties from a resource called &quot;foo.properties&quot;.</p>
  3456. <p>Note that you can reference a global properties file for all of your Ant
  3457. builds using the following:
  3458. <pre> &lt;property file=&quot;${user.home}/.ant-global.properties&quot; /&gt;</pre>
  3459. <p>since the &quot;user.home&quot; property is defined by the Java virtual machine
  3460. to be your home directory. This technique is more appropriate for Unix than
  3461. Windows since the notion of a home directory doesn't exist on Windows. On the
  3462. JVM that I tested, the home directory on Windows is &quot;C:\&quot;. Different JVM
  3463. implementations may use other values for the home directory on Windows.</p>
  3464. <hr>
  3465. <h2><a name="rename">Rename</a></h2>
  3466. <h3><i>Deprecated</i></h3>
  3467. <p><i>This task has been deprecated. Use the Move task instead.</i></p>
  3468. <h3>Description</h3>
  3469. <p>Renames a given file.</p>
  3470. <h3>Parameters</h3>
  3471. <table border="1" cellpadding="2" cellspacing="0">
  3472. <tr>
  3473. <td valign="top"><b>Attribute</b></td>
  3474. <td valign="top"><b>Description</b></td>
  3475. <td align="center" valign="top"><b>Required</b></td>
  3476. </tr>
  3477. <tr>
  3478. <td valign="top">src</td>
  3479. <td valign="top">file to rename.</td>
  3480. <td valign="top" align="center">Yes</td>
  3481. </tr>
  3482. <tr>
  3483. <td valign="top">dest</td>
  3484. <td valign="top">new name of the file.</td>
  3485. <td valign="top" align="center">Yes</td>
  3486. </tr>
  3487. <tr>
  3488. <td valign="top">replace</td>
  3489. <td valign="top">Enable replacing of existing file (default: on).</td>
  3490. <td valign="top" align="center">No</td>
  3491. </tr>
  3492. </table>
  3493. <h3>Examples</h3>
  3494. <pre> &lt;rename src=&quot;foo.jar&quot; dest=&quot;${name}-${version}.jar&quot; /&gt;</pre>
  3495. <p>Renames the file <code>foo.jar</code> to <code>${name}-${version}.jar</code> (assuming <code>name</code>
  3496. and <code>version</code> being predefined properties). If a file named <code>${name}-${version}.jar</code>
  3497. already exists, it will be removed prior to renaming <code>foo.jar</code>.</p>
  3498. <hr>
  3499. <h2><a name="replace">Replace</a></h2>
  3500. <h3>Description</h3>
  3501. <p>Replace is a directory based task for replacing the occurrence of a given string with another string
  3502. in selected file.</p>
  3503. <p>If you want to replace a text that crosses line boundaries, you
  3504. must use a nested <code>&lt;replacetoken&gt;</code> element.</p>
  3505. <h3>Parameters</h3>
  3506. <table border="1" cellpadding="2" cellspacing="0">
  3507. <tr>
  3508. <td valign="top"><b>Attribute</b></td>
  3509. <td valign="top"><b>Description</b></td>
  3510. <td align="center" valign="top"><b>Required</b></td>
  3511. </tr>
  3512. <tr>
  3513. <td valign="top">file</td>
  3514. <td valign="top">file for which the token should be replaced.</td>
  3515. <td align="center" rowspan="2">Exactly one of the two.</td>
  3516. </tr>
  3517. <tr>
  3518. <td valign="top">dir</td>
  3519. <td valign="top">The base directory to use when replacing a token in
  3520. multiple files.</td>
  3521. </tr>
  3522. <tr>
  3523. <td valign="top">token</td>
  3524. <td valign="top">the token which must be replaced.</td>
  3525. <td valign="top" align="center">Yes, unless a nested <code>replacetoken</code>
  3526. element is used.</td>
  3527. </tr>
  3528. <tr>
  3529. <td valign="top">value</td>
  3530. <td valign="top">the new value for the token. When omitted, an empty string
  3531. (&quot;&quot;) is used.</td>
  3532. <td valign="top" align="center">No</td>
  3533. </tr>
  3534. <tr>
  3535. <td valign="top">includes</td>
  3536. <td valign="top">comma separated list of patterns of files that must be
  3537. included. All files are included when omitted.</td>
  3538. <td valign="top" align="center">No</td>
  3539. </tr>
  3540. <tr>
  3541. <td valign="top">includesfile</td>
  3542. <td valign="top">the name of a file. Each line of this file is
  3543. taken to be an include pattern</td>
  3544. <td valign="top" align="center">No</td>
  3545. </tr>
  3546. <tr>
  3547. <td valign="top">excludes</td>
  3548. <td valign="top">comma separated list of patterns of files that must be
  3549. excluded. No files (except default excludes) are excluded when omitted.</td>
  3550. <td valign="top" align="center">No</td>
  3551. </tr>
  3552. <tr>
  3553. <td valign="top">excludesfile</td>
  3554. <td valign="top">the name of a file. Each line of this file is
  3555. taken to be an exclude pattern</td>
  3556. <td valign="top" align="center">No</td>
  3557. </tr>
  3558. <tr>
  3559. <td valign="top">defaultexcludes</td>
  3560. <td valign="top">indicates whether default excludes should be used or not
  3561. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  3562. <td valign="top" align="center">No</td>
  3563. </tr>
  3564. </table>
  3565. <h3>Examples</h3>
  3566. <pre> &lt;replace file=&quot;${src}/index.html&quot; token=&quot;@@@&quot; value=&quot;wombat&quot; /&gt;</pre>
  3567. <p>replaces occurrences of the string &quot;@@@&quot; with the string
  3568. &quot;wombat&quot;, in the file <code>${src}/index.html</code>.</p>
  3569. <h3>Parameters specified as nested elements</h3>
  3570. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  3571. supports all attributes of <code>&lt;fileset&gt;</code> as well as the
  3572. nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  3573. <code>&lt;patternset&gt;</code> elements.</p>
  3574. <p>If either the text you want to replace or the replacement text
  3575. cross line boundaries, you can use nested elements to specify
  3576. them.</p>
  3577. <h3>Examples</h3>
  3578. <blockquote><pre>
  3579. &lt;replace dir=&quot;${src}&quot; value=&quot;wombat&quot;&gt;
  3580. &lt;include name=&quot;**/*.html&quot; /&gt;
  3581. &lt;replacetoken&gt;&lt;[CDATA[multi line
  3582. token]]>&lt;/replacetoken&gt;
  3583. &lt;/replace&gt;
  3584. </pre></blockquote>
  3585. <p>replaces occurrences of the string &quot;multi
  3586. line<em>\n</em>token&quot; with the string &quot;wombat&quot;, in all
  3587. HTML files in the directory <code>${src}</code>.Where <em>\n</em> is
  3588. the platform specific line separator.</p>
  3589. <blockquote><pre>
  3590. &lt;replace file=&quot;${src}/index.html&quot;&gt;
  3591. &lt;replacetoken&gt;&lt;[CDATA[two line
  3592. token]]>&lt;/replacetoken&gt;
  3593. &lt;replacevalue&gt;&lt;[CDATA[two line
  3594. token]]>&lt;/replacevalue&gt;
  3595. &lt;/replace&gt;
  3596. </pre></blockquote>
  3597. <hr>
  3598. <h2><a name="rmic">Rmic</a></h2>
  3599. <h3>Description</h3>
  3600. <p>Runs the rmic compiler for a certain class.</p>
  3601. <p>Rmic can be run on a single class (as specified with the classname
  3602. attribute) or a number of classes at once (all classes below base that
  3603. are neither _Stub nor _Skel classes).</p>
  3604. <p>It is possible to refine the set of files that are being rmiced. This can be
  3605. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  3606. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  3607. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  3608. the files you want to have excluded. This is also done with patterns. And
  3609. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  3610. want to use default exclusions or not. See the section on <a
  3611. href="#directorybasedtasks">directory based tasks</a>, on how the
  3612. inclusion/exclusion of files works, and how to write patterns.</p>
  3613. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  3614. supports all attributes of <code>&lt;fileset&gt;</code>
  3615. (<code>dir</code> becomes <code>base</code>) as well as the nested
  3616. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  3617. <code>&lt;patternset&gt;</code> elements.</p>
  3618. <h3>Parameters</h3>
  3619. <table border="1" cellpadding="2" cellspacing="0">
  3620. <tr>
  3621. <td valign="top"><b>Attribute</b></td>
  3622. <td valign="top"><b>Description</b></td>
  3623. <td align="center" valign="top"><b>Required</b></td>
  3624. </tr>
  3625. <tr>
  3626. <td valign="top">base</td>
  3627. <td valign="top">the location to store the compiled files.</td>
  3628. <td valign="top" align="center">Yes</td>
  3629. </tr>
  3630. <tr>
  3631. <td valign="top">classname</td>
  3632. <td valign="top">the class for which to run <code>rmic</code>.</td>
  3633. <td valign="top" align="center">No</td>
  3634. </tr>
  3635. <tr>
  3636. <td valign="top">filtering</td>
  3637. <td valign="top">indicates whether token filtering should take place</td>
  3638. <td valign="top" align="center">No</td>
  3639. </tr>
  3640. <tr>
  3641. <td valign="top">sourcebase</td>
  3642. <td valign="top">Pass the &quot;-keepgenerated&quot; flag to rmic and
  3643. move the generated source file to the base directory.</td>
  3644. <td align="center" valign="top">No</td>
  3645. </tr>
  3646. <tr>
  3647. <td valign="top">stubversion</td>
  3648. <td valign="top">Specify the JDK version for the generated stub code.
  3649. Specify &quot;1.1&quot; to pass the &quot;-v1.1&quot; option to rmic.</td>
  3650. <td align="center" valign="top">No</td>
  3651. </tr>
  3652. <tr>
  3653. <td valign="top">classpath</td>
  3654. <td valign="top">The classpath to use during compilation</td>
  3655. <td align="center" valign="top">No</td>
  3656. </tr>
  3657. <tr>
  3658. <td valign="top">classpathref</td>
  3659. <td valign="top">The classpath to use during compilation, given as <a
  3660. href="#references">reference</a> to a PATH defined elsewhere</td>
  3661. <td align="center" valign="top">No</td>
  3662. </tr>
  3663. <tr>
  3664. <td valign="top">includes</td>
  3665. <td valign="top">comma separated list of patterns of files that must be
  3666. included. All files are included when omitted.</td>
  3667. <td valign="top" align="center">No</td>
  3668. </tr>
  3669. <tr>
  3670. <td valign="top">includesfile</td>
  3671. <td valign="top">the name of a file. Each line of this file is
  3672. taken to be an include pattern</td>
  3673. <td valign="top" align="center">No</td>
  3674. </tr>
  3675. <tr>
  3676. <td valign="top">excludes</td>
  3677. <td valign="top">comma separated list of patterns of files that must be
  3678. excluded. No files (except default excludes) are excluded when omitted.</td>
  3679. <td valign="top" align="center">No</td>
  3680. </tr>
  3681. <tr>
  3682. <td valign="top">excludesfile</td>
  3683. <td valign="top">the name of a file. Each line of this file is
  3684. taken to be an exclude pattern</td>
  3685. <td valign="top" align="center">No</td>
  3686. </tr>
  3687. <tr>
  3688. <td valign="top">defaultexcludes</td>
  3689. <td valign="top">indicates whether default excludes should be used or not
  3690. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  3691. <td valign="top" align="center">No</td>
  3692. </tr>
  3693. <tr>
  3694. <td valign="top">verify</td>
  3695. <td valign="top">check that classes implement Remote before handing them
  3696. to rmic (default is false)</td>
  3697. <td align="center" valign="top">No</td>
  3698. </tr>
  3699. </table>
  3700. <h3>Parameters specified as nested elements</h3>
  3701. <h4>classpath</h4>
  3702. <p><code>Rmic</code>'s <em>classpath</em> attribute is a <a
  3703. href="#path">PATH like structure</a> and can also be set via a nested
  3704. <em>classpath</em> elements.</p>
  3705. <h3>Examples</h3>
  3706. <pre> &lt;rmic classname=&quot;com.xyz.FooBar&quot; base=&quot;${build}/classes&quot; /&gt;</pre>
  3707. <p>runs the rmic compiler for the class <code>com.xyz.FooBar</code>. The
  3708. compiled files will be stored in the directory <code>${build}/classes</code>.</p>
  3709. <pre> &lt;rmic base=&quot;${build}/classes&quot; includes=&quot;**/Remote*.class&quot; /&gt;</pre>
  3710. <p>runs the rmic compiler for all classes with <code>.class</code>
  3711. files below <code>${build}/classes</code> whose classname starts with
  3712. <i>Remote</i>. The compiled files will be stored in the directory
  3713. <code>${build}/classes</code>.</p>
  3714. <hr>
  3715. <h2><a name="signjar">SignJar</a></h2>
  3716. <h3>Description</h3>
  3717. <p>Signs a jar or zip file with the javasign command line tool.</p>
  3718. <h3>Parameters</h3>
  3719. <table border="1" cellpadding="2" cellspacing="0">
  3720. <tr>
  3721. <td valign="top"><b>Attribute</b></td>
  3722. <td valign="top"><b>Description</b></td>
  3723. <td align="center" valign="top"><b>Required</b></td>
  3724. </tr>
  3725. <tr>
  3726. <td valign="top">jar</td>
  3727. <td valign="top">the jar file to sign</td>
  3728. <td valign="top" align="center">Yes.</td>
  3729. </tr>
  3730. <tr>
  3731. <td valign="top">alias</td>
  3732. <td valign="top">the alias to sign under</td>
  3733. <td valign="top" align="center">Yes.</td>
  3734. </tr>
  3735. <tr>
  3736. <td valign="top">storepass</td>
  3737. <td valign="top">password for keystore integrity.</td>
  3738. <td valign="top" align="center">Yes.</td>
  3739. </tr>
  3740. <tr>
  3741. <td valign="top">keystore</td>
  3742. <td valign="top">keystore location</td>
  3743. <td valign="top" align="center">No</td>
  3744. </tr>
  3745. <tr>
  3746. <td valign="top">storetype</td>
  3747. <td valign="top">keystore type</td>
  3748. <td valign="top" align="center">No</td>
  3749. </tr>
  3750. <tr>
  3751. <td valign="top">keypass</td>
  3752. <td valign="top">password for private key (if different)</td>
  3753. <td valign="top" align="center">No</td>
  3754. </tr>
  3755. <tr>
  3756. <td valign="top">sigfile</td>
  3757. <td valign="top">name of .SF/.DSA file</td>
  3758. <td valign="top" align="center">No</td>
  3759. </tr>
  3760. <tr>
  3761. <td valign="top">signedjar</td>
  3762. <td valign="top">name of signed JAR file</td>
  3763. <td valign="top" align="center">No</td>
  3764. </tr>
  3765. <tr>
  3766. <td valign="top">verbose</td>
  3767. <td valign="top">(true | false) verbose output when signing</td>
  3768. <td valign="top" align="center">No</td>
  3769. </tr>
  3770. <tr>
  3771. <td valign="top">internalsf</td>
  3772. <td valign="top">(true | false) include the .SF file inside the signature
  3773. block</td>
  3774. <td valign="top" align="center">No</td>
  3775. </tr>
  3776. <tr>
  3777. <td valign="top">sectionsonly</td>
  3778. <td valign="top">(true | false) don't compute hash of entire manifest</td>
  3779. <td valign="top" align="center">No</td>
  3780. </tr>
  3781. </table>
  3782. <h3>Examples</h3>
  3783. <blockquote>
  3784. <p><code>&lt;signjar jar=&quot;${dist}/lib/ant.jar&quot;
  3785. alias=&quot;apache-group&quot; storepass=&quot;secret&quot; /&gt;</code></p>
  3786. </blockquote>
  3787. <p>signs the ant.jar with alias &quot;apache-group&quot; accessing the
  3788. keystore and private key via &quot;secret&quot; password.</p>
  3789. <hr>
  3790. <h2><a name="style">Style</a></h2>
  3791. <h3>Description</h3>
  3792. <p>Process a set of documents via XSLT.</p>
  3793. <p>This is useful for building views of XML based documentation,
  3794. or in generating code.</p>
  3795. <p>It is possible to refine the set of files that are being copied. This can be
  3796. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  3797. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  3798. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  3799. the files you want to have excluded. This is also done with patterns. And
  3800. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  3801. want to use default exclusions or not. See the section on <a
  3802. href="#directorybasedtasks">directory based tasks</a>, on how the
  3803. inclusion/exclusion of files works, and how to write patterns.</p>
  3804. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  3805. supports all attributes of <code>&lt;fileset&gt;</code>
  3806. (<code>dir</code> becomes <code>basedir</code>) as well as the nested
  3807. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  3808. <code>&lt;patternset&gt;</code> elements.</p>
  3809. <h3>Parameters</h3>
  3810. <table border="1" cellpadding="2" cellspacing="0">
  3811. <tr>
  3812. <td valign="top"><b>Attribute</b></td>
  3813. <td valign="top"><b>Description</b></td>
  3814. <td align="center" valign="top"><b>Required</b></td>
  3815. </tr>
  3816. <tr>
  3817. <td valign="top">basedir</td>
  3818. <td valign="top">where to find the source xml file.</td>
  3819. <td align="center" valign="top">Yes</td>
  3820. </tr>
  3821. <tr>
  3822. <td valign="top">destdir</td>
  3823. <td valign="top">directory where to store the results.</td>
  3824. <td align="center" valign="top">Yes</td>
  3825. </tr>
  3826. <tr>
  3827. <td valign="top">extension</td>
  3828. <td valign="top">desired file extension to be used for the targets.
  3829. If not specified, the default is &quot;html&quot;.</td>
  3830. <td align="center" valign="top">No</td>
  3831. </tr>
  3832. <tr>
  3833. <td valign="top">style</td>
  3834. <td valign="top">name of the stylesheet to use.</td>
  3835. <td align="center" valign="top">Yes</td>
  3836. </tr>
  3837. <tr>
  3838. <td valign="top">processor</td>
  3839. <td valign="top">name of the XSLT processor to use. Permissible
  3840. values are &quot;xslp&quot; for the XSL:P processor, &quot;xalan&quot;
  3841. for the Apache XML Xalan processor, or the name of an arbitrary XSLTLiaison class.
  3842. Defaults to xslp or xalan (in that order), if one is found in your
  3843. class path</td>
  3844. <td align="center" valign="top">No</td>
  3845. </tr>
  3846. <tr>
  3847. <td valign="top">includes</td>
  3848. <td valign="top">comma separated list of patterns of files that must be
  3849. included. All files are included when omitted.</td>
  3850. <td valign="top" align="center">No</td>
  3851. </tr>
  3852. <tr>
  3853. <td valign="top">includesfile</td>
  3854. <td valign="top">the name of a file. Each line of this file is
  3855. taken to be an include pattern</td>
  3856. <td valign="top" align="center">No</td>
  3857. </tr>
  3858. <tr>
  3859. <td valign="top">excludes</td>
  3860. <td valign="top">comma separated list of patterns of files that must be
  3861. excluded. No files (except default excludes) are excluded when omitted.</td>
  3862. <td valign="top" align="center">No</td>
  3863. </tr>
  3864. <tr>
  3865. <td valign="top">excludesfile</td>
  3866. <td valign="top">the name of a file. Each line of this file is
  3867. taken to be an exclude pattern</td>
  3868. <td valign="top" align="center">No</td>
  3869. </tr>
  3870. <tr>
  3871. <td valign="top">defaultexcludes</td>
  3872. <td valign="top">indicates whether default excludes should be used or not
  3873. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  3874. <td valign="top" align="center">No</td>
  3875. </tr>
  3876. </table>
  3877. <h3>Examples</h3>
  3878. <blockquote>
  3879. <p><pre>
  3880. &lt;style basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  3881. extension=&quot;html&quot; style=&quot;style/apache.xml&quot;/&gt;
  3882. </pre>
  3883. </blockquote>
  3884. <hr>
  3885. <h2><a name="tar">Tar</a></h2>
  3886. <h3>Description</h3>
  3887. <p>Creates a tar archive.</p>
  3888. <p>The <i>basedir</i> attribute is the reference directory from where to tar.</p>
  3889. <p>It is possible to refine the set of files that are being tarred. This can be
  3890. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  3891. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  3892. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  3893. the files you want to have excluded. This is also done with patterns. And
  3894. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  3895. want to use default exclusions or not. See the section on <a
  3896. href="#directorybasedtasks">directory based tasks</a>, on how the
  3897. inclusion/exclusion of files works, and how to write patterns.</p>
  3898. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  3899. supports all attributes of <code>&lt;fileset&gt;</code>
  3900. (<code>dir</code> becomes <code>basedir</code>) as well as the nested
  3901. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  3902. <code>&lt;patternset&gt;</code> elements.</p>
  3903. <p>Note that this task does not perform compression. You might want to use the <a href="#gzip">GZip</a>
  3904. task to come up with a .tar.gz package.</p>
  3905. <h3>Parameters</h3>
  3906. <table border="1" cellpadding="2" cellspacing="0">
  3907. <tr>
  3908. <td valign="top"><b>Attribute</b></td>
  3909. <td valign="top"><b>Description</b></td>
  3910. <td valign="top" align="center"><b>Required</b></td>
  3911. </tr>
  3912. <tr>
  3913. <td valign="top">tarfile</td>
  3914. <td valign="top">the tar-file to create.</td>
  3915. <td align="center" valign="top">Yes</td>
  3916. </tr>
  3917. <tr>
  3918. <td valign="top">basedir</td>
  3919. <td valign="top">the directory from which to zip the files.</td>
  3920. <td align="center" valign="top">Yes</td>
  3921. </tr>
  3922. <tr>
  3923. <td valign="top">includes</td>
  3924. <td valign="top">comma separated list of patterns of files that must be
  3925. included. All files are included when omitted.</td>
  3926. <td valign="top" align="center">No</td>
  3927. </tr>
  3928. <tr>
  3929. <td valign="top">includesfile</td>
  3930. <td valign="top">the name of a file. Each line of this file is
  3931. taken to be an include pattern</td>
  3932. <td valign="top" align="center">No</td>
  3933. </tr>
  3934. <tr>
  3935. <td valign="top">excludes</td>
  3936. <td valign="top">comma separated list of patterns of files that must be
  3937. excluded. No files (except default excludes) are excluded when omitted.</td>
  3938. <td valign="top" align="center">No</td>
  3939. </tr>
  3940. <tr>
  3941. <td valign="top">excludesfile</td>
  3942. <td valign="top">the name of a file. Each line of this file is
  3943. taken to be an exclude pattern</td>
  3944. <td valign="top" align="center">No</td>
  3945. </tr>
  3946. <tr>
  3947. <td valign="top">defaultexcludes</td>
  3948. <td valign="top">indicates whether default excludes should be used or not
  3949. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  3950. <td valign="top" align="center">No</td>
  3951. </tr>
  3952. </table>
  3953. <h3>Examples</h3>
  3954. <pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot; basedir=&quot;htdocs/manual&quot; /&gt;
  3955. &lt;gzip zipfile=&quot;${dist}/manual.tar.gz&quot; src=&quot;${dist}/manual.tar&quot; /&gt;</pre>
  3956. <p>tars all files in the <code>htdocs/manual</code> directory in a file called <code>manual.tar</code>
  3957. in the <code>${dist}</code> directory, then applies the gzip task to compress
  3958. it.</p>
  3959. <pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot;
  3960. basedir=&quot;htdocs/manual&quot;
  3961. excludes=&quot;mydocs/**, **/todo.html&quot;
  3962. /&gt;</pre>
  3963. <p>tars all files in the <code>htdocs/manual</code> directory in a file called <code>manual.tar</code>
  3964. in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
  3965. or files with the name <code>todo.html</code> are excluded.</p>
  3966. <hr>
  3967. <h2><a name="taskdef">Taskdef</a></h2>
  3968. <h3>Description</h3>
  3969. <p>Adds a task definition to the current project, such that this new task can be
  3970. used in the current project. Two attributes are needed, the name that identifies
  3971. this task uniquely, and the full name of the class (including the packages) that
  3972. implements this task.</p>
  3973. <p>Taskdef should be used to add your own tasks to the system. See also &quot;<a
  3974. href="#writingowntask">Writing your own task</a>&quot;.</p>
  3975. <h3>Parameters</h3>
  3976. <table border="1" cellpadding="2" cellspacing="0">
  3977. <tr>
  3978. <td valign="top"><b>Attribute</b></td>
  3979. <td valign="top"><b>Description</b></td>
  3980. <td align="center" valign="top"><b>Required</b></td>
  3981. </tr>
  3982. <tr>
  3983. <td valign="top">name</td>
  3984. <td valign="top">the name of the task</td>
  3985. <td valign="top" align="center">Yes</td>
  3986. </tr>
  3987. <tr>
  3988. <td valign="top">classname</td>
  3989. <td valign="top">the full class name implementing the task</td>
  3990. <td valign="top" align="center">Yes</td>
  3991. </tr>
  3992. <tr>
  3993. <td valign="top">classpath</td> <td valign="top">the classpath to
  3994. use when looking up <code>classname</code>.</td> <td
  3995. align="center" valign="top">No</td>
  3996. </tr>
  3997. </table>
  3998. <h3>Parameters specified as nested elements</h3>
  3999. <h4>classpath</h4>
  4000. <p><code>Taskdef</code>'s <em>classpath</em> attribute is a <a
  4001. href="#path">PATH like structure</a> and can also be set via a nested
  4002. <em>classpath</em> element.</p>
  4003. <h3>Examples</h3>
  4004. <pre> &lt;taskdef name=&quot;myjavadoc&quot; classname=&quot;com.mydomain.JavadocTask&quot; /&gt;</pre>
  4005. <p>makes a task called <code>myjavadoc</code> available to Ant. The class <code>com.mydomain.JavadocTask</code>
  4006. implements the task.</p>
  4007. <hr>
  4008. <h2><a name="touch">Touch</a></h2>
  4009. <h3>Description</h3>
  4010. <p>Changes the modification time of a file and possibly creates it at
  4011. the same time.</p>
  4012. <p>For JDK 1.1 only the creation of new files with a modification time
  4013. of now works, all other cases will emit a warning.</p>
  4014. <h3>Parameters</h3>
  4015. <table border="1" cellpadding="2" cellspacing="0">
  4016. <tr>
  4017. <td valign="top"><b>Attribute</b></td>
  4018. <td valign="top"><b>Description</b></td>
  4019. <td align="center" valign="top"><b>Required</b></td>
  4020. </tr>
  4021. <tr>
  4022. <td valign="top">file</td>
  4023. <td valign="top">the name of the file</td>
  4024. <td valign="top" align="center">Yes</td>
  4025. </tr>
  4026. <tr>
  4027. <td valign="top">millis</td>
  4028. <td valign="top">specifies the new modification time of the file
  4029. in milliseconds since midnight Jan 1 1970</td>
  4030. <td valign="top" align="center">No</td>
  4031. </tr>
  4032. <tr>
  4033. <td valign="top">datetime</td>
  4034. <td valign="top">specifies the new modification time of the file
  4035. in the format MM/DD/YYYY HH:MM AM_or_PM.</td>
  4036. <td valign="top" align="center">No</td>
  4037. </tr>
  4038. </table>
  4039. <p>If both <code>millis</code> and <code>datetime</code> are omitted
  4040. the current time is assumed.</p>
  4041. <h3>Examples</h3>
  4042. <pre> &lt;touch file=&quot;myfile&quot; /&gt;</pre>
  4043. <p>creates <code>myfile</code> if it doesn't exist and changes the
  4044. modification time to the current time.</p>
  4045. <pre> &lt;touch file=&quot;myfile&quot; datetime=&quot;06/28/2000 2:02 pm&quot; /&gt;</pre>
  4046. <p>creates <code>myfile</code> if it doesn't exist and changes the
  4047. modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24
  4048. hour times).</p>
  4049. <hr>
  4050. <h2><a name="tstamp">Tstamp</a></h2>
  4051. <h3>Description</h3>
  4052. <p>Sets the DSTAMP, TSTAMP and TODAY properties in the current project. The
  4053. DSTAMP is in the &quot;yyyymmdd&quot; format, the TSTAMP is in the &quot;hhmm&quot;
  4054. format and TODAY is &quot;month day year&quot;.</p>
  4055. <p>These properties can be used in the buildfile, for instance, to create
  4056. timestamped filenames or used to replace placeholder tags inside documents to
  4057. indicate, for example, the release date. The best place for this task is in your
  4058. initialization target.</p>
  4059. <h3>Parameters</h3>
  4060. <table border="1" cellpadding="2" cellspacing="0">
  4061. <tr>
  4062. <td valign="top"><b>Attribute</b></td>
  4063. <td valign="top"><b>Description</b></td>
  4064. <td align="center" valign="top"><b>Required</b></td>
  4065. </tr>
  4066. </table>
  4067. <h3>Examples</h3>
  4068. <pre> &lt;tstamp/&gt;</pre>
  4069. <hr>
  4070. <h2><a name="uptodate">Uptodate</a></h2>
  4071. <h3>Description</h3>
  4072. <p>Sets a property if a Target file is more up to date than a set of
  4073. Source files. Source files are specified by nested &lt;srcfiles&gt;
  4074. elements, these are <a href="#fileset">FileSet</a>s.</p>
  4075. <p>The value part of the property being set is <i>true</i> if the timestamp of the
  4076. Target file is more recent than the timestamp of every Source file.</p>
  4077. <p>Normally, this task is used to set properties that are useful to avoid target
  4078. execution depending on the relative age of the specified files.</p>
  4079. <h3>Parameters</h3>
  4080. <table border="1" cellpadding="2" cellspacing="0">
  4081. <tr>
  4082. <td valign="top"><b>Attribute</b></td>
  4083. <td valign="top"><b>Description</b></td>
  4084. <td align="center" valign="top"><b>Required</b></td>
  4085. </tr>
  4086. <tr>
  4087. <td valign="top">property</td>
  4088. <td valign="top">the name of the property to set.</td>
  4089. <td valign="top" align="center">Yes</td>
  4090. </tr>
  4091. <tr>
  4092. <td valign="top">targetfile</td>
  4093. <td valign="top">the file for which we want to determine the status.</td>
  4094. <td valign="top" align="center">Yes</td>
  4095. </tr>
  4096. </table>
  4097. <h3>Examples</h3>
  4098. <pre> &lt;uptodate property=&quot;xmlBuild.notRequired&quot; targetfile=&quot;${deploy}\xmlClasses.jar&quot; &gt;
  4099. &lt;srcfiles dir= &quot;${src}/xml&quot; includes=&quot;**/*.dtd&quot; /&gt;
  4100. &lt;/uptodate&gt;</pre>
  4101. <p>sets the property <code><i>xmlBuild.notRequired</i></code> to the value &quot;true&quot;
  4102. if the <i>${deploy}/xmlClasses.jar</i> is more up to date than any of the DTD files in the <i>${src}/xml</i> directory.</p>
  4103. <hr>
  4104. <h2><a name="unzip">Unjar/Unwar/Unzip</a></h2>
  4105. <h3>Description</h3>
  4106. <p>Unzips a zip-, war- or jarfile.</p>
  4107. <p>For JDK 1.1 &quot;last modified time&quot; field is set to current time instead of being
  4108. carried from zipfile.</p>
  4109. <p>File permissions will not be restored on extracted files.</p>
  4110. <h3>Parameters</h3>
  4111. <table border="1" cellpadding="2" cellspacing="0">
  4112. <tr>
  4113. <td valign="top"><b>Attribute</b></td>
  4114. <td valign="top"><b>Description</b></td>
  4115. <td align="center" valign="top"><b>Required</b></td>
  4116. </tr>
  4117. <tr>
  4118. <td valign="top">src</td>
  4119. <td valign="top">zipfile to expand.</td>
  4120. <td align="center" valign="top">Yes</td>
  4121. </tr>
  4122. <tr>
  4123. <td valign="top">dest</td>
  4124. <td valign="top">directory where to store the expanded files.</td>
  4125. <td align="center" valign="top">Yes</td>
  4126. </tr>
  4127. </table>
  4128. <h3>Examples</h3>
  4129. <blockquote>
  4130. <p><code>&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;
  4131. /&gt;</code></p>
  4132. </blockquote>
  4133. <hr>
  4134. <h2><a name="untar">Untar</a></h2>
  4135. <h3>Description</h3>
  4136. <p>Untars a tarfile.</p>
  4137. <p>File permissions will not be restored on extracted files.</p>
  4138. <p>For JDK 1.1 &quot;last modified time&quot; field is set to current time instead of being
  4139. carried from tarfile.</p>
  4140. <h3>Parameters</h3>
  4141. <table border="1" cellpadding="2" cellspacing="0">
  4142. <tr>
  4143. <td valign="top"><b>Attribute</b></td>
  4144. <td valign="top"><b>Description</b></td>
  4145. <td align="center" valign="top"><b>Required</b></td>
  4146. </tr>
  4147. <tr>
  4148. <td valign="top">src</td>
  4149. <td valign="top">tarfile to expand.</td>
  4150. <td align="center" valign="top">Yes</td>
  4151. </tr>
  4152. <tr>
  4153. <td valign="top">dest</td>
  4154. <td valign="top">directory where to store the expanded files.</td>
  4155. <td align="center" valign="top">Yes</td>
  4156. </tr>
  4157. </table>
  4158. <h3>Examples</h3>
  4159. <blockquote>
  4160. <p><code>
  4161. &lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
  4162. &lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
  4163. </code></p>
  4164. </blockquote>
  4165. <hr>
  4166. <h2><a name="war">War</a></h2>
  4167. <h3>Description</h3>
  4168. <p>An extension of the <a href="#jar">Jar</a> task with special
  4169. treatment for files that should end up in the
  4170. <code>WEB-INF/lib</code>, <code>WEB-INF/classes</code> or
  4171. <code>WEB-INF</code> directories of the Web Application Archive. It
  4172. also gives you more control over where your files end up in the
  4173. archive by means of its nested <code>prefixedfileset</code>
  4174. element.</p>
  4175. <h3>Parameters</h3>
  4176. <table border="1" cellpadding="2" cellspacing="0">
  4177. <tr>
  4178. <td valign="top"><b>Attribute</b></td>
  4179. <td valign="top"><b>Description</b></td>
  4180. <td align="center" valign="top"><b>Required</b></td>
  4181. </tr>
  4182. <tr>
  4183. <td valign="top">warfile</td>
  4184. <td valign="top">the war-file to create.</td>
  4185. <td valign="top" align="center">Yes</td>
  4186. </tr>
  4187. <tr>
  4188. <td valign="top">webxml</td>
  4189. <td valign="top">The deployment descriptor to use (WEB-INF/web.xml).</td>
  4190. <td valign="top" align="center">Yes</td>
  4191. </tr>
  4192. <tr>
  4193. <td valign="top">basedir</td>
  4194. <td valign="top">the directory from which to jar the files.</td>
  4195. <td valign="top" align="center">No</td>
  4196. </tr>
  4197. <tr>
  4198. <td valign="top">compress</td>
  4199. <td valign="top">Not only store data but also compress them, defaults to true</td>
  4200. <td align="center" valign="top">No</td>
  4201. </tr>
  4202. <tr>
  4203. <td valign="top">includes</td>
  4204. <td valign="top">comma separated list of patterns of files that must be
  4205. included. All files are included when omitted.</td>
  4206. <td valign="top" align="center">No</td>
  4207. </tr>
  4208. <tr>
  4209. <td valign="top">includesfile</td>
  4210. <td valign="top">the name of a file. Each line of this file is
  4211. taken to be an include pattern</td>
  4212. <td valign="top" align="center">No</td>
  4213. </tr>
  4214. <tr>
  4215. <td valign="top">excludes</td>
  4216. <td valign="top">comma separated list of patterns of files that must be
  4217. excluded. No files (except default excludes) are excluded when omitted.</td>
  4218. <td valign="top" align="center">No</td>
  4219. </tr>
  4220. <tr>
  4221. <td valign="top">excludesfile</td>
  4222. <td valign="top">the name of a file. Each line of this file is
  4223. taken to be an exclude pattern</td>
  4224. <td valign="top" align="center">No</td>
  4225. </tr>
  4226. <tr>
  4227. <td valign="top">defaultexcludes</td>
  4228. <td valign="top">indicates whether default excludes should be used or not
  4229. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  4230. <td valign="top" align="center">No</td>
  4231. </tr>
  4232. <tr>
  4233. <td valign="top">manifest</td>
  4234. <td valign="top">the manifest file to use.</td>
  4235. <td valign="top" align="center">No</td>
  4236. </tr>
  4237. <tr>
  4238. <td valign="top">whenempty</td>
  4239. <td valign="top">Behavior to use if no files match.</td>
  4240. <td valign="top" align="center">No</td>
  4241. </tr>
  4242. </table>
  4243. <h3>Nested elements</h3>
  4244. <h4>lib</h4>
  4245. <p>The nested <code>lib</code> element specifies a <a
  4246. href="#fileset">FileSet</a>. All files included in this fileset will
  4247. end up in the <code>WEB-INF/lib</code> directory of the war file.</p>
  4248. <h4>classes</h4>
  4249. <p>The nested <code>classes</code> element specifies a <a
  4250. href="#fileset">FileSet</a>. All files included in this fileset will
  4251. end up in the <code>WEB-INF/classes</code> directory of the war file.</p>
  4252. <h4>webinf</h4>
  4253. <p>The nested <code>webinf</code> element specifies a <a
  4254. href="#fileset">FileSet</a>. All files included in this fileset will
  4255. end up in the <code>WEB-INF</code> directory of the war file. If this
  4256. fileset includes a file named <code>web.xml</code>, the file is
  4257. ignored and you will get a warning.</p>
  4258. <h4>prefixedfileset</h4>
  4259. <p>The nested <code>prefixedfileset</code> element specifies a <a
  4260. href="#fileset">FileSet</a> with an additional prefix attribute. All
  4261. files included in this fileset will end up in the <em>prefix</em>
  4262. directory of the war file, where <em>prefix</em> is the value of the
  4263. <code>prefix</code> attribute.</p>
  4264. <table border="1" cellpadding="2" cellspacing="0">
  4265. <tr>
  4266. <td valign="top"><b>Attribute</b></td>
  4267. <td valign="top"><b>Description</b></td>
  4268. <td align="center" valign="top"><b>Required</b></td>
  4269. </tr>
  4270. <tr>
  4271. <td valign="top">prefix</td>
  4272. <td valign="top">The prefix directory to add to each filename when
  4273. adding it to the archive. Default is none.</td>
  4274. <td valign="top" align="center">No</td>
  4275. </tr>
  4276. <tr>
  4277. <td valign="top">dir</td>
  4278. <td valign="top">The root of the directory tree of this FileSet.</td>
  4279. <td valign="top" align="center">Yes</td>
  4280. </tr>
  4281. <tr>
  4282. <td valign="top">defaultexcludes</td>
  4283. <td valign="top">indicates whether default excludes should be used or not
  4284. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  4285. <td valign="top" align="center">No</td>
  4286. </tr>
  4287. <tr>
  4288. <td valign="top">includes</td>
  4289. <td valign="top">comma separated list of patterns of files that must be
  4290. included. All files are included when omitted.</td>
  4291. <td valign="top" align="center">No</td>
  4292. </tr>
  4293. <tr>
  4294. <td valign="top">includesfile</td>
  4295. <td valign="top">the name of a file. Each line of this file is
  4296. taken to be an include pattern</td>
  4297. <td valign="top" align="center">No</td>
  4298. </tr>
  4299. <tr>
  4300. <td valign="top">excludes</td>
  4301. <td valign="top">comma separated list of patterns of files that must be
  4302. excluded. No files (except default excludes) are excluded when omitted.</td>
  4303. <td valign="top" align="center">No</td>
  4304. </tr>
  4305. <tr>
  4306. <td valign="top">excludesfile</td>
  4307. <td valign="top">the name of a file. Each line of this file is
  4308. taken to be an exclude pattern</td>
  4309. <td valign="top" align="center">No</td>
  4310. </tr>
  4311. </table>
  4312. <h3>Examples</h3>
  4313. <p>Assume the following structure in the project's base directory:
  4314. <pre>
  4315. thirdparty/libs/jdbc1.jar
  4316. thirdparty/libs/jdbc2.jar
  4317. build/main/com/myco/myapp/Servlet.class
  4318. src/metadata/myapp.xml
  4319. src/html/myapp/index.html
  4320. src/jsp/myapp/front.jsp
  4321. src/graphics/images/gifs/small/logo.gif
  4322. src/graphics/images/gifs/large/logo.gif
  4323. </pre>
  4324. then the war file <code>myapp.war</code> created with
  4325. <pre>
  4326. &lt;war warfile=&quot;myapp.war&quot; webxml=&quot;src/metadata/myapp.xml&quot;&gt;
  4327. &lt;fileset dir=&quot;src/html/myapp&quot; /&gt;
  4328. &lt;fileset dir=&quot;src/jsp/myapp&quot; /&gt;
  4329. &lt;lib dir=&quot;thirdparty/libs&quot;&gt;
  4330. &lt;exclude name=&quot;jdbc1.jar&quot; /&gt;
  4331. &lt;/lib&gt;
  4332. &lt;classes dir=&quot;build/main&quot; /&gt;
  4333. &lt;prefixedfileset dir=&quot;src/graphics/images/gifs&quot;
  4334. prefix="images"/&gt;
  4335. &lt;/war&gt;
  4336. </pre>
  4337. will consist of
  4338. <pre>
  4339. WEB-INF/web.xml
  4340. WEB-INF/lib/jdbc2.jar
  4341. WEB-INF/classes/com/myco/myapp/Servlet.class
  4342. META-INF/MANIFEST.MF
  4343. index.html
  4344. front.jsp
  4345. images/small/logo.gif
  4346. images/large/logo.gif
  4347. </pre>
  4348. using Ant's default manifest file. The content of
  4349. <code>WEB-INF/web.xml</code> is identical to
  4350. <code>src/metadata/myapp.xml</code>.
  4351. <hr>
  4352. <h2><a name="zip">Zip</a></h2>
  4353. <h3>Description</h3>
  4354. <p>Creates a zipfile.</p>
  4355. <p>The <i>basedir</i> attribute is the reference directory from where to zip.</p>
  4356. <p>Note that file permissions will not be stored in the resulting zipfile.</p>
  4357. <p>It is possible to refine the set of files that are being zipped. This can be
  4358. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  4359. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  4360. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  4361. the files you want to have excluded. This is also done with patterns. And
  4362. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  4363. want to use default exclusions or not. See the section on <a
  4364. href="#directorybasedtasks">directory based tasks</a>, on how the
  4365. inclusion/exclusion of files works, and how to write patterns.
  4366. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  4367. supports all attributes of <code>&lt;fileset&gt;</code>
  4368. (<code>dir</code> becomes <code>basedir</code>) as well as the nested
  4369. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  4370. <code>&lt;patternset&gt;</code> elements.</p>
  4371. <p>Or, you may place within it nested file sets, or references to file sets.
  4372. In this case <code>basedir</code> is optional; the implicit file set is <em>only used</em>
  4373. if <code>basedir</code> is set. You may use any mixture of the implicit file set
  4374. (with <code>basedir</code> set, and optional attributes like <code>includes</code>
  4375. and optional subelements like <code>&lt;include&gt;</code>); explicit nested
  4376. <code>&lt;fileset&gt;</code> elements so long as at least one fileset total is specified. The ZIP file will
  4377. only reflect the relative paths of files <em>within</em> each fileset.</p>
  4378. <p>The <code>whenempty</code> parameter controls what happens when no files match.
  4379. If <code>skip</code> (the default), the ZIP is not created and a warning is issued.
  4380. If <code>fail</code>, the ZIP is not created and the build is halted with an error.
  4381. If <code>create</code>, an empty ZIP file (explicitly zero entries) is created,
  4382. which should be recognized as such by compliant ZIP manipulation tools.</p>
  4383. <h3>Parameters</h3>
  4384. <table border="1" cellpadding="2" cellspacing="0">
  4385. <tr>
  4386. <td valign="top"><b>Attribute</b></td>
  4387. <td valign="top"><b>Description</b></td>
  4388. <td valign="top" align="center"><b>Required</b></td>
  4389. </tr>
  4390. <tr>
  4391. <td valign="top">zipfile</td>
  4392. <td valign="top">the zip-file to create.</td>
  4393. <td align="center" valign="top">Yes</td>
  4394. </tr>
  4395. <tr>
  4396. <td valign="top">basedir</td>
  4397. <td valign="top">the directory from which to zip the files.</td>
  4398. <td align="center" valign="top">No</td>
  4399. </tr>
  4400. <tr>
  4401. <td valign="top">compress</td>
  4402. <td valign="top">Not only store data but also compress them, defaults to true</td>
  4403. <td align="center" valign="top">No</td>
  4404. </tr>
  4405. <tr>
  4406. <td valign="top">includes</td>
  4407. <td valign="top">comma separated list of patterns of files that must be
  4408. included. All files are included when omitted.</td>
  4409. <td valign="top" align="center">No</td>
  4410. </tr>
  4411. <tr>
  4412. <td valign="top">includesfile</td>
  4413. <td valign="top">the name of a file. Each line of this file is
  4414. taken to be an include pattern</td>
  4415. <td valign="top" align="center">No</td>
  4416. </tr>
  4417. <tr>
  4418. <td valign="top">excludes</td>
  4419. <td valign="top">comma separated list of patterns of files that must be
  4420. excluded. No files (except default excludes) are excluded when omitted.</td>
  4421. <td valign="top" align="center">No</td>
  4422. </tr>
  4423. <tr>
  4424. <td valign="top">excludesfile</td>
  4425. <td valign="top">the name of a file. Each line of this file is
  4426. taken to be an exclude pattern</td>
  4427. <td valign="top" align="center">No</td>
  4428. </tr>
  4429. <tr>
  4430. <td valign="top">defaultexcludes</td>
  4431. <td valign="top">indicates whether default excludes should be used or not
  4432. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  4433. <td valign="top" align="center">No</td>
  4434. </tr>
  4435. <tr>
  4436. <td valign="top">whenempty</td>
  4437. <td valign="top">Behavior when no files match.</td>
  4438. <td valign="top" align="center">No</td>
  4439. </tr>
  4440. </table>
  4441. <h3>Examples</h3>
  4442. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  4443. basedir=&quot;htdocs/manual&quot;
  4444. /&gt;</pre>
  4445. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  4446. in the <code>${dist}</code> directory.</p>
  4447. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  4448. basedir=&quot;htdocs/manual&quot;
  4449. excludes=&quot;mydocs/**, **/todo.html&quot;
  4450. /&gt;</pre>
  4451. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  4452. in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
  4453. or files with the name <code>todo.html</code> are excluded.</p>
  4454. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  4455. basedir=&quot;htdocs/manual&quot;
  4456. includes=&quot;api/**/*.html&quot;
  4457. excludes=&quot;**/todo.html&quot;
  4458. /&gt;</pre>
  4459. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  4460. in the <code>${dist}</code> directory. Only html files under the directory <code>api</code>
  4461. are zipped, and files with the name <code>todo.html</code> are excluded.</p>
  4462. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;&gt;
  4463. &lt;fileset dir=&quot;htdocs/manual&quot;/&gt;
  4464. &lt;fileset dir=&quot;.&quot; includes=&quot;ChangeLog.txt&quot;/&gt;
  4465. &lt;/zip&gt;</pre>
  4466. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  4467. in the <code>${dist}</code> directory, and also adds the file <code>ChangeLog.txt</code> in the
  4468. current directory. <code>ChangeLog.txt</code> will be added to the top of the ZIP file, just as if
  4469. it had been located at <code>htdocs/manual/ChangeLog.txt</code>.</p>
  4470. <hr>
  4471. <h2><a name="optionaltasks">Optional tasks</a></h2>
  4472. <ul>
  4473. <li><a href="dotnet.html">.NET Tasks</a></li>
  4474. <li><a href="antlr.html">ANTLR</a></li>
  4475. <li><a href="#cab">Cab</a></li>
  4476. <li><a href="ejb.html">EJB Tasks</a></li>
  4477. <li><a href="#ftp">FTP</a></li>
  4478. <li><a href="javacc.html">JavaCC</a></li>
  4479. <li><a href="jlink.html">Jlink</a></li>
  4480. <li><a href="junit.html">JUnit</a></li>
  4481. <li><a href="native2ascii.html">Native2Ascii</a></li>
  4482. <li><a href="#netrexxc">NetRexxC</a></li>
  4483. <li><a href="P4desc.html">Perforce</a></li>
  4484. <li><a href="propertyfile.html">PropertyFile</a></li>
  4485. <li><a href="#renameexts">RenameExtensions</a></li>
  4486. <li><a href="#script">Script</a></li>
  4487. <li><a href="#vssget">VssGet</a></li>
  4488. </ul>
  4489. <hr>
  4490. <h2><a name="cab">Cab</a></h2>
  4491. <h3>Description</h3>
  4492. <p>The cab task creates Microsoft cab archive files. It is invoked
  4493. similar to the <a href="#jar">jar</a> or <a href="#zip">zip</a> tasks.
  4494. This task will only work on Windows, and will be silently ignored on
  4495. other platforms. You must have the Microsoft cabarc tool available in
  4496. your executable path.</p>
  4497. <p>See the section on <a href="#directorybasedtasks">directory based
  4498. tasks</a>, on how the inclusion/exclusion of files works, and how to
  4499. write patterns.</p>
  4500. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  4501. supports all attributes of <code>&lt;fileset&gt;</code>
  4502. (<code>dir</code> becomes <code>basedir</code>) as well as the nested
  4503. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  4504. <code>&lt;patternset&gt;</code> elements.</p>
  4505. <h3>Parameters</h3>
  4506. <table border="1" cellpadding="2" cellspacing="0">
  4507. <tr>
  4508. <td valign="top"><b>Attribute</b></td>
  4509. <td valign="top"><b>Description</b></td>
  4510. <td align="center" valign="top"><b>Required</b></td>
  4511. </tr>
  4512. <tr>
  4513. <td valign="top">cabfile</td>
  4514. <td valign="top">the name of the cab file to create.</td>
  4515. <td valign="top" align="center">Yes</td>
  4516. </tr>
  4517. <tr>
  4518. <td valign="top">basedir</td>
  4519. <td valign="top">the directory to start archiving files from.</td>
  4520. <td valign="top" align="center">Yes</td>
  4521. </tr>
  4522. <tr>
  4523. <td valign="top">verbose</td>
  4524. <td valign="top">set to &quot;yes&quot; if you want to see the output from
  4525. the cabarc tool. defaults to &quot;no&quot;.</td>
  4526. <td valign="top" align="center">No</td>
  4527. </tr>
  4528. <tr>
  4529. <td valign="top">compress</td>
  4530. <td valign="top">set to &quot;no&quot; to store files without compressing.
  4531. defaults to &quot;yes&quot;.</td>
  4532. <td valign="top" align="center">No</td>
  4533. </tr>
  4534. <tr>
  4535. <td valign="top">options</td>
  4536. <td valign="top">use to set additional command-line options for
  4537. the cabarc tool. should not normally be necessary.</td>
  4538. <td valign="top" align="center">No</td>
  4539. </tr>
  4540. <tr>
  4541. <td valign="top">includes</td>
  4542. <td valign="top">comma separated list of patterns of files that
  4543. must be included. All files are included when omitted.</td>
  4544. <td valign="top" align="center">No</td>
  4545. </tr>
  4546. <tr>
  4547. <td valign="top">includesfile</td>
  4548. <td valign="top">the name of a file. Each line of this file is
  4549. taken to be an include pattern</td>
  4550. <td valign="top" align="center">No</td>
  4551. </tr>
  4552. <tr>
  4553. <td valign="top">excludes</td>
  4554. <td valign="top">comma separated list of patterns of files that
  4555. must be excluded. No files (except default excludes) are excluded
  4556. when omitted.</td>
  4557. <td valign="top" align="center">No</td>
  4558. </tr>
  4559. <tr>
  4560. <td valign="top">excludesfile</td>
  4561. <td valign="top">the name of a file. Each line of this file is
  4562. taken to be an exclude pattern</td>
  4563. <td valign="top" align="center">No</td>
  4564. </tr>
  4565. <tr>
  4566. <td valign="top">defaultexcludes</td>
  4567. <td valign="top">indicates whether default excludes should be used
  4568. or not (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  4569. <td valign="top" align="center">No</td>
  4570. </tr>
  4571. </table>
  4572. <h3>Examples</h3>
  4573. <blockquote><pre>
  4574. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  4575. basedir=&quot;htdocs/manual&quot;
  4576. /&gt;
  4577. </pre></blockquote>
  4578. <p>cabs all files in the htdocs/manual directory in a file called
  4579. manual.cab in the ${dist} directory.</p>
  4580. <blockquote><pre>
  4581. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  4582. basedir=&quot;htdocs/manual&quot;
  4583. excludes=&quot;mydocs/**, **/todo.html&quot;
  4584. /&gt;
  4585. </pre></blockquote>
  4586. <p>cabs all files in the htdocs/manual directory in a file called
  4587. manual.cab in the ${dist} directory. Files in the directory mydocs,
  4588. or files with the name todo.html are excluded.</p>
  4589. <blockquote><pre>
  4590. &lt;cab cabfile=&quot;${dist}/manual.cab&quot;
  4591. basedir=&quot;htdocs/manual&quot;
  4592. includes=&quot;api/**/*.html&quot;
  4593. excludes=&quot;**/todo.html&quot;
  4594. verbose=&quot;yes&quot;
  4595. /&gt;
  4596. </pre></blockquote>
  4597. <p>cab all files in the htdocs/manual directory in a file called
  4598. manual.cab in the ${dist} directory. Only html files under the
  4599. directory api are archived, and files with the name todo.html are
  4600. excluded. Output from the cabarc tool is displayed in the build
  4601. output.</p>
  4602. <hr>
  4603. <h2><a name="ftp">FTP</a></h2>
  4604. <h3>Description</h3>
  4605. <p>The ftp task implements a basic FTP client that can send, receive,
  4606. list, and delete files. See below for descriptions and examples of how
  4607. to perform each task.</p>
  4608. <p>The ftp task makes no attempt to determine what file system syntax is
  4609. required by the remote server, and defaults to Unix standards.
  4610. <i>remotedir</i> must be specified in the exact syntax required by the ftp
  4611. server. If the usual Unix conventions are not supported by the server,
  4612. <i>separator</i> can be used to set the file separator that should be used
  4613. instead.</p>
  4614. <p>See the section on <a href="#directorybasedtasks">directory based
  4615. tasks</a>, on how the inclusion/exclusion of files works, and how to
  4616. write patterns.</p>
  4617. <h3>Parameters</h3>
  4618. <table border="1" cellpadding="2" cellspacing="0">
  4619. <tr>
  4620. <td valign="top"><b>Attribute</b></td>
  4621. <td valign="top"><b>Description</b></td>
  4622. <td align="center" valign="top"><b>Required</b></td>
  4623. </tr>
  4624. <tr>
  4625. <td valign="top">server</td>
  4626. <td valign="top">the address of the remote ftp server.</td>
  4627. <td valign="top" align="center">Yes</td>
  4628. </tr>
  4629. <tr>
  4630. <td valign="top">port</td>
  4631. <td valign="top">the port number of the remote ftp server.
  4632. Defaults to port 21.</td>
  4633. <td valign="top" align="center">No</td>
  4634. </tr>
  4635. <tr>
  4636. <td valign="top">userid</td>
  4637. <td valign="top">the login id to use on the ftp server.</td>
  4638. <td valign="top" align="center">Yes</td>
  4639. </tr>
  4640. <tr>
  4641. <td valign="top">password</td>
  4642. <td valign="top">the login password to use on the ftp server.</td>
  4643. <td valign="top" align="center">Yes</td>
  4644. </tr>
  4645. <tr>
  4646. <td valign="top">remotedir</td>
  4647. <td valign="top">the directory to which to upload files on the
  4648. ftp server.</td>
  4649. <td valign="top" align="center">No</td>
  4650. </tr>
  4651. <tr>
  4652. <td valign="top">action</td>
  4653. <td valign="top">the ftp action to perform, defaulting to &quot;send&quot;.
  4654. Currently supports&quot;put&quot;, &quot;get&quot;,
  4655. &quot;del&quot;, and &quot;list&quot;.</td>
  4656. <td valign="top" align="center">No</td>
  4657. </tr>
  4658. <tr>
  4659. <td valign="top">binary</td>
  4660. <td valign="top">selects binary-mode (&quot;yes&quot;) or text-mode
  4661. (&quot;no&quot;) transfers.
  4662. Defaults to &quot;yes&quot;</td>
  4663. <td valign="top" align="center">No</td>
  4664. </tr>
  4665. <tr>
  4666. <td valign="top">passive</td>
  4667. <td valign="top">selects passive-mode (&quot;yes&quot;) transfers.
  4668. Defaults to &quot;no&quot;</td>
  4669. <td valign="top" align="center">No</td>
  4670. </tr>
  4671. <tr>
  4672. <td valign="top">verbose</td>
  4673. <td valign="top">displays information on each file transferred if set
  4674. to &quot;yes&quot;. Defaults to &quot;no&quot;.</td>
  4675. <td valign="top" align="center">No</td>
  4676. </tr>
  4677. <tr>
  4678. <td valign="top">depends</td>
  4679. <td valign="top">transfers only new or changed files if set to
  4680. &quot;yes&quot;. Defaults to &quot;no&quot;.</td>
  4681. <td valign="top" align="center">No</td>
  4682. </tr>
  4683. <tr>
  4684. <td valign="top">newer</td>
  4685. <td valign="top">a synonym for <i>depends</i>.</td>
  4686. <td valign="top" align="center">No</td>
  4687. </tr>
  4688. <tr>
  4689. <td valign="top">separator</td>
  4690. <td valign="top">sets the file separator used on the ftp server.
  4691. Defaults to &quot;/&quot;.</td>
  4692. <td valign="top" align="center">No</td>
  4693. </tr>
  4694. <tr>
  4695. <td valign="top">listing</td>
  4696. <td valign="top">the file to write results of the &quot;list&quot; action.
  4697. Required for the &quot;list&quot; action, ignored otherwise.</td>
  4698. <td valign="top" align="center">No</td>
  4699. </tr>
  4700. </table>
  4701. <h3>Sending Files</h3>
  4702. <p>The easiest way to describe how to send files is with a couple of examples:</p>
  4703. <pre>
  4704. &lt;ftp server=&quot;ftp.apache.org&quot;
  4705. userid=&quot;anonymous&quot;
  4706. password=&quot;me@myorg.com&quot;&gt;
  4707. &lt;fileset dir=&quot;htdocs/manual&quot; /&gt;
  4708. &lt;/ftp&gt;
  4709. </pre>
  4710. <p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and
  4711. uploads all files in the <code>htdocs/manual</code> directory
  4712. to the default directory for that user.</p>
  4713. <pre> &lt;ftp server=&quot;ftp.apache.org&quot;
  4714. remotedir=&quot;incoming&quot;
  4715. userid=&quot;anonymous&quot;
  4716. password=&quot;me@myorg.com&quot;
  4717. depends=&quot;yes&quot;
  4718. &gt;
  4719. &lt;fileset dir=&quot;htdocs/manual&quot; /&gt;
  4720. &lt;/ftp&gt;</pre>
  4721. <p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and
  4722. uploads all new or changed files in the <code>htdocs/manual</code> directory
  4723. to the <code>incoming</code> directory relative to the default directory
  4724. for <code>anonymous</code>.</p>
  4725. <pre> &lt;ftp server=&quot;ftp.apache.org&quot;
  4726. port=&quot;2121&quot;
  4727. remotedir=&quot;/pub/incoming&quot;
  4728. userid=&quot;coder&quot;
  4729. password=&quot;java1&quot;
  4730. depends=&quot;yes&quot;
  4731. binary=&quot;no&quot;
  4732. &gt;
  4733. &lt;fileset dir=&quot;htdocs/manual&quot;&gt;
  4734. &lt;include name=&quot;**/*.html&quot; /&gt;
  4735. &lt;/fileset&gt;
  4736. &lt;/ftp&gt;</pre>
  4737. <p>Logs in to <code>ftp.apache.org</code> at port <code>2121</code> as
  4738. <code>coder</code> with password <code>java1</code> and uploads all new or
  4739. changed HTML files in the <code>htdocs/manual</code> directory to the
  4740. <code>/pub/incoming</code> directory. The files are transferred in text mode. Passive mode has been switched on to send files from behind a firewall.</p>
  4741. <pre> &lt;ftp server=&quot;ftp.nt.org&quot;
  4742. remotedir=&quot;c:\uploads&quot;
  4743. userid=&quot;coder&quot;
  4744. password=&quot;java1&quot;
  4745. separator=&quot;\&quot;
  4746. verbose=&quot;yes&quot;</pre>
  4747. <PRE>
  4748. &gt;
  4749. &lt;fileset dir=&quot;htdocs/manual&quot;&gt;
  4750. &lt;include name=&quot;**/*.html&quot; /&gt;
  4751. &lt;/fileset&gt;
  4752. &lt;/ftp&gt;</PRE><p>Logs in to the Windows-based <code>ftp.nt.org</code> as
  4753. <code>coder</code> with password <code>java1</code> and uploads all
  4754. HTML files in the <code>htdocs/manual</code> directory to the
  4755. <code>c:\uploads</code> directory. Progress messages are displayed as each
  4756. file is uploaded.</p>
  4757. <h3>Getting Files</h3>
  4758. <p>Getting files from an FTP server works pretty much the same way as
  4759. sending them does. The only difference is that the nested filesets
  4760. use the remotedir attribute as the base directory for the files on the
  4761. FTP server, and the dir attribute as the local directory to put the files
  4762. into. The file structure from the FTP site is preserved on the local machine.</p>
  4763. <pre>
  4764. &lt;ftp action=&quot;get&quot;
  4765. server=&quot;ftp.apache.org&quot;
  4766. userid=&quot;anonymous&quot;
  4767. password=&quot;me@myorg.com&quot;&gt;
  4768. &lt;fileset dir=&quot;htdocs/manual&quot; &gt;
  4769. &lt;include name=&quot;**/*.html&quot; /&gt;
  4770. &lt;/fileset&gt;
  4771. &lt;/ftp&gt;
  4772. </pre>
  4773. <p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and
  4774. recursively downloads all .html files from default directory for that user
  4775. into the <code>htdocs/manual</code> directory on the local machine.</p>
  4776. <h3>Deleting Files</h3>
  4777. As you've probably guessed by now, you use nested fileset elements to
  4778. select the files to delete from the remote FTP server. Again, the
  4779. filesets are relative to the remote directory, not a local directory. In
  4780. fact, the dir attribute of the fileset is ignored completely.
  4781. <pre>
  4782. &lt;ftp action=&quot;del&quot;
  4783. server=&quot;ftp.apache.org&quot;
  4784. userid=&quot;anonymous&quot;
  4785. password=&quot;me@myorg.com&quot; &gt;
  4786. &lt;fileset&gt;
  4787. &lt;include name=&quot;**/*.tmp&quot; /&gt;
  4788. &lt;/fileset&gt;
  4789. &lt;/ftp&gt;
  4790. </pre>
  4791. <p>Logs in to <code>ftp.apache.org</code> as <code>anonymous</code> and
  4792. tries to delete all *.tmp files from the default directory for that user.
  4793. If you don't have permission to delete a file, a BuildException is thrown.</p>
  4794. <h3>Listing Files</h3>
  4795. <pre>
  4796. &lt;ftp action=&quot;list&quot;
  4797. server=&quot;ftp.apache.org&quot;
  4798. userid=quot;anonymous&quot;
  4799. password=&quot;me@myorg.com&quot;
  4800. listing=&quot;data/ftp.listing&quot; &gt;
  4801. &lt;fileset&gt;
  4802. &lt;include name=&quot;**&quot; /&gt;
  4803. &lt;/fileset&gt;
  4804. &lt;/ftp&gt;
  4805. </pre>
  4806. <p>This provides a file listing in <code>data/ftp.listing</code> of all the files on
  4807. the FTP server relative to the default directory of the <code>anonymous</code>
  4808. user. The listing is in whatever format the FTP server normally lists files.</p>
  4809. <hr>
  4810. <h2><a name="netrexxc">NetRexxC</a></h2>
  4811. <h3>Description</h3>
  4812. <p>Compiles a <a href="http://www2.hursley.ibm.com/netrexx">NetRexx</a>
  4813. source tree within the running (Ant) VM.</p>
  4814. <p>The source and destination directory will be recursively scanned for
  4815. NetRexx source files to compile. Only NetRexx files that have no corresponding
  4816. class file or where the class file is older than the java file will be compiled.</p>
  4817. <p>Files in the source tree are copied to the destination directory,
  4818. allowing support files to be located properly in the classpath. The source
  4819. files are copied because the NetRexx compiler cannot produce class files in a
  4820. specific directory via parameters</p>
  4821. <p>The directory structure of the source tree should follow the package
  4822. hierarchy.</p>
  4823. <p>It is possible to refine the set of files that are being compiled/copied.
  4824. This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and
  4825. <i>defaultexcludes</i> attributes. With the <i>includes</i> or <i>includesfile</i> attribute you
  4826. specify the files you want to have included by using patterns. The
  4827. <i>exclude</i> or <i>excludesfile</i> attribute is used to specify the files you want to have
  4828. excluded. This is also done with patterns. And finally with the
  4829. <i>defaultexcludes</i> attribute, you can specify whether you
  4830. want to use default exclusions or not. See the section on <a
  4831. href="#directorybasedtasks">directory based tasks</a>, on how the
  4832. inclusion/exclusion of files works, and how to write patterns.</p>
  4833. <p>This task forms an implicit <a href="#fileset">FileSet</a> and
  4834. supports all attributes of <code>&lt;fileset&gt;</code>
  4835. (<code>dir</code> becomes <code>srcdir</code>) as well as the nested
  4836. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  4837. <code>&lt;patternset&gt;</code> elements.</p>
  4838. <h3>Parameters</h3>
  4839. <table border="1" cellpadding="2" cellspacing="0">
  4840. <tr>
  4841. <td valign="top"><b>Attribute</b></td>
  4842. <td valign="top"><b>Description</b></td>
  4843. <td align="center" valign="top"><b>Required</b></td>
  4844. </tr>
  4845. <tr>
  4846. <td valign="top">binary</td>
  4847. <td valign="top">Whether literals are treated as the java binary
  4848. type rather than the NetRexx types</td>
  4849. <td valign="top" align="center">No</td>
  4850. </tr>
  4851. <tr>
  4852. <td valign="top">classpath</td>
  4853. <td valign="top">The classpath to use during compilation</td>
  4854. <td valign="top" align="center">No</td>
  4855. </tr>
  4856. <tr>
  4857. <td valign="top">comments</td>
  4858. <td valign="top">Whether comments are passed through to the
  4859. generated java source</td>
  4860. <td valign="top" align="center">No</td>
  4861. </tr>
  4862. <tr>
  4863. <td valign="top">compact</td>
  4864. <td valign="top">Whether error messages come out in compact or
  4865. verbose format</td>
  4866. <td valign="top" align="center">No</td>
  4867. </tr>
  4868. <tr>
  4869. <td valign="top">compile</td>
  4870. <td valign="top">Whether the NetRexx compiler should compile the
  4871. generated java code</td>
  4872. <td valign="top" align="center">No</td>
  4873. </tr>
  4874. <tr>
  4875. <td valign="top">console</td>
  4876. <td valign="top">Whether or not messages should be displayed on the
  4877. 'console'</td>
  4878. <td valign="top" align="center">No</td>
  4879. </tr>
  4880. <tr>
  4881. <td valign="top">crossref</td>
  4882. <td valign="top">Whether variable cross references are generated</td>
  4883. <td valign="top" align="center">No</td>
  4884. </tr>
  4885. <tr>
  4886. <td valign="top">decimal</td>
  4887. <td valign="top">Whether decimal arithmetic should be used for the
  4888. NetRexx code</td>
  4889. <td valign="top" align="center">No</td>
  4890. </tr>
  4891. <tr>
  4892. <td valign="top">defaultexcludes</td>
  4893. <td valign="top">indicates whether default excludes should be used or not
  4894. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  4895. omitted.</td>
  4896. <td valign="top" align="center">No</td>
  4897. </tr>
  4898. <tr>
  4899. <td valign="top">destDir</td>
  4900. <td valign="top">the destination directory into which the NetRexx
  4901. source files should be copied and then compiled</td>
  4902. <td valign="top" align="center">Yes</td>
  4903. </tr>
  4904. <tr>
  4905. <td valign="top">diag</td>
  4906. <td valign="top">Whether diagnostic information about the compile is
  4907. generated</td>
  4908. <td valign="top" align="center">No</td>
  4909. </tr>
  4910. <tr>
  4911. <td valign="top">excludes</td>
  4912. <td valign="top">comma separated list of patterns of files that must be
  4913. excluded. No files (except default excludes) are excluded when
  4914. omitted.</td>
  4915. <td valign="top" align="center">No</td>
  4916. </tr>
  4917. <tr>
  4918. <td valign="top">excludesfile</td>
  4919. <td valign="top">the name of a file. Each line of this file is
  4920. taken to be an exclude pattern</td>
  4921. <td valign="top" align="center">No</td>
  4922. </tr>
  4923. <tr>
  4924. <td valign="top">explicit</td>
  4925. <td valign="top">Whether variables must be declared explicitly
  4926. before use</td>
  4927. <td valign="top" align="center">No</td>
  4928. </tr>
  4929. <tr>
  4930. <td valign="top">format</td>
  4931. <td valign="top">Whether the generated java code is formatted nicely
  4932. or left to match NetRexx line numbers for call stack debugging</td>
  4933. <td valign="top" align="center">No</td>
  4934. </tr>
  4935. <tr>
  4936. <td valign="top">includes</td>
  4937. <td valign="top">comma separated list of patterns of files that must be
  4938. included. All files are included when omitted.</td>
  4939. <td valign="top" align="center">No</td>
  4940. </tr>
  4941. <tr>
  4942. <td valign="top">includesfile</td>
  4943. <td valign="top">the name of a file. Each line of this file is
  4944. taken to be an include pattern</td>
  4945. <td valign="top" align="center">No</td>
  4946. </tr>
  4947. <tr>
  4948. <td valign="top">java</td>
  4949. <td valign="top">Whether the generated java code is produced</td>
  4950. <td valign="top" align="center">No</td>
  4951. </tr>
  4952. <tr>
  4953. <td valign="top">keep</td>
  4954. <td valign="top">Sets whether the generated java source file should be kept
  4955. after compilation. The generated files will have an extension of
  4956. .java.keep, <b>not</b> .java</td>
  4957. <td valign="top" align="center">No</td>
  4958. </tr>
  4959. <tr>
  4960. <td valign="top">logo</td>
  4961. <td valign="top">Whether the compiler text logo is displayed when
  4962. compiling</td>
  4963. <td valign="top" align="center">No</td>
  4964. </tr>
  4965. <tr>
  4966. <td valign="top">replace</td>
  4967. <td valign="top">Whether the generated .java file should be replaced
  4968. when compiling</td>
  4969. <td valign="top" align="center">No</td>
  4970. </tr>
  4971. <tr>
  4972. <td valign="top">savelog</td>
  4973. <td valign="top">Whether the compiler messages will be written to
  4974. NetRexxC.log as well as to the console</td>
  4975. <td valign="top" align="center">No</td>
  4976. </tr>
  4977. <tr>
  4978. <td valign="top">sourcedir</td>
  4979. <td valign="top">Tells the NetRexx compiler to store the class files in the
  4980. same directory as the source files. The alternative is the working
  4981. directory</td>
  4982. <td valign="top" align="center">No</td>
  4983. </tr>
  4984. <tr>
  4985. <td valign="top">srcDir</td>
  4986. <td valign="top">Set the source dir to find the source Netrexx
  4987. files</td>
  4988. <td valign="top" align="center">Yes</td>
  4989. </tr>
  4990. <tr>
  4991. <td valign="top">strictargs</td>
  4992. <td valign="top">Tells the NetRexx compiler that method calls always
  4993. need parentheses, even if no arguments are needed, e.g.
  4994. <code>aStringVar.getBytes</code> vs.
  4995. <code>aStringVar.getBytes()</code></td>
  4996. <td valign="top" align="center">No</td>
  4997. </tr>
  4998. <tr>
  4999. <td valign="top">strictassign</td>
  5000. <td valign="top">Tells the NetRexx compile that assignments must
  5001. match exactly on type</td>
  5002. <td valign="top" align="center">No</td>
  5003. </tr>
  5004. <tr>
  5005. <td valign="top">strictcase</td>
  5006. <td valign="top">Specifies whether the NetRexx compiler should be
  5007. case sensitive or not</td>
  5008. <td valign="top" align="center">No</td>
  5009. </tr>
  5010. <tr>
  5011. <td valign="top">strictimport</td>
  5012. <td valign="top">Whether classes need to be imported explicitly using an
  5013. <code>import</code> statement. By default the NetRexx compiler will
  5014. import certain packages automatically</td>
  5015. <td valign="top" align="center">No</td>
  5016. </tr>
  5017. <tr>
  5018. <td valign="top">strictprops</td>
  5019. <td valign="top">Whether local properties need to be qualified
  5020. explicitly using <code>this</code></td>
  5021. <td valign="top" align="center">No</td>
  5022. </tr>
  5023. <tr>
  5024. <td valign="top">strictsignal</td>
  5025. <td valign="top">Whether the compiler should force catching of
  5026. exceptions by explicitly named types</td>
  5027. <td valign="top" align="center">No</td>
  5028. </tr>
  5029. <tr>
  5030. <td valign="top">symbols</td>
  5031. <td valign="top">Whether debug symbols should be generated into the
  5032. class file</td>
  5033. <td valign="top" align="center">No</td>
  5034. </tr>
  5035. <tr>
  5036. <td valign="top">time</td>
  5037. <td valign="top">Asks the NetRexx compiler to print compilation
  5038. times to the console</td>
  5039. <td valign="top" align="center">No</td>
  5040. </tr>
  5041. <tr>
  5042. <td valign="top">trace</td>
  5043. <td valign="top">Turns on or off tracing and directs the resultant
  5044. trace output</td>
  5045. <td valign="top" align="center">No</td>
  5046. </tr>
  5047. <tr>
  5048. <td valign="top">utf8</td>
  5049. <td valign="top">Tells the NetRexx compiler that the source is in UTF8</td>
  5050. <td valign="top" align="center">No</td>
  5051. </tr>
  5052. <tr>
  5053. <td valign="top">verbose</td>
  5054. <td valign="top">Whether lots of warnings and error messages should
  5055. be generated</td>
  5056. <td valign="top" align="center">Yes</td>
  5057. </tr>
  5058. </table>
  5059. <h3>Examples</h3>
  5060. <blockquote>
  5061. <p><code>&lt;netrexxc srcDir=&quot;/source/project&quot;
  5062. includes=&quot;vnr/util/*&quot;
  5063. destDir=&quot;/source/project/build&quot;
  5064. classpath=&quot;/source/project2/proj.jar&quot;
  5065. comments=&quot;true&quot;
  5066. crossref=&quot;false&quot; replace=&quot;true&quot;
  5067. keep=&quot;true&quot; /&gt;</code>
  5068. </p>
  5069. </blockquote>
  5070. <hr>
  5071. <h2><a name="renameexts">RenameExtensions</a></h2>
  5072. <h3>Description</h3>
  5073. <p>Renames files in the <code>srcDir</code> directory ending with the
  5074. <code>fromExtension</code> string so that they end with the
  5075. <code>toExtension</code> string. Files are only replaced if
  5076. <code>replace</code> is true
  5077. </p>
  5078. <p>See the section on
  5079. <a href="#directorybasedtasks">directory based tasks</a>, on how the
  5080. inclusion/exclusion of files works, and how to write patterns.
  5081. This task forms an implicit <a href="#fileset">FileSet</a> and
  5082. supports all attributes of <code>&lt;fileset&gt;</code>
  5083. (<code>dir</code> becomes <code>srcDir</code>) as well as the nested
  5084. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  5085. <code>&lt;patternset&gt;</code> elements.</p>
  5086. <h3>Parameters</h3>
  5087. <table border="1" cellpadding="2" cellspacing="0">
  5088. <tr>
  5089. <td valign="top"><b>Attribute</b></td>
  5090. <td valign="top"><b>Description</b></td>
  5091. <td align="center" valign="top"><b>Required</b></td>
  5092. </tr>
  5093. <tr>
  5094. <td valign="top">defaultexcludes</td>
  5095. <td valign="top">indicates whether default excludes should be used or not
  5096. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  5097. omitted.</td>
  5098. <td valign="top" align="center">No</td>
  5099. </tr>
  5100. <tr>
  5101. <td valign="top">excludes</td>
  5102. <td valign="top">comma separated list of patterns of files that must be
  5103. excluded. No files (except default excludes) are excluded when
  5104. omitted.</td>
  5105. <td valign="top" align="center">No</td>
  5106. </tr>
  5107. <tr>
  5108. <td valign="top">excludesfile</td>
  5109. <td valign="top">the name of a file. Each line of this file is
  5110. taken to be an exclude pattern</td>
  5111. <td valign="top" align="center">No</td>
  5112. </tr>
  5113. <tr>
  5114. <td valign="top">fromExtention</td>
  5115. <td valign="top">The string that files must end in to be renamed</td>
  5116. <td valign="top" align="center">Yes</td>
  5117. </tr>
  5118. <tr>
  5119. <td valign="top">includes</td>
  5120. <td valign="top">comma separated list of patterns of files that must be
  5121. included. All files are included when omitted.</td>
  5122. <td valign="top" align="center">No</td>
  5123. </tr>
  5124. <tr>
  5125. <td valign="top">includesfile</td>
  5126. <td valign="top">the name of a file. Each line of this file is
  5127. taken to be an include pattern</td>
  5128. <td valign="top" align="center">No</td>
  5129. </tr>
  5130. <tr>
  5131. <td valign="top">replace</td>
  5132. <td valign="top">Whether the file being renamed to should be
  5133. replaced if it already exists</td>
  5134. <td valign="top" align="center">No</td>
  5135. </tr>
  5136. <tr>
  5137. <td valign="top">srcDir</td>
  5138. <td valign="top">The starting directory for files to search in</td>
  5139. <td valign="top" align="center">Yes</td>
  5140. </tr>
  5141. <tr>
  5142. <td valign="top">toExtension</td>
  5143. <td valign="top">The string that renamed files will end with on
  5144. completion</td>
  5145. <td valign="top" align="center">Yes</td>
  5146. </tr>
  5147. </table>
  5148. <h3>Examples</h3>
  5149. <blockquote>
  5150. <p><code>&lt;renameext srcDir=&quot;/source/project1&quot;
  5151. includes=&quot;**&quot;
  5152. excludes=&quot;**/samples/*&quot;
  5153. fromExtension=&quot;.java.keep&quot;
  5154. toExtension=&quot;.java&quot;
  5155. replace=&quot;true&quot; /&gt;
  5156. </code>
  5157. </p>
  5158. </blockquote>
  5159. <hr>
  5160. <h2><a name="script">Script</a></h2>
  5161. <h3>Description</h3>
  5162. <p>Execute a script in a
  5163. <a href="http://oss.software.ibm.com/developerworks/opensource/bsf/">BSF</a> supported language.
  5164. <p>All items (tasks, targets, etc) of the running project are
  5165. accessible from the script, using either their <code>name</code> or
  5166. <code>id</code> attributes.</p>
  5167. <p>Scripts can do almost anything a task written in Java could do.</p>
  5168. <h3>Parameters</h3>
  5169. <table border="1" cellpadding="2" cellspacing="0">
  5170. <tr>
  5171. <td valign="top"><b>Attribute</b></td>
  5172. <td valign="top"><b>Description</b></td>
  5173. <td align="center" valign="top"><b>Required</b></td>
  5174. </tr>
  5175. <tr>
  5176. <td valign="top">language</td>
  5177. <td valign="top">The programming language the script is written in.
  5178. Must be a supported BSF language</td>
  5179. <td valign="top" align="center">No</td>
  5180. </tr>
  5181. <tr>
  5182. <td valign="top">src</td>
  5183. <td valign="top">The location of the script as a file, if not inline</td>
  5184. <td valign="top" align="center">No</td>
  5185. </tr>
  5186. </table>
  5187. <h3>Examples</h3>
  5188. <blockquote><pre>
  5189. &lt;project name=&quot;squares&quot; default=&quot;main&quot; basedir=&quot;.&quot;&gt;
  5190. &lt;target name=&quot;setup&quot;&gt;
  5191. &lt;script language=&quot;javascript&quot;&gt; &lt;![CDATA[
  5192. for (i=1; i&lt;=10; i++) {
  5193. echo = squares.createTask(&quot;echo&quot;);
  5194. main.addTask(echo);
  5195. echo.setMessage(i*i);
  5196. }
  5197. ]]&gt; &lt;/script&gt;
  5198. &lt;/target&gt;
  5199. &lt;target name=&quot;main&quot; depends=&quot;setup&quot; /&gt;
  5200. &lt;/project&gt;
  5201. </pre></blockquote>
  5202. <p>generates</p>
  5203. <blockquote><pre>
  5204. setup:
  5205. main:
  5206. 1
  5207. 4
  5208. 9
  5209. 16
  5210. 25
  5211. 36
  5212. 49
  5213. 64
  5214. 81
  5215. 100
  5216. BUILD SUCCESSFUL
  5217. </pre></blockquote>
  5218. <p>Another example, using <a href="#references">references by id</a>
  5219. and two different scripting languages:</p>
  5220. <blockquote><pre>
  5221. &lt;project name=&quot;testscript&quot; default=&quot;main&quot;&gt;
  5222. &lt;target name=&quot;sub&quot;&gt;
  5223. &lt;echo id=&quot;theEcho&quot; /&gt;
  5224. &lt;/target&gt;
  5225. &lt;target name=&quot;sub1&quot;&gt;
  5226. &lt;script language=&quot;netrexx&quot;&gt;&lt;![CDATA[
  5227. theEcho.setMessage(&quot;In sub1&quot;)
  5228. sub.execute
  5229. ]]&gt;&lt;/script&gt;
  5230. &lt;/target&gt;
  5231. &lt;target name=&quot;sub2&quot;&gt;
  5232. &lt;script language=&quot;javascript&quot;&gt;&lt;![CDATA[
  5233. theEcho.setMessage(&quot;In sub2&quot;);
  5234. sub.execute();
  5235. ]]&gt;&lt;/script&gt;
  5236. &lt;/target&gt;
  5237. &lt;target name=&quot;main&quot; depends=&quot;sub1,sub2&quot; /&gt;
  5238. &lt;/project&gt;
  5239. </pre></blockquote>
  5240. <p>generates</p>
  5241. <blockquote><pre>
  5242. sub1:
  5243. In sub1
  5244. sub2:
  5245. In sub2
  5246. main:
  5247. BUILD SUCCESSFUL
  5248. </pre></blockquote>
  5249. <hr>
  5250. <h2><a name="vssget">VssGet</a></h2>
  5251. <h3>Description</h3>
  5252. Task to perform GET commands to Microsoft Visual Source Safe.
  5253. <p>If you specify two or more attributes from version, date and
  5254. label only one will be used in the order version, date, label.</p>
  5255. <h3>Parameters</h3>
  5256. <table border="1" cellpadding="2" cellspacing="0">
  5257. <tr>
  5258. <th>Attribute</th>
  5259. <th>Values</th>
  5260. <th>Required</th>
  5261. </tr>
  5262. <tr>
  5263. <td>login</td>
  5264. <td>username,password</td>
  5265. <td>No</td>
  5266. </tr>
  5267. <tr>
  5268. <td>vsspath</td>
  5269. <td>SourceSafe path</td>
  5270. <td>Yes</td>
  5271. </tr>
  5272. <tr>
  5273. <td>localpath</td>
  5274. <td>Override the working directory and get to the specified path</td>
  5275. <td>No</td>
  5276. </tr>
  5277. <tr>
  5278. <td>writable</td>
  5279. <td>true or false</td>
  5280. <td>No</td>
  5281. </tr>
  5282. <tr>
  5283. <td>recursive</td>
  5284. <td>true or false</td>
  5285. <td>No</td>
  5286. </tr>
  5287. <tr>
  5288. <td>version</td>
  5289. <td>a version number to get</td>
  5290. <td>No</td>
  5291. </tr>
  5292. <tr>
  5293. <td>date</td>
  5294. <td>a date stamp to get at</td>
  5295. <td>No</td>
  5296. </tr>
  5297. <tr>
  5298. <td>label</td>
  5299. <td>a label to get for</td>
  5300. <td>No</td>
  5301. </tr>
  5302. <tr>
  5303. <td>ssdir</td>
  5304. <td>directory where <code>ss.exe</code> resides. By default the
  5305. task expects it to be in the PATH.</td>
  5306. <td>No</td>
  5307. </tr>
  5308. </table>
  5309. <p>Note that only one of version, date or label should be specified</p>
  5310. <h3>Examples</h3>
  5311. <blockquote>
  5312. <pre>
  5313. &lt;vssget localPath=&quot;C:\mysrc\myproject&quot;
  5314. recursive=&quot;true&quot;
  5315. label=&quot;Release1&quot;
  5316. login=&quot;me,mypassword&quot;
  5317. vsspath=&quot;/source/aProject&quot;
  5318. writable=&quot;true&quot;/&gt;
  5319. </pre>
  5320. </blockquote>
  5321. <p>Does a get on the VSS-Project <i>$/source/aproject</i> using the username
  5322. <i>me</i> and the password <i>mypassword</i>. It will recursively get the files
  5323. which are labeled <i>Release1</i> and write them to the local directory
  5324. <i>C:\mysrc\myproject</i>. The local files will be writable.</p>
  5325. <hr>
  5326. <h2><a name="buildevents">Build Events</a></h2>
  5327. Ant is capable of generating build events as it performs the tasks necessary to build a project.
  5328. Listeners can be attached to ant to receive these events. This capability could be used, for example,
  5329. to connect Ant to a GUI or to integrate Ant with an IDE.
  5330. <p>To use build events you need to create an ant <code>Project</code> object. You can then call the
  5331. <code>addBuildListener</code> method to add your listener to the project. Your listener must implement
  5332. the <code>org.apache.tools.antBuildListener</code> interface. The listener will receive BuildEvents
  5333. for the following events
  5334. <ul>
  5335. <li>Build started
  5336. <li>Build finished
  5337. <li>Target started
  5338. <li>Target finished
  5339. <li>Task started
  5340. <li>Task finished
  5341. <li>Message logged
  5342. </ul>
  5343. If you wish to attach a listener from the command line you may use the -listener option. For example
  5344. <blockquote>
  5345. <pre>ant -listener org.apache.tools.ant.XmlLogger</pre>
  5346. </blockquote>
  5347. will run ant with a listener which generates an XML representation of the build progress. This
  5348. listener is included with ant as is the default listener which generates the logging to standard
  5349. output.
  5350. <hr>
  5351. <h2><a name="writingowntask">Writing your own task</a></h2>
  5352. <p>It is very easy to write your own task:</p>
  5353. <ol>
  5354. <li>Create a Java class that extends <code>org.apache.tools.ant.Task</code>.</li>
  5355. <li>For each attribute, write a setter method. The setter method must be a
  5356. <code>public void</code> method that takes a single argument. The
  5357. name of the method must begin with &quot;set&quot;, followed by the
  5358. attribute name, with the first character in uppercase, and the rest in
  5359. lowercase. The type of the attribute can be <code>String</code>, any
  5360. primitive type (they are converted for you from their String-representation
  5361. in the build-file. If you specify a boolean your method will be passed the value
  5362. <i>true</i> if the value specified in the build-file is one of &quot;true&quot;,
  5363. &quot;yes&quot; or &quot;on&quot;), <code>Class</code>, <code>File</code>
  5364. (in which case the value of the attribute is interpreted relative to the
  5365. project's basedir) or any other type that has a constructor with a single
  5366. <code>String</code> argument</li>
  5367. <li>If your task has enumerated attributes, you should consider using
  5368. a subclass of org.apache.tools.ant.types.EnumeratedAttribute as argument
  5369. to your setter method. See org.apache.tools.ant.taskdefs.FixCRLF for
  5370. an example.</li>
  5371. <li>If the task should support character data, write a <code>public void
  5372. addText(String)</code> method.</li>
  5373. <li>For each nested element, write a create or add method. A create method
  5374. must be a <code>public</code> method that takes no arguments and returns
  5375. an Object type. The name of the create method must begin with
  5376. &quot;create&quot;, followed by the element name. An add method must be
  5377. a <code>public void</code> method that takes a single argument of an
  5378. Object type with a no argument constructor. The name of the add method
  5379. must begin with &quot;add&quot;, followed by the element name.
  5380. <li>Write a <code>public void execute</code> method, with no arguments, that
  5381. throws a <code>BuildException</code>. This method implements the task
  5382. itself.</li>
  5383. </ol>
  5384. <h3>The life cycle of a task</h3>
  5385. <ol>
  5386. <li>The task gets instantiated using a no-arg constructor at parser
  5387. time. This means even tasks that are never executed get
  5388. instantiated.</li>
  5389. <li>The tasks gets references to its project and location inside the
  5390. build file via their inherited <code>project</code> and
  5391. <code>location</code> variables.</li>
  5392. <li>If the user specified an id attribute to this task, the project
  5393. registers a reference to this newly created task - at parser
  5394. time.</li>
  5395. <li>The task gets a reference to the target it belongs to via its
  5396. inherited <code>target</code> variable.</li>
  5397. <li><code>init()</code> is called at parser time.</li>
  5398. <li>All child elements of the XML element corresponding to this task
  5399. are created via this task's <code>createXXX()</code> methods or
  5400. instantiated and added to this task via its <code>addXXX()</code>
  5401. methods - at parser time.</li>
  5402. <li>All attributes of this task get set via their corresponding
  5403. <code>setXXX</code> methods - at runtime.</li>
  5404. <li>The content character data sections inside the XML element
  5405. corresponding to this task is added to the task via its
  5406. <code>addText</code> method - at runtime.</li>
  5407. <li>All attributes of all child elements get set via their corresponding
  5408. <code>setXXX</code> methods - at runtime.</li>
  5409. <li><code>execute()</code> is called at runtime.</li>
  5410. </ol>
  5411. <h3>Example</h3>
  5412. <p>Let's write our own task, that prints a message on the System.out stream. The
  5413. task has one attribute called &quot;message&quot;.</p>
  5414. <blockquote>
  5415. <pre>package com.mydomain;
  5416. import org.apache.tools.ant.BuildException;
  5417. import org.apache.tools.ant.Task;
  5418. public class MyVeryOwnTask extends Task {
  5419. private String msg;
  5420. // The method executing the task
  5421. public void execute() throws BuildException {
  5422. System.out.println(msg);
  5423. }
  5424. // The setter for the &quot;message&quot; attribute
  5425. public void setMessage(String msg) {
  5426. this.msg = msg;
  5427. }
  5428. }</pre>
  5429. </blockquote>
  5430. <p>It's really this simple;-)</p>
  5431. <p>Adding your task to the system is rather simple too:</p>
  5432. <ol>
  5433. <li>Make sure the class that implements your task is in the classpath when
  5434. starting Ant.</li>
  5435. <li>Add a <i>taskdef</i> element to your project. This actually adds
  5436. your task to the system.</li>
  5437. <li>Use your task in the rest of the buildfile.</li>
  5438. </ol>
  5439. <h3>Example</h3>
  5440. <blockquote>
  5441. <pre>&lt;?xml version=&quot;1.0&quot;?&gt;
  5442. &lt;project name=&quot;OwnTaskExample&quot; default=&quot;main&quot; basedir=&quot;.&quot;&gt;
  5443. &lt;taskdef name=&quot;mytask&quot; classname=&quot;com.mydomain.MyVeryOwnTask&quot;/&gt;
  5444. &lt;target name=&quot;main&quot;&gt;
  5445. &lt;mytask message=&quot;Hello World! MyVeryOwnTask works!&quot; /&gt;
  5446. &lt;/target&gt;
  5447. &lt;/project&gt;
  5448. </pre>
  5449. </blockquote>
  5450. <p>Another way to add a task (more permanently), is to add the task name and
  5451. implementing class name to the <code>default.properties</code> file in the <code>org.apache.tools.ant.taskdefs</code>
  5452. package. Then you can use it as if it were a built in task.</p>
  5453. <hr>
  5454. <h2><a name="faq">FAQ, DTD, external resources</a></h2>
  5455. <p>There is an online FAQ for Ant at <a
  5456. href="http://jakarta.apache.org/jyve-faq/Turbine/screen/DisplayTopics/action/SetAll/project_id/2/faq_id/16">jakarta.apache.org</a>. This
  5457. FAQ is interactive, which means you can ask and answer questions
  5458. online.</p>
  5459. <p>One of the questions poping up quite often is &quot;Is there a DTD for
  5460. buildfiles?&quot;. Please refer to the FAQ for an answer.</p>
  5461. <hr>
  5462. <h2><a name="feedback">Feedback</a></h2>
  5463. <p>To provide feedback on this software, please subscribe to the Ant User
  5464. Mail List (<a href="mailto:ant-user-subscribe@jakarta.apache.org">ant-user-subscribe@jakarta.apache.org</a>)</p>
  5465. <p>If you want to contribute to Ant or stay current with the latest
  5466. development, join the Ant Development Mail List (<a
  5467. href="mailto:ant-dev-subscribe@jakarta.apache.org">ant-dev-subscribe@jakarta.apache.org</a>)</p>
  5468. <p>Archives of both lists can be found at <a
  5469. href="http://archive.covalent.net/">http://archive.covalent.net/</a>. Many
  5470. thanks to Covalent Technologies. Another archive can be found at <a
  5471. href="http://marc.theaimsgroup.com">http://marc.theaimsgroup.com</a>. If
  5472. you know of any additional archive sites, please report to the
  5473. lists.</p>
  5474. <hr>
  5475. <p align="center">Copyright &copy; 2000 Apache Software Foundation. All rights
  5476. Reserved.</p>
  5477. </body>
  5478. </html>