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

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