Is there a good way of capturing and reporting Nant build script errors
during an automated build?

 

Here is what I am doing now:

I have a nested build that will trigger off 5 different Nant build
scripts. Some of the builds require the others to have been completed so
I have put in checks to make sure the builds are successful or not. If
something did not build correctly then it will email out that it failed
and where it failed. And then the builds that require will just not be
triggered and also send out an email stating that the dependency builds
did not complete.

 

Now the problem with this is if the build script itself has a scripting
error in it and this scripting error occurs before the email failure
trigger. At this point no email is sent out, but at least the builds
that depend on these build will still get the flag that the build did
not complete.

 

So I have attempted to try to get the information out of the log file
that is being generated during the build. This is a complete log of the
entire Nested build so the file is in use during this check until the
very end, so what I have to do is copy the file and then open and read
the copied log file so that I can search for: 'NAnt.Cor.BuildException:'
If it finds this text in the log file then there was a scripting error
and then I could report it and the line that caused the problem. Now
this works, but only if the error text makes it to the copied log file.
You see the problem is that when the nested build has returned from the
build of one of the projects and does not find the flag indicating the
build was successful it will perform this copy of the log and then
search the log file for the errors, but sometimes the buffer has not
fully written out the text to the log file and therefore the copied log
file does not contain the error message yet. It is still in the buffer
and was not written to the original log file. I have then tried to write
out a bunch of text to the log file before performing this copy to see
if I could at least get the buffer to flush out the text that it is
still holding, but does not always work.

 

So are there any suggestions on how to flush out the buffer so that the
log file is complete before I copy it, or better yet is there a way to
capture build script errors during the build and simply report them as
the build goes.

 

Thanks,  

 

SMART Technologies Inc.
Tim Mayert

Build and Installation Engineer
Software Development

Tel. 403.228.8552 Fax 403.245.0366
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
http://www.smarttech.com <http://www.smarttech.com/> 
Bringing people and ideas together. (tm)

 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to