You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 219 kB

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