Introduction to Team Build 2008 for Team Build 2005 Users

Published 27 August 07 01:31 PM | dmckinstry

If you haven't already gotten a chance to play with TFS 2008 (Beta 2), I recommend it.  My experience is that it is solid and seems to work better than the RCs worked for the 2005 release.  My primary interest is in the Team Build enhancements, although there are a few other interesting TFS 2008 features such as Destroy and the integration of key TFS Power Tool elements.

From a Team Build perspective, the basic build concepts with 2008 are similar to 2005.  It is still an integrated lifecycle build process layered on top of MSBuild.  It does have some significant architectural changes and features that make it a far more compelling tool.

From an architectural standpoint, infrastructure supporting build has evolved.  The team build service is still installed on your build server(s) and listens on a TCP port using .NET remoting.  The service does very much the same thing that it did in 2005; that is, listen for build requests from the associated TFS and then work with the TFS to perform the build process.  It still uses a TFSBuild.proj file with MSBuild to drive the build process and a TFSBuild.rsp file to provide the command-line MSBuild overrides.

The contents of the TFSBuild file are somewhat changed although they seem to be compatible with the existing project but some of the properties seem obsolete. and other items and properties have been enhanced.  Here are some differences I've noted:

  • BuildMachine is not used anymore.  If you create a new build in Team Build 2008, this property is set to "UNKNOWN".
  • BuildDirectory is also not used and defaults to UNKNOWN.
  • DropLocation is also not used.
  • SolutionToBuild now has additional item metadata to allow specification of explicit Targets and Properties.

There is a moderate selection of other new properties exposing additional capabilities as well as the usual suspects.  Amongst the new configuration properties that I like are IncrementalGet and IncrementalBuild.  Setting these two properties to true may significantly increase the speed of your team builds by maintaining a workspace and only getting deltas of changes files between builds, and by only compiling projects which have changes.  This is certainly useful for Continuous Integration or similar build models that have a high build frequency.  You may well still omit these properties or leave them false if you are concerned about workspace integrity or tampering on the build machine.

If you've been paying attention, you'll notice that previously critical properties such as BuildMachine are now gone and that I have omitted mention of the WorkspaceMapping.XML file!!!  The reason for this is that Team Build has been restructured such that this data is stored elsewhere.  We used to have "Build Types" which were indicated by folder name under the TeamBuildTypes folder at the root of version control in each team project.  Team Build 2008 uses "Build Definitions" which contain this meta data and point to the TFSBuild.proj file.  This has a side effect of allowing you to carry your TFSBuild.proj file with your solution(s) which allows them to easily follow your branching strategy.

The primary elements in a build definition include:

  • The name and description of the build definition.  These are located on the General tab of the build definition dialog.
  • The Workspace mapping for the build.  Since this is separate from the TFSBuild.proj file, it is possible to have multiple build agents  with different workspace mappings using the same TFSBuild.proj.  Or in other words, I can have two related branches with branched versions of the same build file (e.g., $/.../Test/TFSBuild.proj and $/.../Dev/TFSBuild.proj) which effectively specify the same build process but are managed by two different build definitions with their own workspace mappings. It is nice to have a UI to manage workspaces instead of just an XML file:
    WorkspaceMapping User Interface
  • Of course, you still need a reference to the Project File, which points to your TFSBuild.proj file in version control.  If you don't already have one, you can create one using a wizard similar to the build type wizard for Team Build 2005.
  • These is a new Retention Policy capability in Team Build 2008 allowing you to specify how many recent builds to keep before they are automatically deleted.  For Team Build 2005 you had to manually clean up old builds using "TFSBuild DELETE", custom code or other hacks.  Now you can simply specify how many recent copies of the build to keep based on the build outcome (i.e., Failed, Stopped, Partially Succeeded, or Succeeded).  Regardless of the retention policy you can lock builds manually if they are of interest to protect them from being deleted.
    Retention Policy
  • The Build Defaults are specify the default Build Agent and Drop Location.  The Build Agent is another new construct which is used to define the build server, the communications settings, and the working directory for the build.  The first time you create a build definition in a team project you'll need to create a new build agent definition; after that you can reuse it for any other build definition in the team project:
    Build Agent dialog
  • The last portion of the build definition wizard specifies the Trigger settings.  This allows you to define if and when builds should automatically start.  By default, builds will be manually started just as they are in the out-of-the-box Team Build 2005.  However, by just setting a radio button and perhaps a few other setting you can schedule builds or do automated build based on check-in.  In fact, you can easily specify batched builds where a series of checkins can be batched into a build or one-to-one checkin to build.  The ability to actually do one-to-one builds against checkins is facilitated by build queuing.  Team build still only supports one build per team project per agent at a time, but it now supports the ability to request a build and if it can't be done because the agent is busy, it will be queued up and the build will take place when the agent becomes available.  This little feature was rare in some of the available Team Build extensions which provided Continuous Integration for TFS 2005.  With it in place, Team Build can now determine exactly who to assign a bug to when build breaks!
    Build Automation and Continuous Integeration

