TeamBuild ClassMSBuild Extension Pack Help 4.0.12.0
Valid TaskActions are:

GetLatest (Required: TeamFoundationServerUrl, TeamProject Optional: BuildDefinitionName, Status Output: Info)

Queue (Required: TeamFoundationServerUrl, TeamProject, BuildDefinitionName Optional: DropLocation)

RelatedChangesets (Required: TeamFoundationServerUrl, TeamProject Optional: BuildUri, BuildDefinitionName Output: Info, RelatedItems)

RelatedWorkItems (Required: TeamFoundationServerUrl, TeamProject Optional: BuildUri, BuildDefinitionName Output: Info, RelatedItems)

Remote Execution Support: NA

Inheritance Hierarchy

SystemObject
  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPackBaseTask
      MSBuild.ExtensionPack.Tfs2012TeamBuild

Namespace: MSBuild.ExtensionPack.Tfs2012
Assembly: MSBuild.ExtensionPack.Tfs2012 (in MSBuild.ExtensionPack.Tfs2012.dll) Version: 4.0.0.0

The TeamBuild type exposes the following members.

Constructors

  NameDescription
Public methodTeamBuild
Top
Properties

  NameDescription
Public propertyBuildDefinitionName
The name of the build definition.
Public propertyBuildUri
Build Uri. Defaults to latest build.
Public propertyDropLocation
The name of the Drop folder
Public propertyInfo
Gets the Build information
Public propertyRelatedItems
Gets Related items associated with the build
Public propertyStatus
Set the Status property of the build to filter the search. Supports: Failed, InProgress, NotStarted, PartiallySucceeded, Stopped, Succeeded
Public propertyTeamFoundationServerUrl
The Url of the Team Foundation Server.
Public propertyTeamProject
The name of the Team Project containing the build
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <PropertyGroup>
        <TeamFoundationServerUrl>http://YOURSERVER:8080/</TeamFoundationServerUrl>
        <TeamProject>YOURPROJECT</TeamProject>
        <BuildUri></BuildUri>
        <BuildDefinitionName>YOURDEF</BuildDefinitionName>
    </PropertyGroup>
    <Target Name="Default">
        <!-- Get information on the latest build -->
        <MSBuild.ExtensionPack.Tfs2012.TeamBuild TaskAction="GetLatest" TeamFoundationServerUrl="$(TeamFoundationServerUrl)" TeamProject="$(TeamProject)" BuildDefinitionName="$(BuildDefinitionName)">
            <Output ItemName="BuildInfo" TaskParameter="Info"/>
        </MSBuild.ExtensionPack.Tfs2012.TeamBuild>
        <Message Text="BuildDefinitionUri: %(BuildInfo.BuildDefinitionUri)"/>
        <Message Text="BuildFinished: %(BuildInfo.BuildFinished)"/>
        <Message Text="BuildNumber: %(BuildInfo.BuildNumber)"/>
        <Message Text="BuildUri: %(BuildInfo.BuildUri)"/>
        <Message Text="CompilationStatus: %(BuildInfo.CompilationStatus)"/>
        <Message Text="CompilationSuccess: %(BuildInfo.CompilationSuccess)"/>
        <Message Text="DropLocation: %(BuildInfo.DropLocation)"/>
        <Message Text="FinishTime: %(BuildInfo.FinishTime)"/>
        <Message Text="KeepForever: %(BuildInfo.KeepForever)"/>
        <Message Text="LabelName: %(BuildInfo.LabelName)"/>
        <Message Text="LastChangedBy: %(BuildInfo.LastChangedBy)"/>
        <Message Text="LastChangedOn: %(BuildInfo.LastChangedOn)"/>
        <Message Text="LogLocation: %(BuildInfo.LogLocation)"/>
        <Message Text="Quality: %(BuildInfo.Quality)"/>
        <Message Text="Reason: %(BuildInfo.Reason)"/>
        <Message Text="RequestedBy: %(BuildInfo.RequestedBy)"/>
        <Message Text="RequestedFor: %(BuildInfo.RequestedFor)"/>
        <Message Text="SourceGetVersion: %(BuildInfo.SourceGetVersion)"/>
        <Message Text="StartTime: %(BuildInfo.StartTime)"/>
        <Message Text="TestStatus: %(BuildInfo.TestStatus)"/>
        <Message Text="TestSuccess: %(BuildInfo.TestSuccess)"/>
        <!-- Queue a new build -->
        <MSBuild.ExtensionPack.Tfs2012.TeamBuild TaskAction="Queue" TeamFoundationServerUrl="$(TeamFoundationServerUrl)" TeamProject="$(TeamProject)" BuildDefinitionName="$(BuildDefinitionName)"/>
        <!-- Retrieve Changesets associated with a given build -->
        <MSBuild.ExtensionPack.Tfs2012.TeamBuild TaskAction="RelatedChangesets" TeamFoundationServerUrl="$(TeamFoundationServerUrl)" TeamProject="$(TeamProject)" BuildUri="$(BuildUri)" BuildDefinitionName="$(BuildDefinitionName)">
            <Output ItemName="Changesets" TaskParameter="RelatedItems"/>
        </MSBuild.ExtensionPack.Tfs2012.TeamBuild>
        <Message Text="ID = %(Changesets.Identity), Checked In By = %(Changesets.CheckedInBy), URI = %(Changesets.ChangesetUri), Comment = %(Changesets.Comment)"/>
        <!-- Retrieve Work Items associated with a given build -->
        <MSBuild.ExtensionPack.Tfs2012.TeamBuild TaskAction="RelatedWorkItems" TeamFoundationServerUrl="$(TeamFoundationServerUrl)" TeamProject="$(TeamProject)" BuildUri="$(BuildUri)" BuildDefinitionName="$(BuildDefinitionName)">
            <Output ItemName="WorkItems" TaskParameter="RelatedItems"/>
        </MSBuild.ExtensionPack.Tfs2012.TeamBuild>
        <Message Text="ID = %(Workitems.Identity), Status = %(Workitems.Status), Title = %(Workitems.Title), Type  = %(Workitems.Type), URI = %(Workitems.WorkItemUri), AssignedTo = %(Workitems.AssignedTo)"/>
    </Target>
</Project>
See Also

Reference