Thursday, June 19, 2008

Building a Specific Version with Team Build 2008

You need to rebuild your code as it was at a specific point in history (by a label or a changeset)?

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.

But with TFS 2008 Microsoft already put this logic in, and even gave a GUI to use it:

Go to Team Explorer 2008 --> Builds.
Right click the Build definition you want to build.

click Queue New Build.

image

On the pop up window in MSBuild command-line arguments (optional) write:

/p:GetVersion=version

image

Where version is the Versionspec by the following syntax:

image

Hope it will help someone.

2 comments:

Andrew - said...

will this use the latest build proj file? or will it take the proj file from the timestamp of the build?

Jon said...

As far as I understand, it won't take the original build proj file.

first this file is not part of the Label of the build process, and second - this file is taken by the build agent itself and only then this file uses the GetVersion parameter to do the Get.

I do understand what you are trying to do - and you can achieve it manually by going to the Team Build agent directory -> tfsbuildservice.exe.config -> DoNotDownloadBuildType -> change it to true.

This will tell Team build not to take the build proj file. so you can now get the spesific proj file from history.

Hope it helps.