source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.6.2/manual/CoreTasks/subant.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 16.6 KB
Line 
1
2<html>
3<head>
4 <meta http-equiv="Content-Language" content="en-us">
5 <title>Subant
6 Task</title>
7</head>
8
9<body bgcolor="#ffffff" text="#000000" link="#525D76"
10 alink="#525D76" vlink="#525D76">
11
12<table border="0" width="100%" cellspacing="4">
13
14 <!-- PAGE HEADER -->
15 <tr>
16 <td>
17 <table border="0" width="100%"><tr>
18 <td valign="bottom">
19 <font size="+3" face="arial,helvetica,sanserif"><strong>Subant
20 Task</strong></font>
21 <br><font face="arial,helvetica,sanserif">Calls a given target for all defined sub-builds.</font>
22 </td>
23 <td>
24 <!-- PROJECT LOGO -->
25 <a href="http://ant.apache.org/">
26 <img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0"/>
27 </a>
28 </td>
29 </tr></table>
30 </td>
31 </tr>
32
33 <!-- START RIGHT SIDE MAIN BODY -->
34 <tr>
35 <td valign="top" align="left">
36
37 <!-- Applying task/description -->
38 <!-- Start Description -->
39 <table border="0" cellspacing="0" cellpadding="2" width="100%">
40 <tr><td>&nbsp;</td></tr>
41
42 <tr><td bgcolor="#525D76">
43 <font color="#ffffff" face="arial,helvetica.sanserif">
44 <a name="description">
45 <strong>Description</strong></a></font>
46 </td></tr>
47
48 <tr><td><blockquote>
49<p>
50 Calls a given target for all defined sub-builds.
51 This is an extension
52 of ant for bulk project execution.
53
54 <strong>This task must no be used outside of a
55 <code>target</code> if it invokes the same build file it is
56 part of.</strong>
57 </p>
58 <table border="0" cellspacing="0" cellpadding="2" width="100%">
59 <!-- Subsection heading -->
60 <tr><td bgcolor="#828DA6">
61 <font color="#ffffff" face="arial,helvetica.sanserif">
62 <a name="Use with directories">
63 <strong>Use with directories</strong></a></font>
64 </td></tr>
65 <!-- Subsection body -->
66 <tr><td>
67 <p>
68 subant can be used with directory sets to execute a build from different directories.
69 2 different options are offered :
70 </p>
71<ul>
72 <li>
73 to run the same build file <code>/somepath/otherpath/mybuild.xml</code>
74 with different base directories, use the genericantfile attribute
75 </li>
76 <li>if you want to run <code>directory1/mybuild.xml</code>, <code>directory2/mybuild.xml</code>, <code>....</code>,
77 use the antfile attribute. The subant task does not set the base directory for you in this case, because you can specify it in each build file.
78 </li>
79 </ul>
80
81 </td></tr>
82 </table>
83
84 </blockquote></td></tr>
85
86 </table>
87 <!-- End Description -->
88
89 <!-- Ignore -->
90
91
92
93 <!-- Start Attributes -->
94 <table border="0" cellspacing="0" cellpadding="2" width="100%">
95 <tr><td>&nbsp;</td></tr>
96 <tr><td bgcolor="#525D76">
97 <font color="#ffffff" face="arial,helvetica.sanserif">
98 <a name="attributes">
99 <strong>Parameters</strong></a></font>
100 </td></tr>
101 <tr><td><blockquote>
102 <table>
103 <tr>
104 <td bgcolor="#cccccc" valign="top" align="left">
105 <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
106 </td>
107 <td bgcolor="#cccccc" valign="top" align="left">
108 <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
109 </td>
110 <td bgcolor="#cccccc" valign="top" align="left">
111 <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
112 </td>
113 <td bgcolor="#cccccc" valign="top" align="left">
114 <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
115 </td>
116 </tr>
117 <!-- Attribute Group -->
118
119 <!-- Attribute Group -->
120 <!-- Attribute -->
121 <tr>
122 <td bgcolor="#eeeeee" valign="top" align="left">
123 <font color="#000000" size="-1" face="arial,helvetica,sanserif">antfile</font>
124 </td>
125 <td bgcolor="#eeeeee" valign="top" align="left">
126 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Build file name, to use in conjunction with directories.<br/> Defaults to "build.xml".<br/> If <code>genericantfile</code> is set, this attribute is ignored.</font>
127 </td>
128 <td bgcolor="#eeeeee" valign="top" align="left">
129 <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
130 </td>
131 <td bgcolor="#eeeeee" valign="top" align="left" rowspan="9">
132 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
133 </td>
134 </tr>
135 <!-- Attribute -->
136 <tr>
137 <td bgcolor="#eeeeee" valign="top" align="left">
138 <font color="#000000" size="-1" face="arial,helvetica,sanserif">buildpath</font>
139 </td>
140 <td bgcolor="#eeeeee" valign="top" align="left">
141 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the buildpath to be used to find sub-projects.</font>
142 </td>
143 <td bgcolor="#eeeeee" valign="top" align="left">
144 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Path</font>
145 </td>
146 </tr>
147 <!-- Attribute -->
148 <tr>
149 <td bgcolor="#eeeeee" valign="top" align="left">
150 <font color="#000000" size="-1" face="arial,helvetica,sanserif">buildpathref</font>
151 </td>
152 <td bgcolor="#eeeeee" valign="top" align="left">
153 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Buildpath to use, by reference.</font>
154 </td>
155 <td bgcolor="#eeeeee" valign="top" align="left">
156 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Reference</font>
157 </td>
158 </tr>
159 <!-- Attribute -->
160 <tr>
161 <td bgcolor="#eeeeee" valign="top" align="left">
162 <font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
163 </td>
164 <td bgcolor="#eeeeee" valign="top" align="left">
165 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets whether to fail with a build exception on error, or go on.</font>
166 </td>
167 <td bgcolor="#eeeeee" valign="top" align="left">
168 <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
169 </td>
170 </tr>
171 <!-- Attribute -->
172 <tr>
173 <td bgcolor="#eeeeee" valign="top" align="left">
174 <font color="#000000" size="-1" face="arial,helvetica,sanserif">genericantfile</font>
175 </td>
176 <td bgcolor="#eeeeee" valign="top" align="left">
177 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Build file path, to use in conjunction with directories.<br/> Use <code>genericantfile</code>, in order to run the same build file with different basedirs.<br/> If this attribute is set, <code>antfile</code> is ignored.</font>
178 </td>
179 <td bgcolor="#eeeeee" valign="top" align="left">
180 <font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
181 </td>
182 </tr>
183 <!-- Attribute -->
184 <tr>
185 <td bgcolor="#eeeeee" valign="top" align="left">
186 <font color="#000000" size="-1" face="arial,helvetica,sanserif">inheritall</font>
187 </td>
188 <td bgcolor="#eeeeee" valign="top" align="left">
189 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Corresponds to <code>&lt;ant&gt;</code>'s <code>inheritall</code> attribute.</font>
190 </td>
191 <td bgcolor="#eeeeee" valign="top" align="left">
192 <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
193 </td>
194 </tr>
195 <!-- Attribute -->
196 <tr>
197 <td bgcolor="#eeeeee" valign="top" align="left">
198 <font color="#000000" size="-1" face="arial,helvetica,sanserif">inheritrefs</font>
199 </td>
200 <td bgcolor="#eeeeee" valign="top" align="left">
201 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Corresponds to <code>&lt;ant&gt;</code>'s <code>inheritrefs</code> attribute.</font>
202 </td>
203 <td bgcolor="#eeeeee" valign="top" align="left">
204 <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
205 </td>
206 </tr>
207 <!-- Attribute -->
208 <tr>
209 <td bgcolor="#eeeeee" valign="top" align="left">
210 <font color="#000000" size="-1" face="arial,helvetica,sanserif">output</font>
211 </td>
212 <td bgcolor="#eeeeee" valign="top" align="left">
213 <font color="#000000" size="-1" face="arial,helvetica,sanserif">Corresponds to <code>&lt;ant&gt;</code>'s <code>output</code> attribute.</font>
214 </td>
215 <td bgcolor="#eeeeee" valign="top" align="left">
216 <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
217 </td>
218 </tr>
219 <!-- Attribute -->
220 <tr>
221 <td bgcolor="#eeeeee" valign="top" align="left">
222 <font color="#000000" size="-1" face="arial,helvetica,sanserif">target</font>
223 </td>
224 <td bgcolor="#eeeeee" valign="top" align="left">
225 <font color="#000000" size="-1" face="arial,helvetica,sanserif"></font>
226 </td>
227 <td bgcolor="#eeeeee" valign="top" align="left">
228 <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
229 </td>
230 </tr>
231
232
233 </table>
234 </blockquote></td></tr>
235
236 </table>
237 <!-- End Attributes -->
238
239 <!-- Start Elements -->
240 <table border="0" cellspacing="0" cellpadding="2" width="100%">
241 <tr><td>&nbsp;</td></tr>
242
243 <tr><td bgcolor="#525D76">
244 <font color="#ffffff" face="arial,helvetica.sanserif">
245 <a name="elements">
246 <strong>Parameters as nested elements</strong></a></font>
247 </td></tr>
248
249 <tr><td><blockquote>
250 <!-- Start Element -->
251 <table border="0" cellspacing="0" cellpadding="2" width="100%">
252 <tr><td>&nbsp;</td></tr>
253 <tr><td bgcolor="#828DA6">
254 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
255 <strong>dirset</strong> (org.apache.tools.ant.types.DirSet)</font>
256 </td></tr>
257 <tr><td><blockquote>
258 Adds a directory set to the implicit build path. <p> <em>Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!</em>
259 <!-- Ignore -->
260 <!-- Ignore -->
261
262 </blockquote></td></tr>
263 </table>
264 <!-- End Element -->
265 <!-- Start Element -->
266 <table border="0" cellspacing="0" cellpadding="2" width="100%">
267 <tr><td>&nbsp;</td></tr>
268 <tr><td bgcolor="#828DA6">
269 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
270 <strong>filelist</strong> (org.apache.tools.ant.types.FileList)</font>
271 </td></tr>
272 <tr><td><blockquote>
273 Adds an ordered file list to the implicit build path. <p> <em>Note that contrary to file and directory sets, file lists can reference non-existent files or directories!</em>
274 <!-- Ignore -->
275 <!-- Ignore -->
276
277 </blockquote></td></tr>
278 </table>
279 <!-- End Element -->
280 <!-- Start Element -->
281 <table border="0" cellspacing="0" cellpadding="2" width="100%">
282 <tr><td>&nbsp;</td></tr>
283 <tr><td bgcolor="#828DA6">
284 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
285 <strong>fileset</strong> (org.apache.tools.ant.types.FileSet)</font>
286 </td></tr>
287 <tr><td><blockquote>
288 Adds a file set to the implicit build path. <p> <em>Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!</em>
289 <!-- Ignore -->
290 <!-- Ignore -->
291
292 </blockquote></td></tr>
293 </table>
294 <!-- End Element -->
295 <!-- Start Element -->
296 <table border="0" cellspacing="0" cellpadding="2" width="100%">
297 <tr><td>&nbsp;</td></tr>
298 <tr><td bgcolor="#828DA6">
299 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
300 <strong>property</strong> (org.apache.tools.ant.taskdefs.Property)</font>
301 </td></tr>
302 <tr><td><blockquote>
303 Corresponds to <code>&lt;ant&gt;</code>'s nested <code>&lt;property&gt;</code> element.
304 <!-- Ignore -->
305 <!-- Ignore -->
306
307 </blockquote></td></tr>
308 </table>
309 <!-- End Element -->
310 <!-- Start Element -->
311 <table border="0" cellspacing="0" cellpadding="2" width="100%">
312 <tr><td>&nbsp;</td></tr>
313 <tr><td bgcolor="#828DA6">
314 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
315 <strong>propertyset</strong> (org.apache.tools.ant.types.PropertySet)</font>
316 </td></tr>
317 <tr><td><blockquote>
318 Corresponds to <code>&lt;ant&gt;</code>'s nested <code>&lt;propertyset&gt;</code> element.
319 <!-- Ignore -->
320 <!-- Ignore -->
321
322 </blockquote></td></tr>
323 </table>
324 <!-- End Element -->
325 <!-- Start Element -->
326 <table border="0" cellspacing="0" cellpadding="2" width="100%">
327 <tr><td>&nbsp;</td></tr>
328 <tr><td bgcolor="#828DA6">
329 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
330 <strong>buildpath</strong> (org.apache.tools.ant.types.Path)</font>
331 </td></tr>
332 <tr><td><blockquote>
333 Creates a nested build path, and add it to the implicit build path.
334 <!-- Ignore -->
335 <!-- Ignore -->
336
337 </blockquote></td></tr>
338 </table>
339 <!-- End Element -->
340 <!-- Start Element -->
341 <table border="0" cellspacing="0" cellpadding="2" width="100%">
342 <tr><td>&nbsp;</td></tr>
343 <tr><td bgcolor="#828DA6">
344 <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
345 <strong>buildpathelement</strong> (org.apache.tools.ant.types.Path.PathElement)</font>
346 </td></tr>
347 <tr><td><blockquote>
348 Creates a nested <code>&lt;buildpathelement&gt;</code>, and add it to the implicit build path.
349 <!-- Ignore -->
350 <!-- Ignore -->
351
352 </blockquote></td></tr>
353 </table>
354 <!-- End Element -->
355
356 </blockquote></td></tr>
357
358 </table>
359 <!-- End Elements -->
360
361 <table border="0" cellspacing="0" cellpadding="2" width="100%">
362 <tr><td>&nbsp;</td></tr>
363
364 <tr><td bgcolor="#525D76">
365 <font color="#ffffff" face="arial,helvetica.sanserif">
366 <a name="examples">
367 <strong>Examples</strong></a></font>
368 </td></tr>
369
370 <tr><td><blockquote>
371 <pre>
372 &lt;project name="subant" default="subant1"&gt;
373 &lt;property name="build.dir" value="subant.build"/&gt;
374 &lt;target name="subant1"&gt;
375 &lt;subant target=""&gt;
376 &lt;property name="build.dir" value="subant1.build"/&gt;
377 &lt;property name="not.overloaded" value="not.overloaded"/&gt;
378 &lt;fileset dir="." includes="*/build.xml"/&gt;
379 &lt;/subant&gt;
380 &lt;/target&gt;
381 &lt;/project&gt;
382 </pre>
383<p>
384 this snippet build file will run ant in each subdirectory of the project directory,
385 where a file called build.xml can be found.
386 The property build.dir will have the value subant1.build in the ant projects called by subant.
387 </p>
388<pre>
389 &lt;subant target=""&gt;
390 &lt;propertyset&gt;
391 &lt;propertyref prefix="toplevel"/&gt;
392 &lt;mapper type="glob" from="foo*" to="bar*"/&gt;
393 &lt;/propertyset&gt;
394 &lt;fileset dir="." includes="*/build.xml"/&gt;
395 &lt;/subant&gt;
396 </pre>
397<p>
398 this snippet build file will run ant in each subdirectory of the project directory,
399 where a file called build.xml can be found.
400 All properties whose name starts with "foo" are passed, their names are changed to start with "bar" instead
401 </p>
402<pre>
403 &lt;subant target="compile" genericantfile="/opt/project/build1.xml"&gt;
404 &lt;dirset dir="." includes="projects*"/&gt;
405 &lt;/subant&gt;
406 </pre>
407<p>
408 assuming the subdirs of the project dir are called projects1, projects2, projects3
409 this snippet will execute the compile target of /opt/project/build1.xml,
410 setting the basedir to projects1, projects2, projects3
411 </p>
412
413 </blockquote></td></tr>
414
415 </table>
416
417 </td>
418 </tr>
419 <!-- END RIGHT SIDE MAIN BODY -->
420
421 <!-- FOOTER SEPARATOR -->
422 <tr>
423 <td>
424 <hr noshade="" size="1"/>
425 </td>
426 </tr>
427
428 <!-- PAGE FOOTER -->
429 <tr>
430 <td>
431 <div align="center"><font color="#525D76" size="-1"><em>
432 Copyright &#169; 2000-2003, Apache Software Foundation
433 </em></font></div>
434 </td>
435 </tr>
436
437</table>
438
439</body>
440</html>
Note: See TracBrowser for help on using the repository browser.