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 4.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>AntCall Task</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>Nested <a href="#reference"><i>&lt;reference&gt;</i></a> elements can
  22. be used to copy references from the calling project to the new
  23. project, optionally under a different id. References taken from
  24. nested elements will override existing references in the new
  25. project.</p>
  26. <p>
  27. When a target is invoked by antcall, all of its dependent targets will
  28. also be called within the context of any new parameters. For example. if
  29. the target &quot;doSomethingElse&quot; depended on the target &quot;init&quot;, then the
  30. <i>antcall</i> of &quot;doSomethingElse&quot; will call &quot;init&quot; during the call.
  31. Of course, any properties defined in the antcall task or inherited from the calling target
  32. will be fixed and not overridable in the init task -or indeed in the &quot;doSomethingElse&quot; task.
  33. </p>
  34. <h3>Parameters</h3>
  35. <table border="1" cellpadding="2" cellspacing="0">
  36. <tr>
  37. <td valign="top"><b>Attribute</b></td>
  38. <td valign="top"><b>Description</b></td>
  39. <td align="center" valign="top"><b>Required</b></td>
  40. </tr>
  41. <tr>
  42. <td valign="top">target</td>
  43. <td valign="top">The target to execute.</td>
  44. <td valign="top" align="center">Yes</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">inheritAll</td>
  48. <td valign="top">If <code>true</code>, pass all properties to the new Ant
  49. project. Defaults to <code>true</code>.
  50. </td>
  51. <td align="center" valign="top">No</td>
  52. </tr>
  53. </table>
  54. <h3>Parameters specified as nested elements</h3>
  55. <h4>param</h4>
  56. <p>Specifies the properties to set before running the specified target. See <a
  57. href="property.html">property</a> for usage guidelines.</p>
  58. <h4><a name="reference">reference</a></h4>
  59. <p>Used to chose references that shall be copied into the new project,
  60. optionally changing their id.</p>
  61. <table border="1" cellpadding="2" cellspacing="0">
  62. <tr>
  63. <td valign="top"><b>Attribute</b></td>
  64. <td valign="top"><b>Description</b></td>
  65. <td align="center" valign="top"><b>Required</b></td>
  66. </tr>
  67. <tr>
  68. <td valign="top">refid</td>
  69. <td valign="top">The id of the reference in the calling project.</td>
  70. <td valign="top" align="center">Yes</td>
  71. </tr>
  72. <tr>
  73. <td valign="top">toid</td>
  74. <td valign="top">The id of the reference in the new project.</td>
  75. <td valign="top" align="center">No, defaults to the value of refid.</td>
  76. </tr>
  77. </table>
  78. <h3>Examples</h3>
  79. <pre>
  80. &lt;target name=&quot;default&quot;&gt;
  81. &lt;antcall target=&quot;doSomethingElse&quot;&gt;
  82. &lt;param name=&quot;param1&quot; value=&quot;value&quot;/&gt;
  83. &lt;/antcall&gt;
  84. &lt;/target&gt;
  85. &lt;target name=&quot;doSomethingElse&quot;&gt;
  86. &lt;echo message=&quot;param1=${param1}&quot;/&gt;
  87. &lt;/target&gt;
  88. </pre>
  89. <p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p>
  90. <pre>
  91. &lt;antcall ... &gt;
  92. &lt;reference refid=&quot;path1&quot; torefid=&quot;path2&quot; /&gt;
  93. &lt;/antcall&gt;
  94. </pre>
  95. <p>will copy the parent's definition of <code>path1</code> into the
  96. new project using the id <code>path2</code>.</p>
  97. <hr><p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
  98. Reserved.</p>
  99. </body>
  100. </html>