ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mitchell Ackermann" <>
Subject Re: passing fileset as a property
Date Thu, 16 Aug 2001 21:35:36 GMT
Going one step further, you could have a patternset like
  <patternset id="pattern1">
    <include name="a.jar"/>
    <include name=""/>
    <include name=""/>
    <include name="*"/>
(hopefully you wouldn't use jar and zip and java files all at the same time; just an example)

Then, you could create multiple filesets in different directories with that same pattern:

  <fileset dir="${dir1}" id="fileset1">
    <patternset refid="pattern1"/>

  <fileset dir="${dir2}" id="fileset2">
    <patternset refid="pattern1"/>

I use this sometimes with a patternset like
  <patternset id="files">
    <include name="Class1.*"/>
    <include name="Class2.*"/>
    <include name="Class3.*"/>

Then I use that pattern to reference .java files in a source directory, and .class files in
a build directory.
And this is with Ant 1.3.

Mitchell Ackermann

----- Original Message ----- 
From: Matthew Inger <>

Fiedler, Raul wrote:

>"yeah, I've been trying to do this too. Is this feature beyond the
>capabilities of Ant?"
>I am looking for possibility to define a group of filees (fileset) as a
>property and perform different task with it.
>Example jar fileset or delete fileset.

I would try creating the filesets, and assigning them id's.  Then you 
could pass
in the id as a paramter to a function, and do your stuff:

<fileset id="abc" .. >

<target name="delete_fileset">
    <fileset refid="${filesetid}" />

<target name="test">
  <antcall target="delete_fileset">
    <parameter name="filesetid" value="abc" />

View raw message