#1
|
|||
|
|||
VSS History to File
Hello,
I have a build step based on one of your VSS samples that displays the history based on a label. I would like to save this output into its own text file (in addition to the regular build log). Is there a way to do this? Thanks in advance! Derek |
#2
|
|||
|
|||
Put the following in the 'Additional command-line options' field on the SourceSafe action's Options tab:
"-O&c:\out.txt" This will redirect the output to the file specified [1]. Then add the following in the step's script code (Script Editor button | Step tab) to also get the contents logged in the build: Function vbld_StepDone() If vbld_FSO.FileExists("c:\out.txt") Then Builder.LogMessage vbld_GetFileContents("c:\out.txt") End If End Function http://msdn.microsoft.com/library/de...ne_SwitchO.asp |
#3
|
|||
|
|||
Outstanding support and response time!
The VSS history to log is now working, but not the step of injecting the history into build log. In my case, here's the VSS additional command-line: -O&%PROJDIR%\F6TesTDotNetPort.root\F6TesTDotNetPort \%BUILD_HISTORY_LOG% In the Script Editor Step tab, I have this: Function vbld_StepDone() If vbld_FSO.FileExists("%PROJDIR%\F6TesTDotNetPort.ro ot\F6TesTDotNetPort\%BUILD_HISTORY_LOG%") Then Builder.LogMessage vbld_GetFileContents("%%PROJDIR%\F6TesTDotNetPort. root\F6TesTDotNetPort\%BUILD_HISTORY_LOG%") End If End Function Any idea why it's not firing the StepDone call? Thanks! Derek |
#4
|
|||
|
|||
Macros (%name%) aren't expanded in step script code. Change the code in the script event to
Function vbld_StepDone() fname = Application.ExpandMacrosAndScript("%PROJDIR%\F6Tes TDotNetPort.root\F6TesTDotNetPort\%BUILD_HISTORY_L OG%") If vbld_FSO.FileExists(fname) Then Builder.LogMessage vbld_GetFileContents(fname) End If End Function See http://www.visualbuild.com/Manual/?scripteditor.htm for more details. |
#5
|
|||
|
|||
That was it! Thanks for all the help.
Derek |
|
|