Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-08-2004, 12:19 PM
scott willeke scott willeke is online now
Registered User
 
Join Date: 07-09-2003
Posts: 7
Deployment Project Failure Does not Fail Build?

I have noticed that when building Visual Studio .NET Solutions containing only “Deployment Projects” if one project fails to build the build step does not fail, and Visual Build reports the build succeeds. Apparently VS.NET still returns 0 as the success code when deployment projects fail?
The log file shows this at the end of the solution build for the step:
---------------------- Done ----------------------
Build: 3 succeeded, 1 failed, 0 skipped

I verified that the “Ignore Fail” checkbox for the step is not checked.

Additionally, in a subsequent step I have a “Copy Files” step that copies the resulting .msi file to another folder. Despite the fact that the source file does not exist and the step does not copy any files (“0 file(s) copied” is recorded in the log), this step does not fail either.

I need the build to fail if either of these steps does not succeed. I thought of adding an additional step using script to check for the existence of the file (something like (if not vbld_FSO.FileExists("mysetup.msi") then Err.Raise…), but I wanted to see if there was a better solution or recommendation first.

Any suggestions on how I can make one or both of these steps cause the build fail?
Reply With Quote
  #2  
Old 03-08-2004, 04:32 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
It appears that VS.NET does not always return a failure exitcode when some project types fail to build. What you could do is add a check in the step's vbld_StepDone script event (click Script Editor from the step properties dialog and go to the Step tab) that fails the build based on the step output. Here's a VBScript version

Function vbld_StepDone()

If InStr(vbld_AllMacros()("LASTSTEP_OUTPUT").Value, " 0 failed") = 0 Then _
Err.Raise 1, Step.Name, "One or more projects failed to build"

End Function


It's not an error condition for the Copy Files action to not copy any files -- the values specified for include/exclude are evaluated as masks which can match zero or more files, and incremental copy may result in no files getting copied even if some match the masks. You could use a Run Program action with a regular %DOSCMD% copy "source" "dest", which will fail if the copy does not succeed.
Reply With Quote
  #3  
Old 03-08-2004, 04:38 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
It may be nice in a future version to set a system macro to the number of files copied by the Copy Files step.
Reply With Quote
  #4  
Old 03-08-2004, 05:13 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Good idea. For now, you could also do a similar check in the Copy Files action's StepDone event.
Reply With Quote
  #5  
Old 03-10-2004, 04:58 PM
scott willeke scott willeke is online now
Registered User
 
Join Date: 07-09-2003
Posts: 7
Thanks

I've started to use the script to check build output for now. Thanks very much for the help.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 10:13 AM.


Copyright © 1999-2023 Kinook Software, Inc.