Adrian, Maybe another option to the MailLogger would be to use the nant.onsuccess/nant.onfailure properties. That is what I do. Here's an example of what I do:
<...snip...> <property name="nant.onsuccess" value="sendEmailPassed" /> <property name="nant.onfailure" value="sendEmailFailed" /> <...snip...> <target name="sendEmailPassed"> <record name="${build.log}" action="Close" /> <mail from="${email.from}" tolist="${email.to}" subject="TEST.BUILD: PASSED" mailhost="${email.mailhost}"> </mail> </target> <target name="sendEmailFailed"> <record name="${build.log}" action="Close" /> <mail from="${email.from}" tolist="${email.to}" subject="TEST.BUILD: FAILED" mailhost="${email.mailhost}"> <attachments> <include name="${build.log}" /> </attachments> </mail> </target> Let me explain. The nant.onsuccess/nant.onfailure properties are setup in the beginning of my *.build file. The send targets are setup in the end of my *.build file ( you can really have them wherever you want ). During my build I have the record task create a logfile and, if the build fails, I send the logfile; if it passes it doesn't send the logfile. HTH, Felice -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Adrian Lazea Sent: Tuesday, January 11, 2005 6:46 AM To: Gert Driesen Cc: NAnt Users Subject: Re: [Nant-users] Programatically find out the build status. Hi Gert, Thanks for the tip. It worked fine. One more question though: Could I prevent the build log from being sent by email when using the MailLogger? The problem is that the resulting build log is quite large (2MB) and some people are not interested in the build log at all. All they want to receive is an email which should indicate the build status (success or failure). Is there a MailLogger property that I could use to disable this? Thank you, -- Adrian Lazea Windows Client Developer Schlund + Partner AG Tel : +40-21-231-8347 Ext.318 Str Mircea Eliade 18 Mobile: +40-721-090-495 71295, Bucuresti EMail : [EMAIL PROTECTED] Gert Driesen wrote: > ----- Original Message ----- > From: "Adrian Lazea" <[EMAIL PROTECTED]> > To: "NAnt Users" <nant-users@lists.sourceforge.net> > Sent: Tuesday, January 11, 2005 9:53 AM > Subject: [Nant-users] Programatically find out the build status. > > > >>Hi all, >> >>Is there a way to programatically figure out when a build is successful? >>I know I can take a look in the build log and find out, but I'm thinking >>maybe there is a return code (an output parameter) for the <solution> >>task that could indicate the build status. I need this information >>because my nightly build process is supposed to send an email when it's >>done and I would like to have the build status included. > > > You can just use the MailLogger for this purpose. > > See > http://nant.sourceforge.net/nightly/latest/help/fundamentals/listeners.html > for more information. > > Hope this helps, > > Gert ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users