Easily build a different branch of the same C# project (VS2010/TFS)

I'd prefer to solve this using a Team Build/build definition, but I'm open to other solutions.

Currently, I have a build definition that builds my main branch. If I want to build other branches, what's the easiest way? Do I have to clone and modify the build definition for each branch, or is there an easier and more elegant way?

(Specifically, the build definition builds MSI files, and I'd love to just one-click to build MSI files for any previous release branch.)

MyCollection
|
|-- MyProject
     |
     |-- MainBranch
     |    |
     |    |-- MySolution.sln
     |
     |-- EarlierReleasesFolder
          |
          |-- ReleaseBranch-2012-01
          |    |
          |    |-- MySolution.sln
          |
          |-- ReleaseBranch-2012-02
          |    |
          |    |-- MySolution.sln
          |
          |-- ReleaseBranch-2012-03
          |    |
          |    |-- MySolution.sln
          |
          |-- ReleaseBranch-2012-04
          |    |
          |    |-- MySolution.sln

Answers


Using just the default templates that ship with TFS2010, there's no way to change the target solution being built. You have to define the source path of the solution(s) to build as part of your build definition.

Of course, TFS Build is just a WF workflow and fully customizable; if you are so inclined you could clone the default workflow, add a "branch path" parameter, and add a custom task to change the BuildInfo object before going into the MSBuild part of the workflow.


TFS Power Tools adds a Clone Build Definition menu item. It makes it easy to copy a build def, modify the source control mappings and solutions to build list and you are ready to build.

Since you mentioned building MSI's... I need to understand if you just want to start doing dev off these old releases or if this is a build reproductibility excercise where the goal is to reproduce the MSI exactly? If the answer is the later, you need use static PackageCodes instead of * for random.


Currently, I'm thinking:

  • Code against the TFS API to automatically create build definitions for each release branch; or:
  • Manually create the build definitions (using Power Tools to be able to clone build definitions)

Need Your Help

How do i write JOOQ select query for the following MSSQL query?

hibernate spring-mvc jooq

How do I convert below select query from MSSQL to JOOQ format?

How to display a PDF document that includes hyperlinks? (on iOS)

iphone xcode pdf ios cgpdfdocument

The Situation: I have a pdf document that includes hyperlinks. I would like my iPhone app to display this pdf document, and enable clicking of the hyperlinks.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.