Customizable Team Foundation Build Properties

MSBuild properties are key–value pairs you can use to configure builds. For more information, see MSBuild Properties.

The Microsoft.TeamFoundation.Build.targets file defines several MSBuild targets, tasks, and properties for Team Foundation Build. You can modify these properties in the TFSBuild.proj file to:

  • Pass values to Team Foundation Build tasks and targets

  • Override certain build actions

For more information about the TFSBuld.proj file, see Understanding Team Foundation Build Configuration Files.

In this document

Customizing Visual C++ builds

Properties Used to Customize Tasks

Properties that can be Overridden

The following table lists the properties that are defined for Team Foundation Build. You can override them in the TfsBuild.proj file to customize the build process. For more information, see How to: Customize the SolutionToBuild Item Group.

Property

Description

CustomPropertiesForClean

Set this property to pass custom values into every solution when Team Foundation Build calls the Clean target.

CustomPropertiesForBuild

Set this property to pass custom values into every solution when Team Foundation Build calls its default target (usually Build).

SkipClean

Set this property to skip the CoreClean target.

IncrementalGet

Set this property to true to do an incremental get. This is a convenience property that sets CleanCompilationOutputOnly to true, SkipInitializeWorkspace to true, and ForceGet to false.

IncrementalBuild

Set this property to true to do an incremental build. This is a convenience property that sets SkipClean to true, SkipInitializeWorkspace to true, and ForceGet to false.

CleanCompilationOutputOnly

Set this property to true to delete only the intermediate assemblies from the sources directory during the CoreClean target execution. If this property is set to false, the entire sources directory will be deleted during CoreClean target execution.

SkipGetChangesetsAndUpdateWorkItems

Set this property to true to skip the association of changesets and updating of work items for successful builds.

SolutionRoot

Set this property to point to the root of the sources folder on the build computer.

BinariesRoot

Set this property to point to the root of the binaries folder on the build computer.

LabelComment

Set this property to define the comment used by the Label task.

LabelName

Set this label name to define the name used by the Label task.  By default, the label name is set to $(BuildNumber) in the InitializeEndToEndIteration target.

OutDir

Set this property to define the location of the output files in the build working directory.

UpdateAssociatedWorkItemsOnBuildBreak

Set this property to true to update associated work items even for a broken build.

StopOnFirstFailure

Set this property to true to stop cleaning, compiling, and/or testing on the first failure encountered during build execution.

SkipGet

Set this property to skip the CoreGet target.

SkipLabel

Set this property to skip CoreLabel target.

SkipInitializeWorkspace

Set this property to skip the CoreInitializeWorkspace target.

SkipInvalidConfigurations

Set this property to false to generate an error rather than a warning when the user encounters an invalid configuration.

SkipPostBuild

Set this property to skip gathering associated changesets and work items.

SkipDropBuild

Set this property to skip the CoreDropBuild target.

SkipWorkItemCreation

Set this property to skip the CoreCreateWorkItem target.

CustomizableOutDir

Set this property to true when you want to prevent Team Foundation Build from setting OutDir for each solution. Note that you can use the TeamBuildOutDir property to retrieve the value Team Foundation Build would have assigned to OutDir if CustomizableOutDir was set to false.

CustomizablePublishDir

Set this property to true when you want to prevent Team Foundation Build from setting the PublishDir directory for each solution. Note that you can use the TeamBuildPublishDir property to retrieve the value Team Foundation Build would have assigned to PublishDir if CustomizablePublishDir was set to false.

Customizing Visual C++ builds

Team Foundation Build also supports customizing the building of Visual C++ projects. You can use the following properties to set corresponding properties on the VCBuild task used by MSBuild to build Visual C++ projects. For more information, see VCBuild Task.

Team Build Property

VCBuild Task Property

Description

VCBuildAdditionalLibPaths

AdditionalLibPaths

Specifies additional paths to search for libraries before the LIB environment variable paths are searched (corresponds to the LIBPATH option for LINK.exe).

VCBuildAdditionalOptions

AdditionalOptions

Specifies additional command-line options that do not have dedicated task parameters.

VCBuildToolPath

ToolPath

Specifies the location from where the VCBuild task loads the underlying executable file (VCBuild.exe).

VCBuildUseEnvironment

UseEnvironment

Set this to true to use environment variables for PATH, INCLUDE, LIBS, and LIBPATH. Otherwise, set it to false. This property corresponds to the /useenv option for VCBuild.exe. For more information, see /useenv.

AdditionalVCOverrides

None

Use this property to specify additional options for the VCBuild task sheet file(s) generated by Team Foundation Build and specified in the Override property of the VCBuild task.

Properties Used to Customize Tasks

Each default Team Foundation Build task in the Microsoft.TeamFoundation.Build.targets file also includes a set of properties you can use to customize the task. For more information about Team Foundation Build tasks, see Team Foundation Build Tasks. For example, the CreateNewWorkItem task is defined as follows.

<!-- Create WorkItem for build failure -->
<CreateNewWorkItem
          TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
          BuildUri="$(BuildUri)"
          BuildNumber="$(BuildNumber)"
          Description="$(WorkItemDescription)"
          TeamProject="$(TeamProject)"
          Title="$(WorkItemTitle)"
          WorkItemFieldValues="$(WorkItemFieldValues)"
          WorkItemType="$(WorkItemType)"
          ContinueOnError="true" />

To customize the work item that is created on build failure, set the WorkItemFieldValues in the TFSBuild.proj file:

Note

The following assumes that the Areapath and IterationPath properties have also been set.

<WorkItemFieldValues>Area Path=$(AreaPath);Iteration Path=$(IterationPath);Severity=1;Priority=0;Symptom=build break;Steps To Reproduce=Start the build using Team Build;Source=Development;How Found=Build Break;Assigned To=Active</WorkItemFieldValues>

See Also

Tasks

How to: Use Environment Variables in a Build

Concepts

Understanding Team Foundation Build Configuration Files