ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
Subject Re: <echo> with if/unless - a request
Date Fri, 07 Jun 2002 18:11:47 GMT

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:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message