Hi guys,
I have a small FB project which syncs code from perforce and then builds it.
How can i check the output from the sync from perforce part, check if all code is sync to head, if so skip the vs.net build, else do the build?
I am trying to assign the output from the perforce step to a varibale but i am struggling to do so.
Any help greatly appreciated
Thanks
Dave
Dave,
You first of all need to create a FinalBuilder user or project variable, go to Tools menu, Edit Variables.
Then in Perforce Sync action (or any for that matter), go to the Properties tab of the action and set the “Log to variables” checkbox.
But… if you want to scan each line of the output for some text, you can do so using the OnStatusMessage event (look in the Script Editor tab at the bottom of the FB IDE when you’ve selected the Perforce Sync action). This event will get called with the output of the action (it will get called multiple times, and StatusMessage may have more than one line of output each time).
Or… if you are trying to detect if the sync has done anything or not, you could use the “Fail if no files synced” option in the Sync Options tab.
hth.
.t8
Thats Tate,
That worked a charm,
I didn’t want to fail on no file sync, because i send e-mails out on any failure. So if a schedule FB to run every hour and there are no syncs i dont want e-mails been sent out.
I did a text search on the output which i assigned to a variable. I check for ‘File(s) up-to-date’.
I then use and ‘if then’ to check for a match, if nothing then build the solution
Is this a good approach?
Cheers
Dave
I did a text search on the output which i assigned to a variable. I check for 'File(s) up-to-date'.
I then use and 'if then' to check for a match, if nothing then build the solution
Is this a good approach?
It's fine. With FinalBuilder there are often several ways to achieve what you want, if it works and performs ok then I wouldn't worry about it.
Dave,
As Vincent says, there are many ways to skin a cat :)
Another way (but not necessarily better) would be to use the exception handling actions, eg:
TRY
Perforce Sync (fail if no files sync'ed)
CATCH
// no files synced, so abort the build
Stop Run (set Result to Success)
END
// now actually do the build
.t8