Summary
I currently have a NAnt
build script that performs a vssget
on either the latest source code, or a specific branch (using a ${branch}
parameter).
Whenever we do a production build/deployment the code-tree that was built has a branch created, (so that we can continue development and still know what codebase is on production, pretty standard stuff...)
Problem
The process of creation of that branch is still a manual one, performed by someone going into Visual Source Safe Explorer and performing the branching procedure. I was wondering if there is any way in NAnt
of creating a VSS branch.
Current Plan
I already know about using <exec program="ss">
and am trying to avoid that, but in the absence of any better solutions, that is the most probable route I will take.
Does anyone know if there is a NAnt
or NAntContrib
target for this, or if anyone has a script task that they have used to do this in the past and could provide the code for that, that would be very much appreciated.
Disclaimer
I know about cvs, svn, git and all the other Source Control solutions, and to change the tool is not an option at present
We actually need this where I work. I whipped together a small task called 'vssbranch' (not particularly creative but here is the code...an example build file and the output of its execution:
CODE:
BUILD FILE:
OUTPUT:
NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006) Copyright (C) 2001-2006 Gerry Shaw http://nant.sourceforge.net
Buildfile: file:///C:/scm/custom/src/VssBranch/bin/Debug/test.build Target framework: Microsoft .NET Framework 2.0 Target(s) specified: run
run:
[loadtasks] Scanning assembly "NAnt.Contrib.Tasks" for extensions. [loadtasks] Scanning assembly "VssBranch" for extensions. [echo] About to execute: VSS Branch
....
[vssbranch] Branching SecurityProto path: $/VSS/Endur's Source/C#/DailyLive/proto/test-branch/SecurityProto
....
BUILD SUCCEEDED
Total time: 12.9 seconds.
Obviously the output would vary, I was pulling in the items to branch from a text file named 'params.txt'. This task performs what is known in the VSS world as 'Share and Branch' (Branching immediately after Sharing)...other source control systems do not need to share before branching, eh...that's for another day