ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zart Colwing <>
Subject how to copy a bunch of *unrelated* files ?
Date Thu, 28 Mar 2002 18:33:04 GMT
It may seams overly simple but curiously it is not, or I'm really 
stupid ;)

I want to copy a list of file (jar files), each one originating from its 
own directory (thus I can't use a filseset), into the same directory 
inside my distribution directory (the lib directory of my application).

Ideally I'd like to reuse a <path> structure I have defined to compile 
and run the application so that I'm sure to never forget any library 
critical library in the future.

here is a bit of xml to help make the example clear:

<!-- Define ${ext_libs} -->
<!-- The list of jar files requiered to compile and run the 
application -->
<!-- all these files must be copied to the ${dist}/lib directory on 
deployment -->
<path id="ext_libs">

I use the ${ext_libs} path stuctures in a javac task like this:

<javac srcdir="${}" destdir="${build.classes}"
	<classpath refid="ext_libs"/>
	<patternset refid="non.test.source_files"/>

Ok, now the tricky part: I wanted to reuse the ${ext_libs} path to copy 
all the required libraries into the lib directory of my application. 
Naively (again !) I tried:

<copy todir="${dist.lib}">
	<path refid="ext_libs"/>

Unfortunately the copy task does not support a nested <path> element !  
Ok I thought, lets try to create a fileset that reuse this path. Alas, 
while is is entirely possible to create a path from a fileset, the 
inverse is impossible !  This matter of fact is quite understandable 
since a path is a higher level stucture than a fileset (A path structure 
is a more general abstraction that can embed a filseset).

Now the questions:
1- How do I elegantly solve my problem with the Ant tool available 
today, using a single copy task that reuse the ${ext_libs} path ?
2- Isn't it flawed that so many Ant tool use the more restrictive 
fileset structure where they could instead use the more general path 
structure ?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message