ant/docs/manual/CoreTasks/antcall.html
2001-07-20 10:07:35 +00:00

67 lines
2.3 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Ant User Manual</title>
</head>
<body>
<h2><a name="antcall">AntCall</a></h2>
<h3>Description</h3>
<p>Call another target within the same build-file optionally specifying some
properties (param's in this context)</p>
<p>By default, all of the properties of the current project will be
available in the new project. Alternatively, you can
set the <i>inheritAll</i> attribute to <code>false</code> and only
&quot;user&quot; properties (i.e., those passed on the command-line)
will be passed to the new project. In either case, the set of
properties passed to the new project will override the properties that
are set in the new project (See also the <a href="property.html">property task</a>).</p>
<p>You can also set properties in the new project from the old project by
using nested param tags. These properties are always passed regardless of the
setting of <i>inheritAll</i>. This allows you to parameterize your subprojects.</p>
<h3>Parameters</h3>
<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">target</td>
<td valign="top">The target to execute.</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">inheritAll</td>
<td valign="top">If <code>true</code>, pass all properties to the new Ant
project. Defaults to <code>true</code>.
</td>
<td align="center" valign="top">No</td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>param</h4>
<p>Specifies the properties to set before running the specified target. See <a
href="property.html">property</a> for usage guidelines.</p>
<h3>Examples</h3>
<pre>
&lt;target name=&quot;default&quot;&gt;
&lt;antcall target=&quot;doSomethingElse&quot;&gt;
&lt;param name=&quot;param1&quot; value=&quot;value&quot;/&gt;
&lt;/antcall&gt;
&lt;/target&gt;
&lt;target name=&quot;doSomethingElse&quot;&gt;
&lt;echo message=&quot;param1=${param1}&quot;/&gt;
&lt;/target&gt;
</pre>
<p>Will run the target 'doSomethingElse' and echo 'param1=value'.</p>
<hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
Reserved.</p>
</body>
</html>