ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <>
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">
     (the code to insert a main class)
   <fileset ...>

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

<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)
   <fileset ...>

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.


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

View raw message