Nicklas,

A quick and dirty work around for your problem would be set an
environment variable or create and empty file that represents success or
failure. The second nant process could then use that variable/file to
determine whether or not to mail the log.

-Scott

-----Original Message-----
From: Nicklas Norling [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 10:43 AM
To: '[EMAIL PROTECTED]'
Subject: [Nant-users] Logging failures or successes

Hi all.

I'm building a number of projects and would like to send
out feedback from the build using email.
Unfortunately the logs get big and I must zip the logs
before sending them in email. I've understood that leaves
me with the <mail> task. (NAnt.Core.MailLogger has no compression).

When the build is going ok, I want to send a short notice
about the happy occasion.

When the build goes wrong I want to zip up all the logs
and email them to my user list using the <zip> and <mail>
tasks.

The problem is that in order to know if the build succeeded
or not, I must be using nant.onsuccess/nant.onfailure.
And that means I must be executing in the same script as the
build when I jump off to send feedback. But the log files
are then locked and can not be zipped.

<command>
C:\Harv>nant -nologo -f:main.build -l:FullBuild.log all
</command>
<result>
.....
ziplogs:

      [zip] Zipping 4 files to C:\Harv\BuildLogs.zip.
C:\Harv\main.build(65,6):
 Zip file 'C:\Harv\BuildLogs.zip' could not be created.
 The process cannot access the file "C:\Harv\FullBuild.log"
 because it is being used by another process.
</result>

If I on the other hand where to run a separate nant after the
build, then the log file is not locked, but I don't have the
information about the success/failure of the build.

How would one go about solving such a thing?
/Nicklas Norling


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to