Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
How to use multiple filesets with classpath AND copy

How to use multiple filesets with classpath AND copy

2005-06-10       - By Rick Mann

Hi. I'm building a handful of Struts webapps, and would like to do  
this in my build scripts:

I want to specify a collection of .jar files from several different  
directories, and I want to refer to the entire collection with a  
single id. Now, I can make a fileset or filelist for a directory,  
give it an ID and reference it in a classpath or a copy structure.  
But I need to make two or three of these. I don't want my copy tags  
or classpath tags to have to reference more than a single file-
structure ID.

I need some kind of nested fileset. Is there any other way to do it?  
I want the equivalent of the following (of course, using filelists or  
whatever inside). Any ideas?



<fileset id="myFileSet">
    <fileset dir="foodir">
        <include name="log4j-1.2.8.jar"/>
        <include name="lucene-1.4.2.jar"/>
    </fileset>

    <fileset dir="bardir">
        <include name="something.jar"/>
        <include name="somethingelse.jar"/>
    </fileset>
</fileset>

...


<classpath>
    <fileset refid="myFileSet"/>
</classpath>


...

<copy todir="${app.build}" preservelastmodified="true">
    <fileset refid="myFileSet"/>
</copy>


Thanks!


--
Rick


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.