Recently I posted on How to use the TFS 2010 Community StyleCop Build Activity and I am sure it all sounded very awkward and complex, well it did to me.
The point I should have made is that you don’t have to follow this process every time you want to make use of the custom activity. As long as the build process template is the same between to builds you can just copy it, you only need to follow the method in the post the first time.
So assuming you have followed the process in my last post and want to add the same build process to another project, lets say in another Team Project Collection, you do the following
Get the files onto the build box
- In VS2010 open Source Control Explorer select your Team Project and map the BuildProcessTemplates folder to a location on your local disk.
- Create a new folder under the BuildProcessTemplates called Custom Assemblies
- In this new folder copy all the assemblies from the equivalent folder you created in my last post
- Into the BuildProcessTemplates copy the edited build process template that uses the custom activities, again from the equivalent folder in my last post
- From within Source Control Explorer add these new files and check the files into TFS.
- Open Team Explorer, right-click on Builds and select Manage Build Controllers
- Select the controller to configure, and then select Properties
- Set the Version control path to custom assemblies to the location just created under version control containing your added assemblies
- You might want to restart the build service, it should automatically pick up the changes, but I usually do a restart to make sure
Making use of the build
- Create a new build and set it up as normal.
- On the process tab press the new button and browse to find the newly added process template
Once this is done can now save the build and queue it and all should work.
So the 2nd, 3rd etc. uses of a custom activity are not too bad as the first, as long as you can keep your process templates generic.