aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/ant/apache-ant-1.9.6/manual/Tasks/subant.html
blob: 424bb67ef9195ad263a76517b7ff8459f47daf2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<html>
<head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Subant Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
      alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

  <!-- PAGE HEADER -->
  <tr>
    <td>
      <table border="0" width="100%"><tr>
          <td valign="bottom">
            <font size="+3" face="arial,helvetica,sanserif"><strong>Subant Task</strong></font>
            <br><font face="arial,helvetica,sanserif">Calls a given target for all defined sub-builds.</font>
          </td>
          <td>
            <!-- PROJECT LOGO -->
            <a href="http://ant.apache.org/">
              <img src="../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
            </a>
          </td>
      </tr></table>
    </td>
  </tr>

  <!-- START RIGHT SIDE MAIN BODY -->
  <tr>
    <td  valign="top" align="left">

          <!-- Applying task/description -->
    <!-- Start Description -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>

      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica.sanserif">
          <a name="description">
          <strong>Description</strong></a></font>
      </td></tr>

      <tr><td><blockquote>
<p>
            Calls a given target for all defined sub-builds.
            This is an extension
            of ant for bulk project execution.

            <strong>This task must not be used outside of a
                <code>target</code> if it invokes the same build file it is
                part of.</strong>
        </p>
        <p><em>Since Apache Ant 1.6</em></p>

<p><code>subant</code> uses <code>ant</code> internally so many things
  said in <a href="ant.html"><code>ant</code>'s manual page</a> apply
  here as well.</p>

    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <!-- Subsection heading -->
      <tr><td bgcolor="#828DA6">
          <font color="#ffffff" face="arial,helvetica.sanserif">
                              <a name="Use with directories">
          <strong>Use with directories</strong></a></font>
      </td></tr>
      <!-- Subsection body -->
      <tr><td>
        <p>
                subant can be used with directory sets to execute a build from different directories.
                2 different options are offered :
            </p>
<ul>
                <li>
                    to run the same build file <code>/somepath/otherpath/mybuild.xml</code>
                    with different base directories, use the genericantfile attribute
                </li>
                <li>if you want to run <code>directory1/mybuild.xml</code>, <code>directory2/mybuild.xml</code>, <code>....</code>,
                    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.
                </li>
            </ul>

      </td></tr>
    </table>

      </blockquote></td></tr>

    </table>
    <!-- End Description -->

 <!-- Ignore -->



    <!-- Start Attributes -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica.sanserif">
          <a name="attributes">
          <strong>Parameters</strong></a></font>
      </td></tr>
      <tr><td><blockquote>
        <table>
          <tr>
        <td bgcolor="#cccccc" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
        </td>
        <td bgcolor="#cccccc" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
        </td>
        <td bgcolor="#cccccc" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
        </td>
        <td bgcolor="#cccccc" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
        </td>
          </tr>
    <!-- Attribute Group -->

    <!-- Attribute Group -->
        <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">antfile</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <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>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left" rowspan="10">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">buildpath</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the buildpath to be used to find sub-projects.</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Path</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">buildpathref</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Buildpath to use, by reference.</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Reference</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets whether to fail with a build exception on error, or go on.</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">genericantfile</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <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>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">inheritall</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1"
                        face="arial,helvetica,sanserif">Corresponds to
                        <code>&lt;ant&gt;</code>'s
                        <code>inheritall</code> attribute but defaults
                        to false in this task..</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">inheritrefs</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Corresponds to <code>&lt;ant&gt;</code>'s <code>inheritrefs</code> attribute.</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">output</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">Corresponds to <code>&lt;ant&gt;</code>'s <code>output</code> attribute.</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
        </td>
    </tr>
    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">target</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif"></font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
        </td>
    </tr>

    <!-- Attribute -->
    <tr>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">verbose</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">
            Enable/ disable log messages showing when each sub-build path is entered/ exited.
            The default value is false.</font>
        </td>
        <td bgcolor="#eeeeee" valign="top" align="left">
          <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
        </td>
    </tr>


        </table>
      </blockquote></td></tr>

    </table>
    <!-- End Attributes -->

    <!-- Start Elements -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>

      <tr><td bgcolor="#525D76">
        <font color="#ffffff" face="arial,helvetica.sanserif">
          <a name="elements">
          <strong>Parameters as nested elements</strong></a></font>
      </td></tr>

      <tr><td><blockquote>
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>any filesystem based <a href="../Types/resources.html#collection">resource collection</a></strong></font>
      </td></tr>
      <tr><td><blockquote>
        This includes <code>&lt;fileset&gt;</code>,
        <code>&lt;dirset&gt;</code> and <code>&lt;filelist&gt;</code>
        which are the nested resource collections supported prior
        to Ant 1.7.
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>dirset</strong> (org.apache.tools.ant.types.DirSet)</font>
      </td></tr>
      <tr><td><blockquote>
        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>
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>filelist</strong> (org.apache.tools.ant.types.FileList)</font>
      </td></tr>
      <tr><td><blockquote>
        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>
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>fileset</strong> (org.apache.tools.ant.types.FileSet)</font>
      </td></tr>
      <tr><td><blockquote>
        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>
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>property</strong> (org.apache.tools.ant.taskdefs.Property)</font>
      </td></tr>
      <tr><td><blockquote>
        Corresponds to <code>&lt;ant&gt;</code>'s nested <code>&lt;property&gt;</code> element.

