In Ant, copy all the files from the folder tree to one folder?

Can I use Ant to copy all files (not folders) from a folder hierarchy to a single destination folder?

For example, I have a tree like this:

res |-images | |-fg.png | +-bg.png +-sounds +-music.mp3 

And I would like to get this result:

 data |-fg.png |-bg.png +-music.mp3 

As the names are called, file name conflicts are not a problem.

Can this be done with Ant?

+4
source share
1 answer

To accomplish this, you can use the flatten attribute of the flatten task. You can read more at http://ant.apache.org/manual/Tasks/copy.html .

+3
source

Source: https://habr.com/ru/post/1311686/


All Articles