There exists a "ForEach ant Task" which should help.
Search the web for it.

Jens

-----Urspr�ngliche Nachricht-----
Von: Frot [mailto:[EMAIL PROTECTED]] 
Gesendet: Samstag, 8. Juni 2002 14:25
An: Ant Users List
Betreff: Looping through files in the buildfile

Hi all,

I have two seperate, but simular. problems.


First I would like to create a classpath dynamically using all available library files 
present in the projects "./lib" directory.
The classpath (or a property) will look like './lib/mylib.jar,./lib/junit.jar'
I have seen a mail once solving this for the classpath part, but never for the 
property....
Can someone give an example for both options classpath an property ?


Secondly I would like to call a task for every file present in a directory, somthing 
like :

        <loop dir="./database_scripts" files="*.sql">
                <echo message="processing file : ${FILE}" />
                <antcall target="executeSQL">
                        <param name="sqlfile" value="${FILE}" />
                </antcal>
        </loop>

note : where ${FILE} is ofcourse each time a different file name.
I guess this would need some special task (loop)  to be implemented, any suggestions 
on how to tackle this ???

Thanx,

Fred


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to