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.

jarlib-resolve.html 6.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>jarlib-resolve Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="jarlib-resolve">jarlib-resolve</a></h2>
  8. <h3>Description</h3>
  9. <p>Try to locate a jar to satisfy an extension and place
  10. location of jar into property. The task allows you to
  11. add a number of resolvers that are capable of locating a
  12. library for a specific extension. Each resolver will be attempted
  13. in specified order until library is found or no resolvers are left.
  14. If no resolvers are left and failOnError is true then a BuildException
  15. will be thrown.</p>
  16. <p>Note that this task
  17. works with extensions as defined by the "Optional Package" specification.
  18. For more information about optional packages, see the document
  19. <em>Optional Package Versioning</em> in the documentation bundle for your
  20. Java2 Standard Edition package, in file
  21. <code>guide/extensions/versioning.html</code> or online at
  22. <a href="http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html">
  23. http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html</a>.</p>
  24. <p>See the Extension and ExtensionSet documentation for further details</p>
  25. <h3>Parameters</h3>
  26. <table border="1" cellpadding="2" cellspacing="0">
  27. <tr>
  28. <td valign="top"><b>Attribute</b></td>
  29. <td valign="top"><b>Description</b></td>
  30. <td align="center" valign="top"><b>Required</b></td>
  31. </tr>
  32. <tr>
  33. <td valign="top">property</td>
  34. <td valign="top">The name of property to set to library location.</td>
  35. <td valign="top" align="center">Yes</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">failOnError</td>
  39. <td valign="top">True if failure to locate library should result in build exception.</td>
  40. <td valign="top" align="center">No, defaults to true.</td>
  41. </tr>
  42. <tr>
  43. <td valign="top">checkExtension</td>
  44. <td valign="top">True if libraries returned by nested resolvers should be checked to see if
  45. they supply extension.</td>
  46. <td valign="top" align="center">No, defaults to true.</td>
  47. </tr>
  48. </table>
  49. <h3>Parameters specified as nested elements</h3>
  50. <h4>extension</h4>
  51. <p><a href="../OptionalTypes/extension.html">Extension</a> the extension
  52. to resolve. Must be present</p>
  53. <h4>location</h4>
  54. <p>The location sub element allows you to look for a library in a
  55. location relative to project directory.</p>
  56. <table border="1" cellpadding="2" cellspacing="0">
  57. <tr>
  58. <td valign="top"><b>Attribute</b></td>
  59. <td valign="top"><b>Description</b></td>
  60. <td align="center" valign="top"><b>Required</b></td>
  61. </tr>
  62. <tr>
  63. <td valign="top">location</td>
  64. <td valign="top">The pathname of library.</td>
  65. <td valign="top" align="center">Yes</td>
  66. </tr>
  67. </table>
  68. <h4>url</h4>
  69. <p>The url resolver allows you to download a library from a URL to a
  70. local file.</p>
  71. <table border="1" cellpadding="2" cellspacing="0">
  72. <tr>
  73. <td valign="top"><b>Attribute</b></td>
  74. <td valign="top"><b>Description</b></td>
  75. <td align="center" valign="top"><b>Required</b></td>
  76. </tr>
  77. <tr>
  78. <td valign="top">url</td>
  79. <td valign="top">The URL to download.</td>
  80. <td valign="top" align="center">Yes</td>
  81. </tr>
  82. <tr>
  83. <td valign="top">destfile</td>
  84. <td valign="top">The file to download URL into.</td>
  85. <td valign="top" align="center">No, But one of destfile or
  86. destdir must be present</td>
  87. </tr>
  88. <tr>
  89. <td valign="top">destdir</td>
  90. <td valign="top">The directory in which to place downloaded file.</td>
  91. <td valign="top" align="center">No, But one of destfile or
  92. destdir must be present</td>
  93. </tr>
  94. </table>
  95. <h4>ant</h4>
  96. <p>The ant resolver allows you to run a ant build file to generate a library.</p>
  97. <table border="1" cellpadding="2" cellspacing="0">
  98. <tr>
  99. <td valign="top"><b>Attribute</b></td>
  100. <td valign="top"><b>Description</b></td>
  101. <td align="center" valign="top"><b>Required</b></td>
  102. </tr>
  103. <tr>
  104. <td valign="top">antfile</td>
  105. <td valign="top">The build file.</td>
  106. <td valign="top" align="center">Yes</td>
  107. </tr>
  108. <tr>
  109. <td valign="top">destfile</td>
  110. <td valign="top">The file that the ant build creates.</td>
  111. <td valign="top" align="center">Yes</td>
  112. </tr>
  113. <tr>
  114. <td valign="top">target</td>
  115. <td valign="top">The target to run in build file.</td>
  116. <td valign="top" align="center">No</td>
  117. </tr>
  118. </table>
  119. <h3>Examples</h3>
  120. <p><b>Resolve Extension to file.</b> If file does not exist or file
  121. does not implement extension then throw an exception.</p>
  122. <pre>
  123. &lt;extension id=&quot;dve.ext&quot;
  124. extensionName=&quot;org.realityforge.dve&quot;
  125. specificationVersion=&quot;1.2&quot;
  126. specificationVendor=&quot;Peter Donald&quot;/&gt;
  127. &lt;jarlib-resolve property="dve.library"&gt;
  128. &lt;extension refid="dve.ext"/&gt;
  129. &lt;location location="/opt/jars/dve.jar"/&gt;
  130. &lt;/jarlib-resolve&gt;
  131. </pre>
  132. <p><b>Resolve Extension to url.</b> If url does not exist or can not write
  133. to destfile or files does not implement extension then throw an exception.</p>
  134. <pre>
  135. &lt;extension id=&quot;dve.ext&quot;
  136. extensionName=&quot;org.realityforge.dve&quot;
  137. specificationVersion=&quot;1.2&quot;
  138. specificationVendor=&quot;Peter Donald&quot;/&gt;
  139. &lt;jarlib-resolve property="dve.library"&gt;
  140. &lt;extension refid="dve.ext"/&gt;
  141. &lt;url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/&gt;
  142. &lt;/jarlib-resolve&gt;
  143. </pre>
  144. <p><b>Resolve Extension to file produce by ant build.</b> If file does not get produced
  145. or ant file is missing or build fails then throw an exception (Note does not check
  146. that library implements extension).</p>
  147. <pre>
  148. &lt;extension id=&quot;dve.ext&quot;
  149. extensionName=&quot;org.realityforge.dve&quot;
  150. specificationVersion=&quot;1.2&quot;
  151. specificationVendor=&quot;Peter Donald&quot;/&gt;
  152. &lt;jarlib-resolve property="dve.library" checkExtension="false"&gt;
  153. &lt;extension refid="dve.ext"/&gt;
  154. &lt;ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/&gt;
  155. &lt;/jarlib-resolve&gt;
  156. </pre>
  157. <p><b>Resolve Extension via multiple methods.</b> First check local file to see if it implements
  158. extension. If it does not then try to build it from source in parallel directory. If that
  159. fails then finally try to download it from a website. If all steps fail then throw a build
  160. exception.</p>
  161. <pre>
  162. &lt;extension id=&quot;dve.ext&quot;
  163. extensionName=&quot;org.realityforge.dve&quot;
  164. specificationVersion=&quot;1.2&quot;
  165. specificationVendor=&quot;Peter Donald&quot;/&gt;
  166. &lt;jarlib-resolve property="dve.library"&gt;
  167. &lt;extension refid="dve.ext"/&gt;
  168. &lt;location location="/opt/jars/dve.jar"/&gt;
  169. &lt;ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/&gt;
  170. &lt;url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/&gt;
  171. &lt;/jarlib-resolve&gt;
  172. </pre>
  173. <hr><p align="center">Copyright &copy; 2002,2004 The Apache Software Foundation.
  174. All rights Reserved.</p>
  175. </body>
  176. </html>