TeamCity 3.0 Help

System Properties of a Build Configuration

Various build configuration settings can be defined by referencing Build Configuration Properties. Build Configuration Properties are either user-defined or predefined.

In this section:

Defining Properties

The system properties and environment variables required for a build configuration can be defined in three locations. Where these properties and variables are set will determine whether they affect a specific build configuration, all of a project's build configurations that use the same VCS root, or a specific Build Agent.

  • To define properties specific to a build configuration, enter them on the Build Configuration's 6.Properties and environment variables page.

  • To define properties for all of a project's build configurations that use the same VCS root, create a text file named teamcity.default.properties, and check it into the VCS root. Ensure the file appears directly in the build working directory by specifying appropriate Configuring VCS Settings. The name and path to the file can be customized via the teamcity.default.properties property of a build configuration. Properties defined this way will not be visible in the TeamCity web UI, but will be passed directly to the build process.

  • To define agent-specific properties edit the Build Agent's buildAgent.properties file (<agent home>/conf/buildAgent.properties). (see agent below)

    The system properties and environment variables are defined in the teamcity.default.properties and buildAgent.properties files using the following format: [env|system].property_name=property_value For example: env.CATALINA_HOME=C:\tomcat_6.0.13

  • env. properties define the environment variables used during the process of running the build. These consist of the environment variables of the agent running the build, the environment variables defined in the agent configuration and the TeamCity default properties files and the environment variables set for the build configuration on the 6.Properties and environment variables page when you Creating and Editing Build Configurations. Please note that the agent's environment variables can vary depending upon which user the agent process is running. The list of environment variables available on a specific build agent can be found on the Environment variables tab of the Agent Details page .

  • system. properties include the properties defined on the 6.Properties and environment variables page in build configuration area of TeamCity, agent-specific predefined properties as well as system properties defined in the agent configuration file.

Referencing Properties

On the build configuration administration screens the properties can be referenced by %system.<property name>% and %env.<property name>%. Only the properties defined on agent and in the build configuration itself can be referenced.

Any user-defined property can reference other properties by using the following format:

