I am just not able to find but sure this should have been asked before, I am trying to set builds on various branch , which differ in terms of workspace mapping and other arguments that are related to branch location , like solution file, what happens is when we increment the major or minor number I branch the code , what I am planning to achieve is when code is branched I could generate build definition file with specific arguments related to that branch like correct workspace , path to solution file and to version file.
Share
I would suggest creating a custom utility that you use to create a branch that will perform the branch operation in version control and also create a build definition to match. Below is some code to create a build definition using the TFS API.
Alternatively, you can create a web service that subscribes to the CheckInEvent from the TFS Eventing Service and inspect the details to see if it was a branch operation and create a build definition programmatically from there.
Below code was shamelessly copied from this great blog post: http://geekswithblogs.net/jakob/archive/2010/04/26/creating-a-build-definition-using-the-tfs-2010-api.aspx