ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shweta <>
Subject nested ant cntrib for loops
Date Sat, 04 Aug 2012 02:40:07 GMT
I have two txt files –

File1.txt – contains list of src dir
File2.txt – contains list of dest dir

I need to do the copy using a loop from src dir to dest dir

File1.txt (SVN dire structure)
… on

File2.txt (LINUX structure)

….so on

I need to copy the abcBIN ‘s files dir to apps/xxx/yyy/bin/abc and so on.
One to one mapping.

<project xmlns:ac="antlib:net.sf.antcontrib">

<taskdef resource="net/sf/antcontrib/">


             <pathelement location="path-to-ant-contrib.jar"/>



            <loadfile property="file1" srcfile="File1.txt"/>

<loadfile property="file2" srcfile="File2.txt"/>

<ac:for param="i" list="${file1}">
<ac:for param="j" list="${file2}">



<property name="src.dir" value="/home/name/svn_repo/dir" />
<property name="dest.dir" value="/home/name/mapp" />  
<copy todir="${dest.dir}/@{j}">     <fileset dir="${src.dir}/@{i}">  


It is not working  though 

I am getting an error “ac:for doesn't support the nested "for" element”

I can’t use UNIX shell or Perl. It has to be done in ANT 

Please let me know if anyone has a better solution.

View this message in context:
Sent from the Ant - Users mailing list archive at

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

View raw message