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

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