ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "didge" <>
Subject <antexec>
Date Thu, 06 Feb 2003 00:56:36 GMT
Has anyone written a Task that would be to CallTarget as exec is to fork in
unix?  That is, unlike CallTarget which essentially re-inits the project,
'ExecTarget' would simply execute the named target.  I can't find anything
like it in the ant 1.5.1 source or in my internet searching.

For example:

	<target name="aTarget">

	<target name="bTarget">
		<antexec target="aTarget"/>

In my projects, I have some deeply nested <antcall>s and I was shocked at
how much faster my build ran when I used this ExecTarget implementation


 * Exec another target in the same project.
 *  <pre>
 *    &lt;target name="foo"&gt;
 *      &lt;antexec target="bar" /&gt;
 *    &lt;/target&gt;
 *    &lt;target name="bar" depends="init"&gt;
 *      ...
 *    &lt;/target&gt;
 * </pre>
 * @author <a href="">didge</a>
 * @ant.task name="antexec" category="control"
public class ExecTarget extends Task {
    private String target;

    public String getTarget() {
        return target;

    public void setTarget(String target) { = target;

    public void execute() throws BuildException {

Are there any reasons why I wouldn't want to do this, assuming that I want
to be able to side affect my project and I don't want the overhead of

Dave Masser-Frye

View raw message