Michael Jervis wrote:
> If one or more lines contains fail, I want to fail the build, but only
> after I've looped all rows and printed out the fails, so my build log
> email will look like:
>
> [echo] Change 1 failed
> [echo] Change 87 failed
> [echo] Change 987 failed
> [fail] Build failed, one or more change programs failed to apply
>
> Can this be done? If so how? Can I set a property in the <do> element
> and make behaviour depend on that? Or would I need to do a <script>
> element and do it all by hand?
>   
You could just initialize a property to "succeed" and then set it to 
"fail" every time you detect a failed line.  When finished looping 
through the file, all you need is something like
  <fail if="${my.result == 'fail'}" > ....

Better yet, initialize it to 0, increment it for every failure, and then 
test to see if it's greater than zero.  That way you'll get an error 
count. 

Gary


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to