ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten Wutzke" <>
Subject Re: Conditional if/unless echo
Date Thu, 10 Apr 2003 17:02:57 GMT
I can see from a standpoint of the Ant developers' arguments, providing if-then-else procedural
functionality is not wanted for Ant's purpose (a build tool).

However, the if-then-else logic for set/unset properties found its way to the <fail>
task. The <fail> task is very similar to <echo>, it's even more complex, because
it can exit the build. So, I don't see why to reject if-then-else logic for the more primitive
<echo> task.

Even for Ant 2.0 it's not an issue. Task level if/unless has been rejected, *because no votes
seem to exist for it*!!!

<snip from Ant 1.5.3 $ANT_HOME/docs/Ant2/requested-features.txt>


* tasks provide some way to identify their attributes from the

  Possible solutions include a special method like getProperties(), an
  external describing file shipping with the task class or special
  javadoc comments parsed by a custom doclet. Whatever the method it
  should not impose any cost on runtime as it is only used a small 
  proportion of the time (design-time).  


* tasks should have access to its own XML representation.

  [REJECTED - vetoes by Christoph Wilhelms, Conor MacNeill and Simeon Fitch]


* Task level if and unless attributes.

  [REJECTED - no single +1 vote]


* Allow tasks to find out, whether another task has completed successfully.

  [REJECTED - vetoes by Conor MacNeill, Glenn McAllister, Peter Donald
              and Stefan Bodewig]

* provide failonerror like functionality to all tasks. (Provide this as an aspect??
  much like logging aspect or classloader aspect).



There are no vetoes against conditional tasks, so let's vote *now*. Even if there won't be
general conditional tasks in the near future, there should at least be a conditional echo.

Does anyone know where to vote for conditional tasks (or echo)? I looked in Bugzilla, but
I couldn't find the bug. Does anyone know the link???


David McTavish wrote:

> where do I vote to add it to Ant?
> D, can you maybe post your solution into the Bugzilla?  I think the
> if/unless mechanism may better follow the "interface" for ant tasks than my
> implementation. I think this would be a great add to Ant, and the cost is so
> marginal (ie: 5 lines of code?). So long as the default behaviour is echo, I
> can't comprehend why this wouldn't be a good addition.
> d.
> -----Original Message-----
> From: Dominique Devienne []
> Sent: Thursday, April 10, 2003 10:19 AM
> To: 'Ant Users List'
> Subject: RE: Conditional if/unless echo
> The level attribute is not that useful... Most of the time, we want to debug
> or be more verbose about our own build logic, for the purpose of build users
> to see, not build writer. Thus, getting all the Ant verbose or debug output
> is not suitable, since drowns the important build-writer-specified
> information. This is why <echo> should have an if/unless attribute (I'd even
> add a ifTrue attribute, like I demonstrated with my <echopath> task).
> This is so simple and useful, I just don't get why people pushed back on it
> several time before... --DD
> -----Original Message-----
> From: Erik Hatcher [] 
> Sent: Thursday, April 10, 2003 9:03 AM
> To: Ant Users List
> Subject: Re: Conditional if/unless echo
> Gotcha.  You could still use an Ant property for the value of the 
> 'level' attribute, so essentially you could hide it by putting it at 
> the debug level.  But your solution is grand also!
> 	Erik

UNICEF bittet um Spenden fur die Kinder im Irak! Hier online an
UNICEF spenden:

View raw message