ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rizwan Merchant" <riz...@alpha-it.com>
Subject RE: CVS failure notification..
Date Fri, 19 Aug 2005 16:43:13 GMT

you are right, I have several different targets and need to capture errors
and notify people of any errors that may occur during the build process. My
problem is that depending on the target, different people need to be
notified of different errors. This is why I have to check every target
seperately.
I looked through Mailloggers..it doesnt seem to have the capability to send
out emails based on specific target errors..i.e
error on target 1 --> send email to person 1
error on target 2 --> send email to person 2
.
.
. and so on..

is this correct, or am I missing something?

Also, there doesnt seem to be any concrete examples of how to use
Mailloggers on the ant site..

Thanks a lot, appreciate your help.

-----Original Message-----
From: Ivan Ivanov [mailto:rambiusparkisanius@yahoo.com]
Sent: Friday, August 19, 2005 11:58 AM
To: Ant Users List
Subject: RE: CVS failure notification..


Hello,

As far as I can see you are trying to capture the
output of some task and send emails if something goes
wrong. I would suggest to have a look ant loggers and
listeners[1] and especially at MailLogger[2] which
collects the output of the whole build process and
mails it. You can control it to send mails only on
build failures.

Now regarding <javac>: first of all if you want to
process its output you should set its failonerror
attribute to false; by default compile errors fail the
whole build (and it should be so). I also forgot to
tell you there is a <record>[3] task which lets you
record the output of specific parts of the build file.

You already know how to search the output from a task
captured in a file. This may be a tedious process if
you do it for each possible part and investigating
MailLogger in your case may be more useful

Regards
Ivan

[1]http://ant.apache.org/manual/listeners.html
[2]http://ant.apache.org/manual/listeners.html#MailLogger
[3]http://ant.apache.org/manual/CoreTasks/recorder.html

--- Rizwan Merchant <rizwan@alpha-it.com> wrote:

>
> Thanks Ivan, I will try that. will the same work for
> javac task? I noticed
> there is no "output" or "error" attribute for the
> javac task. how would i
> send a failure notification email if javac fails?
>
> wouldnt it be simpler if ant had the functionality
> to set a property for
> each task in case of failure? then we can just test
> the property and go
> about doing what we want...
>
> -----Original Message-----
> From: Ivan Ivanov
> [mailto:rambiusparkisanius@yahoo.com]
> Sent: Friday, August 19, 2005 11:08 AM
> To: Ant Users List
> Subject: Re: CVS failure notification..
>
>
> Hello,
>
> one way to do this is to use error and output
> attributes of <cvs> task (quote from [1]):
> output - the file to direct standard output from the
> (cvs) command.
> error - the file to direct standard error from the
> (cvs) command
>
> So you can store the error in a text file, than load
> that file as a property and check whether it
> <condition>[2] whether contains a given error
> message.
>
> Here is the pseudo code:
> <cvs command="checkout"
>
cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
>   package="my_module"
>   dest="${checkout.dir}"
>   error="${cvs.error.file}"
> />
> <loadfile property="cvs.error.msg"
>   srcfile="${cvs.error.file}"/>
>
> <condition property="cvs.error">
>   <contains string="${cvs.error.msg}"
>
> substring="<cvs_error_msg_that_might_be_returned>">
> </condition>
>
> The problem in this approach is that you should find
> all possible cvs_error_msg_that_might_be_returned.
>
> Well, you can also do the following: if the error
> file
> is created, then obviously there is an error while
> checking the module out. Instead of trying to find
> the
> exact error, mail the whole error file :)
>
> Regards
> Ivan
>
> [1]http://ant.apache.org/manual/CoreTasks/cvs.html
>
[2]http://ant.apache.org/manual/CoreTasks/conditions.html
> --- Rizwan Merchant <rizwan@alpha-it.com> wrote:
>
> >
> > Hi,
> > I'm using ant to checkout code from the CVS. If
> the
> > checkout is not
> > successful I would like to send an email to
> someone
> > to notify them of the
> > problem.
> >
> > How do I detect this error in ant? Say the
> password
> > on the cvs account is
> > wrong, cvs notifies of bad login and then the ant
> > continues executing with a
> > "build successful" result (i.e. cvs exits
> normally).
> >
> > Any ideas? Pls help.
> >
> > Thanks,
> > -Rizwan.
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>




____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message