ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <rhi...@sympatico.ca>
Subject Need guidance re <fail>
Date Fri, 22 Oct 2004 13:26:09 GMT
I'm at the point where I'm starting to 'get' Ant - more or less ;-) - so I'd like to start
re-engineering my scripts so that they follow the best possible practices.

One of the aspects that I want to improve is error handling. Right now, I mostly just assume
that everything is going to work and don't do much error handling; if the build fails, it
fails. 

However, I'd like to polish things to the point where, if any task (or at least target) fails
for some reason, that a message specifying the nature of the problem is displayed and a specific
error sound is played.

The problem is that the documentation on <fail> leaves a lot to the imagination. I'm
not at all clear on how I make my script branch to a <fail> task and then generate a
message specific to the task which actually failed. A message that says "Your build failed"
is a lot less useful to me than one that says "The second compile task of target ABC failed
because you ran out of memory."

Can anyone explain to me how to structure my scripts so that <fail> does what I want
(or at least as close as is possible at the moment)?

Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it so simple that
there are obviously no deficiencies. And the other way is to make it so complicated that there
are no obvious deficiencies." - C.A.R. Hoare
Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message