I would like to set up a nightly build/test file which will email out the
build log if the build fails, but I keep getting this message below, which
looks to me as though the build log file is locked, so nant cannot read in
the file while it is writing it at the same time.  How do other people mail
out the build log when their build breaks?

Thanks in advance for your help.

build_failed:

     [mail] File 'C:\dherbst\src\Build\nightly.txt' NOT added to
 message body. File does not exist or cannot be accessed.
     [mail] Sending mail to [EMAIL PROTECTED]

BUILD FAILED

C:\dherbst\src\Build\nightly.build(639,7):
External Program Failed: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\vbc.exe
(ret
urn code was 1)

Total time: 32 seconds.

I have a windows task set up to do our build and test runs at 4am, it runs
the nightly.bat script below:

echo Starting the nightly build
echo .
del nightly.txt
echo .
C:\dherbst\bin\nant\bin\NAnt.exe -logfile:nightly.txt

In the nightly.build script I have the following:

  <!-- Set the onFailure property so you get the emails out for the nightly
build -->
  <property name="nant.onfailure" value="build_failed" />

And the failure target:
  <!-- Failure target to send a mail that the build failed -->
  <target name="build_failed" >
     
     <mail if="${SendMailResults}"
           from="[EMAIL PROTECTED]"
           tolist="[EMAIL PROTECTED]"
           mailhost="mail"
           message="You ... have ...      f a i l e d.   

   The nightly build has failed.   Sorry.   Thank you for playing.

For Details, please see below:
----------------------------------
  "
           subject="[Build]"
           >
           <files>
               <includes name="nightly.txt" />
           </files>   
     </mail>
  </target>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to