Let’s say that C:/dir2/ has one file called file2.txt
And that C:/dir3/has one file called file3.txt
This ant script:
<copy todir="C:/dir1">
<zipfileset dir="C:/dir2" prefix="dirprefix2"/>
<zipfileset dir="C:/dir3" prefix="dirprefix3"/>
</copy>
copies the files to:
C:/dir1/file2.txt
C:/dir1/file3.txt
But I wanted it to copy to:
C:/dir1/dirprefix2/file2.txt
C:/dir1/dirprefix3/file3.txt
Anyone knows what I am doing wrong?
The attribute
prefixis used only when creating archives.The following should work fine:
Alternatively, you can use macros:
then you will have one line per directory, like this: