You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ken Arnold <ar...@moonhill.org> on 2002/08/22 19:23:17 UTC

task results as conditionals

I as running down the (apparently old) question of how to run arbitrary 
tasks whose failure doesn't stop the build.  I find that the idea of 
putting "failonerror" on all tasks is considered the solution.  While 
this will work for me, I tried something else first and it seems to me 
to be more powerful, and which I can't find in the mail archive.

If you consider an ant task's result to map to true on success and false 
on failure, then I could use <conditional> to do arbitrary combinations, 
as in:

<conditional>
     <or>
         <javac ..../>
         <exec ..../>
     </or>
</conditional>

This would run javac, and if it failed, exec some program (possibly to 
analyze the error output)

The view would be that an arbitrary task in a conditional would be run 
for its result, and therefore it would be up to the conditional (or its 
user) to decide what to do with that failure.

I can imagine this being used in other contexts, and because of the 
conditional logic, can be more powerful than a simple fail/nofail on a 
single target.

Possibly this comes from some conceptual error on my part, but if so, I 
figure I might as well go for public humiliation over private error.-)

		Ken Arnold


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>