ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Dawson <>
Subject RE: proposed <fail> enhancement (implementation attached)
Date Thu, 22 Mar 2001 18:23:48 GMT
> > I'd like to submit a change for Ant 1.4 to add "if" and "unless"
> > attributes to the <fail> task,
> Michael McCallum has submitted a similar task a few weeks back.  And
> he's not been the first 8-)

oops. I changed email addresses and wasn't on the list for a while. my

did the previous submission also add the multi-line message capability? even
if we don't add the if/unless, having the multiline message would be nice.

> Personally I wouldn't like to add if/unless attributes to some tasks
> but not to all. If we agree that this is a good thing, it should be a
> core thing IMHO - otherwise we'll find ourselves adding if/unless to
> yet another task every once in a while.

true. but it might get pretty messy... I typically think of the if/unless as
applying for messages to output and for execution control -- currently this
is limited to executing groups of tasks or not. if you want to optionally
print a message, create another task.

if we added
<echo if/unless="foo" message="foo">
<fail if/unless="foo" message="foo">
<skip if/unless="foo" message="foo">

then we could issue warnings (with echo) and/or fail in the same spot where
we check <available>.

skip would be an alternative to using if/unless in the target description,
so that you could have partial execution, or place your <available> checks
right in your target rather than off somewhere else in an init target (the
closer, the more maintainable the build.xml file will be)

on the other hand there needs to be a balance to make the control structures
a little more flexible without going to the point of creating a new
xml-based programming language. the minute we add a "skip", someone's going
to want "for", "while", "switch/case", etc. :-)

> > Anything that wants to ensure that junit has been provided must
> > depend on BOTH init and checkJUnit.
> No, just on checkJUnit, when you make checkJunit depend on init.

oops again, thanks. I made the bad assumption that if/unless would prevent
the execution of the dependencies.


View raw message