How to copy files from different directories in Ant
Cainiao Zou
Ranch Hand
Joined: Mar 03, 2009
Posts: 36
posted
0
I'm using Ant 1.7, want to copy files from different paths (they have no relationship, so i cannot use the include selector to filter them out of their root directory). I try to use the <path> inside the <copy> instead of <fileset>, because with <path> i can specify multi paths which is in <fileset> not possible. My ant script looks like this, but it doesn't work.
Anybody has idea about how to use the <path> inside <copy>? Or maybe anybody has the advise about how to copy files from different source without selector?
Btw, i don't want to hard code the source directories, they will be read from a propertiy file, so writing multi <fileset> inside <copy> should not be considered.
Btw, i don't want to hard code the source directories, they will be read from a propertiy file, so writing multi <fileset> inside <copy> should not be considered.
Do you mean to say that you don't know how many directories will be copied and that each time it could be different? And therefore you cannot use <fileset>s because you don't know how many you need? If so, you might have to install the antcontrib library and use one of its loop tasks to run the <copy> task multiple times, each time specifying a another source directory.