How to: Make Team Build get a previous version

In Team Build 2008 there is a property called GetVersion. Here’s what the description from Aaron Hallberg’s blog says about it:

GetVersion.  Passed to the Version property of the Get task.  Defaults to SourceGetVersion (see below), but can be overridden to retrieve a particular version from source control.

To use this property to build a previous version of the source code you have three options:

Additional MSBuild Parameters dialog

Queue a new build and in the "Additional MSBuild Parameters" box, put:

/p:GetVersion=CXXXX

Where XXXX is the changeset you want to build. See screenshots here.

TFSBuild.rsp – MSBuild Response file

Or, put the same option in the TFSBuild.rsp (response) file. The contents of this file are passed as command line parameters to MSBuild.

/p:GetVersion=CXXXX

TFSBuild.proj

Or, Add a property into the TFSBuild.proj Team Build project file.

<PropertyGroup>

  <GetVersion>CXXXX</GetVersion>

</PropertyGroup>

You don’t have to specify a changeset either. You can specify any valid versionspec. See the versionspec heading under Command-Line Syntax for more options.

With TFS 2005 you would have needed to change the core implementation of Team Build.
See Aaron Hallberg's "Building a Specific Version with Team Build" blog.

Another thing to keep in mind is – What version of TFSBuild.proj will you be using to build the previous version of the code? What I typically do is store the TFSBuild.proj file alongside the source code in the branch. That way when you branch the code and you need to make build script changes, they are isolated and merged back with the code changes.
Published 26 June 08 12:35 by grantholliday
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Pregnant Man &raquo; How to: Make Team Build get a previous version said on June 28, 2008 3:24 AM:

PingBack from http://wordnew.acne-reveiw.info/?p=3858

# Team System News said on June 30, 2008 9:24 AM:

How Do I: Use the Checksum and ExpectedSchema Database Test Conditions Tommy Norman on TFS API: Work...

# xwang said on December 25, 2008 1:47 AM:

关键字:Label,Changeset,datetime...在TeamBuild的时候我们经常有需求需要编译某个版本,例如某个Label,或者什么时候提交的,而不是最新提交的版本,在T...

Leave a Comment

(required) 
(optional)
(required) 

Search

Go

This Blog

Syndication

Page view tracker