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.

antcall.html 2.8 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="antcall">AntCall</a></h2>
  8. <h3>Description</h3>
  9. <p>Call another target within the same build-file optionally specifying some
  10. properties (param's in this context)</p>
  11. <p>By default, all of the properties of the current project will be
  12. available in the new project. Alternatively, you can
  13. set the <i>inheritAll</i> attribute to <code>false</code> and only
  14. &quot;user&quot; properties (i.e., those passed on the command-line)
  15. will be passed to the new project. In either case, the set of
  16. properties passed to the new project will override the properties that
  17. are set in the new project (See also the <a href="property.html">property task</a>).</p>
  18. <p>You can also set properties in the new project from the old project by
  19. using nested param tags. These properties are always passed regardless of the
  20. setting of <i>inheritAll</i>. This allows you to parameterize your subprojects.</p>
  21. <p>
  22. When a target is invoked by antcall, all of its dependent targets will
  23. also be called within the context of any new parameters. For example. if
  24. the target &quot;doSomethingElse&quot; depended on the target &quot;init&quot;, then the
  25. <i>antcall</i> of &quot;doSomethingElse&quot; will call &quot;init&quot; during the call.
  26. Of course, any properties defined in the antcall task or inherited from the calling target
  27. will be fixed and not overridable in the init task -or indeed in the &quot;doSomethingElse&quot; task.
  28. </p>
  29. <h3>Parameters</h3>
  30. <table border="1" cellpadding="2" cellspacing="0">
  31. <tr>
  32. <td valign="top"><b>Attribute</b></td>
  33. <td valign="top"><b>Description</b></td>
  34. <td align="center" valign="top"><b>Required</b></td>
  35. </tr>
  36. <tr>
  37. <td valign="top">target</td>
  38. <td valign="top">The target to execute.</td>
  39. <td valign="top" align="center">Yes</td>
  40. </tr>
  41. <tr>
  42. <td valign="top">inheritAll</td>
  43. <td valign="top">If <code>true</code>, pass all properties to the new Ant
  44. project. Defaults to <code>true</code>.
  45. </td>
  46. <td align="center" valign="top">No</td>
  47. </tr>
  48. </table>
  49. <h3>Parameters specified as nested elements</h3>
  50. <h4>param</h4>
  51. <p>Specifies the properties to set before running the specified target. See <a
  52. href="property.html">property</a> for usage guidelines.</p>
  53. <h3>Examples</h3>
  54. <pre>
  55. &lt;target name=&quot;default&quot;&gt;
  56. &lt;antcall target=&quot;doSomethingElse&quot;&gt;
  57. &lt;param name=&quot;param1&quot; value=&quot;value&quot;/&gt;
  58. &lt;/antcall&gt;
  59. &lt;/target&gt;
  60. &lt;target name=&quot;doSomethingElse&quot;&gt;
  61. &lt;echo message=&quot;param1=${param1}&quot;/&gt;
  62. &lt;/target&gt;
  63. </pre>
  64. <p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p>
  65. <hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  66. Reserved.</p>
  67. </body>
  68. </html>