ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: question about failonerror
Date Fri, 01 Jun 2001 02:12:49 GMT
--- Mike Pedersen <michael.pedersen@oracle.com> wrote:
> Hello all, I currently use failonerror to allow builds to continue even
> if there are compilation errors. My question is: what is the best way to
> know during the build if there are compile errors.  For example, after
> the compile task completes I want to send an email of there were errors.

> Does ant set any property that I can use to get this information?

Nope. But you could capture the logging output, then run a couple of shell
commands to grab any errors -- eg:

  grep -q -s "Compile failed" ant.log && \
    awk '/\[javac\].*\.java:[0-9]+:/,/\[javac\] [0-9]+ errors/' ant.log

Or you could do it as a <script> task if you need to be
platform-independent (sorry, feeling a little too lazy to do that example
:)  I think I remember someone recently submitting a new mail task that
lets you get the body of the message from a file (check the archives), so
put the pulled errors out to a file (if there are some), use <available>
to check for the file, then conditionally execute the mail task to send
the errors file based on whether the file exists, then delete the errors
file.

('course, there could be some Java listener-thingy way of doing it as well
-- but I'm feeling way too lazy to look into all that :)

Hope this at least helps some,
Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Mime
View raw message