<p>When more than one nested <code>&lt;property&gt;</code> element
  would set a property of the same name, the one declared last will
  win.  This is for backwards compatibility reasons even so it is
  different from the way <code>&lt;property&gt;</code> tasks in build
  files behave.</p>

 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>propertyset</strong> (org.apache.tools.ant.types.PropertySet)</font>
      </td></tr>
      <tr><td><blockquote>
        Corresponds to <code>&lt;ant&gt;</code>'s nested <code>&lt;propertyset&gt;</code> element.
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>buildpath</strong> (org.apache.tools.ant.types.Path)</font>
      </td></tr>
      <tr><td><blockquote>
        Creates a nested build path, and add it to the implicit build path.
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>buildpathelement</strong> (org.apache.tools.ant.types.Path.PathElement)</font>
      </td></tr>
      <tr><td><blockquote>
        Creates a nested <code>&lt;buildpathelement&gt;</code>, and add it to the implicit build path.
 <!-- Ignore -->
 <!-- Ignore -->

      </blockquote></td></tr>
    </table>
    <!-- End Element -->




<!-- manually written -->
    <!-- Start Element -->
    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>
      <tr><td bgcolor="#828DA6">
        <font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
          <strong>target</strong> (org.apache.tools.ant.taskdefs.Ant.TargetElement)</font>
      </td></tr>
      <tr><td><blockquote>
        You can specify multiple targets using nested <code>&lt;target&gt;</code> elements
        instead of using the target attribute.  These will be executed as if
        Ant had been invoked with a single target whose dependencies are the
        targets so specified, in the order specified.
 <!-- Ignore -->
 <!-- Ignore -->
      <table border="1" cellpadding="2" cellspacing="0">
        <tr>
          <td valign="top"><b>Attribute</b></td>
          <td valign="top"><b>Description</b></td>
          <td align="center" valign="top"><b>Required</b></td>
        </tr>
        <tr>
          <td valign="top">name</td>
          <td valign="top">The name of the called target.</td>
          <td valign="top" align="center">Yes</td>
        </tr>
      </table>
      <p><em>since Ant 1.7</em>.</p>
      </blockquote></td></tr>
    </table>
    <!-- End Element -->
<!-- manually written end -->

      </blockquote></td></tr>

    </table>
    <!-- End Elements -->



    <table border="0" cellspacing="0" cellpadding="2" width="100%">
      <tr><td>&nbsp;</td></tr>

      <tr><td bgcolor="#525D76">
          <font color="#ffffff" face="arial,helvetica.sanserif">
                              <a name="examples">
          <strong>Examples</strong></a></font>
      </td></tr>

      <tr><td><blockquote style="">
        <pre>
        &lt;project name="subant" default="subant1"&gt;
            &lt;property name="build.dir" value="subant.build"/&gt;
            &lt;target name="subant1"&gt;
                &lt;subant target=""&gt;
                    &lt;property name="build.dir" value="subant1.build"/&gt;
                    &lt;property name="not.overloaded" value="not.overloaded"/&gt;
                    &lt;fileset dir="." includes="*/build.xml"/&gt;
                &lt;/subant&gt;
            &lt;/target&gt;
        &lt;/project&gt;
        </pre>
