ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: Can Ant iterate?
Date Thu, 22 Aug 2002 00:45:12 GMT
Ron Chernich wrote:
> We are considering migrating from make to ant for our Java projects, but have hit a hitch
where a makefile tag needs to iterate over a pattern matched set of files, calling a java
application.  Something like:
> LIST=`ls config/*.xml`
> ...
> for F in $(LIST); do
>   $(JAVA) com.mumble.SchemaCompiler $(F)
> done
> I can see how FileSet will give me the list and AntCall could execute a Task to run our
schema compiler, but can't see how to join the two up.  Is it possible or do we just not get
> Ron Chernich
> Engineering Director, DSTC

You have 3 choices

1. Use <apply>, possibly combined with <uptodate> and execute your 
schema compiler for the files in a fileset.

2. Write a Task to do it and the necessary dependency checks, fileset 
support, etc. Tasks are pretty easy to write and can make your build 
files clearer. Many tasks are just wrappers for running the java task 
anyway. The task can be built as part of the build.

3. Use <script> (not recommended in general)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message