ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: writing my own listener
Date Sat, 29 Mar 2003 19:20:03 GMT
I cannot say for sure without more details, but I would think its a bit 
risky to use an Ant task in a buildFinished event since the build has 
now finished and perhaps something it needs is no longer available or 
configured properly.

Look at the MailLogger within Ant's codebase and duplicate that - or 
perhaps modify the existing MailLogger to adjust its formatting 
conditionally to be more brief if you like and submit it back to us.

	Erik

On Saturday, March 29, 2003, at 02:15  PM, Janez Dovc wrote:

> Dear all,
>
> I want to send compact build report of my automatic nightly build to
> specific email address. So I started to write my own ant listener. For 
> the
> time being, I only add few lines of code to
>
> public void buildFinished(BuildEvent arg0)
> 	{
> 		Message message=new Message();
> 		message.addText("Testing of email task");
> 		EmailAddress receiver=new EmailAddress();
> 		receiver.setAddress("janez.dovc@cosylab.com");
> 		EmailTask email=new EmailTask();
> 		email.setFrom("janez.dovc@ijs.si");
> 		email.addTo(receiver);
> 		email.setSubject("BuildFinished");
> 		email.addMessage(message);
> 		email.setMailhost("localhost");
> 		email.execute();
> 	}
>
> And I added my listener to ant
>
> /usr/local/ant/bin/ant -listener com.cosylab.ant.CosyListener -logger
> org.apache.tools.ant.XmlLogger -logfile
> /www/vhosts/java/reports/nightly/$logfile.xml etc.
>
> XMLLogger successfully creates his log file, but my listener doesn't 
> respond
> - no email is sent.
>
> What am I doing wrong?
>
> Best regards,
>
> Janez
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


Mime
View raw message