Are you closing (not just stopping) the Release.log recorder in your
"failure" target ?

I attached an example of a working build file.

Note, when you close the Recorder in the failure target, the final build
result will not yet have been written to the log, so I don't think its
useful for you anyway.  I don't think we can change this behaviour as this
would mean that the build output that's generated in the failure target will
not be available to other loggers that send out the results when the
BuildFinished event is raised.

Gert

----- Original Message ----- 
From: "Nicklas Norling" <[EMAIL PROTECTED]>
To: "'N. V.'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, October 20, 2003 9:28 AM
Subject: RE: [Nant-users] Logging failures or successes


> Sorry to say, this did not work either. The logfile is
> still locked, even with autoflush turned on.
>
> C:\Harv> nant release
>
>   <target name="release" depends="init">
>     <record name="Release.log" action="Start" autoflush="true"/>
>     <property name="debug" value="false"/>
>     <nant buildfile="${build.dir}\src\default.build" target="release"/>
>     <nant buildfile="${build.dir}\Documentation\demo.build"
> target="release"/>
>     <record name="Release.log" action="Stop"/>
>   </target>
>
> ziplogs:
>
>       [zip] Zipping 2 files to C:\Harv\BuildLogs.zip.
> C:\Harv\main.build(69,6):
>  Zip file 'C:\Harv\BuildLogs.zip' could not be created.
>  The process cannot access the file "C:\Harv\Release.log" because it is
> being used by another proces
>
> The ziplogs target is called on
>     <property name="nant.onfailure" value="failure" />
>
> Maybe I should report this as a bug on either NAnt or NAntContrib?
> Shurely this ought to work for effective logging?
>
> /Nicke
>
> -----Original Message-----
> From: Nicklas Norling [mailto:[EMAIL PROTECTED]
> Sent: den 17 oktober 2003 12:19
> To: 'N. V.'; [EMAIL PROTECTED]
> Subject: RE: [Nant-users] Logging failures or successes
>
>
> Hi Nick.
>
> Thanks for the tip, that's pretty much exactly what I need!
> Got to look closer at things in NAntContrib I guess.
>
> /Nicke
>
>
> -------------------------------------------------------
> This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
> The Event For Linux Datacenter Solutions & Strategies in The Enterprise
> Linux in the Boardroom; in the Front Office; & in the Server Room
> http://www.enterpriselinuxforum.com
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
>
<project name="test" default="release">
   <property name="nant.onfailure" value="failure" />

   <target name="release">
     <record name="Release.log" action="Start" autoflush="true"/>
     <fail>error</fail>
     <record name="Release.log" action="Stop"/>
   </target>

   <target name="failure">
     <record name="Release.log" action="Close" />
     <zip zipfile="d:\record-log.zip">
	<fileset>
		<includes name="Release.log" />
	</fileset>
     </zip>
   </target>
</project>
 

Reply via email to