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

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