ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Blanc <Sebastien.Bl...@alcatel.com>
Subject Re: local build file with ant
Date Tue, 25 Mar 2003 02:03:26 GMT
Ray,
for this solution you have to recurse as well on each subdir the same way until
you reach a package that you consider as an entity and that contains the basic
target with the same name (this is a recursion). it does not matter which target
it is since <ant> call can call any target, the bad part of it beeing that u
have to duplicate this kind of ANT code in the top build.xml for all the targets
u need, but usually it should only be main, otherwise wat's the point of not
having one single build.xml. u can also use the sample of code sent yesterday
with pathconvert to compute dynamically the list of subdirs from your top dir
(and so on recursively) not to hardcode the list of subdirs (nice when a new
directory is added or renamed).

FYI this was extracted from XDOCLET top build.xml file.

++.

seb.

Ray Tayek wrote:

> At 01:09 AM 3/23/03 -0600, you wrote:
> >Hi Ray !
> >here follows a sample of build.xml that makes <ant> recursive calls to
> >clean the
> >sub packages:
> >     <target name="clean">
> >         <echo message="Cleaning all: reverting back to source
> > distribution..." />
> >         <ant dir="${basedir}/core" target="clean"/>
> >         <ant dir="${basedir}/modules" target="clean"/>
> >         <ant dir="${basedir}/samples" target="clean"/>
> >         <delete dir="${dist.dir}"/>
> >         <delete>
> >             <fileset dir="." includes="**/velocity.log*"/>
> >             <fileset dir="." includes="**/maven.log*"/>
> >         </delete>
> >     </target>
>
> looks like he has to "know" what he is doing. imho, this is a good thing.
> it looks to me that this will not recurse indefinitely (unless one of the
> ant clean tasks in (say) core had similar logic to recurse?
>
> >the same can be done for compilation or any other task, for instance the
> >main one:
> >     <target name="main">
> >         <ant dir="${basedir}/core" target="main"/>
> >         <ant dir="${basedir}/modules" target="main"/>
> >         <ant dir="${basedir}/samples" target="main"/>
> >     </target>
> >this is documented here in the ANT core tasks:
> >http://ant.apache.org/manual/CoreTasks/antcall.html
> >
> >seb.
>
> great! - this certainly solves part of the puzzle.
>
> thanks for your assistance.
>
> ---
> ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
> vice chair orange county java users group http://www.ocjug.org/
> hate spam? http://samspade.org/ssw/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message