I have two txt files: File1.txt - contains a list of src dir; and File2.txt - contains a list of dest dir. I need to make a copy using a loop from src dir to dest dir.
File1.txt (SVN structure structure)
abcBIN abcBIN/fdPro ...so on
File2.txt (LINUX structure)
apps/xxx/yyy/bin/abc apps/xxx/yyy/bin/abc/fdpro ...so on
I need to copy the file abcBIN files to applications / xxx / yyy / bin / abc, etc. From one to one.
<project xmlns:ac="antlib:net.sf.antcontrib"> <taskdef resource="net/sf/antcontrib/antcontrib.properties"> <classpath> <pathelement location="path-to-ant-contrib.jar"/> </classpath> </taskdef> <loadfile property="file1" srcfile="File1.txt"/> <loadfile property="file2" srcfile="File2.txt"/> <ac:for param="i" list="${file1}"> <ac:for param="j" list="${file2}"> <sequential> <echo>@{i}@{j}</echo> <echo>copying....</echo> <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}"> </fileset> </copy> </sequential> </ac:for> </ac:for> </project>
He does not work.
I get an error message:
ac:for doesn't support the nested "for" element
I cannot use the UNIX or Perl shell. This must be done in Ant.
Please let me know if you have a better idea of a nested loop in Ant.
source share