开发者

In Ant, copy all files from a tree of folders into a single folder?

开发者 https://www.devze.com 2023-01-02 15:33 出处:网络
Is it possible to use Ant to copy all the files (not folders) from a hierarchy of folders into one destination folder?

Is it possible to use Ant to copy all the files (not folders) from a hierarchy of folders into one destination folder?

For instance, I have a tre开发者_运维知识库e like this:

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

And I would like a result like this:

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

The way things are named, filename conflicts are not an issue.

Is this possible to do with Ant?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号