Using the SetBuildProperties Task to Update the Log Location for a Build

One of the new tasks available in Team Build Orcas (VS 2008) is the SetBuildProperties task.  This task allows you to modify any of the settable properties of a BuildDetail object directly from you MSBuild script (TfsBuild.proj).  The settable properties include:

  • BuildNumber.  This is often displayed in the GUI as Build Name.
  • CompilationStatus.  A string representation of the BuildPhaseStatus value for the compilation phase of the build.  Valid values include "Failed", "Succeeded", and "Unknown".
  • DropLocation.  The location of the build outputs - typically a UNC path.
  • LabelName.  The name of the version control label generated for the build.
  • LogLocation.  The location of the log file for the build - typically a file called BuildLog.txt at the DropLocation.
  • Quality.  The quality of the build.
  • SourceGetVersion.  The version specifier used to retrieve source files for the build.
  • Status.  A string representation of the BuildStatus value for the overall status of the build.  Valid values include "InProgress", "Succeeded", "PartiallySucceeded", "Failed", "Stopped", and "NotStarted".
  • TestStatus.  A string representation of the BuildPhaseStatus value for the testing phase of the build.  Valid values include "Failed", "Succeeded", and "Unknown".

Using the task is pretty simple - just specify the TeamFoundationServerUrl and BuildUri that identify the BuildDetail to be modified and set the desired properties to their new values.  For example, to set the log location for a build to a URL, rather than the typical UNC path, you might do something like the following:

   <Target Name="AfterDropBuild">
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)"
                        LogLocation="https://www.myurl.com/BuildOutput/BuildNumber_20071016/BuildLog.htm" />
  </Target>

After this change, the link to the log file in the build report for this build will show the new URL, rather than the default UNC path.

Comments

  • Anonymous
    October 16, 2007
    PingBack from http://www.artofbam.com/wordpress/?p=9075
  • Anonymous
    October 19, 2007
    AngelaB on That Other Visual Studio Team Edition that No One Likes To Talk About. Brian Harry on Final...