ant copy with flatten directories

reference to Copy Task

e.g.
original file structure:
libs
-log4j.jar
+ws
-jaxws-api.jar
-saaj-api.jar
+junit
 -junit.jar

to:

build
-log4j.jar
-jaxws-api.jar
-saaj-api.jar
-junit.jar

script:

<copy todir="${build}" flatten="true">
  <fileset dir="${lib.dir}">
  <include name="**/*.jar"/>
</fileset>
</copy>

Advertisements