Team Foundation Build Recipes

Add custom message to build report

Modified: 2009/03/24 07:08 by ryan.dorrell - Categorized as: Team Build Recipes
Edit

Description

Ever wanted to have custom messages on the build report in TFS? There is a new task in TFS 2008, BuildStep, that allows you to display a custom message in the build report, and it gives you some control over what is displayed when the build is running, and when it succeeds.

Edit

Usage

Use the BuildStep task to display custom messages on the build report. See http://msdn.microsoft.com/en-us/library/bb399129.aspx for full documentation on this task.

The recipe consists of two steps: first, inside a , you define a BuildStep task and give it an ID (which you’ll use in the second BuildStep task).

The next part is to define another BuildStep task which “closes” the first one you created – put anything between these two tasks that you want to report on. While whatever you put between these tasks is running, you’ll see the first message in the build report, then the message of the second BuildStep task when it succeeds.

Edit

Source



Edit

Script

 
      

     <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                 BuildUri="$(BuildUri)"
                 Message="Some long running task has started...">
       <Output TaskParameter="Id" PropertyName="MyMessageID" />
     </BuildStep>
     
      
       <SomeLongRunningTask />

  
     <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                BuildUri="$(BuildUri)"
                Id="$(MyMessageID)"
                Message="Long running task has succeeded!"
                Status="Succeeded" />




Edit

Notes

You can also create BuildStep tasks for the statuses "Failed" and "Stopped".

© 2008 William Bartholomew blog.bartholomew.id.au

Powered by screwturn wiki