How about reading Ant's FAQ?! :)
http://jakarta.apache.org/ant/faq.html#mail-logger
A BuildListener is *exactly* how to do what you want.
As a matter of fact, Ant 1.5 includes a MailLogger (thank you very much :)
that does this very thing.
Erik
----- Original Message -----
From: "stephan beal" <[EMAIL PROTECTED]>
To: "Ant Developers List" <[EMAIL PROTECTED]>
Sent: Wednesday, April 17, 2002 10:31 AM
Subject: Re: why no workie: adding attributes to Project
> On Wednesday 17 April 2002 15:33, Erik Hatcher wrote:
> > Well, your custom BuildListener/Logger could do anything you want,
really.
> > I've never seen it used to launch another target when a build failed,
and I
> > would suspect there would be some issues with doing this and would not
> > recommend it.
>
> The reason i wanna do that is to send my compile log via email even if the
> build fails. Right now i have to turn off failonerror for <javac> so my
email
> target gets run even if there are compile errors. i don't _really_ want to
do
> that, though, because then i cannot tell if the build really failed. If it
> does not fail, i'd like it to continue and copy the output files to our
test
> server. As it stands now i've got to monitor the build, make sure it
> succeeded, then start the upload manually. Not a big deal, just a minor
> annoyance.
>
> > Its certainly not quite the same as what you were getting at, but
try/catch
> > or the logger/listener approach is much better than tweaking with
Project,
> > which is a change you will have to maintain yourself forever and would
not
> > become part of the core Ant 1.x codebase.
>
> Just like my cvs cdata patch, so one more patch won't kill me. ;) True,
i'd
> rather avoid that, so....
>
> >From Peter Donald:
> > I would *highly* recomend using the TryCatch task as I have have
> > been using a version for a while now and it covers almost all my
> > error handling needs. I
> > haven't used the task at sourceforge but I vaguely recall Stefan
> > describing it and I thought it was better than what I was using :)
>
> That'll be my next stop, thanks :). i think that'll be more suitable for
some
> other things i'm currently kludging around, too.
>
> ----- stephan
> Generic Unix Computer Guy
> [EMAIL PROTECTED] - http://www.einsurance.de
> Office: +49 (89) 552 92 862 Handy: +49 (179) 211 97 67
> "As death comes, without our looking for it, so should be life."
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>