source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/docs/manual/OptionalTasks/jarlib-resolve.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

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