On Friday, June 7, 2002, at 08:37  AM, Dominique Devienne wrote:

> Better yet, factor the conditions in a base class, and derive from it. 
> That way, you can add the conditions to any task you want that derives 
> from Task (basically simple tasks).

Man - o - man, I would love to see this in more ANT tasks.  Simple if 
support, like exists for targets, would make certain of my scripts a LOT 
cleaner - vis:

<target jar-manifest if="jar.main-class">
   <manifest>
     (the code to insert a main class)
   </manifest>
   <fileset ...>
</target>

<target jar-no-manifest unless="jar.main-class">
   <fileset ...>
</target>

<target jar depends="jar-manifest, jar-no-manifest"" />

could just become

<target jar >
   <manifest if="jar.main-class">
     (the code to insert a main class)
   </manifest>
   <fileset ...>
</target>

This is still declarative in the sense that ANT likes, but I would not 
have to split targets into a gaziillion bits depending on what value I 
want sent to a single task in a larger target.

Scott


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to