ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey A Kenward" <kenwa...@dteenergy.com>
Subject Re: Task from a task?
Date Mon, 30 Apr 2001 22:22:08 GMT
I found foreach, (thank you Tim), and that's exactly what I plan to do.

Also, I had to get Ant.java out of CVS to get around the 1.3 bug that was
mentioned in ant-dev.

Thinks are working great now.

-Jeff

Diane Holt wrote:

> --- Jeffrey A Kenward <kenwardj@dteenergy.com> wrote:
> > What's the best way to invoke a task from another task?
> >
> > For instance, I'm trying to write a task to search for build files
> > further down in the build tree and invoke the ANT task on it once it's
> > found.
>
> You could use the newly submitted (but not committed) <foreach> task (I
> picked up Chris Greenlee's updated version) -- see the ant-dev mail
> archives at message:
>   http://marc.theaimsgroup.com/?l=ant-dev&m=98842104504477&w=2
>
> It's designed to do <antcall>'s, which means running a target in the
> current build-file, but that target could do an <ant>. For example:
>
>   <target name="recurse">
>     <taskdef name="foreach"
>        classname="org.apache.tools.ant.taskdefs.optional.ForeachTask"/>
>     <foreach target="runAnt">
>       <param name="file">
>         <fileset dir="." includes="**/build.xml"/>
>       </param>
>     </foreach>
>   </target>
>
>   <target name="runAnt">
>     <ant antfile="${file}"/>
>   </target>
>
> This will run the default target in each build.xml file in every
> subdirectory of the current directory. If you want to run a specific
> target in the sub-project build-files, include the "target" attribute in
> the <ant> task (include nested <property>'s if you want to override
> property values in the sub-project build-files).
>
> Note: You'll need to pick up the latest Ant.java from CVS, as apparently
> the <foreach> task hits a bug that was in the 1.3 version, which has since
> been fixed in CVS.
>
> Diane
>
> =====
> (holtdl@yahoo.com)
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/

Mime
View raw message