March 21st, 2007

Aaron’s back and has new posts on Team Build

Buck Hodges
Director of Engineering

Aaron Hallberg took a month off after the birth of his daughter, Stella.  Now that he’s back, he’s got a couple of interesting posts.

The first one applies to TFS 2005 (aka v1) and shows you how to pass custom properties to each solution that you build.  It’s something that a lot of folks have needed to be able to do, but the solution with v1 is not good.  If you choose to do this, you will have to fix your build when you upgrade to Orcas (notice that I didn’t say if you upgrade to Orcas ;-)).  In Orcas, we’ve made this really easy to do, so all of this only applies to TFS 2005 (v1).

Passing custom properties to individual solutions in Team Build

Gautam Goenka posted an article on this topic way back on April 20, 2006.  It included a targets file which overrode the standard Team Build CoreCompile target and allowed user-specified properties to be passed into the MSBuild tast that Team Build uses to build the solution in the SolutionToBuild item group.  This approach is fine if you want to pass the same custom property values into each solution in the SolutionToBuild item group, but what if you want to pass different property values into each solution?

Manish Agarwal posted an article that could help get you started here.  His goal was to enable redirecting assemblies to solution-specific subdirectories, but it was easily extendable to passing other user-specified properties on a solution-specific basis.  Unfortunately, it also some problems, including breaking the calculation of errors/warnings during the compilation phase of the build.

Before pressing on, I should say that we do not recommend overriding the Core* targets in a Team Build build.  The primary reason here is that you will almost certainly be broken after you upgrade to Orcas if you override these targets, since most of them will be changing radically in that new version.  See this post by Buck Hodges for more details here.  The good news here is that the issues that caused people to override the Core* targets in Team Build v1 have been addressed in Orcas, so you should no longer find it necessary to do this sort of thing.

Having said all that, attached you will find a new CoreCompile override that will allow you pass custom property values into each solution via solution-specific metadata.  For example, if you wanted each solution to put its binaries into a solution-specific subdirectory (rather than the default behavior, where all binaries end up in a single directory), you could do the following:

more…

In his most recent post, Aaron describes some of the lower-level changes that we made to the targets file and build process in Orcas (v2) that significantly improve your ability to customize and extend the build process, including how to pass custom properties to each solution being built.  A great deal of what we have done here has been based on the feedback we’ve gotten from the forum, blogs, and other discussions with customers.

Orcas Changes

The March CTP of Orcas is now available (Buck has a post on this here), and with it comes your first chance to play around with the new and improved Team Build.  I’m pretty excited about the changes in the build process (defined in Microsoft.TeamFoundation.Build.targets), so I figured I’d mention some of them:

more…

Technorati tags: , , ,

Author

Buck Hodges
Director of Engineering

Director of Engineering, Azure DevOps

0 comments