Java Mailing List Archive

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

Apache Ant Archive

» Ant Users List
» Ant Developers List
filelist/fileset with multiple directory

filelist/fileset with multiple directory

2007-01-24       - By Matt Benson
Reply:     1     2     3     4     5     6     7     8     9     10  

If we can think of an elegant way to design this, this
question comes up enough that it might be useful to
include such a selector in Ant core.

$0.02,
Matt

--- Stefan Bodewig <bodewig@(protected)> wrote:

> On Wed, 24 Jan 2007, Mikael Sitruk
> <MikaelS@(protected)> wrote:
>
> > I would like to know if it is possible to define a
> fileset/filelist
> > that will return the first occurrence of the
> patterned file from a
> > list of directories, like the java class loading
> and path.
> >
> > For example suppose we have 3 directories:
> >
> > Dir1: a.txt, b.java
> >
> > Dir2: a.txt,c:jar
> >
> > Dir3: b.java
>
> I think you should be able to write a custom
> resource selector to do
> this, let's say you'd typedef it as
> "returnfirstmatch" than you could
> use it as
>
> <restrict>
>   <union>
>     <fileset dir="Dir1"/>
>     <fileset dir="Dir2"/>
>     <fileset dir="Dir3"/>
>   </union>
>   <returnsfirstmatch/>
> </restrict>
>
> shouldn't be too difficult to do, but I don't think
> it can be done
> with stock Ant, at least not in a generic way.  For
> you specific case
>
> <union>
>   <fileset dir="Dir1"/>
>   <fileset dir="Dir2">
>     <not>
>       <present targetdir="Dir1"/>
>     </not>
>   </fileset>
>   <fileset dir="Dir3">
>     <not>
>       <or>
>         <present targetdir="Dir1"/>
>         <present targetdir="Dir2"/>
>       </or>
>     </not>
>   </fileset>
> </union>
>
> would work, but I'd really choose the custom
> selector route.
>
> Stefan
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)
>
>




_______________________________________________________________________________
_____
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

---------------------------------------------------------------------
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.