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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant</title>
  5. </head>
  6. <body>
  7. <h1>Ant User Manual</h1>
  8. <p>by</p>
  9. <!-- Names are in alphabetical order, on last name -->
  10. <ul>
  11. <li>Jacques Bergeron (<a href="mailto:jacques.bergeron@dogico.com">jacques.bergeron@dogico.com</a>)</li>
  12. <li>Stefan Bodewig (<a href="mailto:stefan.bodewig@megabit.net">stefan.bodewig@megabit.net</a>)</li>
  13. <li>Patrick Chanezon (<a href="mailto:chanezon@netscape.com">chanezon@netscape.com</a>)</li>
  14. <li>James Duncan Davison (<a href="mailto:duncan@x180.com">duncan@x180.com</a>)</li>
  15. <li>Tom Dimock (<a href="mailto:tad1@cornell.edu">tad1@cornell.edu</a>)</li>
  16. <li>Bill Kelly (<a href="mailto:bill.kelly@softwired-inc.com">bill.kelly@softwired-inc.com</a>)</li>
  17. <li>Arnout J. Kuiper (<a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>)</li>
  18. <li>Conor MacNeill (<a href="mailto:conor@cortexebusiness.com.au">conor@cortexebusiness.com.au</a>)</li>
  19. <li>Stefano Mazzocchi (<a href="mailto:stefano@apache.org">stefano@apache.org</a>)</li>
  20. <li>Sam Ruby (<a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>)</li>
  21. </ul>
  22. <p>Version 1.0.8.1 - 2000/06/28</p>
  23. <hr>
  24. <h2>Table of Contents</h2>
  25. <ul>
  26. <li><a href="#introduction">Introduction</a></li>
  27. <li><a href="#getting">Getting Ant</a></li>
  28. <li><a href="#sysrequirements">System Requirements</a></li>
  29. <li><a href="#buildingant">Building Ant</a></li>
  30. <li><a href="#installing">Installing Ant</a></li>
  31. <li><a href="#running">Running Ant</a></li>
  32. <li><a href="#buildfile">Writing a simple buildfile</a>
  33. <li><a href="#directorybasedtasks">Directory based tasks</a></li>
  34. <li><a href="#tasks">Built in Tasks</a>
  35. <li><a href="#optionaltasks">Optional Tasks</a>
  36. <li><a href="#buildevents">Build Events</a>
  37. <li><a href="#writingowntask">Writing your own task</a></li>
  38. <li><a href="#license">License</a></li>
  39. <li><a href="#feedback">Feedback</a></li>
  40. </ul>
  41. <hr>
  42. <h2><a name="introduction">Introduction</a></h2>
  43. <p>Ant is a Java based build tool. In theory it is kind of like make without
  44. make's wrinkles.</p>
  45. <h3>Why?</h3>
  46. <p>Why another build tool when there is already make, gnumake, nmake, jam, and
  47. others? Because all of those tools have limitations that its original author
  48. couldn't live with when developing software across multiple platforms. Make like
  49. tools are inherently shell based. They evaluate a set of dependencies and then
  50. execute commands not unlike what you would issue on a shell. This means that you
  51. can easily extend these tools by using or writing any program for the OS that
  52. you are working on. However, this also means that you limit yourself to the OS,
  53. or at least the OS type such as Unix, that you are working on.</p>
  54. <p>Makefiles are inherently evil as well. Anybody who has worked on them for any
  55. time has run into the dreaded tab problem. &quot;Is my command not executing
  56. because I have a space in front of my tab!!!&quot; said the original author of
  57. Ant way too many times. Tools like Jam took care of this to a great degree, but
  58. still use yet another format to use and remember.</p>
  59. <p>Ant is different. Instead a model where it is extended with shell based
  60. commands, it is extended using Java classes. Instead of writing shell commands,
  61. the configuration files are XML based calling out a target tree where various
  62. tasks get executed. Each task is run by an object which implements a particular
  63. Task interface.</p>
  64. <p>Granted, this removes some of the expressive power that is inherent by being
  65. able to construct a shell command such as `find . -name foo -exec rm {}` but it
  66. gives you the ability to be cross platform. To work anywhere and everywhere. And
  67. hey, if you really need to execute a shell command, Ant has an exec rule that
  68. allows different commands to be executed based on the OS that it is executing
  69. on.</p>
  70. <hr>
  71. <h2><a name="getting">Getting Ant</a></h2>
  72. <h3>Binary edition</h3>
  73. <p>The latest stable version of Ant can be downloaded from <a
  74. href="http://jakarta.apache.org/builds/tomcat/release/v3.0/ant.zip">http://jakarta.apache.org/builds/tomcat/release/v3.0/ant.zip</a>.
  75. If you like living on the edge, you can download the latest version from <a
  76. href="http://jakarta.apache.org/builds/tomcat/nightly/ant.zip">http://jakarta.apache.org/builds/tomcat/nightly/ant.zip</a>.</p>
  77. <h3>Source edition</h3>
  78. <p>If you prefer the source edition, you can download Ant from <a
  79. href="http://jakarta.apache.org/builds/tomcat/release/v3.0/src/jakarta-tools.src.zip">http://jakarta.apache.org/builds/tomcat/release/v3.0/src/jakarta-tools.src.zip</a>
  80. (latest stable) or from <a
  81. href="http://jakarta.apache.org/from-cvs/jakarta-tools/">http://jakarta.apache.org/from-cvs/jakarta-ant/</a>
  82. (current). See the section <a href="#buildingant">Building Ant</a> on how to
  83. build Ant from the source code.</p>
  84. <hr>
  85. <h2><a name="sysrequirements">System Requirements</a></h2>
  86. <p>
  87. To build and use ant you must have a JAXP compilant XML parser installed and available on your classpath.
  88. <p>
  89. If you do not have a JAXP compliant XML parse installed, you may use the reference implementation
  90. available from Sun. It is available from <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>.
  91. Once installed make sure the "jaxp.jar" and "parser.jar" files are in your classpath.
  92. <p>
  93. You will also need the JDK installed on your system, version 1.1 or later.
  94. <hr>
  95. <h2><a name="buildingant">Building Ant</a></h2>
  96. <p>Go to the directory <code>jakarta-ant</code>.</p>
  97. <p>Make sure the JDK is in you path.</p>
  98. <p>Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
  99. to build a bootstrap version of Ant.</p>
  100. <p>When finished, use</p>
  101. <blockquote>
  102. <p><code>build.bat -Dant.dist.dir=&lt;directory to install Ant&gt; dist</code></p>
  103. </blockquote>
  104. <p>for Windows, and</p>
  105. <blockquote>
  106. <p><code>build.sh -Dant.dist.dir=&lt;directory to install Ant&gt; dist</code></p>
  107. </blockquote>
  108. <p>for UNIX, to create a binary distribution of Ant. This distribution can be
  109. found in the directory you specified.</p>
  110. <hr>
  111. <h2><a name="installing">Installing Ant</a></h2>
  112. <p>The binary distribution of Ant consists of three directories: <code>bin</code>,
  113. <code>docs</code> and <code>lib</code>. Only the <code>bin</code> and <code>lib</code>
  114. directory are crucial for running Ant. To run Ant, the following must be done:</p>
  115. <ul>
  116. <li>Add the <code>bin</code> directory to your path.</li>
  117. <li>Set the ANT_HOME environment variable. This should be set to the directory
  118. which contains the <code>bin</code> and <code>lib</code> directory.</li>
  119. <li>Set the JAVA_HOME environment variable. This should be set to the
  120. directory where the JDK is installed.</li>
  121. </ul>
  122. <h3>Windows</h3>
  123. <p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the
  124. environment:</p>
  125. <pre>set ANT_HOME=c:\ant
  126. set JAVA_HOME=c:\jdk1.2.2
  127. set PATH=%PATH%;%ANT_HOME%\bin</pre>
  128. <h3>Unix (bash)</h3>
  129. <p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up
  130. the environment:</p>
  131. <pre>export ANT_HOME=/usr/local/ant
  132. export JAVA_HOME=/usr/local/jdk-1.2.2
  133. export PATH=${PATH}:${ANT_HOME}/bin</pre>
  134. <h3>Advanced</h3>
  135. <p>There are lots of variants that can be used to run Ant. What you need is at
  136. least the following:</p>
  137. <p>The classpath for Ant must contain <code>ant.jar</code> and any jars/classes
  138. needed for your chosen JAXP compliant XML parser.</p>
  139. <p>When you need JDK functionality (like a <a href="#javac">javac</a> task, or a
  140. <a href="#rmic">rmic</a> task), then for JDK 1.1, the <code>classes.zip</code>
  141. file of the JDK must be added to the classpath; for JDK 1.2, <code>tools.jar</code>
  142. must be added. The scripts supplied with ant, in the bin directory, will add
  143. <code>tools.jar</code> automatically if the JAVA_HOME environment variable is set.</p>
  144. <p>When you are executing platform specific applications (like the <a
  145. href="#exec">exec</a> task, or the <a href="#cvs">cvs</a> task), the property <code>ant.home</code>
  146. must be set to the directory containing a bin directory, which contains the <code>antRun</code> shell script necessary to run execs on Unix.</p>
  147. <hr>
  148. <h2><a name="running">Running Ant</a></h2>
  149. <p>Running Ant is simple, when you installed it as described in the previous
  150. section. Just type <code>ant</code>.</p>
  151. <p>When nothing is specified, Ant looks for a <code>build.xml</code> file in the
  152. current directory. When found, it uses that file as a buildfile. To make Ant use
  153. another buildfile, use the commandline option <i>-buildfile &lt;file&gt;</i>,
  154. where <i>&lt;file&gt;</i> is the buildfile you want to use.</p>
  155. <p>You can also set properties which override properties specified in the
  156. buildfile (see the <a href="#property">property task</a>).
  157. This can be done with the <i>-D&lt;property&gt;=&lt;value&gt;</i>
  158. option, where <i>&lt;property&gt;</i> is the name of the property and <i>&lt;value&gt;</i>
  159. the value.</p>
  160. <p>To more options are <i>-quiet</i> which instructs Ant to print less
  161. information on the console when running. The option <i>-verbose</i> on the other
  162. hand makes Ant print more information on the console.</p>
  163. <p>It is also possible to specify the target that should be executed. Default
  164. the target that is mentioned in the <i>default</i> attribute of the project is
  165. used. This can be overridden by adding the target name to the end of the
  166. commandline.</p>
  167. <p>Commandline option summary:</p>
  168. <pre>ant [options] [target]
  169. Options:
  170. -help print this message
  171. -version print the version information and exit
  172. -quiet be extra quiet
  173. -verbose be extra verbose
  174. -logfile &lt;file&gt; use given file for log
  175. -listener &lt;classname&gt; add an instance of class as a project listener
  176. -buildfile &lt;file&gt; use given buildfile
  177. -D&lt;property&gt;=&lt;value&gt; use value for given property</pre>
  178. <h3>Examples</h3>
  179. <blockquote>
  180. <pre>ant</pre>
  181. </blockquote>
  182. <p>runs Ant using the <code>build.xml</code> file in the current directory, on
  183. the default target.</p>
  184. <blockquote>
  185. <pre>ant -buildfile test.xml</pre>
  186. </blockquote>
  187. <p>runs Ant using the <code>test.xml</code> file in the current directory, on
  188. the default target.</p>
  189. <blockquote>
  190. <pre>ant -buildfile test.xml dist</pre>
  191. </blockquote>
  192. <p>runs Ant using the <code>test.xml</code> file in the current directory, on a
  193. target called <code>dist</code>.</p>
  194. <blockquote>
  195. <pre>ant -buildfile test.xml -Dbuild=build/classes dist</pre>
  196. </blockquote>
  197. <p>runs Ant using the <code>test.xml</code> file in the current directory, on a
  198. target called <code>dist</code>. It also sets the <i>build</i> property to the
  199. value <i>build/classes</i>.</p>
  200. <h3>Running Ant by hand</h3>
  201. <p>When you have installed Ant in the do-it-yourself way, Ant can be started
  202. with:</p>
  203. <blockquote>
  204. <pre>java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]</pre>
  205. </blockquote>
  206. <p>These instructions actually do exactly the same as the <code>ant</code>
  207. command. The options and target are the same as when running Ant with the <code>ant</code>
  208. command. This example assumes you have set up your classpath to include
  209. <ul>
  210. <li>ant.jar
  211. <li>jars/classes for your XML parser
  212. <li>the JDK's tools.jar
  213. </ul>
  214. <hr>
  215. <h2><a name="buildfile">Writing a simple buildfile</a></h2>
  216. <p>The buildfile is written in XML. Each buildfile contains one project.</p>
  217. <h3>Projects</h3>
  218. <p>A project has three attributes:</p>
  219. <table border="1" cellpadding="2" cellspacing="0">
  220. <tr>
  221. <td valign="top"><b>Attribute</b></td>
  222. <td valign="top"><b>Description</b></td>
  223. <td align="center" valign="top"><b>Required</b></td>
  224. </tr>
  225. <tr>
  226. <td valign="top">name</td>
  227. <td valign="top">the name of the project.</td>
  228. <td align="center" valign="top">Yes</td>
  229. </tr>
  230. <tr>
  231. <td valign="top">default</td>
  232. <td valign="top">the default target to use when no target is supplied.</td>
  233. <td align="center" valign="top">Yes</td>
  234. </tr>
  235. <tr>
  236. <td valign="top">basedir</td>
  237. <td valign="top">the base directory from which all path calculations are
  238. done. This attribute might be overridden by setting the &quot;basedir&quot;
  239. property on forehand. When this is done, it might be ommitted in the
  240. project tag.</td>
  241. <td align="center" valign="top">Yes</td>
  242. </tr>
  243. </table>
  244. <p>Each project defines one or more targets. A target is a set of tasks you want
  245. to be executed. When starting Ant, you can select which target you want to have
  246. executed. When no target is given, the project's default is used.</p>
  247. <h3>Targets</h3>
  248. <p>A target can depend on other targets. You might have a target for compiling,
  249. for instance, and a target for creating a distributable. You can only build a
  250. distributable when you have compiled first, so the distribute target depends on
  251. the compile target. Ant resolves all these dependencies.</p>
  252. <p>Ant tries to execute the targets in the <i>depends</i> attribute in the order
  253. they appear (from left to right). Keep in mind that it is possible that a target
  254. can get executed earlier when an earlier target depends on it:</p>
  255. <blockquote>
  256. <pre>&lt;target name=&quot;A&quot;/&gt;
  257. &lt;target name=&quot;B&quot; depends=&quot;A&quot;/&gt;
  258. &lt;target name=&quot;C&quot; depends=&quot;B&quot;/&gt;
  259. &lt;target name=&quot;D&quot; depends=&quot;C,B,A&quot;/&gt;</pre>
  260. </blockquote>
  261. <p>Suppose we want to execute target D. From its <i>depends</i> attribute, you
  262. might think that first target C, then B and then A is executed. Wrong! C depends
  263. on B, and B depends on A, so first A is executed, then B, then C, and finally D.</p>
  264. <p>A target gets executed only once. Even when more targets depend on it (see
  265. the previous example).</p>
  266. <p>A target has also the ability to perform its execution if a property has been
  267. set. This allows, for example, better control on the building process depending
  268. on the state of the system (java version, OS, command line properties, etc...).
  269. To make target <i>sense</i> this property you should add the <i>if</i> attribute
  270. with the name of the property that the target should react to, for example</p>
  271. <blockquote>
  272. <pre>&lt;target name=&quot;build-module-A&quot; if=&quot;module-A-present&quot;/&gt;</pre>
  273. </blockquote>
  274. <p>If no <i>if</i> attribute is present, the target will always be executed.</p>
  275. <p>It is a good practice to place your <a href="#property">property</a> and <a
  276. href="#tstamp">tstamp</a> tasks in a so called initialization target, on which
  277. all other targets depend. Make sure that that target is always the first one in
  278. the depends list of the other targets. In this manual, most initialization targets
  279. have the name "init".</p>
  280. <p>A target has the following attributes:</p>
  281. <table border="1" cellpadding="2" cellspacing="0">
  282. <tr>
  283. <td valign="top"><b>Attribute</b></td>
  284. <td valign="top"><b>Description</b></td>
  285. <td align="center" valign="top"><b>Required</b></td>
  286. </tr>
  287. <tr>
  288. <td valign="top">name</td>
  289. <td valign="top">the name of the project.</td>
  290. <td align="center" valign="top">Yes</td>
  291. </tr>
  292. <tr>
  293. <td valign="top">depends</td>
  294. <td valign="top">a comma separated list of names of targets on which this
  295. target depends.</td>
  296. <td align="center" valign="top">No</td>
  297. </tr>
  298. <tr>
  299. <td valign="top">if</td>
  300. <td valign="top">the name of the property that must be set in order for this
  301. target to execute.</td>
  302. <td align="center" valign="top">No</td>
  303. </tr>
  304. </table>
  305. <h3>Tasks</h3>
  306. <p>A task is a piece of code that can be executed.</p>
  307. <p>A task can have multiple attributes (or arguments if you prefer). The value
  308. of an attribute might contain references to a property. These references will be
  309. resolved before the task is executed.</p>
  310. <p>Tasks have a common structure:</p>
  311. <blockquote>
  312. <pre>&lt;name attribute1=&quot;value1&quot; attribute2=&quot;value2&quot; ... /&gt;</pre>
  313. </blockquote>
  314. <p>where name is the name of the task, attribute-x the attribute name, and
  315. value-x the value of this attribute.</p>
  316. <p>There is a set of <a href="#tasks">built in tasks</a>, but it is also very
  317. easy to <a href="#writingowntask">write your own</a>.</p>
  318. <h3>Properties</h3>
  319. <p>A project can have a set of properties. These might be set in the buildfile
  320. by the <a href="#property">property task</a>, or might be set outside Ant. A
  321. property has a name and a value. Properties might be used in in the value of
  322. task attributes. This is done by placing the property name between
  323. &quot;${&quot; and &quot;}&quot; in the attribute value.</p>
  324. <p>If there is a property called &quot;builddir&quot; with the value
  325. &quot;build&quot;, then this could be used in an attribute like this: &quot;${builddir}/classes&quot;.
  326. This is resolved as &quot;build/classes&quot;.</p>
  327. <h3>Token Filters</h3>
  328. <p>A project can have a set of tokens that might be automatically expanded if
  329. found when a file is copied, when the filtering-copy behavior is selected in the
  330. tasks that support this. These might be set in the buildfile
  331. by the <a href="#filter">filter task</a>.&nbsp;</p>
  332. <p>Since this can be a very harmful behavior, the tokens in the files <b>must</b>
  333. be of the form<i> @token@</i> where <i>token</i> is the token name that is set
  334. in the filter task. This token syntax matches the syntax of other build systems
  335. that perform such filtering and remains sufficiently orthogonal to most
  336. programming and scripting languages, as well with documentation systems.</p>
  337. <p>Note: in case a token with the format @token@ if found in a file but no
  338. filter is associated with that token, no changes take place. So, no escaping
  339. method is present, but as long as you choose appropriate names for your tokens,
  340. this should not cause problems.</p>
  341. <h3>Examples</h3>
  342. <blockquote>
  343. <pre>&lt;project name=&quot;foo&quot; default=&quot;dist&quot; basedir=&quot;.&quot;&gt;
  344. &lt;target name=&quot;init&quot;&gt;
  345. &lt;tstamp/&gt;
  346. &lt;property name=&quot;build&quot; value=&quot;build&quot; /&gt;
  347. &lt;property name=&quot;dist&quot; value=&quot;dist&quot; /&gt;
  348. &lt;filter token=&quot;version&quot; value=&quot;1.0.3&quot; /&gt;
  349. &lt;filter token=&quot;year&quot; value=&quot;2000&quot; /&gt;
  350. &lt;/target&gt;
  351. &lt;target name=&quot;prepare&quot; depends=&quot;init&quot;&gt;
  352. &lt;mkdir dir=&quot;${build}&quot; /&gt;
  353. &lt;/target&gt;
  354. &lt;target name=&quot;compile&quot; depends=&quot;prepare&quot;&gt;
  355. &lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot; filtering=&quot;on&quot;/&gt;
  356. &lt;/target&gt;
  357. &lt;target name=&quot;dist&quot; depends=&quot;compile&quot;&gt;
  358. &lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;
  359. &lt;jar jarfile=&quot;${dist}/lib/foo${DSTAMP}.jar&quot;
  360. basedir=&quot;${build}&quot; items=&quot;com&quot;/&gt;
  361. &lt;/target&gt;
  362. &lt;target name=&quot;clean&quot; depends=&quot;init&quot;&gt;
  363. &lt;deltree dir=&quot;${build}&quot; /&gt;
  364. &lt;deltree dir=&quot;${dist}&quot; /&gt;
  365. &lt;/target&gt;
  366. &lt;/project&gt;
  367. </pre>
  368. </blockquote>
  369. <hr>
  370. <h2><a name="directorybasedtasks">Directory based tasks</a></h2>
  371. <p>Some tasks use directory trees for the task they perform. For instance, the <a
  372. href="#javac">Javac task</a> which works upon a directory tree with .java files.
  373. Sometimes it can be very useful to work on a subset of that directory tree. This
  374. section describes how you can select a subset of such a directory tree.</p>
  375. <p>Ant gives you two ways to create a subset, both of which can be used at the same
  376. time:</p>
  377. <ul>
  378. <li>Only include files/directories that match at least one pattern of a set of
  379. patterns</li>
  380. <li>Exclude files/directories that match at least one pattern a set of
  381. patterns</li>
  382. </ul>
  383. <p>When both inclusion and exclusion are used, only files/directories that match
  384. the include patterns, and don't match the exclude patterns are used.</p>
  385. <p>Patterns can be specified inside the buildfile via task attributes or
  386. nested elements and via external files. Each line of the external file
  387. is taken as pattern that is added to the list of include or exclude
  388. patterns.</p>
  389. <h3>Patterns</h3>
  390. <p>As described earlier, patterns are used for the inclusion and exclusion.
  391. These patterns look very much like the patterns used in DOS and UNIX:</p>
  392. <p>'*' matches zero or more characters, '?' matches one character.</p>
  393. <p>Examples:</p>
  394. <p>'*.java' matches '.java', 'x.java' and 'FooBar.java', but not 'FooBar.xml'
  395. (does not end with '.java').</p>
  396. <p>'?.java' matches 'x.java', 'A.java', but not '.java' or 'xyz.java' (both
  397. don't have one character before '.java').</p>
  398. <p>Combinations of '*'s and '?'s are allowed.</p>
  399. <p>Matching is done per-directory. This means that first the first directory in
  400. the pattern is matched against the first directory in the path to match. Then
  401. the second directories are matched, and so on. E.g. when we have the pattern '/?abc/*/*.java'
  402. and the path '/xabc/foobar/test.java', then first '?abc' is matched with 'xabc',
  403. then '*' is matched with 'foobar' and finally '*.java' is matched with 'test.java'.
  404. They all match so the path matches the pattern.</p>
  405. <p>Too make things a bit more flexible, we add one extra feature, which makes it
  406. possible to match multiple directory levels. This can be used to match a
  407. complete directory tree, or a file anywhere in the directory tree. To do this, '**'
  408. must be used as the name of a directory. When '**' is used as the name of a
  409. directory in the pattern, it matches zero or more directories. For instance:
  410. '/test/**' matches all files/directories under '/test/', such as '/test/x.java',
  411. or '/test/foo/bar/xyz.html', but not '/xyz.xml'.</p>
  412. <p>There is one &quot;shorthand&quot;, if a pattern ends with '/' or '\', then '**'
  413. is appended. E.g. &quot;mypackage/test/&quot; is interpreted as were it &quot;mypackage/test/**&quot;.</p>
  414. <p>Examples:</p>
  415. <table border="1" cellpadding="2" cellspacing="0">
  416. <tr>
  417. <td valign="top">**/CVS/*</td>
  418. <td valign="top">Matches all files in CVS directories, that can be located
  419. anywhere in the directory tree.
  420. <p>Matches:</p>
  421. <p>CVS/Repository<br>
  422. org/apache/CVS/Entries<br>
  423. org/apache/jakarta/tools/ant/CVS/Entries</p>
  424. <p>But not:</p>
  425. <p>org/apache/CVS/foo/bar/Entries ('foo/bar/' part does not match)</td>
  426. </tr>
  427. <tr>
  428. <td valign="top">org/apache/jakarta/**</td>
  429. <td valign="top">Matches all files in the org/apache/jakarta directory tree.
  430. <p>Matches:</p>
  431. <p>org/apache/jakarta/tools/ant/docs/index.html<br>
  432. org/apache/jakarta/test.xml</p>
  433. <p>But not:</p>
  434. <p>org/apache/xyz.java ('jakarta'/' part is missing)</td>
  435. </tr>
  436. <tr>
  437. <td valign="top">org/apache/**/CVS/*</td>
  438. <td valign="top">Matches all files in CVS directories, that are located
  439. anywhere in the directory tree under org/apache.
  440. <p>Matches:</p>
  441. <p>org/apache/CVS/Entries<br>
  442. org/apache/jakarta/tools/ant/CVS/Entries</p>
  443. <p>But not:</p>
  444. <p>org/apache/CVS/foo/bar/Entries ('foo/bar/' part does not match)</td>
  445. </tr>
  446. <tr>
  447. <td valign="top">**/test/**</td>
  448. <td valign="top">Matches all files which have a directory 'test' in their
  449. path, including 'test' as a filename.</td>
  450. </tr>
  451. </table>
  452. <p>When these patterns are used in inclusion and exclusion, you have a powerful
  453. way to select just the files you want.</p>
  454. <h3>Examples</h3>
  455. <pre> &lt;copydir src=&quot;${src}&quot;
  456. dest=&quot;${dist}&quot;
  457. includes=&quot;**/images/*&quot;
  458. excludes=&quot;**/*.gif&quot; /&gt;</pre>
  459. <p>This copies all files in directories called &quot;images&quot;, that are
  460. located in the directory tree &quot;${src}&quot; to the destination &quot;${dist}&quot;,
  461. but excludes all &quot;*.gif&quot; files from the copy.</p>
  462. <p> This example can also be expressed using nested elements as
  463. <pre> &lt;copydir src=&quot;${src}&quot;
  464. dest=&quot;${dist}&quot;&gt;
  465. &lt;include name=&quot;**/images/*&quot;/&gt;
  466. &lt;exclude name=&quot;**/*.gif&quot; /&gt;
  467. &lt;/copydir&gt;
  468. </pre>
  469. <h3>Default Excludes</h3>
  470. <p>There are a set of definitions which are excluded by default from all directory based tasks.
  471. They are:
  472. <pre> &quot;**/*~&quot;,
  473. &quot;**/#*#&quot;,
  474. &quot;**/%*%&quot;,
  475. &quot;**/CVS&quot;,
  476. &quot;**/CVS/*&quot;,
  477. &quot;**/.cvsignore&quot;
  478. </pre>
  479. If you do not want these default excludes applied, you may disable them with the
  480. <code>defaultexcludes=&quot;no&quot;</code> attribute.</p>
  481. <hr>
  482. <h2><a name="tasks">Built in tasks</a></h2>
  483. <ul>
  484. <li><a href="#ant">Ant</a></li>
  485. <li><a href="#available">Available</a></li>
  486. <li><a href="#chmod">Chmod</a></li>
  487. <li><a href="#copydir">Copydir</a></li>
  488. <li><a href="#copyfile">Copyfile</a></li>
  489. <li><a href="#cvs">Cvs</a></li>
  490. <li><a href="#delete">Delete</a></li>
  491. <li><a href="#deltree">Deltree</a></li>
  492. <li><a href="#echo">Echo</a></li>
  493. <li><a href="#exec">Exec</a></li>
  494. <li><a href="#expand">Expand</a></li>
  495. <li><a href="#filter">Filter</a></li>
  496. <li><a href="#fixcrlf">FixCRLF</a></li>
  497. <li><a href="#get">Get</a></li>
  498. <li><a href="#gunzip">GUnzip</a></li>
  499. <li><a href="#gzip">GZip</a></li>
  500. <li><a href="#jar">Jar</a></li>
  501. <li><a href="#java">Java</a></li>
  502. <li><a href="#javac">Javac</a></li>
  503. <li><a href="#javadoc">Javadoc/Javadoc2</a></li>
  504. <li><a href="#keysubst">KeySubst</a></li>
  505. <li><a href="#mkdir">Mkdir</a></li>
  506. <li><a href="#patch">Patch</a></li>
  507. <li><a href="#property">Property</a></li>
  508. <li><a href="#rename">Rename</a></li>
  509. <li><a href="#replace">Replace</a></li>
  510. <li><a href="#rmic">Rmic</a></li>
  511. <li><a href="#tar">Tar</a></li>
  512. <li><a href="#taskdef">Taskdef</a></li>
  513. <li><a href="#touch">Touch</a></li>
  514. <li><a href="#tstamp">Tstamp</a></li>
  515. <li><a href="#style">Style</a></li>
  516. <li><a href="#untar">Untar</a></li>
  517. <li><a href="#zip">Zip</a></li>
  518. </ul>
  519. <hr>
  520. <h2><a name="ant">Ant</a></h2>
  521. <h3><b>Description:</b></h3>
  522. <p>Runs Ant on a supplied buildfile. This can be used to build subprojects.</p>
  523. <p>When the <i>antfile</i> attribute is omitted, the file &quot;build.xml&quot;
  524. in the supplied directory (<i>dir</i> attribute) is used.</p>
  525. <p>If no target attribute is supplied, the default target of the new project is
  526. used.</p>
  527. <p>The properties of the current project will be available in the new project.
  528. These properties will override the properties that are set in the new project.
  529. (See also the <a href="#property">properties task</a>).</p>
  530. <h3>Parameters:</h3>
  531. <table border="1" cellpadding="2" cellspacing="0">
  532. <tr>
  533. <td valign="top"><b>Attribute</b></td>
  534. <td valign="top"><b>Description</b></td>
  535. <td align="center" valign="top"><b>Required</b></td>
  536. </tr>
  537. <tr>
  538. <td valign="top">antfile</td>
  539. <td valign="top">the buildfile to use.</td>
  540. <td valign="top" align="center">No</td>
  541. </tr>
  542. <tr>
  543. <td valign="top">dir</td>
  544. <td valign="top">the directory to use as a basedir for the new Ant project.</td>
  545. <td valign="top" align="center">Yes</td>
  546. </tr>
  547. <tr>
  548. <td valign="top">target</td>
  549. <td valign="top">the target of the new Ant project that should be executed.</td>
  550. <td valign="top" align="center">No</td>
  551. </tr>
  552. <tr>
  553. <td valign="top">output</td>
  554. <td valign="top">Filename to write the ant output to.
  555. </td>
  556. <td align="center" valign="top">No</td>
  557. </tr>
  558. </table>
  559. <h3>Examples</h3>
  560. <blockquote>
  561. <p><code>&lt;ant antfile=&quot;subproject/subbuild.xml&quot; dir=&quot;subproject&quot;
  562. target=&quot;compile&quot; /&gt;</code></p>
  563. <p><code>&lt;ant dir=&quot;subproject&quot; /&gt;</code></p>
  564. </blockquote>
  565. <hr>
  566. <h2><a name="available">Available</a></h2>
  567. <h3>Description</h3>
  568. <p>Sets a property if a resource is available at runtime. This resource can be a
  569. file resource, a class in classpath or a JVM system resource.</p>
  570. <p>The value part of the properties being set is <i>true</i> if the resource is
  571. present, otherwise, the property is not set.</p>
  572. <p>Normally, this task is used to set properties that are useful to avoid target
  573. execution depending on system parameters.</p>
  574. <h3>Parameters</h3>
  575. <table border="1" cellpadding="2" cellspacing="0">
  576. <tr>
  577. <td valign="top"><b>Attribute</b></td>
  578. <td valign="top"><b>Description</b></td>
  579. <td align="center" valign="top"><b>Required</b></td>
  580. </tr>
  581. <tr>
  582. <td valign="top">property</td>
  583. <td valign="top">the name of the property to set.</td>
  584. <td valign="top" align="center">Yes</td>
  585. </tr>
  586. <tr>
  587. <td valign="top">classname</td>
  588. <td valign="top">the class to look for in classpath.</td>
  589. <td valign="middle" align="center" rowspan="3">Yes</td>
  590. </tr>
  591. <tr>
  592. <td valign="top">resource</td>
  593. <td valign="top">the resource to look for in the JVM</td>
  594. </tr>
  595. <tr>
  596. <td valign="top">file</td>
  597. <td valign="top">the file to look for.</td>
  598. </tr>
  599. </table>
  600. <h3>Examples</h3>
  601. <pre> &lt;available classname=&quot;org.whatever.Myclass&quot; property=&quot;Myclass.present&quot; /&gt;</pre>
  602. <p>sets the property <code><i>Myclass.present</i></code> to the value &quot;true&quot;
  603. if the <i>org.whatever.Myclass</i> is found in Ant's classpath.</p>
  604. <hr>
  605. <h2><a name="chmod">Chmod</a></h2>
  606. <h3>Description</h3>
  607. <p>Changes the permissions of a file. Right now it has efect only under Unix.
  608. The permissions are also UNIX style, like the argument for the chmod command.</p>
  609. <h3>Parameters</h3>
  610. <table border="1" cellpadding="2" cellspacing="0">
  611. <tr>
  612. <td valign="top"><b>Attribute</b></td>
  613. <td valign="top"><b>Description</b></td>
  614. <td align="center" valign="top"><b>Required</b></td>
  615. </tr>
  616. <tr>
  617. <td valign="top">src</td>
  618. <td valign="top">the file of which the permissions must be changed.</td>
  619. <td valign="top" align="center">Yes</td>
  620. </tr>
  621. <tr>
  622. <td valign="top">perm</td>
  623. <td valign="top">the new permissions.</td>
  624. <td valign="top" align="center">Yes</td>
  625. </tr>
  626. </table>
  627. <h3>Examples</h3>
  628. <blockquote>
  629. <p><code>&lt;chmod src=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;
  630. /&gt;</code></p>
  631. </blockquote>
  632. <p>makes the &quot;start.sh&quot; file readable and executable for anyone on a
  633. UNIX system.</p>
  634. <hr>
  635. <h2><a name="copydir">Copydir</a></h2>
  636. <h3>Description</h3>
  637. <p>Copies a directory tree from the source to the destination.</p>
  638. <p>It is possible to refine the set of files that are being copied. This can be
  639. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  640. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  641. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  642. the files you want to have excluded. This is also done with patterns. And
  643. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  644. want to use default exclusions or not. See the section on <a
  645. href="#directorybasedtasks">directory based tasks</a>, on how the
  646. inclusion/exclusion of files works, and how to write patterns. The patterns are
  647. relative to the <i>src</i> directory.</p>
  648. <p>The <i>ignore</i> attribute contains the names of the files/directories that
  649. must be excluded from the copy. The names specified in the <i>ignore</i>
  650. attribute are just names, they do not contain any path information! Note that
  651. this attribute has been replaced by the <i>excludes</i> attribute.</p>
  652. <h3>Parameters</h3>
  653. <table border="1" cellpadding="2" cellspacing="0">
  654. <tr>
  655. <td valign="top"><b>Attribute</b></td>
  656. <td valign="top"><b>Description</b></td>
  657. <td align="center" valign="top"><b>Required</b></td>
  658. </tr>
  659. <tr>
  660. <td valign="top">src</td>
  661. <td valign="top">the directory to copy.</td>
  662. <td valign="top" align="center">Yes</td>
  663. </tr>
  664. <tr>
  665. <td valign="top">dest</td>
  666. <td valign="top">the directory to copy to.</td>
  667. <td valign="top" align="center">Yes</td>
  668. </tr>
  669. <tr>
  670. <td valign="top">ignore</td>
  671. <td valign="top">comma separated list of filenames/directorynames to ignore.
  672. No files (except default excludes) are excluded when omitted. (<b>deprecated</b>,
  673. use <i>excludes</i> instead).</td>
  674. <td valign="top" align="center">No</td>
  675. </tr>
  676. <tr>
  677. <td valign="top">includes</td>
  678. <td valign="top">comma separated list of patterns of files that must be
  679. included. All files are included when omitted.</td>
  680. <td valign="top" align="center">No</td>
  681. </tr>
  682. <tr>
  683. <td valign="top">includesfile</td>
  684. <td valign="top">the name of a file. Each line of this file is
  685. taken to be an include pattern</td>
  686. <td valign="top" align="center">No</td>
  687. </tr>
  688. <tr>
  689. <td valign="top">excludes</td>
  690. <td valign="top">comma separated list of patterns of files that must be
  691. excluded. No files (except default excludes) are excluded when omitted.</td>
  692. <td valign="top" align="center">No</td>
  693. </tr>
  694. <tr>
  695. <td valign="top">excludesfile</td>
  696. <td valign="top">the name of a file. Each line of this file is
  697. taken to be an exclude pattern</td>
  698. <td valign="top" align="center">No</td>
  699. </tr>
  700. <tr>
  701. <td valign="top">defaultexcludes</td>
  702. <td valign="top">indicates whether default excludes should be used or not
  703. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  704. <td valign="top" align="center">No</td>
  705. </tr>
  706. <tr>
  707. <td valign="top">filtering</td>
  708. <td valign="top">indicates whether token filtering should take place during
  709. the copy</td>
  710. <td valign="top" align="center">No</td>
  711. </tr>
  712. <tr>
  713. <td valign="top">forceoverwrite</td>
  714. <td valign="top">overwrite existing files even if the destination
  715. files are newer (default is false).</td>
  716. <td valign="top" align="center">No</td>
  717. </tr>
  718. </table>
  719. <h3>Examples</h3>
  720. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  721. dest=&quot;${dist}&quot;
  722. /&gt;</pre>
  723. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>.</p>
  724. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  725. dest=&quot;${dist}&quot;
  726. includes=&quot;**/*.java&quot;
  727. excludes=&quot;**/Test.java&quot;
  728. /&gt;</pre>
  729. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  730. recursively. All java files are copied, except for files with the name <code>Test.java</code>.</p>
  731. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  732. dest=&quot;${dist}&quot;
  733. includes=&quot;**/*.java&quot;
  734. excludes=&quot;mypackage/test/**&quot; /&gt;</pre>
  735. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  736. recursively. All java files are copied, except for the files under the <code>mypackage/test</code>
  737. directory.</p>
  738. <hr>
  739. <h2><a name="copyfile">Copyfile</a></h2>
  740. <h3>Description</h3>
  741. <p>Copies a file from the source to the destination. The file is only copied if
  742. the source file is newer than the destination file, or when the destination file
  743. does not exist.</p>
  744. <h3>Parameters</h3>
  745. <table border="1" cellpadding="2" cellspacing="0">
  746. <tr>
  747. <td valign="top"><b>Attribute</b></td>
  748. <td valign="top"><b>Description</b></td>
  749. <td align="center" valign="top"><b>Required</b></td>
  750. </tr>
  751. <tr>
  752. <td valign="top">src</td>
  753. <td valign="top">the filename of the file to copy.</td>
  754. <td valign="top" align="center">Yes</td>
  755. </tr>
  756. <tr>
  757. <td valign="top">dest</td>
  758. <td valign="top">the filename of the file where to copy to.</td>
  759. <td valign="top" align="center">Yes</td>
  760. </tr>
  761. <tr>
  762. <td valign="top">filtering</td>
  763. <td valign="top">indicates whether token filtering should take place during
  764. the copy</td>
  765. <td valign="top" align="center">No</td>
  766. </tr>
  767. </table>
  768. <h3>Examples</h3>
  769. <blockquote>
  770. <p><code>&lt;copyfile src=&quot;test.java&quot; dest=&quot;subdir/test.java&quot;
  771. /&gt;</code></p>
  772. <p><code>&lt;copyfile src=&quot;${src}/index.html&quot; dest=&quot;${dist}/help/index.html&quot;
  773. /&gt;</code></p>
  774. </blockquote>
  775. <hr>
  776. <h2><a name="cvs">Cvs</a></h2>
  777. <h3>Description</h3>
  778. <p>Handles packages/modules retrieved from a
  779. <a href="http://www.cyclic.com/">CVS</a> repository.</p>
  780. <p>When doing automated builds, the <a href="#get">get task</a> should be
  781. preferred over the <i>checkout</i> command, because of speed.</p>
  782. <h3>Parameters</h3>
  783. <table border="1" cellpadding="2" cellspacing="0">
  784. <tr>
  785. <td valign="top"><b>Attribute</b></td>
  786. <td valign="top"><b>Description</b></td>
  787. <td align="center" valign="top"><b>Required</b></td>
  788. </tr>
  789. <tr>
  790. <td valign="top">command</td>
  791. <td valign="top">the CVS command to execute.</td>
  792. <td align="center" valign="top">No, default &quot;checkout&quot;</td>
  793. </tr>
  794. <tr>
  795. <td valign="top">cvsRoot</td>
  796. <td valign="top">the CVSROOT variable.</td>
  797. <td align="center" valign="top">No</td>
  798. </tr>
  799. <tr>
  800. <td valign="top">dest</td>
  801. <td valign="top">the directory where the checked out files should be placed.</td>
  802. <td align="center" valign="top">Yes</td>
  803. </tr>
  804. <tr>
  805. <td valign="top">package</td>
  806. <td valign="top">the package/module to check out.</td>
  807. <td align="center" valign="top">No</td>
  808. </tr>
  809. <tr>
  810. <td valign="top">tag</td>
  811. <td valign="top">the tag of the package/module to check out.</td>
  812. <td align="center" valign="top">No</td>
  813. </tr>
  814. <tr>
  815. <td valign="top">date</td>
  816. <td valign="top">Use the most recent revision no later than the given date</td>
  817. <td align="center" valign="top">No</td>
  818. </tr>
  819. <tr>
  820. <td valign="top">quiet</td>
  821. <td valign="top">supress informational messages.</td>
  822. <td align="center" valign="top">No, default &quot;false&quot;</td>
  823. </tr>
  824. <tr>
  825. <td valign="top">noexec</td>
  826. <td valign="top">report only, don't change any files.</td>
  827. <td align="center" valign="top">No, default &quot;false&quot;</td>
  828. </tr>
  829. </table>
  830. <h3>Examples</h3>
  831. <pre> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@jakarta.apache.org:/home/cvspublic&quot;
  832. package=&quot;jakarta-tools&quot;
  833. dest=&quot;${ws.dir}&quot;
  834. /&gt;</pre>
  835. <p>checks out the package/module &quot;jakarta-tools&quot; from the CVS
  836. repository pointed to by the cvsRoot attribute, and stores the files in &quot;${ws.dir}&quot;.</p>
  837. <pre> &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot; /&gt;</pre>
  838. <p>updates the package/module that has previously been checked out into
  839. &quot;${ws.dir}&quot;.</p>
  840. <hr>
  841. <h2><a name="delete">Delete</a></h2>
  842. <h3>Description</h3>
  843. <p>Deletes either a single file or
  844. all files in a specified directory and its sub-directories.</p>
  845. <p>It is possible to refine the set of files that are being deleted. This can be
  846. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  847. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  848. have included in the deletion process by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  849. the files you want to have excluded from the deletion process. This is also done with patterns. And
  850. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  851. want to use default exclusions or not. See the section on <a
  852. href="#directorybasedtasks">directory based tasks</a>, on how the
  853. inclusion/exclusion of files works, and how to write patterns. The patterns are
  854. relative to the <i>dir</i> directory.</p>
  855. <h3>Parameters</h3>
  856. <table border="1" cellpadding="2" cellspacing="0">
  857. <tr>
  858. <td valign="top"><b>Attribute</b></td>
  859. <td valign="top"><b>Description</b></td>
  860. <td align="center" valign="top"><b>Required</b></td>
  861. </tr>
  862. <tr>
  863. <td valign="top">file</td>
  864. <td valign="top">The file to delete.</td>
  865. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  866. </tr>
  867. <tr>
  868. <td valign="top">dir</td>
  869. <td valign="top">The directory to delete files from.</td>
  870. </tr>
  871. <tr>
  872. <td valign="top">includes</td>
  873. <td valign="top">Comma separated list of patterns of files that must be
  874. deleted. All files are in the current directory
  875. and any sub-directories are deleted when omitted.</td>
  876. <td valign="top" align="center">No</td>
  877. </tr>
  878. <tr>
  879. <td valign="top">includesfile</td>
  880. <td valign="top">the name of a file. Each line of this file is
  881. taken to be an include pattern</td>
  882. <td valign="top" align="center">No</td>
  883. </tr>
  884. <tr>
  885. <td valign="top">excludes</td>
  886. <td valign="top">Comma separated list of patterns of files that must be
  887. excluded from the deletion list. No files (except default excludes) are excluded when omitted.</td>
  888. <td valign="top" align="center">No</td>
  889. </tr>
  890. <tr>
  891. <td valign="top">excludesfile</td>
  892. <td valign="top">the name of a file. Each line of this file is
  893. taken to be an exclude pattern</td>
  894. <td valign="top" align="center">No</td>
  895. </tr>
  896. <tr>
  897. <td valign="top">defaultexcludes</td>
  898. <td valign="top">Indicates whether default excludes should be used or not
  899. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  900. <td valign="top" align="center">No</td>
  901. </tr>
  902. <tr>
  903. <td valign="top">verbose</td>
  904. <td valign="top">Show name of each deleted file (&quot;true&quot;/&quot;false&quot;). Default is "false" when omitted.</td>
  905. <td align="center" valign="top">No</td>
  906. </tr>
  907. </table>
  908. <h3>Examples</h3>
  909. <pre> &lt;delete file=&quot;/lib/ant.jar&quot; /&gt;</pre>
  910. <p>deletes the file <code>/lib/ant.jar</code>.</p>
  911. <pre> &lt;delete dir=&quot;lib&quot; /&gt;</pre>
  912. <p>deletes all files in the <code>/lib</code> directory.</p>
  913. <pre> &lt;delete dir=&quot;.&quot;
  914. include=&quot;**/*.bak&quot;
  915. /&gt;
  916. </pre>
  917. <p>deletes all files with the extension &quot;<code>.bak</code>&quot from the current directory
  918. and any sub-directories.</p>
  919. <h2><a name="deltree">Deltree</a></h2>
  920. <h3>Description</h3>
  921. <p>Deletes a directory with all its files and subdirectories.</p>
  922. <h3>Parameters</h3>
  923. <table border="1" cellpadding="2" cellspacing="0">
  924. <tr>
  925. <td valign="top"><b>Attribute</b></td>
  926. <td valign="top"><b>Description</b></td>
  927. <td align="center" valign="top"><b>Required</b></td>
  928. </tr>
  929. <tr>
  930. <td valign="top">dir</td>
  931. <td valign="top">the directory to delete.</td>
  932. <td valign="top" align="center">Yes</td>
  933. </tr>
  934. </table>
  935. <h3>Examples</h3>
  936. <pre> &lt;deltree dir=&quot;dist&quot; /&gt;</pre>
  937. <p>deletes the directory <code>dist</code>, including its files and
  938. subdirectories.</p>
  939. <pre> &lt;deltree dir=&quot;${dist}&quot; /&gt;</pre>
  940. <p>deletes the directory <code>${dist}</code>, including its files and
  941. subdirectories.</p>
  942. <hr>
  943. <h2><a name="echo">Echo</a></h2>
  944. <h3>Description</h3>
  945. <p>Echoes a message to System.out.</p>
  946. <h3>Parameters</h3>
  947. <table border="1" cellpadding="2" cellspacing="0">
  948. <tr>
  949. <td valign="top"><b>Attribute</b></td>
  950. <td valign="top"><b>Description</b></td>
  951. <td align="center" valign="top"><b>Required</b></td>
  952. </tr>
  953. <tr>
  954. <td valign="top">message</td>
  955. <td valign="top">the message to echo.</td>
  956. <td valign="top" align="center">Yes</td>
  957. </tr>
  958. </table>
  959. <h3>Examples</h3>
  960. <pre> &lt;echo message=&quot;Hello world&quot; /&gt;</pre>
  961. <hr>
  962. <h2><a name="exec">Exec</a></h2>
  963. <h3>Description</h3>
  964. <p>Executes a system command. When the <i>os</i> attribute is specified, then
  965. the command is only executed when Ant is run on one of the specified operating
  966. systems.</p>
  967. <h3>Parameters</h3>
  968. <table border="1" cellpadding="2" cellspacing="0">
  969. <tr>
  970. <td valign="top"><b>Attribute</b></td>
  971. <td valign="top"><b>Description</b></td>
  972. <td align="center" valign="top"><b>Required</b></td>
  973. </tr>
  974. <tr>
  975. <td valign="top">command</td>
  976. <td valign="top">the command to execute.</td>
  977. <td align="center" valign="top">Yes</td>
  978. </tr>
  979. <tr>
  980. <td valign="top">dir</td>
  981. <td valign="top">the directory in which the command should be executed.</td>
  982. <td align="center" valign="top">Yes</td>
  983. </tr>
  984. <tr>
  985. <td valign="top">os</td>
  986. <td valign="top">list of Operating Systems on which the command may be
  987. executed.</td>
  988. <td align="center" valign="top">No</td>
  989. </tr>
  990. <tr>
  991. <td valign="top">output</td>
  992. <td valign="top">the file to which the output of the command should be
  993. redirected.</td>
  994. <td align="center" valign="top">Yes</td>
  995. </tr>
  996. </table>
  997. <h3>Examples</h3>
  998. <blockquote>
  999. <p><code>&lt;exec dir=&quot;${src}&quot; command=&quot;dir&quot; os=&quot;windows&quot;
  1000. output=&quot;dir.txt&quot; /&gt;</code></p>
  1001. </blockquote>
  1002. <hr>
  1003. <h2><a name="expand">Expand</a></h2>
  1004. <h3>Description</h3>
  1005. <p>Unzips a zipfile.</p>
  1006. <p>For JDK 1.1 "last modified time" field is set to current time instead of being
  1007. carried from zipfile.</p>
  1008. <h3>Parameters</h3>
  1009. <table border="1" cellpadding="2" cellspacing="0">
  1010. <tr>
  1011. <td valign="top"><b>Attribute</b></td>
  1012. <td valign="top"><b>Description</b></td>
  1013. <td align="center" valign="top"><b>Required</b></td>
  1014. </tr>
  1015. <tr>
  1016. <td valign="top">src</td>
  1017. <td valign="top">zipfile to expand.</td>
  1018. <td align="center" valign="top">Yes</td>
  1019. </tr>
  1020. <tr>
  1021. <td valign="top">dest</td>
  1022. <td valign="top">directory where to store the expanded files.</td>
  1023. <td align="center" valign="top">Yes</td>
  1024. </tr>
  1025. </table>
  1026. <h3>Examples</h3>
  1027. <blockquote>
  1028. <p><code>&lt;expand src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;
  1029. /&gt;</code></p>
  1030. </blockquote>
  1031. <hr>
  1032. <h2><a name="filter">Filter</a></h2>
  1033. <h3>Description</h3>
  1034. <p>Sets a token filter for this project. Token filters are used by all tasks
  1035. that perform file copying operations through the Project commodity methods.</p>
  1036. <p>Note: the token string must not contain the separators chars (@).</p>
  1037. <h3>Parameters</h3>
  1038. <table border="1" cellpadding="2" cellspacing="0">
  1039. <tr>
  1040. <td valign="top"><b>Attribute</b></td>
  1041. <td valign="top"><b>Description</b></td>
  1042. <td align="center" valign="top"><b>Required</b></td>
  1043. </tr>
  1044. <tr>
  1045. <td valign="top">token</td>
  1046. <td valign="top">the token string without @</td>
  1047. <td align="center" valign="top">Yes</td>
  1048. </tr>
  1049. <tr>
  1050. <td valign="top">value</td>
  1051. <td valign="top">the string that should be put to replace the token when the
  1052. file is copied</td>
  1053. <td align="center" valign="top">Yes</td>
  1054. </tr>
  1055. </table>
  1056. <h3>Examples</h3>
  1057. <pre> &lt;filter token=&quot;year&quot; value=&quot;2000&quot; /&gt;
  1058. &lt;copydir src=&quot;${src.dir}&quot; dest=&quot;${dest.dir}&quot;/&gt;</pre>
  1059. <p>will copy recursively all the files from the <i>src.dir</i> directory into
  1060. the <i>dest.dir</i> directory replacing all the occurencies of the string <i>@year@</i>
  1061. with <i>2000.</i></p>
  1062. <hr>
  1063. <h2><a name="fixcrlf">FixCRLF</a></h2>
  1064. <h3>Description</h3>
  1065. <p>Adjusts a text file to local.</p>
  1066. <p>It is possible to refine the set of files that are being adjusted. This can be
  1067. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  1068. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  1069. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  1070. the files you want to have excluded. This is also done with patterns. And
  1071. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1072. want to use default exclusions or not. See the section on <a
  1073. href="#directorybasedtasks">directory based tasks</a>, on how the
  1074. inclusion/exclusion of files works, and how to write patterns. The patterns are
  1075. relative to the <i>src</i> directory.</p>
  1076. <h3>Parameters</h3>
  1077. <table border="1" cellpadding="2" cellspacing="0">
  1078. <tr>
  1079. <td valign="top"><b>Attribute</b></td>
  1080. <td valign="top"><b>Description</b></td>
  1081. <td align="center" valign="top"><b>Required</b></td>
  1082. </tr>
  1083. <tr>
  1084. <td valign="top">srcDir</td>
  1085. <td valign="top">Where to find the files to be fixed up.</td>
  1086. <td valign="top" align="center">Yes</td>
  1087. </tr>
  1088. <tr>
  1089. <td valign="top">destDir</td>
  1090. <td valign="top">Where to place the corrected files. Defaults to
  1091. srcDir (replacing the original file)</td>
  1092. <td valign="top" align="center">No</td>
  1093. </tr>
  1094. <tr>
  1095. <td valign="top">includes</td>
  1096. <td valign="top">comma separated list of patterns of files that must be
  1097. included. All files are included when omitted.</td>
  1098. <td valign="top" align="center">No</td>
  1099. </tr>
  1100. <tr>
  1101. <td valign="top">includesfile</td>
  1102. <td valign="top">the name of a file. Each line of this file is
  1103. taken to be an include pattern</td>
  1104. <td valign="top" align="center">No</td>
  1105. </tr>
  1106. <tr>
  1107. <td valign="top">excludes</td>
  1108. <td valign="top">comma separated list of patterns of files that must be
  1109. excluded. No files (except default excludes) are excluded when omitted.</td>
  1110. <td valign="top" align="center">No</td>
  1111. </tr>
  1112. <tr>
  1113. <td valign="top">excludesfile</td>
  1114. <td valign="top">the name of a file. Each line of this file is
  1115. taken to be an exclude pattern</td>
  1116. <td valign="top" align="center">No</td>
  1117. </tr>
  1118. <tr>
  1119. <td valign="top">defaultexcludes</td>
  1120. <td valign="top">indicates whether default excludes should be used or not
  1121. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1122. <td valign="top" align="center">No</td>
  1123. </tr>
  1124. <tr>
  1125. <td valign="top">cr</td>
  1126. <td valign="top">Specifies how carriage return (CR) characters are to
  1127. be handled. Valid values for this property are:
  1128. <ul>
  1129. <li>add: ensure that there is a CR before every LF
  1130. <li>asis: leave CR characters alone
  1131. <li>remove: remove all CR characters
  1132. </ul>
  1133. Default is based on the platform on which you are running this task.
  1134. For Unix platforms, the default is remove. For DOS based systems
  1135. (including Windows), the default is add.
  1136. <p>
  1137. Note: Unless this property is specified as "asis", extra CR characters
  1138. which do not preceed a LF will be removed.
  1139. </td>
  1140. <td valign="top" align="center">No</td>
  1141. </tr>
  1142. <tr>
  1143. <td valign="top">tab</td>
  1144. <td valign="top">Specifies how tab characters are to be handled. Valid
  1145. values for this property are:
  1146. <ul>
  1147. <li>add: convert sequences of spaces which span a tab stop to tabs
  1148. <li>asis: leave tab and space characters alone
  1149. <li>remove: convert tabs to spaces
  1150. </ul>
  1151. Default for this parameter is "asis".
  1152. <p>
  1153. Note: Unless this property is specified as "asis", extra spaces and
  1154. tabs after the last non-whitespace character on the line will be removed.
  1155. </td>
  1156. <td valign="top" align="center">No</td>
  1157. </tr>
  1158. <tr>
  1159. <td valign="top">eof</td>
  1160. <td valign="top">Specifies how DOS end of file (control-Z) characters are
  1161. to be handled. Valid values for this property are:
  1162. <ul>
  1163. <li>add: ensure that there is an EOF character at the end of the file
  1164. <li>asis: leave EOF characters alone
  1165. <li>remove: remove any EOF character found at the end
  1166. </ul>
  1167. Default is based on the platform on which you are running this task.
  1168. For Unix platforms, the default is remove. For DOS based systems
  1169. (including Windows), the default is asis.
  1170. </td>
  1171. <td valign="top" align="center">No</td>
  1172. </tr>
  1173. </table>
  1174. <h3>Examples</h3>
  1175. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1176. cr=&quot;remove&quot; eof=&quot;remove&quot;
  1177. includes=&quot;**/*.sh&quot;
  1178. /&gt;</pre>
  1179. <p>Removes carriage return and eof characters from the shell scripts. Tabs and
  1180. spaces are left as is.
  1181. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1182. cr=&quot;add&quot;
  1183. includes=&quot;**/*.bat&quot;
  1184. /&gt;</pre>
  1185. <p>Ensures that there are carriage return characters prior to evey line feed.
  1186. Tabs and spaces are left as is.
  1187. EOF characters are left alone if run on
  1188. DOS systems, and are removed if run on Unix systems.</p>
  1189. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1190. tabs=&quot;add&quot;
  1191. includes=&quot;**/Makefile&quot;
  1192. /&gt;</pre>
  1193. <p>Adds or removes CR characters to match local OS conventions, and
  1194. converts spaces to tabs when appropriate. EOF characters are left alone if
  1195. run on DOS systems, and are removed if run on Unix systems.
  1196. Many versions of make require tabs prior to commands.</p>
  1197. <pre> &lt;fixcrlf srcdir=&quot;${src}&quot;
  1198. tabs=&quot;remove&quot;
  1199. includes=&quot;**/README*&quot;
  1200. /&gt;</pre>
  1201. <p>Adds or removes CR characters to match local OS conventions, and
  1202. converts all tabs to spaces. EOF characters are left alone if run on
  1203. DOS systems, and are removed if run on Unix systems.
  1204. You never know what editor a user will use to browse README's.</p>
  1205. <hr>
  1206. <h2><a name="get">Get</a></h2>
  1207. <h3>Description</h3>
  1208. <p>Gets a file from an URL. When the verbose option is &quot;on&quot;, this task
  1209. displays a '.' for every 100 Kb retrieved.</p>
  1210. <p>This task should be preferred above the <a href="#cvs">CVS task</a> when
  1211. doing automated builds. CVS is significant slower than loading a compressed
  1212. archive with http/ftp.</p>
  1213. <h3>Parameters</h3>
  1214. <table border="1" cellpadding="2" cellspacing="0">
  1215. <tr>
  1216. <td valign="top"><b>Attribute</b></td>
  1217. <td valign="top"><b>Description</b></td>
  1218. <td align="center" valign="top"><b>Required</b></td>
  1219. </tr>
  1220. <tr>
  1221. <td valign="top">src</td>
  1222. <td valign="top">the URL from which to retrieve a file.</td>
  1223. <td align="center" valign="top">Yes</td>
  1224. </tr>
  1225. <tr>
  1226. <td valign="top">dest</td>
  1227. <td valign="top">the file where to store the retrieved file.</td>
  1228. <td align="center" valign="top">Yes</td>
  1229. </tr>
  1230. <tr>
  1231. <td valign="top">verbose</td>
  1232. <td valign="top">show verbose information (&quot;on&quot;/&quot;off&quot;).</td>
  1233. <td align="center" valign="top">No</td>
  1234. </tr>
  1235. <tr>
  1236. <td valign="top">ignoreerrors</td>
  1237. <td valign="top">Log errors but don't treat as fatal.</td>
  1238. <td align="center" valign="top">No</td>
  1239. </tr>
  1240. </table>
  1241. <h3>Examples</h3>
  1242. <pre> &lt;get src=&quot;http://jakarta.apache.org/&quot; dest=&quot;help/index.html&quot; /&gt;</pre>
  1243. <p>gets the index page of http://jakarta.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
  1244. <hr>
  1245. <h2><a name="gunzip">GUnzip</a></h2>
  1246. <h3>Description</h3>
  1247. <p>Expands a GZip file.</p>
  1248. <p>If <i>dest</i> is a directory the name of the destination file is
  1249. the same as <i>src</i> (with the &quot;.gz&quot; extension removed if
  1250. present). If <i>dest</i> is ommited, the parent dir of <i>src</i> is
  1251. taken. The file is only expanded if the source file is newer than the
  1252. destination file, or when the destination file does not exist.</p>
  1253. <h3>Parameters</h3>
  1254. <table border="1" cellpadding="2" cellspacing="0">
  1255. <tr>
  1256. <td valign="top"><b>Attribute</b></td>
  1257. <td valign="top"><b>Description</b></td>
  1258. <td align="center" valign="top"><b>Required</b></td>
  1259. </tr>
  1260. <tr>
  1261. <td valign="top">src</td>
  1262. <td valign="top">the file to expand.</td>
  1263. <td align="center" valign="top">Yes</td>
  1264. </tr>
  1265. <tr>
  1266. <td valign="top">dest</td>
  1267. <td valign="top">the destination file or directory.</td>
  1268. <td align="center" valign="top">No</td>
  1269. </tr>
  1270. </table>
  1271. <h3>Examples</h3>
  1272. <blockquote>
  1273. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot;/&gt;</code></p>
  1274. </blockquote>
  1275. <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
  1276. <blockquote>
  1277. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;</code></p>
  1278. </blockquote>
  1279. <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
  1280. <blockquote>
  1281. <p><code>&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;subdir&quot;/&gt;</code></p>
  1282. </blockquote>
  1283. <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
  1284. subdir is a directory).</p>
  1285. <hr>
  1286. <h2><a name="gzip">GZip</a></h2>
  1287. <h3>Description</h3>
  1288. <p>GZips a file.</p>
  1289. <h3>Parameters</h3>
  1290. <table border="1" cellpadding="2" cellspacing="0">
  1291. <tr>
  1292. <td valign="top"><b>Attribute</b></td>
  1293. <td valign="top"><b>Description</b></td>
  1294. <td align="center" valign="top"><b>Required</b></td>
  1295. </tr>
  1296. <tr>
  1297. <td valign="top">src</td>
  1298. <td valign="top">the file to gzip.</td>
  1299. <td align="center" valign="top">Yes</td>
  1300. </tr>
  1301. <tr>
  1302. <td valign="top">zipfile</td>
  1303. <td valign="top">the destination file.</td>
  1304. <td align="center" valign="top">Yes</td>
  1305. </tr>
  1306. </table>
  1307. <h3>Examples</h3>
  1308. <blockquote>
  1309. <p><code>&lt;gzip src=&quot;test.tar&quot; zipfile=&quot;test.tar.gz&quot;
  1310. /&gt;</code></p>
  1311. </blockquote>
  1312. <hr>
  1313. <h2><a name="jar">Jar</a></h2>
  1314. <h3>Description</h3>
  1315. <p>Jars a set of files.</p>
  1316. <p>The <i>basedir</i> attribute is the reference directory from where to jar.</p>
  1317. <p>It is possible to refine the set of files that are being jarred. This can be
  1318. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  1319. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  1320. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  1321. the files you want to have excluded. This is also done with patterns. And
  1322. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1323. want to use default exclusions or not. See the section on <a
  1324. href="#directorybasedtasks">directory based tasks</a>, on how the
  1325. inclusion/exclusion of files works, and how to write patterns. The patterns are
  1326. relative to the <i>basedir</i> directory.</p>
  1327. <p>The <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i> attributes
  1328. replace the <i>items</i> and <i>ignore</i> attributes. The following explains
  1329. how the deprecated <i>items</i> and <i>ignore</i> attribute behave.</p>
  1330. <p>When &quot;*&quot; is used for <i>items</i>, all files in the basedir, and
  1331. its subdirectories, will be jarred. Otherwise all the files and directories
  1332. mentioned in the items list will jarred. When a directory is specified, then all
  1333. files within it are also jarred.</p>
  1334. <p>With the <i>ignore</i> attribute, you can specify files or directories to
  1335. ignore. These files will not be jarred. The items in the <i>ignore</i> attribute
  1336. override the items in the <i>items</i> attribute. The names specified in the <i>ignore</i>
  1337. attribute are just names, they do not contain any path information!</p>
  1338. <h3>Parameters</h3>
  1339. <table border="1" cellpadding="2" cellspacing="0">
  1340. <tr>
  1341. <td valign="top"><b>Attribute</b></td>
  1342. <td valign="top"><b>Description</b></td>
  1343. <td align="center" valign="top"><b>Required</b></td>
  1344. </tr>
  1345. <tr>
  1346. <td valign="top">jarfile</td>
  1347. <td valign="top">the jar-file to create.</td>
  1348. <td valign="top" align="center">Yes</td>
  1349. </tr>
  1350. <tr>
  1351. <td valign="top">basedir</td>
  1352. <td valign="top">the directory from which to jar the files.</td>
  1353. <td valign="top" align="center">Yes</td>
  1354. </tr>
  1355. <tr>
  1356. <td valign="top">compress</td>
  1357. <td valign="top">Not only store data but also compress them, defaults to true</td>
  1358. <td align="center" valign="top">No</td>
  1359. </tr>
  1360. <tr>
  1361. <td valign="top">items</td>
  1362. <td valign="top">a comma separated list of the files/directories to jar. All
  1363. files are included when omitted. (<b>deprecated</b>, use <i>includes</i>
  1364. instead).</td>
  1365. <td valign="top" align="center">No</td>
  1366. </tr>
  1367. <tr>
  1368. <td valign="top">ignore</td>
  1369. <td valign="top">comma separated list of filenames/directorynames to exclude
  1370. from the jar. No files (except default excludes) are excluded when
  1371. omitted. (<b>deprecated</b>, use <i>excludes</i> instead).</td>
  1372. <td valign="top" align="center">No</td>
  1373. </tr>
  1374. <tr>
  1375. <td valign="top">includes</td>
  1376. <td valign="top">comma separated list of patterns of files that must be
  1377. included. All files are included when omitted.</td>
  1378. <td valign="top" align="center">No</td>
  1379. </tr>
  1380. <tr>
  1381. <td valign="top">includesfile</td>
  1382. <td valign="top">the name of a file. Each line of this file is
  1383. taken to be an include pattern</td>
  1384. <td valign="top" align="center">No</td>
  1385. </tr>
  1386. <tr>
  1387. <td valign="top">excludes</td>
  1388. <td valign="top">comma separated list of patterns of files that must be
  1389. excluded. No files (except default excludes) are excluded when omitted.</td>
  1390. <td valign="top" align="center">No</td>
  1391. </tr>
  1392. <tr>
  1393. <td valign="top">excludesfile</td>
  1394. <td valign="top">the name of a file. Each line of this file is
  1395. taken to be an exclude pattern</td>
  1396. <td valign="top" align="center">No</td>
  1397. </tr>
  1398. <tr>
  1399. <td valign="top">defaultexcludes</td>
  1400. <td valign="top">indicates whether default excludes should be used or not
  1401. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1402. <td valign="top" align="center">No</td>
  1403. </tr>
  1404. <tr>
  1405. <td valign="top">manifest</td>
  1406. <td valign="top">the manifest file to use.</td>
  1407. <td valign="top" align="center">No</td>
  1408. </tr>
  1409. </table>
  1410. <h3>Examples</h3>
  1411. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; /&gt;</pre>
  1412. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1413. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p>
  1414. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
  1415. basedir=&quot;${build}/classes&quot;
  1416. excludes=&quot;**/Test.class&quot;
  1417. /&gt;</pre>
  1418. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1419. called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files
  1420. with the name <code>Test.class</code> are excluded.</p>
  1421. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
  1422. basedir=&quot;${build}/classes&quot;
  1423. includes=&quot;mypackage/test/**&quot;
  1424. excludes=&quot;**/Test.class&quot;
  1425. /&gt;</pre>
  1426. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1427. called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only
  1428. files under the directory <code>mypackage/test</code> are used, and files with
  1429. the name <code>Test.class</code> are excluded.</p>
  1430. <h3>Deprecated examples</h3>
  1431. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; items=&quot;*&quot; /&gt;</pre>
  1432. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1433. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p>
  1434. <pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot; items=&quot;*&quot; ignore=&quot;Test.class&quot; /&gt;</pre>
  1435. <p>jars all files in the <code>${build}/classes</code> directory in a file
  1436. called <code>app.jar</code> in the <code>${dist}/lib</code> directory.
  1437. Files/directories with the name <code>Test.class</code> are excluded.</p>
  1438. <hr>
  1439. <h2><a name="java">Java</a></h2>
  1440. <h3>Description</h3>
  1441. <p>Executes a Java class within the running (Ant) VM or forks another VM if
  1442. specified.</p>
  1443. <p>Be careful that the executed class doesn't call System.exit(), because it
  1444. will terminate the VM and thus Ant. In case this happens, it's highly suggested
  1445. that you set the fork attribute so that System.exit() stops the other VM and not
  1446. the one that is currently running Ant.</p>
  1447. <h3>Parameters</h3>
  1448. <table border="1" cellpadding="2" cellspacing="0">
  1449. <tr>
  1450. <td valign="top"><b>Attribute</b></td>
  1451. <td valign="top"><b>Description</b></td>
  1452. <td align="center" valign="top"><b>Required</b></td>
  1453. </tr>
  1454. <tr>
  1455. <td valign="top">classname</td>
  1456. <td valign="top">the Java class to execute.</td>
  1457. <td align="center" valign="top">Yes</td>
  1458. </tr>
  1459. <tr>
  1460. <td valign="top">args</td>
  1461. <td valign="top">the arguments for the class that is executed.</td>
  1462. <td align="center" valign="top">No</td>
  1463. </tr>
  1464. <tr>
  1465. <td valign="top">classpath</td>
  1466. <td valign="top">the classpath to use.</td>
  1467. <td align="center" valign="top">No</td>
  1468. </tr>
  1469. <tr>
  1470. <td valign="top">fork</td>
  1471. <td valign="top">if enabled triggers the class execution in another VM
  1472. (disabled by default)</td>
  1473. <td align="center" valign="top">No</td>
  1474. </tr>
  1475. <tr>
  1476. <td valign="top">jvm</td>
  1477. <td valign="top">the command used to invoke the Java Virtual Machine,
  1478. default is 'java'. The command is resolved by java.lang.Runtime.exec().
  1479. Ignored if fork is disabled.
  1480. </td>
  1481. <td align="center" valign="top">No</td>
  1482. </tr>
  1483. <tr>
  1484. <td valign="top">jvmargs</td>
  1485. <td valign="top">the arguments to pass to the forked VM (ignored if fork is
  1486. disabled)</td>
  1487. <td align="center" valign="top">No</td>
  1488. </tr>
  1489. </table>
  1490. <h3>Examples</h3>
  1491. <pre> &lt;java classname=&quot;test.Main&quot; /&gt;</pre>
  1492. <pre> &lt;java classname=&quot;test.Main&quot; args=&quot;-h&quot; /&gt;</pre>
  1493. <pre> &lt;java classname=&quot;test.Main&quot;
  1494. args=&quot;-h&quot;
  1495. fork=&quot;yes&quot;
  1496. jvmargs=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;
  1497. /&gt;</pre>
  1498. <hr>
  1499. <h2><a name="javac">Javac</a></h2>
  1500. <h3>Description</h3>
  1501. <p>Compiles a source tree within the running (Ant) VM.</p>
  1502. <p>The source and destination directory will be recursively scanned for Java
  1503. source files to compile. Only Java files that have no corresponding class file
  1504. or where the class file is older than the java file will be compiled.</p>
  1505. <p>Files in the source tree, that are no java files, are copied to the
  1506. destination directory, allowing support files to be located properly in the
  1507. classpath.</p>
  1508. <p>The directory structure of the source tree should follow the package
  1509. hierarchy.</p>
  1510. <p>It is possible to refine the set of files that are being compiled/copied.
  1511. This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  1512. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  1513. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  1514. the files you want to have excluded. This is also done with patterns. And
  1515. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  1516. want to use default exclusions or not. See the section on <a
  1517. href="#directorybasedtasks">directory based tasks</a>, on how the
  1518. inclusion/exclusion of files works, and how to write patterns. The patterns are
  1519. relative to the <i>srcdir</i> directory.</p>
  1520. <p>It is possible to use different compilers. This can be selected with the
  1521. &quot;build.compiler&quot; property. There are three choices:</p>
  1522. <ul>
  1523. <li>classic (the standard compiler of JDK 1.1/1.2)</li>
  1524. <li>modern (the new compiler of JDK 1.3)</li>
  1525. <li>jikes (the <a
  1526. href="http://oss.software.ibm.com/developerworks/opensource/jikes/project">Jikes</a>
  1527. compiler)</li>
  1528. </ul>
  1529. <p>For JDK 1.1/1.2 is classic the default. For JDK 1.3 is modern the default.</p>
  1530. <h3>Parameters</h3>
  1531. <table border="1" cellpadding="2" cellspacing="0">
  1532. <tr>
  1533. <td valign="top"><b>Attribute</b></td>
  1534. <td valign="top"><b>Description</b></td>
  1535. <td align="center" valign="top"><b>Required</b></td>
  1536. </tr>
  1537. <tr>
  1538. <td valign="top">srcdir</td>
  1539. <td valign="top">location of the java files.</td>
  1540. <td align="center" valign="top">Yes</td>
  1541. </tr>
  1542. <tr>
  1543. <td valign="top">destdir</td>
  1544. <td valign="top">location where to store the class files.</td>
  1545. <td align="center" valign="top">Yes</td>
  1546. </tr>
  1547. <tr>
  1548. <td valign="top">includes</td>
  1549. <td valign="top">comma separated list of patterns of files that must be
  1550. included. All files are included when omitted.</td>
  1551. <td valign="top" align="center">No</td>
  1552. </tr>
  1553. <tr>
  1554. <td valign="top">includesfile</td>
  1555. <td valign="top">the name of a file. Each line of this file is
  1556. taken to be an include pattern</td>
  1557. <td valign="top" align="center">No</td>
  1558. </tr>
  1559. <tr>
  1560. <td valign="top">excludes</td>
  1561. <td valign="top">comma separated list of patterns of files that must be
  1562. excluded. No files (except default excludes) are excluded when omitted.</td>
  1563. <td valign="top" align="center">No</td>
  1564. </tr>
  1565. <tr>
  1566. <td valign="top">excludesfile</td>
  1567. <td valign="top">the name of a file. Each line of this file is
  1568. taken to be an exclude pattern</td>
  1569. <td valign="top" align="center">No</td>
  1570. </tr>
  1571. <tr>
  1572. <td valign="top">defaultexcludes</td>
  1573. <td valign="top">indicates whether default excludes should be used or not
  1574. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  1575. <td valign="top" align="center">No</td>
  1576. </tr>
  1577. <tr>
  1578. <td valign="top">classpath</td>
  1579. <td valign="top">the classpath to use.</td>
  1580. <td align="center" valign="top">No</td>
  1581. </tr>
  1582. <tr>
  1583. <td valign="top">bootclasspath</td>
  1584. <td valign="top">location of bootstrap class files.</td>
  1585. <td align="center" valign="top">No</td>
  1586. </tr>
  1587. <tr>
  1588. <td valign="top">extdirs</td>
  1589. <td valign="top">location of installed extensions.</td>
  1590. <td align="center" valign="top">No</td>
  1591. </tr>
  1592. <tr>
  1593. <td valign="top">debug</td>
  1594. <td valign="top">indicates whether there should be compiled with debug
  1595. information (&quot;on&quot;).</td>
  1596. <td align="center" valign="top">No</td>
  1597. </tr>
  1598. <tr>
  1599. <td valign="top">optimize</td>
  1600. <td valign="top">indicates whether there should be compiled with
  1601. optimization (&quot;on&quot;).</td>
  1602. <td align="center" valign="top">No</td>
  1603. </tr>
  1604. <tr>
  1605. <td valign="top">deprecation</td>
  1606. <td valign="top">indicates whether there should be compiled with deprecation
  1607. information (&quot;on&quot;).</td>
  1608. <td align="center" valign="top">No</td>
  1609. </tr>
  1610. <tr>
  1611. <td valign="top">filtering</td>
  1612. <td valign="top">indicates whether token filtering should take place</td>
  1613. <td valign="top" align="center">No</td>
  1614. </tr>
  1615. <tr>
  1616. <td valign="top">target</td>
  1617. <td valign="top">Generate class files for specific VM version, e.g. "1.1" or "1.2".</td>
  1618. <td align="center" valign="top">No</td>
  1619. </tr>
  1620. </table>
  1621. <h3>Examples</h3>
  1622. <pre> &lt;javac srcdir=&quot;${src}&quot;
  1623. destdir=&quot;${build}&quot;
  1624. classpath=&quot;xyz.jar&quot;
  1625. debug=&quot;on&quot;
  1626. /&gt;</pre>
  1627. <p>compiles all .java files under the directory <code>${src}</code>, and stores
  1628. the .class files in the directory <code>${build}</code>. It also copies the non-java
  1629. files from the tree under <code>${src}</code> to the tree under <code>${build}</code>.
  1630. The classpath used contains <code>xyz.jar</code>, and debug information is on.</p>
  1631. <pre> &lt;javac srcdir=&quot;${src}&quot;
  1632. destdir=&quot;${build}&quot;
  1633. includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
  1634. excludes=&quot;mypackage/p1/testpackage/**&quot;
  1635. classpath=&quot;xyz.jar&quot;
  1636. debug=&quot;on&quot;
  1637. /&gt;</pre>
  1638. <p>compiles .java files under the directory <code>${src}</code>, and stores the
  1639. .class files in the directory <code>${build}</code>. It also copies the non-java
  1640. files from the tree under <code>${src}</code> to the tree under <code>${build}</code>.
  1641. The classpath used contains <code>xyz.jar</code>, and debug information is on.
  1642. Only files under <code>mypackage/p1</code> and <code>mypackage/p2</code> are
  1643. used. Files in the <code>mypackage/p1/testpackage</code> directory are excluded
  1644. form compilation and copy.</p>
  1645. <hr>
  1646. <h2><a name="javadoc">Javadoc/Javadoc2</a></h2>
  1647. <h3>Description</h3>
  1648. <p>Generates code documentation using the javadoc tool.</p>
  1649. <p>The source directory will be recursively scanned for Java source files to process
  1650. but only those matching the inclusion rules will be passed to the javadoc tool. This
  1651. allows wildcards to be used to choose between package names, reducing verbosity
  1652. and management costs over time. This task, however, has no notion of
  1653. &quot;changed&quot; files, unlike the <a href="#javac">javac</a> task. This means
  1654. all packages will be processed each time this task is run. In general, however,
  1655. this task is used much less frequently.</p>
  1656. <p>This task works seamlessly between different javadoc versions (1.1 and 1.2),
  1657. with the obvious restriction that the 1.2 attributes will be ignored if run in a
  1658. 1.1 VM.</p>
  1659. <p>NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the
  1660. same VM as ant without breaking functionality. For this reason, this task
  1661. always forks the VM. This overhead is not significant since javadoc is normally a heavy
  1662. application and will be called infrequently.</p>
  1663. <p>NOTE: the packagelist attribute allows you to specify the list of packages to
  1664. document outside of the Ant file. It's a much better practice to include everything
  1665. inside the build.xml file. This option was added in order to make it easier to
  1666. migrate from regular makefiles, where you would use this option of javadoc.
  1667. The packages listed in packagelist are not checked, so the task performs even
  1668. if some packages are missing or broken. Use this option if you wish to convert from
  1669. an existing makefile. Once things are running you should then switch to the regular
  1670. notation.
  1671. <p>DEPRECATION: the javadoc2 task simply points to the javadoc task and it's
  1672. there for back compatibility reasons. Since this task will be removed in future
  1673. versions, you are strongly encouraged to use <a href="#javadoc">javadoc</a>
  1674. instead.</p>
  1675. <h3>Parameters</h3>
  1676. <table border="1" cellpadding="2" cellspacing="0">
  1677. <tr>
  1678. <td valign="top"><b>Attribute</b></td>
  1679. <td valign="top"><b>Description</b></td>
  1680. <td align="center" valign="top"><b>Availability</b></td>
  1681. <td align="center" valign="top"><b>Required</b></td>
  1682. </tr>
  1683. <tr>
  1684. <td valign="top">sourcepath</td>
  1685. <td valign="top">Specify where to find source files</td>
  1686. <td align="center" valign="top">all</td>
  1687. <td align="center" valign="top">Yes</td>
  1688. </tr>
  1689. <tr>
  1690. <td valign="top">destdir</td>
  1691. <td valign="top">Destination directory for output files</td>
  1692. <td align="center" valign="top">all</td>
  1693. <td align="center" valign="top">Yes</td>
  1694. </tr>
  1695. <tr>
  1696. <td valign="top">maxmemory</td>
  1697. <td valign="top">Max amount of memory to allocate to the javadoc VM</td>
  1698. <td align="center" valign="top">all</td>
  1699. <td align="center" valign="top">No</td>
  1700. </tr>
  1701. <tr>
  1702. <td valign="top">sourcefiles</td>
  1703. <td valign="top">Space separated list of source files</td>
  1704. <td align="center" valign="top">all</td>
  1705. <td align="center" valign="middle" rowspan="2">at least one of the two</td>
  1706. </tr>
  1707. <tr>
  1708. <td valign="top">packagenames</td>
  1709. <td valign="top">Space separated list of package files (with terminating
  1710. wildcard)</td>
  1711. <td align="center" valign="top">all</td>
  1712. </tr>
  1713. <tr>
  1714. <td valign="top">packageList</td>
  1715. <td valign="top">The name of a file containing the packages to process</td>
  1716. <td align="center" valign="top">all</td>
  1717. <td align="center" valign="top">No</td>
  1718. </tr>
  1719. <tr>
  1720. <td valign="top">classpath</td>
  1721. <td valign="top">Specify where to find user class files</td>
  1722. <td align="center" valign="top">all</td>
  1723. <td align="center" valign="top">No</td>
  1724. </tr>
  1725. <tr>
  1726. <td valign="top">Bootclasspath</td>
  1727. <td valign="top">Override location of class files loaded by the bootstrap
  1728. class loader</td>
  1729. <td align="center" valign="top">1.2</td>
  1730. <td align="center" valign="top">No</td>
  1731. </tr>
  1732. <tr>
  1733. <td valign="top">Extdirs</td>
  1734. <td valign="top">Override location of installed extensions</td>
  1735. <td align="center" valign="top">1.2</td>
  1736. <td align="center" valign="top">No</td>
  1737. </tr>
  1738. <tr>
  1739. <td valign="top">Overview</td>
  1740. <td valign="top">Read overview documentation from HTML file</td>
  1741. <td align="center" valign="top">1.2</td>
  1742. <td align="center" valign="top">No</td>
  1743. </tr>
  1744. <tr>
  1745. <td valign="top">Public</td>
  1746. <td valign="top">Show only public classes and members</td>
  1747. <td align="center" valign="top">all</td>
  1748. <td align="center" valign="top">No</td>
  1749. </tr>
  1750. <tr>
  1751. <td valign="top">Protected</td>
  1752. <td valign="top">Show protected/public classes and members (default)</td>
  1753. <td align="center" valign="top">all</td>
  1754. <td align="center" valign="top">No</td>
  1755. </tr>
  1756. <tr>
  1757. <td valign="top">Package</td>
  1758. <td valign="top">Show package/protected/public classes and members</td>
  1759. <td align="center" valign="top">all</td>
  1760. <td align="center" valign="top">No</td>
  1761. </tr>
  1762. <tr>
  1763. <td valign="top">Private</td>
  1764. <td valign="top">Show all classes and members</td>
  1765. <td align="center" valign="top">all</td>
  1766. <td align="center" valign="top">No</td>
  1767. </tr>
  1768. <tr>
  1769. <td valign="top">Old</td>
  1770. <td valign="top">Generate output using JDK 1.1 emulating doclet</td>
  1771. <td align="center" valign="top">1.2</td>
  1772. <td align="center" valign="top">No</td>
  1773. </tr>
  1774. <tr>
  1775. <td valign="top">Verbose</td>
  1776. <td valign="top">Output messages about what Javadoc is doing</td>
  1777. <td align="center" valign="top">1.2</td>
  1778. <td align="center" valign="top">No</td>
  1779. </tr>
  1780. <tr>
  1781. <td valign="top">Locale</td>
  1782. <td valign="top">Locale to be used, e.g. en_US or en_US_WIN</td>
  1783. <td align="center" valign="top">1.2</td>
  1784. <td align="center" valign="top">No</td>
  1785. </tr>
  1786. <tr>
  1787. <td valign="top">Encoding</td>
  1788. <td valign="top">Source file encoding name</td>
  1789. <td align="center" valign="top">all</td>
  1790. <td align="center" valign="top">No</td>
  1791. </tr>
  1792. <tr>
  1793. <td valign="top">Version</td>
  1794. <td valign="top">Include @version paragraphs</td>
  1795. <td align="center" valign="top">all</td>
  1796. <td align="center" valign="top">No</td>
  1797. </tr>
  1798. <tr>
  1799. <td valign="top">Use</td>
  1800. <td valign="top">Create class and package usage pages</td>
  1801. <td align="center" valign="top">1.2</td>
  1802. <td align="center" valign="top">No</td>
  1803. </tr>
  1804. <tr>
  1805. <td valign="top">Author</td>
  1806. <td valign="top">Include @author paragraphs</td>
  1807. <td align="center" valign="top">all</td>
  1808. <td align="center" valign="top">No</td>
  1809. </tr>
  1810. <tr>
  1811. <td valign="top">Splitindex</td>
  1812. <td valign="top">Split index into one file per letter</td>
  1813. <td align="center" valign="top">1.2</td>
  1814. <td align="center" valign="top">No</td>
  1815. </tr>
  1816. <tr>
  1817. <td valign="top">Windowtitle</td>
  1818. <td valign="top">Browser window title for the documenation (text)</td>
  1819. <td align="center" valign="top">1.2</td>
  1820. <td align="center" valign="top">No</td>
  1821. </tr>
  1822. <tr>
  1823. <td valign="top">Doctitle</td>
  1824. <td valign="top">Include title for the package index(first) page (html-code)</td>
  1825. <td align="center" valign="top">1.2</td>
  1826. <td align="center" valign="top">No</td>
  1827. </tr>
  1828. <tr>
  1829. <td valign="top">Header</td>
  1830. <td valign="top">Include header text for each page (html-code)</td>
  1831. <td align="center" valign="top">1.2</td>
  1832. <td align="center" valign="top">No</td>
  1833. </tr>
  1834. <tr>
  1835. <td valign="top">Footer</td>
  1836. <td valign="top">Include footer text for each page (html-code)</td>
  1837. <td align="center" valign="top">1.2</td>
  1838. <td align="center" valign="top">No</td>
  1839. </tr>
  1840. <tr>
  1841. <td valign="top">bottom</td>
  1842. <td valign="top">Include bottom text for each page (html-code)</td>
  1843. <td align="center" valign="top">1.2</td>
  1844. <td align="center" valign="top">No</td>
  1845. </tr>
  1846. <tr>
  1847. <td valign="top">link</td>
  1848. <td valign="top">Create links to javadoc output at the given URL</td>
  1849. <td align="center" valign="top">1.2</td>
  1850. <td align="center" valign="top">No</td>
  1851. </tr>
  1852. <tr>
  1853. <td valign="top">linkoffline</td>
  1854. <td valign="top">Link to docs at &lt;url&gt; using package list at
  1855. &lt;url2&gt;</td>
  1856. <td align="center" valign="top">1.2</td>
  1857. <td align="center" valign="top">No</td>
  1858. </tr>
  1859. <tr>
  1860. <td valign="top">group</td>
  1861. <td valign="top">Group specified packages together in overview page</td>
  1862. <td align="center" valign="top">1.2</td>
  1863. <td align="center" valign="top">No</td>
  1864. </tr>
  1865. <tr>
  1866. <td valign="top">nodeprecated</td>
  1867. <td valign="top">Do not include @deprecated information</td>
  1868. <td align="center" valign="top">all</td>
  1869. <td align="center" valign="top">No</td>
  1870. </tr>
  1871. <tr>
  1872. <td valign="top">nodeprecatedlist</td>
  1873. <td valign="top">Do not generate deprecated list</td>
  1874. <td align="center" valign="top">1.2</td>
  1875. <td align="center" valign="top">No</td>
  1876. </tr>
  1877. <tr>
  1878. <td valign="top">notree</td>
  1879. <td valign="top">Do not generate class hierarchy</td>
  1880. <td align="center" valign="top">all</td>
  1881. <td align="center" valign="top">No</td>
  1882. </tr>
  1883. <tr>
  1884. <td valign="top">noindex</td>
  1885. <td valign="top">Do not generate index</td>
  1886. <td align="center" valign="top">all</td>
  1887. <td align="center" valign="top">No</td>
  1888. </tr>
  1889. <tr>
  1890. <td valign="top">nohelp</td>
  1891. <td valign="top">Do not generate help link</td>
  1892. <td align="center" valign="top">1.2</td>
  1893. <td align="center" valign="top">No</td>
  1894. </tr>
  1895. <tr>
  1896. <td valign="top">nonavbar</td>
  1897. <td valign="top">Do not generate navigation bar</td>
  1898. <td align="center" valign="top">1.2</td>
  1899. <td align="center" valign="top">No</td>
  1900. </tr>
  1901. <tr>
  1902. <td valign="top">serialwarn</td>
  1903. <td valign="top">FUTURE: Generate warning about @serial tag</td>
  1904. <td align="center" valign="top">1.2</td>
  1905. <td align="center" valign="top">No</td>
  1906. </tr>
  1907. <tr>
  1908. <td valign="top">helpfile</td>
  1909. <td valign="top">FUTURE: Specifies the HTML help file to use</td>
  1910. <td align="center" valign="top">1.2</td>
  1911. <td align="center" valign="top">No</td>
  1912. </tr>
  1913. <tr>
  1914. <td valign="top">stylesheetfile</td>
  1915. <td valign="top">Specifies the CSS stylesheet to use</td>
  1916. <td align="center" valign="top">1.2</td>
  1917. <td align="center" valign="top">No</td>
  1918. </tr>
  1919. <tr>
  1920. <td valign="top">charset</td>
  1921. <td valign="top">FUTURE: Charset for cross-platform viewing of generated
  1922. documentation</td>
  1923. <td align="center" valign="top">1.2</td>
  1924. <td align="center" valign="top">No</td>
  1925. </tr>
  1926. <tr>
  1927. <td valign="top">docencoding</td>
  1928. <td valign="top">Output file encoding name</td>
  1929. <td align="center" valign="top">1.1</td>
  1930. <td align="center" valign="top">No</td>
  1931. </tr>
  1932. <tr>
  1933. <td valign="top">doclet</td>
  1934. <td valign="top">Specifies the class file that starts the doclet used in generating the documentation.</td>
  1935. <td align="center" valign="top">1.2</td>
  1936. <td align="center" valign="top">No</td>
  1937. </tr>
  1938. <tr>
  1939. <td valign="top">docletpath</td>
  1940. <td valign="top">Specifies the path to the doclet class file that is specified with the -doclet option.</td>
  1941. <td align="center" valign="top">1.2</td>
  1942. <td align="center" valign="top">No</td>
  1943. </tr>
  1944. <tr>
  1945. <td valign="top">additionalparam</td>
  1946. <td valign="top">Lets you add additional parameters to the javadoc command line. Useful for doclets</td>
  1947. <td align="center" valign="top">1.2</td>
  1948. <td align="center" valign="top">No</td>
  1949. </tr>
  1950. </table>
  1951. <h3>Parameters specified as subelements</h3>
  1952. Two parameters of the Javadoc task may be specified as nested elements of the
  1953. Javadoc task element: link and group.
  1954. When present, there can be any number of each of these elements.
  1955. They perform the same role as the link, linkoffline and
  1956. group attributes. You can use either syntax (or both at once), but with the nested
  1957. elements you can easily specify multiple occurrences of the arguments.
  1958. <h4>link</h4>
  1959. Create link to javadoc output at the given URL
  1960. <h4>Parameters</h4>
  1961. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  1962. <tr>
  1963. <td valign="top"><b>Attribute</b></td>
  1964. <td valign="top"><b>Description</b></td>
  1965. <td align="center" valign="top"><b>Required</b></td>
  1966. </tr>
  1967. <tr>
  1968. <td valign="top">href</td>
  1969. <td valign="top">The URL for the external documentation you wish to link to</td>
  1970. <td align="center" valign="top">Yes</td>
  1971. </tr>
  1972. <tr>
  1973. <td valign="top">offline</td>
  1974. <td valign="top">True if this link is not available online at the time of
  1975. generating the documentation</td>
  1976. <td align="center" valign="top">No</td>
  1977. </tr>
  1978. <tr>
  1979. <td valign="top">packagelistLoc</td>
  1980. <td valign="top">The location to the directory containing the package-list file for
  1981. the external documentation</td>
  1982. <td align="center" valign="top">Only if the offline attribute is true</td>
  1983. </tr>
  1984. </table>
  1985. <h4>groups</h4>
  1986. Separates packages on the overview page into whatever groups you specify,
  1987. one group per table.
  1988. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  1989. <tr>
  1990. <td valign="top"><b>Attribute</b></td>
  1991. <td valign="top"><b>Description</b></td>
  1992. <td align="center" valign="top"><b>Required</b></td>
  1993. </tr>
  1994. <tr>
  1995. <td valign="top">title</td>
  1996. <td valign="top">Title of the group</td>
  1997. <td align="center" valign="top">Yes</td>
  1998. </tr>
  1999. <tr>
  2000. <td valign="top">packages</td>
  2001. <td valign="top">List of packages to include in that group</td>
  2002. <td align="center" valign="top">Yes</td>
  2003. </tr>
  2004. </table>
  2005. <h3>Example</h3>
  2006. <pre> &lt;javadoc packagenames=&quot;com.dummy.test.*&quot;
  2007. sourcepath=&quot;src&quot;
  2008. destdir=&quot;docs/api&quot;
  2009. author=&quot;true&quot;
  2010. version=&quot;true&quot;
  2011. use=&quot;true&quot;
  2012. windowtitle=&quot;Test API&quot;
  2013. doctitle=&quot;&lt;h1&gt;Test&lt;/h1&gt;&quot;
  2014. bottom=&quot;&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;&quot;&gt;
  2015. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  2016. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*&quot;/&gt;
  2017. &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;
  2018. &lt;link href=&quot;http://developer.java.sun.com/developer/products/xml/docs/api/&quot;/&gt;
  2019. &lt/javadoc&gt;</pre>
  2020. <hr>
  2021. <h2><a name="keysubst">KeySubst</a></h2>
  2022. <h3>Description</h3>
  2023. <p>Performs keyword substitution in the source file, and writes the result to
  2024. the destination file.</p>
  2025. <p>Keys in the source file are of the form ${keyname}. The <i>keys</i> attribute
  2026. contains key/value pairs. When a key is found in the <i>keys</i> attribute, then
  2027. &quot;${keyname}&quot; is replaced by the corresponding value.</p>
  2028. <p>The <i>keys</i> attribute is of the form
  2029. &quot;name1=value1*name2=value2*name3=value3&quot;. The '*' is called the
  2030. separator, which might we changed with the <i>sep</i> attribute.</p>
  2031. <p>Note: the source file and destination file may not be the same.</p>
  2032. <h3>Parameters</h3>
  2033. <table border="1" cellpadding="2" cellspacing="0">
  2034. <tr>
  2035. <td valign="top"><b>Attribute</b></td>
  2036. <td valign="top"><b>Description</b></td>
  2037. <td align="center" valign="top"><b>Required</b></td>
  2038. </tr>
  2039. <tr>
  2040. <td valign="top">src</td>
  2041. <td valign="top">the source file.</td>
  2042. <td align="center" valign="top">Yes</td>
  2043. </tr>
  2044. <tr>
  2045. <td valign="top">dest</td>
  2046. <td valign="top">the destination file.</td>
  2047. <td align="center" valign="top">Yes</td>
  2048. </tr>
  2049. <tr>
  2050. <td valign="top">sep</td>
  2051. <td valign="top">the separator for the name/value pairs.</td>
  2052. <td align="center" valign="top">No</td>
  2053. </tr>
  2054. <tr>
  2055. <td valign="top">keys</td>
  2056. <td valign="top">name/value pairs for replacement.</td>
  2057. <td align="center" valign="top">Yes</td>
  2058. </tr>
  2059. </table>
  2060. <h3>Examples</h3>
  2061. <pre> &lt;keysubst src=&quot;abc.txt&quot; dest=&quot;def.txt&quot; keys=&quot;VERSION=1.0.3*DATE=2000-01-10&quot; /&gt;</pre>
  2062. <hr>
  2063. <h2><a name="mkdir">Mkdir</a></h2>
  2064. <h3>Description</h3>
  2065. <p>Creates a directory. Also non-existent parent directories are created, when
  2066. necessary.</p>
  2067. <h3>Parameters</h3>
  2068. <table border="1" cellpadding="2" cellspacing="0">
  2069. <tr>
  2070. <td valign="top"><b>Attribute</b></td>
  2071. <td valign="top"><b>Description</b></td>
  2072. <td align="center" valign="top"><b>Required</b></td>
  2073. </tr>
  2074. <tr>
  2075. <td valign="top">dir</td>
  2076. <td valign="top">the directory to create.</td>
  2077. <td align="center" valign="top">Yes</td>
  2078. </tr>
  2079. </table>
  2080. <h3>Examples</h3>
  2081. <pre>&lt;mkdir dir=&quot;${dist}&quot; /&gt;</pre>
  2082. <p>creates a directory <code>${dist}</code>.</p>
  2083. <pre>&lt;mkdir dir=&quot;${dist}/lib&quot; /&gt;</pre>
  2084. <p>creates a directory <code>${dist}/lib</code>.</p>
  2085. <hr>
  2086. <h2><a name="patch">Patch</a></h2>
  2087. <h3>Description</h3>
  2088. <p>Applies a diff file to originals.
  2089. <h3>Parameters</h3>
  2090. <table border="1" cellpadding="2" cellspacing="0">
  2091. <tr>
  2092. <td valign="top"><b>Attribute</b></td>
  2093. <td valign="top"><b>Description</b></td>
  2094. <td align="center" valign="top"><b>Required</b></td>
  2095. </tr>
  2096. <tr>
  2097. <td valign="top">dir</td>
  2098. <td valign="top">the directory in which the command should be executed.</td>
  2099. <td align="center" valign="top">Yes</td>
  2100. </tr>
  2101. <tr>
  2102. <td valign="top">os</td>
  2103. <td valign="top">list of Operating Systems on which the command may be
  2104. executed.</td>
  2105. <td align="center" valign="top">No</td>
  2106. </tr>
  2107. <tr>
  2108. <td valign="top">output</td>
  2109. <td valign="top">the file to which the output of the patch command
  2110. should be redirected.</td>
  2111. <td align="center" valign="top">No</td>
  2112. </tr>
  2113. <tr>
  2114. <td valign="top">patchfile</td>
  2115. <td valign="top">the file that includes the diff output</td>
  2116. <td align="center" valign="top">Yes</td>
  2117. </tr>
  2118. <tr>
  2119. <td valign="top">originalfile</td>
  2120. <td valign="top">the file to patch</td>
  2121. <td align="center" valign="top">No, tries to guess it from the diff
  2122. file</td>
  2123. </tr>
  2124. <tr>
  2125. <td valign="top">backups</td>
  2126. <td valign="top">Keep backups of the unpatched files</td>
  2127. <td align="center" valign="top">No</td>
  2128. </tr>
  2129. <tr>
  2130. <td valign="top">quiet</td>
  2131. <td valign="top">Work silently unless an error occurs</td>
  2132. <td align="center" valign="top">No</td>
  2133. </tr>
  2134. <tr>
  2135. <td valign="top">reverse</td>
  2136. <td valign="top">Assume patch was created with old and new files
  2137. swapped.</td>
  2138. <td align="center" valign="top">No</td>
  2139. </tr>
  2140. <tr>
  2141. <td valign="top">ignorewhitespace</td>
  2142. <td valign="top">Ignore whitespace differences.</td>
  2143. <td align="center" valign="top">No</td>
  2144. </tr>
  2145. <tr>
  2146. <td valign="top">strip</td>
  2147. <td valign="top">Strip the smallest prefix containing <i>num</i> leading
  2148. slashes from filenames.</td>
  2149. <td align="center" valign="top">No</td>
  2150. </tr>
  2151. </table>
  2152. <h3>Examples</h3>
  2153. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; /&gt;</pre>
  2154. <p>applies the diff included in <i>module.1.0-1.1.patch</i> to the
  2155. files in base directory guessing the filename(s) from the diff output.
  2156. <pre> &lt;patch patchfile=&quot;module.1.0-1.1.patch&quot; strip="1" /&gt;</pre>
  2157. <p>like above but one leading directory part will be removed. i.e. if
  2158. the diff output looked like
  2159. <pre>
  2160. --- a/mod1.0/A Mon Jun 5 17:28:41 2000
  2161. +++ a/mod1.1/A Mon Jun 5 17:28:49 2000
  2162. </pre>
  2163. the leading <i>a/</i> will be stripped.
  2164. <h2><a name="property">Property</a></h2>
  2165. <h3>Description</h3>
  2166. <p>Sets a property (by name and value), or set of properties (from file or
  2167. resource) in the project.</p>
  2168. <p>When a property was set by the user, or was a property in a parent project
  2169. (that started this project with the <a href="#ant">ant task</a>), then this
  2170. property cannot be set, and will be ignored. This means that properties set
  2171. outside the current project always override the properties of the current
  2172. project.</p>
  2173. <p>There are three ways to set properties:</p>
  2174. <ul>
  2175. <li>By supplying both the <i>name</i> and <i>value</i> attribute.</li>
  2176. <li>By setting the <i>file</i> attribute with the filename of the property
  2177. file to load. This property file has the format as defined by the file used
  2178. in the class java.util.Properties.</li>
  2179. <li>By setting the <i>resource</i> attribute with the resource name of the
  2180. property file to load. This property file has the format as defined by the
  2181. file used in the class java.util.Properties.</li>
  2182. </ul>
  2183. <p>Although combinations of the three ways are possible, only one should be used
  2184. at a time. Problems might occur with the order in which properties are set, for
  2185. instance.</p>
  2186. <p>The value part of the properties being set, might contain references to other
  2187. properties. These references are resolved at the time these properties are set.
  2188. This also holds for properties loaded from a property file.</p>
  2189. <h3>Parameters</h3>
  2190. <table border="1" cellpadding="2" cellspacing="0">
  2191. <tr>
  2192. <td valign="top"><b>Attribute</b></td>
  2193. <td valign="top"><b>Description</b></td>
  2194. <td align="center" valign="top"><b>Required</b></td>
  2195. </tr>
  2196. <tr>
  2197. <td valign="top">name</td>
  2198. <td valign="top">the name of the property to set.</td>
  2199. <td valign="top" align="center">Yes</td>
  2200. </tr>
  2201. <tr>
  2202. <td valign="top">value</td>
  2203. <td valign="top">the value of the property.</td>
  2204. <td valign="middle" align="center" rowspan="3">Yes</td>
  2205. </tr>
  2206. <tr>
  2207. <td valign="top">resource</td>
  2208. <td valign="top">the resource name of the property file.</td>
  2209. </tr>
  2210. <tr>
  2211. <td valign="top">file</td>
  2212. <td valign="top">the filename of the property file .</td>
  2213. </tr>
  2214. </table>
  2215. <h3>Examples</h3>
  2216. <pre> &lt;property name=&quot;foo.dist&quot; value=&quot;dist&quot; /&gt;</pre>
  2217. <p>sets the property <code>foo.dist</code> to the value &quot;dist&quot;.</p>
  2218. <pre> &lt;property file=&quot;foo.properties&quot; /&gt;</pre>
  2219. <p>reads a set of properties from a file called &quot;foo.properties&quot;.</p>
  2220. <pre> &lt;property resource=&quot;foo.properties&quot; /&gt;</pre>
  2221. <p>reads a set of properties from a resource called &quot;foo.properties&quot;.</p>
  2222. <p>Note that you can reference a global properties file for all of your Ant
  2223. builds using the following:
  2224. <pre> &lt;property file=&quot;${user.home}/.ant-global.properties&quot; /&gt;</pre>
  2225. <p>since the &quot;user.home&quot; property is defined by the Java virtual machine
  2226. to be your home directory. This technique is more appropriate for Unix than
  2227. Windows since the notion of a home directory doesn't exist on Windows. On the
  2228. JVM that I tested, the home directory on Windows is &quot;C:\&quot;. Different JVM
  2229. implementations may use other values for the home directory on Windows.
  2230. <hr>
  2231. <h2><a name="rename">Rename</a></h2>
  2232. <h3>Description</h3>
  2233. <p>Renames a given file.</p>
  2234. <h3>Parameters</h3>
  2235. <table border="1" cellpadding="2" cellspacing="0">
  2236. <tr>
  2237. <td valign="top"><b>Attribute</b></td>
  2238. <td valign="top"><b>Description</b></td>
  2239. <td align="center" valign="top"><b>Required</b></td>
  2240. </tr>
  2241. <tr>
  2242. <td valign="top">src</td>
  2243. <td valign="top">file to rename.</td>
  2244. <td valign="top" align="center">Yes</td>
  2245. </tr>
  2246. <tr>
  2247. <td valign="top">dest</td>
  2248. <td valign="top">new name of the file.</td>
  2249. <td valign="top" align="center">Yes</td>
  2250. </tr>
  2251. <tr>
  2252. <td valign="top">replace</td>
  2253. <td valign="top">Enable replacing of existing file (default: on).</td>
  2254. <td valign="top" align="center">No</td>
  2255. </tr>
  2256. </table>
  2257. <h3>Examples</h3>
  2258. <pre> &lt;rename src=&quot;foo.jar&quot; dest=&quot;${name}-${version}.jar&quot; /&gt;</pre>
  2259. <p>Renames the file <code>foo.jar</code> to <code>${name}-${version}.jar</code> (assuming <code>name</code>
  2260. and <code>version</code> being predefined properties). If a file named <code>${name}-${version}.jar</code>
  2261. already exists, it will be removed prior to renameing <code>foo.jar</code>.</p>
  2262. <hr>
  2263. <h2><a name="replace">Replace</a></h2>
  2264. <h3>Description</h3>
  2265. <p>Replace is a directory based task for replacing the occurrence of a given string with another string
  2266. in selected file.</p>
  2267. <h3>Parameters</h3>
  2268. <table border="1" cellpadding="2" cellspacing="0">
  2269. <tr>
  2270. <td valign="top"><b>Attribute</b></td>
  2271. <td valign="top"><b>Description</b></td>
  2272. <td align="center" valign="top"><b>Required</b></td>
  2273. </tr>
  2274. <tr>
  2275. <td valign="top">file</td>
  2276. <td valign="top">file for which the token should be replaced. If not present the dir attribute
  2277. must be specified</td>
  2278. <td valign="top" align="center">No</td>
  2279. </tr>
  2280. <tr>
  2281. <td valign="top">dir</td>
  2282. <td valign="top">The base directory to use when replacing a token in multiple files. If not present the file attribute
  2283. must be specified</td>
  2284. <td valign="top" align="center">No</td>
  2285. </tr>
  2286. <tr>
  2287. <td valign="top">token</td>
  2288. <td valign="top">the token which must be replaced.</td>
  2289. <td valign="top" align="center">Yes</td>
  2290. </tr>
  2291. <tr>
  2292. <td valign="top">value</td>
  2293. <td valign="top">the new value for the token. When omitted, an empty string
  2294. (&quot;&quot;) is used.</td>
  2295. <td valign="top" align="center">No</td>
  2296. </tr>
  2297. <tr>
  2298. <td valign="top">includes</td>
  2299. <td valign="top">comma separated list of patterns of files that must be
  2300. included. All files are included when omitted.</td>
  2301. <td valign="top" align="center">No</td>
  2302. </tr>
  2303. <tr>
  2304. <td valign="top">includesfile</td>
  2305. <td valign="top">the name of a file. Each line of this file is
  2306. taken to be an include pattern</td>
  2307. <td valign="top" align="center">No</td>
  2308. </tr>
  2309. <tr>
  2310. <td valign="top">excludes</td>
  2311. <td valign="top">comma separated list of patterns of files that must be
  2312. excluded. No files (except default excludes) are excluded when omitted.</td>
  2313. <td valign="top" align="center">No</td>
  2314. </tr>
  2315. <tr>
  2316. <td valign="top">excludesfile</td>
  2317. <td valign="top">the name of a file. Each line of this file is
  2318. taken to be an exclude pattern</td>
  2319. <td valign="top" align="center">No</td>
  2320. </tr>
  2321. <tr>
  2322. <td valign="top">defaultexcludes</td>
  2323. <td valign="top">indicates whether default excludes should be used or not
  2324. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2325. <td valign="top" align="center">No</td>
  2326. </tr>
  2327. </table>
  2328. <h3>Examples</h3>
  2329. <pre> &lt;replace file=&quot;${src}/index.html&quot; token=&quot;@@@&quot; value=&quot;wombat&quot; /&gt;</pre>
  2330. <p>replaces occurrences of the string &quot;@@@&quot; with the string
  2331. &quot;wombat&quot;, in the file <code>${src}/index.html</code>.</p>
  2332. <hr>
  2333. <h2><a name="rmic">Rmic</a></h2>
  2334. <h3>Description</h3>
  2335. <p>Runs the rmic compiler for a certain class.</p>
  2336. <h3>Parameters</h3>
  2337. <table border="1" cellpadding="2" cellspacing="0">
  2338. <tr>
  2339. <td valign="top"><b>Attribute</b></td>
  2340. <td valign="top"><b>Description</b></td>
  2341. <td align="center" valign="top"><b>Required</b></td>
  2342. </tr>
  2343. <tr>
  2344. <td valign="top">base</td>
  2345. <td valign="top">the location to store the compiled files.</td>
  2346. <td valign="top" align="center">Yes</td>
  2347. </tr>
  2348. <tr>
  2349. <td valign="top">classname</td>
  2350. <td valign="top">the class for which to run <code>rmic</code>.</td>
  2351. <td valign="top" align="center">Yes</td>
  2352. </tr>
  2353. <tr>
  2354. <td valign="top">filtering</td>
  2355. <td valign="top">indicates whether token filtering should take place</td>
  2356. <td valign="top" align="center">No</td>
  2357. </tr>
  2358. <tr>
  2359. <td valign="top">sourcebase</td>
  2360. <td valign="top">Pass the "-keepgenerated" flag to rmic and
  2361. move the generated source file to the base directory.</td>
  2362. <td align="center" valign="top">No</td>
  2363. </tr>
  2364. <tr>
  2365. <td valign="top">stubversion</td>
  2366. <td valign="top">Specify the JDK version for the generated stub code.
  2367. Specify "1.1" to pass the "-v1.1" option to rmic.</td>
  2368. <td align="center" valign="top">No</td>
  2369. </tr>
  2370. <tr>
  2371. <td valign="top">classpath</td>
  2372. <td valign="top">The classpath to use during compilation</td>
  2373. <td align="center" valign="top">No</td>
  2374. </tr>
  2375. </table>
  2376. <h3>Examples</h3>
  2377. <pre> &lt;rmic classname=&quot;com.xyz.FooBar&quot; base=&quot;${build}/classes&quot; /&gt;</pre>
  2378. <p>runs the rmic compiler for the class <code>com.xyz.FooBar</code>. The
  2379. compiled files will be stored in the directory <code>${build}/classes</code>.</p>
  2380. <hr>
  2381. <h2><a name="tar">Tar</a></h2>
  2382. <h3>Description</h3>
  2383. <p>Creates a tar archive.</p>
  2384. <p>The <i>basedir</i> attribute is the reference directory from where to tar.</p>
  2385. <p>It is possible to refine the set of files that are being tarred. This can be
  2386. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  2387. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  2388. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  2389. the files you want to have excluded. This is also done with patterns. And
  2390. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2391. want to use default exclusions or not. See the section on <a
  2392. href="#directorybasedtasks">directory based tasks</a>, on how the
  2393. inclusion/exclusion of files works, and how to write patterns. The patterns are
  2394. relative to the <i>basedir</i> directory.</p>
  2395. <p>The <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i> attributes
  2396. replace the <i>items</i> and <i>ignore</i> attributes. The following explains
  2397. how the deprecated <i>items</i> and <i>ignore</i> attribute behave.</p>
  2398. <p>When &quot;*&quot; is used for <i>items</i>, all files in the basedir, and
  2399. its subdirectories, will be tarred. Otherwise all the files and directories
  2400. mentioned in the items list will tarred. When a directory is specified, then all
  2401. files within it are also tarred.</p>
  2402. <p>With the <i>ignore</i> attribute, you can specify files or directories to
  2403. ignore. These files will not be tarred. The items in the <i>ignore</i> attribute
  2404. override the items in the <i>items</i> attribute. The names specified in the <i>ignore</i>
  2405. attribute are just names, they do not contain any path information!</p>
  2406. <p>Note that this task does not perform compression. You might want to use the <a href="#gzip">GZip</a>
  2407. task to come up with a .tar.gz package.</p>
  2408. <h3>Parameters</h3>
  2409. <table border="1" cellpadding="2" cellspacing="0">
  2410. <tr>
  2411. <td valign="top"><b>Attribute</b></td>
  2412. <td valign="top"><b>Description</b></td>
  2413. <td valign="top" align="center"><b>Required</b></td>
  2414. </tr>
  2415. <tr>
  2416. <td valign="top">tarfile</td>
  2417. <td valign="top">the tar-file to create.</td>
  2418. <td align="center" valign="top">Yes</td>
  2419. </tr>
  2420. <tr>
  2421. <td valign="top">basedir</td>
  2422. <td valign="top">the directory from which to zip the files.</td>
  2423. <td align="center" valign="top">Yes</td>
  2424. </tr>
  2425. <tr>
  2426. <td valign="top">includes</td>
  2427. <td valign="top">comma separated list of patterns of files that must be
  2428. included. All files are included when omitted.</td>
  2429. <td valign="top" align="center">No</td>
  2430. </tr>
  2431. <tr>
  2432. <td valign="top">includesfile</td>
  2433. <td valign="top">the name of a file. Each line of this file is
  2434. taken to be an include pattern</td>
  2435. <td valign="top" align="center">No</td>
  2436. </tr>
  2437. <tr>
  2438. <td valign="top">excludes</td>
  2439. <td valign="top">comma separated list of patterns of files that must be
  2440. excluded. No files (except default excludes) are excluded when omitted.</td>
  2441. <td valign="top" align="center">No</td>
  2442. </tr>
  2443. <tr>
  2444. <td valign="top">excludesfile</td>
  2445. <td valign="top">the name of a file. Each line of this file is
  2446. taken to be an exclude pattern</td>
  2447. <td valign="top" align="center">No</td>
  2448. </tr>
  2449. <tr>
  2450. <td valign="top">defaultexcludes</td>
  2451. <td valign="top">indicates whether default excludes should be used or not
  2452. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2453. <td valign="top" align="center">No</td>
  2454. </tr>
  2455. </table>
  2456. <h3>Examples</h3>
  2457. <pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot; basedir=&quot;htdocs/manual&quot; /&gt;
  2458. &lt;gzip zipfile=&quot;${dist}/manual.tar.gz&quot; src=&quot;${dist}/manual.tar&quot; /&gt;</pre>
  2459. <p>tars all files in the <code>htdocs/manual</code> directory in a file called <code>manual.tar</code>
  2460. in the <code>${dist}</code> directory, then applies the gzip task to compress
  2461. it.</p>
  2462. <pre> &lt;tar tarfile=&quot;${dist}/manual.tar&quot;
  2463. basedir=&quot;htdocs/manual&quot;
  2464. excludes=&quot;mydocs/**, **/todo.html&quot;
  2465. /&gt;</pre>
  2466. <p>tars all files in the <code>htdocs/manual</code> directory in a file called <code>manual.tar</code>
  2467. in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
  2468. or files with the name <code>todo.html</code> are excluded.</p>
  2469. <hr>
  2470. <h2><a name="taskdef">Taskdef</a></h2>
  2471. <h3>Description</h3>
  2472. <p>Adds a task definition to the current project, such that this new task can be
  2473. used in the current project. Two attributes are needed, the name that identifies
  2474. this task uniquely, and the full name of the class (including the packages) that
  2475. implements this task.</p>
  2476. <p>Taskdef should be used to add your own tasks to the system. See also &quot;<a
  2477. href="#writingowntask">Writing your own task</a>&quot;.</p>
  2478. <h3>Parameters</h3>
  2479. <table border="1" cellpadding="2" cellspacing="0">
  2480. <tr>
  2481. <td valign="top"><b>Attribute</b></td>
  2482. <td valign="top"><b>Description</b></td>
  2483. <td align="center" valign="top"><b>Required</b></td>
  2484. </tr>
  2485. <tr>
  2486. <td valign="top">name</td>
  2487. <td valign="top">the name of the task</td>
  2488. <td valign="top" align="center">Yes</td>
  2489. </tr>
  2490. <tr>
  2491. <td valign="top">classname</td>
  2492. <td valign="top">the full class name implementing the task</td>
  2493. <td valign="top" align="center">Yes</td>
  2494. </tr>
  2495. </table>
  2496. <h3>Examples</h3>
  2497. <pre> &lt;taskdef name=&quot;myjavadoc&quot; classname=&quot;com.mydomain.JavadocTask&quot; /&gt;</pre>
  2498. <p>makes a task called <code>myjavadoc</code> available to Ant. The class <code>com.mydomain.JavadocTask</code>
  2499. implements the task.</p>
  2500. <hr>
  2501. <h2><a name="touch">Touch</a></h2>
  2502. <h3>Description</h3>
  2503. <p>Changes the modification time of a file and possibly creates it at
  2504. the same time.</p>
  2505. <p>For JDK 1.1 only the creation of new files with a modification time
  2506. of now works, all other cases will emit a warning.</p>
  2507. <h3>Parameters</h3>
  2508. <table border="1" cellpadding="2" cellspacing="0">
  2509. <tr>
  2510. <td valign="top"><b>Attribute</b></td>
  2511. <td valign="top"><b>Description</b></td>
  2512. <td align="center" valign="top"><b>Required</b></td>
  2513. </tr>
  2514. <tr>
  2515. <td valign="top">file</td>
  2516. <td valign="top">the name of the file</td>
  2517. <td valign="top" align="center">Yes</td>
  2518. </tr>
  2519. <tr>
  2520. <td valign="top">millis</td>
  2521. <td valign="top">specifies the new modification time of the file
  2522. in milliseconds since midnight Jan 1 1970</td>
  2523. <td valign="top" align="center">No</td>
  2524. </tr>
  2525. <tr>
  2526. <td valign="top">datetime</td>
  2527. <td valign="top">specifies the new modification time of the file
  2528. in the format MM/DD/YYYY HH:MM AM_or_PM.</td>
  2529. <td valign="top" align="center">No</td>
  2530. </tr>
  2531. </table>
  2532. <p>If both <code>millis</code> and <code>datetime</code> are ommited
  2533. the current time is assumed.</p>
  2534. <h3>Examples</h3>
  2535. <pre> &lt;touch file=&quot;myfile&quot; /&gt;</pre>
  2536. <p>creates <code>myfile</code> if it doesn't exist and changes the
  2537. modification time to the current time.</p>
  2538. <pre> &lt;touch file=&quot;myfile&quot; datetime=&quot;06/28/2000 2:02 pm&quot; /&gt;</pre>
  2539. <p>creates <code>myfile</code> if it doesn't exist and changes the
  2540. modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24
  2541. hour times).</p>
  2542. <hr>
  2543. <h2><a name="tstamp">Tstamp</a></h2>
  2544. <h3>Description</h3>
  2545. <p>Sets the DSTAMP, TSTAMP and TODAY properties in the current project. The
  2546. DSTAMP is in the &quot;yyyymmdd&quot; format, the TSTAMP is in the &quot;hhmm&quot;
  2547. format and TODAY is &quot;month day year&quot;.</p>
  2548. <p>These properties can be used in the buildfile, for instance, to create
  2549. timestamped filenames or used to replace placeholder tags inside documents to
  2550. indicate, for example, the release date. The best place for this task is in your
  2551. initialization target.</p>
  2552. <h3>Parameters</h3>
  2553. <table border="1" cellpadding="2" cellspacing="0">
  2554. <tr>
  2555. <td valign="top"><b>Attribute</b></td>
  2556. <td valign="top"><b>Description</b></td>
  2557. <td align="center" valign="top"><b>Required</b></td>
  2558. </tr>
  2559. </table>
  2560. <h3>Examples</h3>
  2561. <pre> &lt;tstamp/&gt;</pre>
  2562. <hr>
  2563. <h2><a name="style">Style</a></h2>
  2564. <h3>Description</h3>
  2565. <p>Process a set of documents via XSLT.</p>
  2566. <p>This is useful for building views of XML based documentation,
  2567. or in generating code.</p>
  2568. <p>It is possible to refine the set of files that are being copied. This can be
  2569. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  2570. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  2571. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  2572. the files you want to have excluded. This is also done with patterns. And
  2573. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2574. want to use default exclusions or not. See the section on <a
  2575. href="#directorybasedtasks">directory based tasks</a>, on how the
  2576. inclusion/exclusion of files works, and how to write patterns. The patterns are
  2577. relative to the <i>basedir</i> directory.</p>
  2578. <h3>Parameters</h3>
  2579. <table border="1" cellpadding="2" cellspacing="0">
  2580. <tr>
  2581. <td valign="top"><b>Attribute</b></td>
  2582. <td valign="top"><b>Description</b></td>
  2583. <td align="center" valign="top"><b>Required</b></td>
  2584. </tr>
  2585. <tr>
  2586. <td valign="top">basedir</td>
  2587. <td valign="top">where to find the source xml file.</td>
  2588. <td align="center" valign="top">Yes</td>
  2589. </tr>
  2590. <tr>
  2591. <td valign="top">destdir</td>
  2592. <td valign="top">directory where to store the results.</td>
  2593. <td align="center" valign="top">Yes</td>
  2594. </tr>
  2595. <tr>
  2596. <td valign="top">extention</td>
  2597. <td valign="top">desired file extension to be used for the targets.
  2598. If not specified, the default is "html".</td>
  2599. <td align="center" valign="top">No</td>
  2600. </tr>
  2601. <tr>
  2602. <td valign="top">style</td>
  2603. <td valign="top">name of the stylesheet to use.</td>
  2604. <td align="center" valign="top">Yes</td>
  2605. </tr>
  2606. <tr>
  2607. <td valign="top">processor</td>
  2608. <td valign="top">name of the XSLT processor to use. Permissable
  2609. values are "xslp" for the XSL:P processor, "xalan" for the Apache XML Xalan
  2610. processor, or the name of an arbitrary XSLTLiaison class.
  2611. Defaults to xslp or xalan (in that order), if one is found in your
  2612. class path</td>
  2613. <td align="center" valign="top">No</td>
  2614. </tr>
  2615. <tr>
  2616. <td valign="top">includes</td>
  2617. <td valign="top">comma separated list of patterns of files that must be
  2618. included. All files are included when omitted.</td>
  2619. <td valign="top" align="center">No</td>
  2620. </tr>
  2621. <tr>
  2622. <td valign="top">includesfile</td>
  2623. <td valign="top">the name of a file. Each line of this file is
  2624. taken to be an include pattern</td>
  2625. <td valign="top" align="center">No</td>
  2626. </tr>
  2627. <tr>
  2628. <td valign="top">excludes</td>
  2629. <td valign="top">comma separated list of patterns of files that must be
  2630. excluded. No files (except default excludes) are excluded when omitted.</td>
  2631. <td valign="top" align="center">No</td>
  2632. </tr>
  2633. <tr>
  2634. <td valign="top">excludesfile</td>
  2635. <td valign="top">the name of a file. Each line of this file is
  2636. taken to be an exclude pattern</td>
  2637. <td valign="top" align="center">No</td>
  2638. </tr>
  2639. <tr>
  2640. <td valign="top">defaultexcludes</td>
  2641. <td valign="top">indicates whether default excludes should be used or not
  2642. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2643. <td valign="top" align="center">No</td>
  2644. </tr>
  2645. </table>
  2646. <h3>Examples</h3>
  2647. <blockquote>
  2648. <p><pre>
  2649. &lt;style basedir=&quot;doc&quot; destdir=&quot;build/doc&quot;
  2650. extension=&quot;html&quot; style=&quot;style/apache.xml&quot;/&gt;
  2651. </pre></p>
  2652. </blockquote>
  2653. <hr>
  2654. <h2><a name="untar">Untar</a></h2>
  2655. <h3>Description</h3>
  2656. <p>Untars a tarfile.</p>
  2657. <p>For JDK 1.1 "last modified time" field is set to current time instead of being
  2658. carried from tarfile.</p>
  2659. <h3>Parameters</h3>
  2660. <table border="1" cellpadding="2" cellspacing="0">
  2661. <tr>
  2662. <td valign="top"><b>Attribute</b></td>
  2663. <td valign="top"><b>Description</b></td>
  2664. <td align="center" valign="top"><b>Required</b></td>
  2665. </tr>
  2666. <tr>
  2667. <td valign="top">src</td>
  2668. <td valign="top">tarfile to expand.</td>
  2669. <td align="center" valign="top">Yes</td>
  2670. </tr>
  2671. <tr>
  2672. <td valign="top">dest</td>
  2673. <td valign="top">directory where to store the expanded files.</td>
  2674. <td align="center" valign="top">Yes</td>
  2675. </tr>
  2676. </table>
  2677. <h3>Examples</h3>
  2678. <blockquote>
  2679. <p><code>
  2680. &lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
  2681. &lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
  2682. </code></p>
  2683. </blockquote>
  2684. <hr>
  2685. <h2><a name="zip">Zip</a></h2>
  2686. <h3>Description</h3>
  2687. <p>Creates a zipfile.</p>
  2688. <p>The <i>basedir</i> attribute is the reference directory from where to zip.</p>
  2689. <p>It is possible to refine the set of files that are being zipped. This can be
  2690. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  2691. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  2692. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  2693. the files you want to have excluded. This is also done with patterns. And
  2694. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  2695. want to use default exclusions or not. See the section on <a
  2696. href="#directorybasedtasks">directory based tasks</a>, on how the
  2697. inclusion/exclusion of files works, and how to write patterns. The patterns are
  2698. relative to the <i>basedir</i> directory.</p>
  2699. <p>The <i>includes</i>, <i>excludes</i> and <i>defaultexcludes</i> attributes
  2700. replace the <i>items</i> and <i>ignore</i> attributes. The following explains
  2701. how the deprecated <i>items</i> and <i>ignore</i> attribute behave.</p>
  2702. <p>When &quot;*&quot; is used for <i>items</i>, all files in the basedir, and
  2703. its subdirectories, will be zipped. Otherwise all the files and directories
  2704. mentioned in the items list will zipped. When a directory is specified, then all
  2705. files within it are also zipped.</p>
  2706. <p>With the <i>ignore</i> attribute, you can specify files or directories to
  2707. ignore. These files will not be zipped. The items in the <i>ignore</i> attribute
  2708. override the items in the <i>items</i> attribute. The names specified in the <i>ignore</i>
  2709. attribute are just names, they do not contain any path information!</p>
  2710. <h3>Parameters</h3>
  2711. <table border="1" cellpadding="2" cellspacing="0">
  2712. <tr>
  2713. <td valign="top"><b>Attribute</b></td>
  2714. <td valign="top"><b>Description</b></td>
  2715. <td valign="top" align="center"><b>Required</b></td>
  2716. </tr>
  2717. <tr>
  2718. <td valign="top">zipfile</td>
  2719. <td valign="top">the zip-file to create.</td>
  2720. <td align="center" valign="top">Yes</td>
  2721. </tr>
  2722. <tr>
  2723. <td valign="top">basedir</td>
  2724. <td valign="top">the directory from which to zip the files.</td>
  2725. <td align="center" valign="top">Yes</td>
  2726. </tr>
  2727. <tr>
  2728. <td valign="top">compress</td>
  2729. <td valign="top">Not only store data but also compress them, defaults to true</td>
  2730. <td align="center" valign="top">No</td>
  2731. </tr>
  2732. <tr>
  2733. <td valign="top">items</td>
  2734. <td valign="top">a comma separated list of the files/directories to zip. All
  2735. files are included when omitted. (<b>deprecated</b>, use <i>includes</i>
  2736. instead).</td>
  2737. <td valign="top" align="center">No</td>
  2738. </tr>
  2739. <tr>
  2740. <td valign="top">ignore</td>
  2741. <td valign="top">comma separated list of filenames/directorynames to exclude
  2742. from the zip. No files (except default excludes) are excluded when
  2743. omitted. (<b>deprecated</b>, use <i>excludes</i> instead).</td>
  2744. <td valign="top" align="center">No</td>
  2745. </tr>
  2746. <tr>
  2747. <td valign="top">includes</td>
  2748. <td valign="top">comma separated list of patterns of files that must be
  2749. included. All files are included when omitted.</td>
  2750. <td valign="top" align="center">No</td>
  2751. </tr>
  2752. <tr>
  2753. <td valign="top">includesfile</td>
  2754. <td valign="top">the name of a file. Each line of this file is
  2755. taken to be an include pattern</td>
  2756. <td valign="top" align="center">No</td>
  2757. </tr>
  2758. <tr>
  2759. <td valign="top">excludes</td>
  2760. <td valign="top">comma separated list of patterns of files that must be
  2761. excluded. No files (except default excludes) are excluded when omitted.</td>
  2762. <td valign="top" align="center">No</td>
  2763. </tr>
  2764. <tr>
  2765. <td valign="top">excludesfile</td>
  2766. <td valign="top">the name of a file. Each line of this file is
  2767. taken to be an exclude pattern</td>
  2768. <td valign="top" align="center">No</td>
  2769. </tr>
  2770. <tr>
  2771. <td valign="top">defaultexcludes</td>
  2772. <td valign="top">indicates whether default excludes should be used or not
  2773. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  2774. <td valign="top" align="center">No</td>
  2775. </tr>
  2776. </table>
  2777. <h3>Examples</h3>
  2778. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2779. basedir=&quot;htdocs/manual&quot;
  2780. /&gt;</pre>
  2781. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2782. in the <code>${dist}</code> directory.</p>
  2783. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2784. basedir=&quot;htdocs/manual&quot;
  2785. excludes=&quot;mydocs/**, **/todo.html&quot;
  2786. /&gt;</pre>
  2787. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2788. in the <code>${dist}</code> directory. Files in the directory <code>mydocs</code>,
  2789. or files with the name <code>todo.html</code> are excluded.</p>
  2790. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2791. basedir=&quot;htdocs/manual&quot;
  2792. includes=&quot;api/**/*.html&quot;
  2793. excludes=&quot;**/todo.html&quot;
  2794. /&gt;</pre>
  2795. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2796. in the <code>${dist}</code> directory. Only html files under the directory <code>api</code>
  2797. are zipped, and files with the name <code>todo.html</code> are excluded.</p>
  2798. <h3>Deprecated examples</h3>
  2799. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2800. basedir=&quot;htdocs/manual&quot;
  2801. items=&quot;*&quot;
  2802. /&gt;</pre>
  2803. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2804. in the <code>${dist}</code> directory.</p>
  2805. <pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
  2806. basedir=&quot;htdocs/manual&quot;
  2807. items=&quot;*&quot;
  2808. ignore=&quot;mydocs, todo.html&quot;
  2809. /&gt;</pre>
  2810. <p>zips all files in the <code>htdocs/manual</code> directory in a file called <code>manual.zip</code>
  2811. in the <code>${dist}</code> directory. Files/directories with the names <code>mydocs</code>
  2812. and <code>todo.html</code> are excluded.</p>
  2813. <hr>
  2814. <h2><a name="buildevents">Build Events</a></h2>
  2815. Ant is capable of generating build events as it performs the tasks necessary to build a project.
  2816. Listeners can be attached to ant to receive these events. This capability could be used, for example,
  2817. to connect Ant to a GUI or to integrate Ant with an IDE.
  2818. <p>To use build events you need to create an ant <code>Project</code> object. You can then call the
  2819. <code>addBuildListener</code> method to add your listener to the project. Your listener must implement
  2820. the <code>org.apache.tools.antBuildListener</code> interface. The listener will receive BuildEvents
  2821. for the following events
  2822. <ul>
  2823. <li>Build started
  2824. <li>Build finished
  2825. <li>Target started
  2826. <li>Target finished
  2827. <li>Task started
  2828. <li>Task finished
  2829. <li>Message logged
  2830. </ul>
  2831. If you wish to attach a listener from the command line you may use the -listener option. For example
  2832. <blockquote>
  2833. <pre>ant -listener org.apache.tools.ant.XmlLogger</pre>
  2834. </blockquote>
  2835. will run ant with a listener which generates an XML representaion of the build progress. This
  2836. listener is included with ant as is the default listener which generates the logging to standard
  2837. output.
  2838. <hr>
  2839. <h2><a name="writingowntask">Writing your own task</a></h2>
  2840. <p>It is very easy to write your own task:</p>
  2841. <ol>
  2842. <li>Create a Java class that extends <code>org.apache.tools.ant.Task</code>.</li>
  2843. <li>For each attribute, write a setter method. The setter method must be a <code>public
  2844. void</code> method that takes one <code>String</code> as an argument. The
  2845. name of the method must begin with &quot;set&quot;, followed by the
  2846. attribute name, with the first character in uppercase, and the rest in
  2847. lowercase.</li>
  2848. <li>Write a <code>public void execute</code> method, with no arguments, that
  2849. throws a <code>BuildException</code>. This method implements the task
  2850. itself.</li>
  2851. </ol>
  2852. <p>It is important to know that Ant first calls the setters for the attributes
  2853. it encounters for a specific task in the buildfile, before it executes is.</p>
  2854. <p>Let's write our own task, that prints a message on the System.out stream. The
  2855. task has one attribute called &quot;message&quot;.</p>
  2856. <blockquote>
  2857. <pre>package com.mydomain;
  2858. import org.apache.tools.ant.BuildException;
  2859. import org.apache.tools.ant.Task;
  2860. public class MyVeryOwnTask extends Task {
  2861. private String msg;
  2862. // The method executing the task
  2863. public void execute() throws BuildException {
  2864. System.out.println(msg);
  2865. }
  2866. // The setter for the &quot;message&quot; attribute
  2867. public void setMessage(String msg) {
  2868. this.msg = msg;
  2869. }
  2870. }</pre>
  2871. </blockquote>
  2872. <p>It's really this simple;-)</p>
  2873. <p>Adding your task to the system is rather simple too:</p>
  2874. <ol>
  2875. <li>Make sure the class that implements your task is in the classpath when
  2876. starting Ant.</li>
  2877. <li>In your initialization target, add a <i>taskdef</i> task. This actually adds
  2878. your task to the system.</li>
  2879. <li>Use your task in the rest of the buildfile.</li>
  2880. </ol>
  2881. <h3>Example</h3>
  2882. <blockquote>
  2883. <pre>&lt;?xml version=&quot;1.0&quot;?&gt;
  2884. &lt;project name=&quot;OwnTaskExample&quot; default=&quot;main&quot; basedir=&quot;.&quot;&gt;
  2885. &lt;target name=&quot;init&quot;&gt;
  2886. &lt;taskdef name=&quot;mytask&quot; classname=&quot;com.mydomain.MyVeryOwnTask&quot;/&gt;
  2887. &lt;/target&gt;
  2888. &lt;target name=&quot;main&quot; depends=&quot;init&quot;&gt;
  2889. &lt;mytask message=&quot;Hello World! MyVeryOwnTask works!&quot; /&gt;
  2890. &lt;/target&gt;
  2891. &lt;/project&gt;
  2892. </pre>
  2893. </blockquote>
  2894. <p>Another way to add a task (more permanently), is to add the task name and
  2895. implementing class name to the <code>default.properties</code> file in the <code>org.apache.tools.ant.taskdefs</code>
  2896. package. Then you can use it as if it were a built in task.</p>
  2897. <hr>
  2898. <h2><a name="feedback">Feedback</a></h2>
  2899. <p>To provide feedback on this software, please subscribe to the Ant Development
  2900. Mail List <a href="mailto:(ant-dev-subscribe@jakarta.apache.org">(ant-dev-subscribe@jakarta.apache.org</a>)</p>
  2901. <hr>
  2902. <p align="center">Copyright 2000 Apache Software Foundation. All rights
  2903. Reserved.</p>
  2904. <h2><a name="optionaltasks">Optional tasks</a></h2>
  2905. <ul>
  2906. <li><a href="#netrexxc">NetRexxC</a></li>
  2907. <li><a href="#renameexts">RenameExtensions</a></li>
  2908. <li><a href="#script">Script</a></li>
  2909. </ul>
  2910. <hr>
  2911. <h2><a name="netrexxc">NetRexxC</a></h2>
  2912. <h3><b>Description:</b></h3>
  2913. <p>Compiles a <a href="http://www2.hursley.ibm.com/netrexx">NetRexx</a>
  2914. source tree within the running (Ant) VM.</p>
  2915. <p>The source and destination directory will be recursively scanned for
  2916. NetRexx source files to compile. Only NetRexx files that have no corresponding
  2917. class file or where the class file is older than the java file will be compiled.</p>
  2918. <p>Files in the source tree are copied to the destination directory,
  2919. allowing support files to be located properly in the classpath. The source
  2920. files are copied because the NetRexx compiler cannot produce class files in a
  2921. specific directory via parameters</p>
  2922. <p>The directory structure of the source tree should follow the package
  2923. hierarchy.</p>
  2924. <p>It is possible to refine the set of files that are being compiled/copied.
  2925. This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and
  2926. <i>defaultexcludes</i> attributes. With the <i>includes</i> or <i>includesfile</i> attribute you
  2927. specify the files you want to have included by using patterns. The
  2928. <i>exclude</i> or <i>excludesfile</i> attribute is used to specify the files you want to have
  2929. excluded. This is also done with patterns. And finally with the
  2930. <i>defaultexcludes</i> attribute, you can specify whether you
  2931. want to use default exclusions or not. See the section on <a
  2932. href="#directorybasedtasks">directory based tasks</a>, on how the
  2933. inclusion/exclusion of files works, and how to write patterns. The
  2934. patterns are relative to the <i>srcDir</i> directory.</p>
  2935. <h3>Parameters:</h3>
  2936. <table border="1" cellpadding="2" cellspacing="0">
  2937. <tr>
  2938. <td valign="top"><b>Attribute</b></td>
  2939. <td valign="top"><b>Description</b></td>
  2940. <td align="center" valign="top"><b>Required</b></td>
  2941. </tr>
  2942. <tr>
  2943. <td valign="top">binary</td>
  2944. <td valign="top">Whether literals are treated as the java binary
  2945. type rather than the NetRexx types</td>
  2946. <td valign="top" align="center">No</td>
  2947. </tr>
  2948. <tr>
  2949. <td valign="top">classpath</td>
  2950. <td valign="top">The classpath to use during compilation</td>
  2951. <td valign="top" align="center">No</td>
  2952. </tr>
  2953. <tr>
  2954. <td valign="top">comments</td>
  2955. <td valign="top">Whether comments are passed through to the
  2956. generated java source</td>
  2957. <td valign="top" align="center">No</td>
  2958. </tr>
  2959. <tr>
  2960. <td valign="top">compact</td>
  2961. <td valign="top">Whether error messages come out in compact or
  2962. verbose format</td>
  2963. <td valign="top" align="center">No</td>
  2964. </tr>
  2965. <tr>
  2966. <td valign="top">compile</td>
  2967. <td valign="top">Whether the NetRexx compiler should compile the
  2968. generated java code</td>
  2969. <td valign="top" align="center">No</td>
  2970. </tr>
  2971. <tr>
  2972. <td valign="top">console</td>
  2973. <td valign="top">Whether or not messages should be displayed on the
  2974. 'console'</td>
  2975. <td valign="top" align="center">No</td>
  2976. </tr>
  2977. <tr>
  2978. <td valign="top">crossref</td>
  2979. <td valign="top">Whether variable cross references are generated</td>
  2980. <td valign="top" align="center">No</td>
  2981. </tr>
  2982. <tr>
  2983. <td valign="top">decimal</td>
  2984. <td valign="top">Whether decimal arithmetic should be used for the
  2985. NetRexx code</td>
  2986. <td valign="top" align="center">No</td>
  2987. </tr>
  2988. <tr>
  2989. <td valign="top">defaultexcludes</td>
  2990. <td valign="top">indicates whether default excludes should be used or not
  2991. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  2992. omitted.</td>
  2993. <td valign="top" align="center">No</td>
  2994. </tr>
  2995. <tr>
  2996. <td valign="top">destDir</td>
  2997. <td valign="top">the destination directory into which the NetRexx
  2998. source files should be copied and then compiled</td>
  2999. <td valign="top" align="center">Yes</td>
  3000. </tr>
  3001. <tr>
  3002. <td valign="top">diag</td>
  3003. <td valign="top">Whether diagnostic information about the compile is
  3004. generated</td>
  3005. <td valign="top" align="center">No</td>
  3006. </tr>
  3007. <tr>
  3008. <td valign="top">excludes</td>
  3009. <td valign="top">comma separated list of patterns of files that must be
  3010. excluded. No files (except default excludes) are excluded when
  3011. omitted.</td>
  3012. <td valign="top" align="center">No</td>
  3013. </tr>
  3014. <tr>
  3015. <td valign="top">excludesfile</td>
  3016. <td valign="top">the name of a file. Each line of this file is
  3017. taken to be an exclude pattern</td>
  3018. <td valign="top" align="center">No</td>
  3019. </tr>
  3020. <tr>
  3021. <td valign="top">explicit</td>
  3022. <td valign="top">Whether variables must be declared explicitly
  3023. before use</td>
  3024. <td valign="top" align="center">No</td>
  3025. </tr>
  3026. <tr>
  3027. <td valign="top">format</td>
  3028. <td valign="top">Whether the generated java code is formatted nicely
  3029. or left to match NetRexx line numbers for call stack debugging</td>
  3030. <td valign="top" align="center">No</td>
  3031. </tr>
  3032. <tr>
  3033. <td valign="top">includes</td>
  3034. <td valign="top">comma separated list of patterns of files that must be
  3035. included. All files are included when omitted.</td>
  3036. <td valign="top" align="center">No</td>
  3037. </tr>
  3038. <tr>
  3039. <td valign="top">includesfile</td>
  3040. <td valign="top">the name of a file. Each line of this file is
  3041. taken to be an include pattern</td>
  3042. <td valign="top" align="center">No</td>
  3043. </tr>
  3044. <tr>
  3045. <td valign="top">java</td>
  3046. <td valign="top">Whether the generated java code is produced</td>
  3047. <td valign="top" align="center">No</td>
  3048. </tr>
  3049. <tr>
  3050. <td valign="top">keep</td>
  3051. <td valign="top">Sets whether the generated java source file should be kept
  3052. after compilation. The generated files will have an extension of
  3053. .java.keep, <b>not</b> .java</td>
  3054. <td valign="top" align="center">No</td>
  3055. </tr>
  3056. <tr>
  3057. <td valign="top">logo</td>
  3058. <td valign="top">Whether the compiler text logo is displayed when
  3059. compiling</td>
  3060. <td valign="top" align="center">No</td>
  3061. </tr>
  3062. <tr>
  3063. <td valign="top">replace</td>
  3064. <td valign="top">Whether the generated .java file should be replaced
  3065. when compiling</td>
  3066. <td valign="top" align="center">No</td>
  3067. </tr>
  3068. <tr>
  3069. <td valign="top">savelog</td>
  3070. <td valign="top">Whether the compiler messages will be written to
  3071. NetRexxC.log as well as to the console</td>
  3072. <td valign="top" align="center">No</td>
  3073. </tr>
  3074. <tr>
  3075. <td valign="top">sourcedir</td>
  3076. <td valign="top">Tells the NetRexx compiler to store the class files in the
  3077. same directory as the source files. The alternative is the working
  3078. directory</td>
  3079. <td valign="top" align="center">No</td>
  3080. </tr>
  3081. <tr>
  3082. <td valign="top">srcDir</td>
  3083. <td valign="top">Set the source dir to find the source Netrexx
  3084. files</td>
  3085. <td valign="top" align="center">Yes</td>
  3086. </tr>
  3087. <tr>
  3088. <td valign="top">strictargs</td>
  3089. <td valign="top">Tells the NetRexx compiler that method calls always
  3090. need parentheses, even if no arguments are needed, e.g.
  3091. <code>aStringVar.getBytes</code> vs.
  3092. <code>aStringVar.getBytes()</code></td>
  3093. <td valign="top" align="center">No</td>
  3094. </tr>
  3095. <tr>
  3096. <td valign="top">strictassign</td>
  3097. <td valign="top">Tells the NetRexx compile that assignments must
  3098. match exactly on type</td>
  3099. <td valign="top" align="center">No</td>
  3100. </tr>
  3101. <tr>
  3102. <td valign="top">strictcase</td>
  3103. <td valign="top">Specifies whether the NetRexx compiler should be
  3104. case sensitive or not</td>
  3105. <td valign="top" align="center">No</td>
  3106. </tr>
  3107. <tr>
  3108. <td valign="top">strictimport</td>
  3109. <td valign="top">Whether classes need to be imported explicitly using an
  3110. <code>import</code> statement. By default the NetRexx compiler will
  3111. import certain packages automatically</td>
  3112. <td valign="top" align="center">No</td>
  3113. </tr>
  3114. <tr>
  3115. <td valign="top">strictprops</td>
  3116. <td valign="top">Whether local properties need to be qualified
  3117. explicitly using <code>this</code></td>
  3118. <td valign="top" align="center">No</td>
  3119. </tr>
  3120. <tr>
  3121. <td valign="top">strictsignal</td>
  3122. <td valign="top">Whether the compiler should force catching of
  3123. exceptions by explicitly named types</td>
  3124. <td valign="top" align="center">No</td>
  3125. </tr>
  3126. <tr>
  3127. <td valign="top">symbols</td>
  3128. <td valign="top">Whether debug symbols should be generated into the
  3129. class file</td>
  3130. <td valign="top" align="center">No</td>
  3131. </tr>
  3132. <tr>
  3133. <td valign="top">time</td>
  3134. <td valign="top">Asks the NetRexx compiler to print compilation
  3135. times to the console</td>
  3136. <td valign="top" align="center">No</td>
  3137. </tr>
  3138. <tr>
  3139. <td valign="top">trace</td>
  3140. <td valign="top">Turns on or off tracing and directs the resultant
  3141. trace output</td>
  3142. <td valign="top" align="center">No</td>
  3143. </tr>
  3144. <tr>
  3145. <td valign="top">utf8</td>
  3146. <td valign="top">Tells the NetRexx compiler that the source is in UTF8</td>
  3147. <td valign="top" align="center">No</td>
  3148. </tr>
  3149. <tr>
  3150. <td valign="top">verbose</td>
  3151. <td valign="top">Whether lots of warnings and error messages should
  3152. be generated</td>
  3153. <td valign="top" align="center">Yes</td>
  3154. </tr>
  3155. </table>
  3156. <h3>Examples</h3>
  3157. <blockquote>
  3158. <p><code>&lt;netrexxc srcDir=&quot;/source/project&quot;
  3159. includes=&quot;vnr/util/*&quot;
  3160. destDir=&quot;/source/project/build&quot;
  3161. classpath=&quot;/source/project2/proj.jar&quot;
  3162. comments=&quot;true&quot;
  3163. crossref=&quot;false&quot; replace=&quot;true&quot;
  3164. keep=&quot;true&quot; /&gt;</code>
  3165. </p>
  3166. </blockquote>
  3167. <hr>
  3168. <h2><a name="renameexts">RenameExtensions</a></h2>
  3169. <h3><b>Description:</b></h3>
  3170. <p>Renames files in the <code>srcDir</code> directory ending with the
  3171. <code>fromExtension</code> string so that they end with the
  3172. <code>toExtension</code> string. Files are only replaced if
  3173. <code>replace</code> is true
  3174. </p>
  3175. <p>See the section on
  3176. <a href="#directorybasedtasks">directory based tasks</a>, on how the
  3177. inclusion/exclusion of files works, and how to write patterns. The
  3178. patterns are relative to the <i>srcDir</i> directory.</p>
  3179. <h3>Parameters:</h3>
  3180. <table border="1" cellpadding="2" cellspacing="0">
  3181. <tr>
  3182. <td valign="top"><b>Attribute</b></td>
  3183. <td valign="top"><b>Description</b></td>
  3184. <td align="center" valign="top"><b>Required</b></td>
  3185. </tr>
  3186. <tr>
  3187. <td valign="top">defaultexcludes</td>
  3188. <td valign="top">indicates whether default excludes should be used or not
  3189. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  3190. omitted.</td>
  3191. <td valign="top" align="center">No</td>
  3192. </tr>
  3193. <tr>
  3194. <td valign="top">excludes</td>
  3195. <td valign="top">comma separated list of patterns of files that must be
  3196. excluded. No files (except default excludes) are excluded when
  3197. omitted.</td>
  3198. <td valign="top" align="center">No</td>
  3199. </tr>
  3200. <tr>
  3201. <td valign="top">excludesfile</td>
  3202. <td valign="top">the name of a file. Each line of this file is
  3203. taken to be an exclude pattern</td>
  3204. <td valign="top" align="center">No</td>
  3205. </tr>
  3206. <tr>
  3207. <td valign="top">fromExtention</td>
  3208. <td valign="top">The string that files must end in to be renamed</td>
  3209. <td valign="top" align="center">Yes</td>
  3210. </tr>
  3211. <tr>
  3212. <td valign="top">includes</td>
  3213. <td valign="top">comma separated list of patterns of files that must be
  3214. included. All files are included when omitted.</td>
  3215. <td valign="top" align="center">No</td>
  3216. </tr>
  3217. <tr>
  3218. <td valign="top">includesfile</td>
  3219. <td valign="top">the name of a file. Each line of this file is
  3220. taken to be an include pattern</td>
  3221. <td valign="top" align="center">No</td>
  3222. </tr>
  3223. <tr>
  3224. <td valign="top">replace</td>
  3225. <td valign="top">Whether the file being renamed to should be
  3226. replaced if it already exists</td>
  3227. <td valign="top" align="center">No</td>
  3228. </tr>
  3229. <tr>
  3230. <td valign="top">srcDir</td>
  3231. <td valign="top">The starting directory for files to search in</td>
  3232. <td valign="top" align="center">Yes</td>
  3233. </tr>
  3234. <tr>
  3235. <td valign="top">toExtension</td>
  3236. <td valign="top">The string that renamed files will end with on
  3237. completion</td>
  3238. <td valign="top" align="center">Yes</td>
  3239. </tr>
  3240. </table>
  3241. <h3>Examples</h3>
  3242. <blockquote>
  3243. <p><code>&lt;renameext srcDir=&quot;/source/project1&quot;
  3244. includes=&quot;**&quot;
  3245. excludes=&quot;**/samples/*&quot;
  3246. fromExtension=&quot;.java.keep&quot;
  3247. toExtension=&quot;.java&quot;
  3248. replace=&quot;true&quot; /&gt;
  3249. </code>
  3250. </p>
  3251. </blockquote>
  3252. <hr>
  3253. <h2><a name="script">Script</a></h2>
  3254. <h3><b>Description:</b></h3>
  3255. <p>Execute a script in a
  3256. <a href="http://www.alphaworks.ibm.com/tech/bsf">BSF</a> supported language.
  3257. <p>All items (tasks, targets, etc) of the running project are accessible
  3258. from the script.
  3259. <h3>Parameters:</h3>
  3260. <table border="1" cellpadding="2" cellspacing="0">
  3261. <tr>
  3262. <td valign="top"><b>Attribute</b></td>
  3263. <td valign="top"><b>Description</b></td>
  3264. <td align="center" valign="top"><b>Required</b></td>
  3265. </tr>
  3266. <tr>
  3267. <td valign="top">language</td>
  3268. <td valign="top">The programming language the script is written in.
  3269. Must be a supported BSF language</td>
  3270. <td valign="top" align="center">No</td>
  3271. </tr>
  3272. <tr>
  3273. <td valign="top">src</td>
  3274. <td valign="top">The location of the script as a file, if not inline</td>
  3275. <td valign="top" align="center">No</td>
  3276. </tr>
  3277. </table>
  3278. <h3>Examples</h3>
  3279. <blockquote>
  3280. <p>None yet available</p>
  3281. </blockquote>
  3282. </body>
  3283. </html>