tags:

views:

174

answers:

1

I've a root directory and it contains many directories,in turn each sub-directory contains many directories and so on.For example if "A" is a root directory it contains sub-directories "A.a","A.b",so on... and each directory("A.a","A.b",etc) contains many directories.I want to copy the inner directories of "A.a" , "A.b" ,etc.. to other directory structure similar to the "A".Instead of copying the each directory I want to use loop that iterates every directory and it's sub-directories(even files).How to do that...Please help me out as I'm new to Ant...

+1  A: 

For copying, use 'copy' and 'fileset':

<copy todir="./destination/dir">
    <fileset dir="./source/dir">
        <include name="**/*" />
    </fileset>
</copy>

The include directive inside the fileset will cause Ant to review each directory recursively.

Other tasks that involve files and directories (such as move for ftp) will also accept filesets.

Shaun