Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-30-2005, 07:19 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
Question Automating check out /check in of each step?

The company I work for uses Visual Sourcesafe, and Visual Build Pro. I need to check out the current step, build it, then check it back in (so the version number in the project file is altered correctly, for instance in a .VBP for visual basic). I also need to make it so that if the file cannot be checked out (because someone else has the file checked out) that it does not continue with the build / check in.

How can I script something along these lines or automate it somehow ...

if not isCheckedOut(currStep.project) then
checkOut(currStep.project)
build(currStep)
checkIn(currStep.project)

Thanks for any advice in advance.
Reply With Quote
  #2  
Old 08-30-2005, 07:28 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
It's normally automatic. If the checkout step fails (which it will if a file that you attempt to checkout is already checked out [provided that you don't have multiple checkouts enabled in VSS]) and the step is not marked to ignore failure, the build will not continue.
Reply With Quote
  #3  
Old 08-30-2005, 07:36 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
Sorry, maybe I phrased my question badly. What I'm after is some generic piece of code that I can run before and after each step (preferably automatically so i dont have to add it before / after each step) which checks out that steps project then checks it back in after build.

The machine we use to build our software keeps a local copy of the entire of sourcesafe which is automatically grabbed at the start of our Build script, so with each step we are compiling from that local (non-checked out) project. The problem is, the original project files are not registering any version change because they were never updated (checked out and in). So although the version number is being udpated LOCALLY each time, the version in sourcesafe still has the old version number.

Because our build script is so large we need the ability to be able to build an individual project, so we dont want to check out ALL of our projects each time. So basically i want something like the following.

Steps...

Get All of SourceSafe
Build App1 (auto check out / in)
Build App2 (auto check out / in)
Build App3 (auto check out / in)


Thanks for the prompt response, sorry if I'm not explaining this very well.
Reply With Quote
  #4  
Old 08-30-2005, 09:28 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
One way to do this would be to create a subroutine that generically checks out a VBP, builds it, and checks it in, and then call this subroutine for each project that needs to be built.
Reply With Quote
  #5  
Old 08-30-2005, 09:34 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
Thats really what i'm getting at, how would I build a 'generic' sub.

How can i get the filename of the current project so that I can check it out / in? I had a look at the pre-defined variables but I couldnt quite what I needed.
Reply With Quote
  #6  
Old 08-30-2005, 09:42 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See the Advanced.bld sample. The 'Call a Subroutine' step passes a macro SUB_PARM1 to the 'Another Sub' subroutine, which uses that macro in a Log Message step.
Reply With Quote
  #7  
Old 08-30-2005, 10:05 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
Okay, thanks that is how I pass values to a sub - but how can i pass the filename of the main step in that group? If i have to type the entire filename again for the checkout / checkin step then i'm better creating 40 checkout and 40 checkin steps for each of the 40 programs. It just seems very tedious
Reply With Quote
  #8  
Old 08-30-2005, 10:22 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
What do you mean by 'the filename of the main step in that group'?
Reply With Quote
  #9  
Old 08-30-2005, 10:27 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
Okay, we tend to put each app in its own group
so what i really want is

mygroup
-Checkthisprogout (generically so i dont have to type info in)

-buildthisprog
(the main step in the group, probably referring to a visual basic project, so a local .vbp file)

-Checkthisprogin (generically so i dont have to type info in)
Reply With Quote
  #10  
Old 08-30-2005, 11:07 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I'm not sure if you are using 'group' and 'project' interchangeably, or if you actually have VBGs that each contain one VBP, but it sounds like you want a single step in your .bld file for each .VBP that might get built (so that you can selectively include only the ones you want to build at a certain time). You can use a single Subroutine Call step for each .VBP file, which passes the .VBP filename in a macro, then use that filename in the subroutine to checkout, build, and checkin. You will need to convert the filename to a VSS path for the checkin/out steps, and how that conversion is done depends on your directory and VSS structure. See the attached sample for one approach. Let me know if that helps or if I'm totally off track.
Attached Files
File Type: bld processvbps.bld (2.6 KB, 1882 views)
Reply With Quote
  #11  
Old 08-30-2005, 11:12 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
Thanks very much for all your help so far, im off home now but i'll check this out first thing in the morning.
Reply With Quote
  #12  
Old 08-31-2005, 03:37 AM
BallyUK BallyUK is online now
Registered User
 
Join Date: 08-30-2005
Posts: 15
I think with this and looking at the other samples I have this thing licked, thanks a lot for your 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 01:19 AM.


Copyright © 1999-2023 Kinook Software, Inc.