Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I copy a directory from one location to another using Ant?

Tags:

ant

I am looking to copy a directory from one location to another. However, after looking at "copy" and "copyDir" (which is deprecated) it seems that Ant, by default, only copies the content of one location to another, not the actual directory (and everything in it).

So, as an example I have the following:

./Foo/test.txt

And I apply the following piece of Ant:

 <copy todir="./build">
    <fileset dir="./Foo"/>
 </copy>

The result looks like this:

./build/test.txt

Whereas I would like it to be:

./build/Foo/test.txt

Hope that makes sense. How can I do that?

like image 372
sjwb Avatar asked Sep 09 '10 15:09

sjwb


Video Answer


1 Answers

What about this:

<copy todir="./build">
  <fileset dir=".">
    <include name="Foo/**"/> 
  </fileset>
</copy>
like image 119
Arne Burmeister Avatar answered Sep 28 '22 16:09

Arne Burmeister