You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Deep Chand <dg...@gmail.com> on 2006/02/07 06:52:38 UTC

send email about status of the build

Hello community,

I'm a newbie to Ant. I tried to search for this solution but couldn't find.

I want to send emails with the status of the build and with logs if
there are errors. I'm able to send email and also the build process
works but I'm not able to figure out how to write the error logs in a
file from the ant script. Is there any task that can interpret the log
file or do I have to define a custom task?  I guess this should be a
very common problem ...so what's the recommended practice. Thanks in
advance.

I know I can use some thing like below to figure out if certain file
is present or not:

<condition property="foundErrors">
		<available file="errorFile">
	</condition>

Please help.

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


Re: send email about status of the build

Posted by Tommy Nordgren <to...@chello.se>.
See the book Extreme Programming with Ant, from Sams Publishing
The subject is adequately covered there.

On Feb 7, 2006, at 6:52 AM, Deep Chand wrote:

> Hello community,
>
> I'm a newbie to Ant. I tried to search for this solution but  
> couldn't find.
>
> I want to send emails with the status of the build and with logs if
> there are errors. I'm able to send email and also the build process
> works but I'm not able to figure out how to write the error logs in a
> file from the ant script. Is there any task that can interpret the log
> file or do I have to define a custom task?  I guess this should be a
> very common problem ...so what's the recommended practice. Thanks in
> advance.
>
> I know I can use some thing like below to figure out if certain file
> is present or not:
>
> <condition property="foundErrors">
> 		<available file="errorFile">
> 	</condition>
>
> Please help.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren@chello.se




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


Re: send email about status of the build

Posted by "Ivan \"Rambius\" Ivanov" <ra...@yahoo.com>.
Hello,

In general you can send emails from Ant using <mail>
task. However, it is not useful for emailing the
status of the build, because the build may fail and
stop before reaching the target with <mail> task, i.e.
in case of failure you will not receive an email.

--- Deep Chand <dg...@gmail.com> wrote:

> Hello community,
> 
> I'm a newbie to Ant. I tried to search for this
> solution but couldn't find.
> 
> I want to send emails with the status of the build
> and with logs if
> there are errors. I'm able to send email and also
> the build process
> works but I'm not able to figure out how to write
> the error logs in a
> file from the ant script. 
I am aware of the following general ways:
- start ant with -logfile option like
ant mytarget -l mylogfile.log
- use <record> task [2]. It is a flexible way to log
only a portion of the build script
- use pipes like
ant mytarget > mylogfile.log

> Is there any task that can interpret the log
> file or do I have to define a custom task?  I guess
> this should be a
> very common problem ...so what's the recommended
> practice. Thanks in advance.
The recommended practice for mailing the build output
is using MailLogger [3]. It is used like
ant -logger org.apache.tools.ant.listener.MailLogger

For the whole concepts of Ant loggers and listeners
see [4].

Regards
Ivan

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

__________________________________________________
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


Re: send email about status of the build

Posted by Ninju Bohra <ni...@yahoo.com>.
You can use the <record> task to capture output to a file.
 
For a more complete build status/notification system you should look into CruiseControl rather than trying to add on the email/logging features to a build script.
 
Enjoy,
 
Ninju
 



----- Original Message ----
From: Deep Chand <dg...@gmail.com>
To: user@ant.apache.org
Sent: Monday, February 06, 2006 11:52:38 PM
Subject: send email about status of the build


Hello community,

I'm a newbie to Ant. I tried to search for this solution but couldn't find.

I want to send emails with the status of the build and with logs if
there are errors. I'm able to send email and also the build process
works but I'm not able to figure out how to write the error logs in a
file from the ant script. Is there any task that can interpret the log
file or do I have to define a custom task?  I guess this should be a
very common problem ...so what's the recommended practice. Thanks in
advance.

I know I can use some thing like below to figure out if certain file
is present or not:

<condition property="foundErrors">
        <available file="errorFile">
    </condition>

Please help.

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