<p>
            this snippet build file will run ant in each subdirectory of the project directory,
            where a file called build.xml can be found.
            The property build.dir will have the value subant1.build in the ant projects called by subant.
        </p>
<pre>
          &lt;subant target=""&gt;
              &lt;propertyset&gt;
                  &lt;propertyref prefix="toplevel"/&gt;
                  &lt;mapper type="glob" from="foo*" to="bar*"/&gt;
              &lt;/propertyset&gt;
              &lt;fileset dir="." includes="*/build.xml"/&gt;
          &lt;/subant&gt;
        </pre>
<p>
            this snippet build file will run ant in each subdirectory of the project directory,
            where a file called build.xml can be found.
            All properties whose name starts with "foo" are passed, their names are changed to start with "bar" instead
        </p>
<pre>
          &lt;subant target="compile" genericantfile="/opt/project/build1.xml"&gt;
              &lt;dirset dir="." includes="projects*"/&gt;
          &lt;/subant&gt;
        </pre>
<p>
            assuming the subdirs of the project dir are called projects1, projects2, projects3
            this snippet will execute the compile target of /opt/project/build1.xml,
            setting the basedir to projects1, projects2, projects3
        </p>

        <!-- manually written -->
        <p>Now a little more complex - but useful - scenario. Assume that we have
        a directory structure like this:</p>
        <pre>
        root
          |  common.xml
          |  build.xml
          |
          +-- modules
                +-- modA
                |     +-- src
                +-- modB
                      +-- src

        <u><b>common.xml:</b></u><br>
        &lt;project&gt;
            &lt;property name="src.dir"      value="src"/&gt;
            &lt;property name="build.dir"    value="build"/&gt;
            &lt;property name="classes.dir"  value="${build.dir}/classes"/&gt;

            &lt;target name="compile"&gt;
                &lt;mkdir dir="${classes.dir}"/&gt;
                &lt;javac srcdir="${src.dir}" destdir="${classes.dir}"/&gt;
            &lt;/target&gt;

            &lt;!-- more targets --&gt;
        &lt;/project&gt;

        <u><b>build.xml:</b></u><br>
        &lt;project&gt;

            &lt;macrodef name="iterate"&gt;
                &lt;attribute name="target"/&gt;
                &lt;sequential&gt;
                    &lt;subant target="@{target}"&gt;
                        &lt;fileset dir="modules" includes="*/build.xml"/&gt;
                    &lt;/subant&gt;
                &lt;/sequential&gt;
            &lt;/macrodef&gt;


            &lt;target name="compile"&gt;
                &lt;iterate target="compile"/&gt;
            &lt;/target&gt;

            &lt;!-- more targets --&gt;
        &lt;/project&gt;

        <u><b>modules/modA/build.xml:</b></u><br>
        &lt;project name="modA"&gt;
            &lt;import file="../../common.xml"/&gt;
        &lt;/project&gt;
        </pre>

        <p>This results in very small buildfiles in the modules, maintainable
        buildfile (common.xml) and a clear project structure. Additionally
        the root buildfile is capable to run the whole build over all
        modules.
        </p>

        <pre>
        &lt;subant failonerror="false"&gt;
            &lt;fileset dir="." includes="**/build.xml" excludes="build.xml"/&gt;
            &lt;target name="clean"/&gt;
            &lt;target name="build"/&gt;
        &lt;/subant&gt;
        </pre>

        <p>Does a &quot;clean build&quot; for each subproject.</p>
        <p><b>Hint:</b> because buildfiles are plain xml, you could generate the
        masterbuildfile from the common buildfile by using a XSLT transformation:
        </p>

        <pre>
        &lt;xslt in=&quot;common.xml&quot;
              out=&quot;master.xml&quot;
              style=&quot;${ant.home}/etc/common2master.xsl&quot;
        /&gt;
        </pre>

        <!-- manually written -->

      </blockquote></td></tr>

    </table>

    </td>
  </tr>
  <!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>