TFS 2008: Some properties that you can use to customize your build

Buck Hodges

Martin Woodward has posted a nice list of properties from Team Build that he has found useful.  While some of the properties were also in TFS 2005, quite a few are new for TFS 2008 (aka Orcas).

Some of the properties, such as RequestedFor, are properties of the current build that are set by the server, and thus you wouldn’t set them yourself.

There are two in particular that I would like to highlight:  IncrementalGet and IncrementalBuild.  Setting IncrementalGet to true in your tfsbuild.proj file (it’s false by default for backwards compatibility) will result in each build of that build definition reusing the existing workspace (and it will create a workspace if this is the very first build of that definition) and simply getting the files that have changed since the last build.  By contrast, the default setting will result in every file in the workspace being retrieved each time the build is executed.

IncrementalBuild takes it one step further.  In addition to doing what IncrementalGet does, it does not clean the binaries output directory.  The result is that each build will simply build binaries corresponding to the source that’s changed (assuming you’ve got all your dependencies setup correctly, etc.).

Check out Martin’s post for more properties. 

30 Useful Team Build Properties

If you are going to get into the Zen of TFS Team Build, then at some point you are going to have to read the TeamBuild .targets file (located in %ProgramFiles%\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets).  The TeamBuild build scripts are usually extensions of this master build script.  In Orcas the script has has several revisions to make sure as many hooks are provided as possible, but extraordinary lengths have been gone to to make sure that scripts written to target the old (VS 2005) version of the file will still work with the new one.   The problem with all MSBuild scripts, and a problem that is shared with Nant and Ant scripts alike, is that they take a little bit of working out.  You cannot just pick up a script and read it from beginning to end due to the way that dependencies work in these process execution languages and the fact that you can have multiple entry points.  Fortunately, the TeamBuild .targets file is very well commented and there is also additional documentation available on MSDN listing the points you should start to look when hooking in your logic.

However, when you eventually override your first target to write a custom bit of code in the build process, you are going to need to know some properties that are available for you.  Below is my list of 30 build properties that you will find useful.  There are over 70 available if you read the target file you will find them all, these are just the ones that I find most useful – some to read the properties available, and some to override to easily alter the behavior of the build script.

more…

0 comments

Leave a comment

Feedback usabilla icon