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">
<pathelement
location="${user.home}/Developer/Java/jaf-1.0.1/lib/activation.jar"/>
<pathelement
location="${user.home}/Developer/Java/javamail-1.2/lib/mailapi.jar"/>
<pathelement
location="${user.home}/Developer/Java/javamail-1.2/lib/smtp.jar"/>
<pathelement
location="${user.home}/Developer/Java/regex4j/regex4j.jar"/>
<pathelement
location="${user.home}/Developer/Java/log4j-1.2beta4/dist/lib/log4j-1.2beta4.
jar"/>
</path>
I use the ${ext_libs} path stuctures in a javac task like this:
<javac srcdir="${src.java}" destdir="${build.classes}"
<classpath refid="ext_libs"/>
<patternset refid="non.test.source_files"/>
</javac>
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"/>
</copy>
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 ?
ZC.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>