ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Atherton <br...@callenish.com>
Subject Re: Splitting up optional.jar
Date Sat, 20 Jul 2002 06:38:09 GMT
At 11:38 AM 7/17/02 +0200, Stefan Bodewig wrote:
>Also I may need a little help with selectors:
>[...]
>What I could use immediately would be a selector container that
>supported if/unless in some way.

Hmm. That should be relatively trivial to add. If the "if" property does 
not exist or the "unless" property does exist, the selector will not select 
any file at all. We could even add that into BaseSelector, giving all core 
selectors the "if" and "unless" attributes. The only trouble might be that 
the build script could end up confusing to read, trying to work out how all 
these conditions play out between selectors.

The alternative would be to define if and unless just on the <selector> 
tag. That might be clearer since the if and unless attributes would be the 
only reason you would use the <selector> tag anywhere other than as a child 
of <project>.

So what do people think? Is this a better way to optionally select test 
classes and source code:

     <or>
         <filename name="Test*.class" if="include.tests"/>
         <and if="include.source">
             <filename name="*.java"/>
             <not>
                 <filename name="*Test*.java" unless="include.tests"/>
             </not>
         </and>
     <or>

or is this:

     <or>
         <selector if="need.tests">
             <filename name="Test*.class"/>
         </selector>
         <selector if="include.source">
             <and>
                 <filename name="*.java"/>
                 <not>
                     <selector unless="need.tests">
                         <filename name="*Test*.java"/>
                     </selector>
                 </not>
             </and>
         </selector>
     <or>

Personally I prefer the former.

I'm willing to make the change either way, since it would be easy for me to 
do. If someone has been looking for a chance to get more familiar with the 
selector code, though, this would be an easy introduction.



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


Mime
View raw message