Share via


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 Customize the SolutionToBuild Item Group.

Property

Description

BinariesRoot

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

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 whole sources directory will be deleted during CoreClean target execution.

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 PublishDir 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.

CustomPropertiesForBuild

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

CustomPropertiesForClean

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

GetAllowUnmapped

Set this property to false to make the build fail if unmapped files exist in a shelveset (for gated check-in and private builds).

GetAutoMerge

Set this property to false to make the build fail if there are any conflicts during the version control get operation in a gated check-in or private build.

GetNoCIOption

Set this property to false to exclude insertion of the ***NO_CI*** string in the check-in comments when running a gated check-in build. Be aware that setting this property to false will cause affected continuous integration builds to be queued.

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.

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.

LabelComment

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

LabelName

Set this label name to define the name that is 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.

PerformTestImpactAnalysis

Set this property to false to disable test impact analysis.

PublishTestResults

Set this property to false to skip publishing test results.

SkipClean

Set this property to skip the CoreClean target.

SkipDropBuild

Set this property to skip the CoreDropBuild target.

SkipGet

Set this property to skip the CoreGet target.

SkipGetChangesetsAndUpdateWorkItems

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

SkipInitializeWorkspace

Set this property to skip the CoreInitializeWorkspace target.

SkipInvalidConfigurations

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

SkipLabel

Set this property to skip CoreLabel target.

SkipPostBuild

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

SkipWorkItemCreation

Set this property to skip the CoreCreateWorkItem target.

SolutionRoot

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

StopOnFirstFailure

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

UpdateAssociatedWorkItemsOnBuildBreak

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

Customizing Visual C++ builds

Team Foundation Build also supports customizing the building of Visual C++ 9.0 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