Another improvement over Team Build 2005 is that you can now maintain portions of the build process using a user interface instead of purely through XML files.  The TFSBuild.proj file is still maintained using an XML file editor, but the build definition and build agents can both be maintained using a user interface!

There are certainly other changes in Team Build 2008, but this should summarize all of the significant change.  I rarely recommend prerelease software for any of my clients.  However due to the vast enhancements in Continuous Integration support (i.e., triggers, queuing and retention policies), both my company and one of my customers are using TFS 2008 Beta 2 and it's go-live license.  Note that for my client, the users are still using Visual Studio 2005 and Team Explorer 2005...  but the Team System back end is all 2008!

Give it a look... And enjoy!

Comments

# Ponder .NET said on August 27, 2007 04:55 PM:

Visual Studio Team System 2008 is an incremental release and not a revolutionary new product. It is a

# Team System News said on August 28, 2007 09:22 AM:

Buck Hodges on How to construct the Team System Web Access 2005 URL to a file in version control. The...

# MSDN Blog Postings » Dave McKinstry on Build in TFS 2008 said on September 7, 2007 02:32 AM:

Pingback from  MSDN Blog Postings  » Dave McKinstry on Build in TFS 2008

# kiran said on September 12, 2007 05:32 AM:

I have installed the orcas team explorer on my machine which has VSTS 2005.

But now when i open teh visual studio 2005 editor i am not able to see the option of teh build definition dialog.

Please help

# dmckinstry said on September 12, 2007 07:02 AM:

Hi Kiran,

The 2008 build componenents will only be visible from Team Explorer 2008.  Team Explorer and Visual Studio 2008 install along side Visual Studio 2005 but are not integrated.  To manipulate 2008 builds, please try Team Explorer 2008.

Hope this helps!

# Marc said on January 7, 2008 10:46 AM:

I have the opposite problem to Kiran. We have TFS 2005 but I am now using Team Explorer 2008. The 'New Build Definition' is greyed out for me but 'New Team Build Type' is enabled on another system with the same user permissions. Do you know if Team Explorer 2008 should be backwards-compatible with TFS 2005?

# dmckinstry said on January 8, 2008 08:59 AM:

Hi Marc,

My understanding is that Team Explorer 2008 is fully backward compatible EXCEPT for build.  If I remember correctly, build users can kick off builds and review results but can't really manipulate TFS 2005 builds.

You should install Team Explorer 2005 if you need to create builds for a 2005 TFS.

-Dave

# Nasser said on January 24, 2008 12:01 PM:

One of our teams is reluctant to upgrade to 2008 as they had tremendous problems setting up 2005. They don't want to risk another cycle like that. So my question is:  Do you guys know if it is possible to use TFSBuild 2008 against TFS 2005 repository?

Also the article above was written on the basis of the Beta version. The final release of 2008 has certain differences. For instance it does support DropLocation and the remoting protocol seems to be http (at least this is the only acceptable protocol for Migration from VSS).

-Nasser  

# dmckinstry said on January 24, 2008 12:18 PM:

Hi Nasser -

Unfortunately, TFS and Team Build versions are locked together.  Team Build 2008 must be driven from TFS 2008.  In addition, to get the goodness of Build 2008 you need Team Explorer 2008.

Most of the stuff in this post is completely applicable to the RTM release.  I didn't follow what you meant by DropLocation.  You are correct that they have dropped .NET remoting from 2005 in favor of HTTP.  By default 2008 build agents listen on HTTP port 9191 under "/Build/v2.0/AgentService.asmx" although this is not using IIS.

Good luck with the eventual adoption of 2008.  I just finished walking another team through a 2005>2008 upgrade and it went well for them but that doesn't mean your team doesn't have reasons to be cautious.

-Dave

Leave a Comment

(required) 
(required) 
(optional)
(required)