ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <jalbe...@cellectivity.com>
Subject RE: Custom selector how-to...
Date Tue, 09 Dec 2003 10:19:27 GMT
> From: Dominique Devienne [mailto:DDevienne@lgc.com] 
> 
> I have two apparently simple question about custom selectors:
> 
> 1) How can I access the Project associated to a selector?
> 
>    I can see no obvious way to access it, as unlike ProjectComponent
>    deriving classes that can use getProject(), there's no such thing
>    in BaseExtendSelector...
> 
>    I need to create a Path from a string for pre-Ant 1.6 
> parametrization,
>    and also create a DirectoryScanner, which also requires a Project.
> 

If you need a directory scanner, are you sure that what you are trying
to build
is a <selector>? Maybe it is a new <fileset> type. No?

> 2) Can selectors be id'd/refid'd like tasks/types?
> 
>    I must write a selector with an expensive up-front config phase
>    (remember the DirectoryScanner above?) that I want to use in
>    several different <fileset>s, so I'd rather avoid doing 
> the expensive
>    up-front config N times...
> 

You can always define your selector to accept a refid attribute which
you
use to delegate on you selector instance.

Jose Alberto

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message