ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: [SUBMIT] Selector API Implementation
Date Sun, 13 Jan 2002 08:46:24 GMT
On Sun, 13 Jan 2002 13:02, Magesh Umasankar wrote:
> This is an implementation of the proposed Selector functionality
> (
> This is designed to work in Ant1 itself.
> A minor change from the proposal is the retention of 'name' as
> a mandatory attribute for include/exclude elements.
> This implementation allows addition of selectors as needed.
> Each selector element takes in 3 attributes - type, value and
> operation, such that one can say:
> <include name="**/*.java">
>    <selector type="type" operation="equals" value="file"/>
>    <selector type="modify-time"
>              operation="greater-than"
>              value="29th Feb 2003"/>
> </include>
> I have implemented an example selector (FileTypeSelector).
> Please take a look and vote to let me know if you find this
> worth commiting.
> Note: must go into the
> /org/apache/tools/ant/selectors directory.

I had a look and it looks good - however I aren't familiar enough with all 
that stuff to say for certain ;) I noticed you added 2 methods to the 
FileScanner interface - but I guess that is highly unlikely to cause issues 
outside of the main ant-dev tree - so I guess thats ok.

About the only modification I would make is to add an initialize or prepare 
method to the FileSelector. That way in the selector you wouldn't keep having 
to do expensive string compares. You could instead do the compare once and 
cache it in a boolean variable. That should be much faster.

Another thing I just thought of is that passing in a File object is going to 
make it difficult (impossible?) to work with ZipFileScanner and friends? So 
it may be an idea to pass in a string or maybe we could just ignore the fact 
that it doesn't work for the time being ... not sure. What do you think?



"Wise men don't need advice. Fools don't take it." 
                        -Benjamin Franklin 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message