ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Poor support for selectors
Date Fri, 12 Mar 2004 14:53:56 GMT
> From: []
> I thought for myself to create a <scriptselector> where you simply
> implement the isSelected() method.
> Base should be the BaseExtendSelector and the script gets
> basedir, filename and file (the arguments of isSelected()) as
> populated variables.
> <fileset>
>     <scriptselector language="javascript">
>         return file.canWrite();
>     </scriptselector>
> </fileset>

I agree with Jan. I don't want to have build script littered with code.
<script>+BeanSehll power is awesome, but it's too verbose for my build.xml.

I would see a <script>-based selector extending DynamicConfigurator so I
can specify configuration arguments directory in the <script> tag, and
simply two nested tags, one optional for one time initialization, the other
required with the isSelected method.

To take Peter's example, I would envision:

<fileset dir=".">
  <scriptselector language="beanshell" pattern="^.*reg.*$"> 
      _pattern = java.util.Pattern.compile(pattern);
      _matcher = _pattern.matcher("");
      return _matcher.reset(new;

Or less performant, but less code:

<fileset dir=".">
  <scriptselector language="beanshell" pattern="^.*reg.*$"> 
      return new;

isselected automatically gets the basedir/filename/file names bound to the
method argument, and must be documented as such.

But I may be off base here ;-) --DD

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

View raw message