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.

antlib_descriptors.html 7.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html lang="en">
  3. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  4. <head>
  5. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  6. <title>Apache Ant - Antlib Descriptor</title>
  7. <link type="text/css" href="../../page.css" rel="stylesheet">
  8. <meta name="author" content="Antoine Levy-Lambert">
  9. <meta name="email" content="antoine@apache.org">
  10. </head>
  11. <body>
  12. <p class="navpath">
  13. <script src="../../breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  14. </p>
  15. <div class="logobar">
  16. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  17. <tr>
  18. <td align="left"><img border="0" alt="Apache Ant site" src="../../images/group-logo.gif"></td>
  19. <td align="center" width="100%"><img alt="Apache Ant logo" border="0" src="../../images/project-logo.gif"></td>
  20. <td align="right">
  21. <form target="_blank" onsubmit="q.value = query.value + ' site:ant.apache.org'" action="http://www.google.com/search" method="get">
  22. <table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F">
  23. <tr>
  24. <td colspan="3"><img height="10" width="1" alt="" src="../../images/spacer.gif"></td>
  25. </tr>
  26. <tr>
  27. <td><img height="1" width="1" alt="" src="../../images/spacer.gif"></td>
  28. <td nowrap="nowrap" class="searchcaption">
  29. <input name="q" type="hidden">
  30. <input size="15" id="query" type="text">
  31. <img height="1" width="5" alt="" src="../../images/spacer.gif">
  32. <input name="Search" value="Search" type="submit">
  33. <br>
  34. the Apache Ant site
  35. </td>
  36. <td><img height="1" width="1" alt="" src="../../images/spacer.gif"></td>
  37. </tr>
  38. <tr>
  39. <td><img alt="" border="0" height="10" width="9" src="../../images/search-left.gif"></td>
  40. <td><img height="1" width="1" alt="" src="../../images/spacer.gif"></td>
  41. <td><img alt="" border="0" height="10" width="9" src="../../images/search-right.gif"></td>
  42. </tr>
  43. </table>
  44. </form>
  45. </td>
  46. </tr>
  47. </table>
  48. </div>
  49. <div class="tab">
  50. <table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
  51. <tr>
  52. <td width="5"><img alt="" height="8" width="8" src="../../images/spacer.gif"></td><td valign="bottom">
  53. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  54. <tr>
  55. <td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="../../index.html"><font size="2" face="Arial, Helvetica, Sans-serif">Home</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-right.gif"></td>
  56. </tr>
  57. </table>
  58. </td>
  59. <td width="5"><img alt="" height="8" width="8" src="../../images/spacer.gif"></td><td valign="bottom">
  60. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  61. <tr>
  62. <td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="../../projects/index.html"><font size="2" face="Arial, Helvetica, Sans-serif">Projects</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-right.gif"></td>
  63. </tr>
  64. </table>
  65. </td>
  66. </tr>
  67. </table>
  68. </div>
  69. <div class="bluebar"></div>
  70. <div class="menucontainer">
  71. <div class="menu">
  72. <ul>
  73. </ul>
  74. </div>
  75. <img style="float: left" height="10" width="10" border="0" alt="" src="../../images/menu-left.gif">
  76. <img style="float: right" height="10" width="10" border="0" alt="" src="../../images/menu-right.gif">
  77. </div>
  78. <div class="lightbluebar">&nbsp;</div>
  79. <div class="main">
  80. <div class="content">
  81. <h1 class="title">Antlib Descriptor</h1>
  82. <h3 class="section">
  83. <a name="antlib descriptor in the proposal"></a>
  84. antlib descriptor in the proposal
  85. </h3>
  86. <pre class="code">
  87. &lt;antlib version=&quot;1.5&quot; &gt;
  88. &lt;task name=&quot;mkdir&quot; class=&quot;org.apache.tools.ant.taskdefs.Mkdir&quot;/&gt;
  89. ...
  90. &lt;data-type name=&quot;fileset&quot; class=&quot;org.apache.tools.ant.types.FileSet&quot;/&gt;
  91. ...
  92. &lt;role name=&quot;filter&quot; class=&quot;org.apache.tools.ant.filters.ChainableReader&quot;/&gt;
  93. ...
  94. &lt;filter name=&quot;escapeunicode&quot; class=&quot;org.apache.tools.ant.filters.EscapeUnicode&quot;/&gt;
  95. &lt;/antlib&gt;
  96. </pre>
  97. <p>
  98. This is the layout of the antlib descriptor in the proposal. In each antlib jar file, the descriptor would be found under
  99. META-INF/antlib.xml
  100. </p>
  101. <h3 class="section">
  102. <a name="concerns concerning the location of the descriptor (Costin Manolache)"></a>
  103. concerns concerning the location of the descriptor (Costin Manolache)
  104. </h3>
  105. <ol>
  106. <li>
  107. startup time. In order to load one library you need to process all
  108. of them. It can be resolved with caching the result and looking at .jar
  109. modifications. Most likely we'll have dozens of antlibs - and that'll only
  110. grow in time. The processing of (all) TLDs at startup ( for tomcat ) adds a
  111. very visible overhead on startup, and at least tomcat is a long-running
  112. process.
  113. </li>
  114. <br />
  115. <li>
  116. Placing multiple antlibs in a single jar may be trickier.
  117. </li>
  118. <br />
  119. <li>
  120. It may place too much emphasis on the .jars and filesystem layout.
  121. </li>
  122. <br />
  123. <li>
  124. A bit harder to control ( as we know from c-logging and JAXP ),
  125. </li>
  126. <br />
  127. <li>Explicit control over what antlibs are to be used - versus loading
  128. everything. Well - I like "magic" loading, but a lot of things in ant
  129. are done explicitely.
  130. </li>
  131. </ol>
  132. <br />
  133. <p>
  134. I have no problem accepting a getResources() solution ( just like I'm
  135. ok with using XML - but not any XML :-), but those issues should be
  136. considered.
  137. <br />
  138. A lot of the "mess" in ant is the result of doing some things without
  139. considering all implications or just as side effect of how code happened
  140. to work. That's why I'm so strongly for breaking things down to individual
  141. problems instead of a bundle solution.
  142. </p>
  143. </div>
  144. </div>
  145. <p class="copyright">
  146. Copyright &copy; 2000-2003&nbsp;The Apache Software Foundation. All rights reserved.
  147. <script type="text/javascript" language="JavaScript"><!--
  148. document.write(" - "+"Last Published: " + document.lastModified);
  149. // -->
  150. </script>
  151. </p>
  152. </body>
  153. </html>