ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: filelist/fileset with multiple directory
Date Wed, 24 Jan 2007 19:56:07 GMT
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@apache.org> wrote:

> On Wed, 24 Jan 2007, Mikael Sitruk
> <MikaelS@amdocs.com> 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@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



 
____________________________________________________________________________________
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@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message