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.

subant.html 20 kB

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