Customize Build Template in TFS2012 to Build All Solutions-Part 1
In this article, I will show one way to build all solutions in source control. I will add a new argument to a build template which holds a comma separated string of solutions and I will be using a tool I built in the previous post (can be found here). In the next article, I will reuse the code to build a UIEditor to edit the argument we are passing to the build definition.
Modify the Build Template
In Team Explorer, click on the Source Control Explorer.
Open your build template. Here I am opening a clone of the Default template.
Click on the Arguments tab at the bottom and scroll down. Then click on Create Argument.
Rename the argument to Solutions. The argument will hold comma separated string of solutions.
Collapse the Arguments tab by clicking on it.
One of the new features in Visual Studio 2012 is the ability to search or find text in a Work Flow document. Press ctrl + F and find BuildSettings.ProjectsToBuild.
There are two instances that need to be replaced with Solutions.Split(“,”c), VB code : One in the Clean Configuration sequence and the other in Compile and Test for Configuration sequence. While you are there, change the Display Name the For Each loop if you want to.
Save and Check in.
Modify Build Definition
Go to Builds in Team Explorer.
Edit an existing build or create a new build definition.
Go to the process tab, expand Show Details.
From the drop down select the Build process File you modified.
Launch the tool that finds all solutions in source control (Check this article).
Copy the found solutions.
Paste the copied value into the Solutions argument.
Save and queue a build
In my repository, I have 6 solutions and they all got built 🙂
In part two, I will create a UI Editor to avoid launching the solutions finder tool.