%[env|system].property_name% For example: system.tomcat.libs=%env.CATALINA_HOME%/lib/*.jar

An exception to this is the teamcity.build.checkoutDir, which is referenced as is, without prefixes.

Any Global and system property (system.*) can be referenced in a build script by the property name:

  • For Ant and NAnt use ${<property name>}

  • For MSBuild (Visual Studio 2005/2008 Project Files) use $(<property name>)

Any user-defined environment variable is passed to the environment of the build agent that will process the build and can be used there as a usual environment variable.

Any property that is referenced in a build configuration, but is not defined, becomes a Agent Requirements for the configuration. The build configuration will be run only on agents that have this property defined.

Predefined Properties

Global

These properties can be used for setting various build configuration settings and inside build scripts.

Property Name

Value

teamcity.build.checkoutDir

working folder where the build is started

build.number

build number assigned by TeamCity

build.vcs.number.XX

VCS changelist number, where XX is the number of VCS root (1, 2, etc.) Use build.vcs.number.1 if only one VCS root is configured for a project

For a full list of supported properties please refer to the 6.Properties and environment variables section of Build Configuration settings in TeamCity Web UI.

Agent-specific

Agent-specific properties are defined on each build agent and vary depending on its environment. Aside from standard properties (for example os.name or os.arch, etc. — these are provided by JVM running on agent) agents also have properties based on installed applications. TeamCity automatically detects a number of applications including the presence of .NET Framework, Visual Studio, and TeamCity NUnitLauncher utility and adds the corresponding system properties and environment variables. (A complete list of predefined properties is provided in tablePredefinedProperties and listOfPredefinedProperties below). If additional applications/libraries are available in the environment, the administrator can manually define the property in the buildAgent.properties file (<agent home>/conf/buildAgent.properties). These properties can be used for setting various build configuration options, for defining build configuration requirements (e.g. existence or lack of some property) and inside build scripts. For more information on how to reference these properties see ref above.

Predefined Property

Description

agent.name

Name of the agent as specified in the buildAgent.properties agent configuration file. Can be used to set a requirement of build configuration to run (or not run) on particular build agent.

DotNetFramework<version>[_x86|_x64]

This property is defined if the corresponding version(s) of .NET Framework is installed

DotNetFramework<version>[_x86|_x64]_Path

This property's value is set to the corresponding framework version(s) path(s)

DotNetFrameworkSDK<version>[_x86|_x64]

This property is defined if the corresponding version(s) of .NET Framework SDK is installed

DotNetFrameworkSDK<version>[_x86|_x64]_Path

This property's value is the path of the corresponding framework SDK version

WindowsSDK<version>

This property is defined if the corresponding version of Windows SDK is installed. Version can be either 6.0 or 6.0A

VS[2003|2005|2008]

This property is defined if the corresponding version(s) of Visual Studio is installed

VS[2003|2005|2008]_Path

This property's value is the path to the directory that contains devenv.exe

teamcity.dotnet.nunitlauncher<version>

This property's value is the path to the directory that contains the standalone NUnit test launcher, NUnitLauncher.exe. The version number refers to the version of .NET Framework under which the test will run. The version equals the version of .NET Framework and can have a value of 1.1, 2.0, or 2.0vsts.

teamcity.dotnet.nunitlauncher.msbuild.task

The property's value is the path to the directory that contains the MSBuild task dll providing the NUnit task for MSBuild, sln2005, or sln2008.

Here is the complete list of supported predefined properties:

  • DotNetFramework1.0,

  • DotNetFramework1.0_Path,

  • DotNetFramework1.0_x86,

  • DotNetFramework1.0_x86_Path,

  • DotNetFramework1.1,

  • DotNetFramework1.1_Path,

  • DotNetFramework1.1_x86,

  • DotNetFramework1.1_x86_Path,

  • DotNetFramework2.0,

  • DotNetFramework2.0_Path,

  • DotNetFramework2.0_x86,

  • DotNetFramework2.0_x86_Path,

  • DotNetFramework2.0_x64,

  • DotNetFramework2.0_x64_Path,

  • DotNetFramework2.0_x86,

  • DotNetFramework2.0_x86_Path,

  • DotNetFrameworkSDK1.0,

  • DotNetFrameworkSDK1.1,

  • DotNetFrameworkSDK1.1_Path,

  • DotNetFrameworkSDK1.1_x86,

  • DotNetFrameworkSDK1.1_x86_Path,

  • DotNetFrameworkSDK2.0,

  • DotNetFrameworkSDK2.0_Path,

  • DotNetFrameworkSDK2.0_x86,

  • DotNetFrameworkSDK2.0_x86_Path

  • VS2003

  • VS2003_Path

  • VS2005

  • VS2005_Path

  • VS2008

  • VS2008_Path

You can disable the autodetection of these predefined properties by editing the buildAgent.properties file and adding the disableDotNetDetection property. Please note that this property is case-sensitive.

This property can have the following values:

Value

Description

empty string

All versions of .NET Framework will be detected and added to the Agent's properties

'*'

All existing versions of .NET Framework will not be detected and thus not included in the Agent's Properties

version number(s) (Values should be separated by commas)

Excludes versions of .NET Framework starting with that number

'windowsSDK6.0' or 'w'

Excludes Windows SDK 6.0

VS<X>

Excludes Visual Studio version <X>, where <X> can be 2003, 2005, 2008 or left blank to exclude all existing versions of Visual Studio

Examples

Description

disableDotNetDetection=3

Excludes .NET Framework 3.0, 3.5 and all other versions starting with 3

disableDotNetDetection=1.1,2.0

Excludes .NET Framework versions 1.1 and 2.0

disableDotNetDetection=w,2.0,VS2003

Excludes Windows SDK 6.0, .NET Framework 2.0 and Visual Studio 2003

Last modified: 20 April 2023