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

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