ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mitchell Ackermann" <mitchell.ackerm...@epsiia.com>
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="b.zip"/>
    <include name="c.java"/>
    <include name="*"/>
    ...
  </patternset>
(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>

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

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

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 <matti@sedonacorp.com>


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" .. >
 ...
</fileset>

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

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



Mime
View raw message