You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Florent Zara <fz...@free.fr> on 2003/05/26 18:09:31 UTC

Reuse a fileset

Hi,

I'm using Ant 1.4.1.
I've define a path element which is resued several times, like in other 
path-like structures or tasks parameters.
<path id="classpathid.jaronly">
  <fileset dir="${lib.dir}/ext/lib" includes="crimson.jar,log4j*.jar" />
  <fileset dir="${lib.dir}/int/lib" includes="common-utils.jar" />
</path>

I would like to use these filesets in a copy task, that does not support 
nested path elements (which is normal).

So, How to define a bunch of fileset and reuse them in either pathlike 
structure or a copy task ?

Thank you.
Florent


Re: Reuse a fileset

Posted by Florent Zara <fz...@free.fr>.
Antoine Levy-Lambert wrote:
> I am not totally sure about ant 1.4.1, but this could work
>   <fileset dir="${lib.dir}/ext/lib" includes="crimson.jar,log4j*.jar"
> id="fileset1"/>
>    <fileset dir="${lib.dir}/int/lib" includes="common-utils.jar"
> id="filesetcommons-utils.jar"/>
>   <path id="classpathid.jaronly">
>      <fileset refid="fileset1"/>
>      <fileset refid="filesetcommons-utils.jar"/>
>  </path>
>  <copy todir="somedir">
>       <fileset refid="fileset1"/>
>       <fileset refid="filesetcommonts-utils.jar"/>
>  </copy>

It does not seem to work with 1.4.1 ...

> You can nest several filesets in the copy task if you use the todir
> attribute in ant1.6

I have to stick with 1.4.1 :(

Thank you ofr your help.

Florent


Re: Reuse a fileset

Posted by Antoine Levy-Lambert <le...@tiscali-dsl.de>.
I am not totally sure about ant 1.4.1, but this could work
  <fileset dir="${lib.dir}/ext/lib" includes="crimson.jar,log4j*.jar"
id="fileset1"/>
   <fileset dir="${lib.dir}/int/lib" includes="common-utils.jar"
id="filesetcommons-utils.jar"/>
  <path id="classpathid.jaronly">
     <fileset refid="fileset1"/>
     <fileset refid="filesetcommons-utils.jar"/>
 </path>
 <copy todir="somedir">
      <fileset refid="fileset1"/>
      <fileset refid="filesetcommonts-utils.jar"/>
 </copy>
You can nest several filesets in the copy task if you use the todir
attribute in ant1.6
----- Original Message -----
From: "Florent Zara" <fz...@free.fr>
To: <us...@ant.apache.org>
Sent: Monday, May 26, 2003 6:09 PM
Subject: Reuse a fileset


> Hi,
>
> I'm using Ant 1.4.1.
> I've define a path element which is resued several times, like in other
> path-like structures or tasks parameters.
> <path id="classpathid.jaronly">
>   <fileset dir="${lib.dir}/ext/lib" includes="crimson.jar,log4j*.jar" />
>   <fileset dir="${lib.dir}/int/lib" includes="common-utils.jar" />
> </path>
>
> I would like to use these filesets in a copy task, that does not support
> nested path elements (which is normal).
>
> So, How to define a bunch of fileset and reuse them in either pathlike
> structure or a copy task ?
>
> Thank you.
> Florent
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>