Ant

Search
Searching TeamCity 4.x Documentation
Table of Contents

This page contains reference information about the Ant build runner fields:

Option Description
Build runner
Select Ant from the drop-down list.

Ant Parameters

Option Description
Path to build.xml file

If you choose this radio button, the text field is enabled, where you can type the path to the build.xml file of the project. The path is relative to the project root directory.
Build file content
If you choose this radio button, click the link Type build file content, and enter source code of your custom build file in the text area. Use Hide link to close the text area. Note that the text area is resizeable.
Working directory
Specify the build working directory.
Targets Use this text field to specify valid Ant targets as a list of space-separated strings. If this field is left empty, default target specified in build.xml file will be run.
Ant home path
Use this optional parameter to specify path to the distributive of your custom Ant. You do not need to specify this parameter, if you are going to use Ant distributive that comes bundled with TeamCity (Ant 1.7).
Please note, that you should use Ant 1.7 if you want to run JUnit4 tests in your builds.

Additional Ant command line parameters Optionally, specify additional command line parameters as a space-separated list.

Java Parameters

Option Description

JDK home path
Use this field to specify the path to your custom JDK which should be used to run the build. If the field is left blank, the path to JDK Home is read either from the JAVA_HOME environment variable on agent  computer, or from env.JAVA_HOME property specified in the build agent configuration file (buildAgent.properties). If these both values are not specified, TeamCity uses Java home of the build agent process itself.
If you have multiple build agents, it is recommended to specify value of this property as a reference to a property defined on specific build agent: %system.JDK_1_4%. After that you can specify the value of property system.JDK_1_4 in build agent's configuration file (buildAgent.properties) to the specific path to JDK 1.4 on this build agent:
system.JDK_1_4=/home/local/jdk_1.4.11
For all run parameters with values specified in terms of other properties (for example, %system.JAVA_1_4%), an implicit requirement is added (ensuring the referenced property is either defined on the agent machine or specified in the build parameters).
JVM command line parameters
You can specify such JVM command line parameters as, for example, maximum heap size or parameters enabling remote debugging. These values are passed by the JVM used to run your build.
Example:
-Xmx512m -Xms256m

Test parameters

Tests reordering works the following way: TeamCity provides tests that should be run first (test classes), after that when a JUnit task starts, it checks whether it includes these tests. If at least one test is included, TeamCity generates a new fileset containing included tests only and processes it before all other filesets. It also patches other filesets to exclude tests added to the automatically generated fileset. After that JUnit starts and runs as usual.

Option Description
Reduce test failure feedback time: Use following two options to instruct TeamCity to run some tests before others.
Run recently failed tests first If checked, in the first place TeamCity will run tests failed in previous finished or running builds as well as tests having high failure rate (a so called blinking tests)
Run new and modified tests first If checked, before any other test, TeamCity will run tests added or modified in change lists included in the running build.
If both options are enabled at the same time, tests of the new and modified tests group will have higher priority, and will be executed in the first place.

Coverage Info

Option Description
Code coverage The following options are available:
  • Enable code coverage: Check this option, if you want code coverage to be analyzed.
    The mechanism used in TeamCity is based on EMMA open-source toolkit (see http://emma.sourceforge.net/ for details).

    If this option is not checked, other coverage settings are disabled.

    'metadata is empty' problem
    For some complex build scripts, coverage metadata cannot be collected. In this case, try adding debug=true parameter to javac tasks in your Ant script.
  • Include Source Files in the Coverage Data: Check this option to include source files into the code coverage report (you'll be able to see sources on the Web).
    Warning
    Enabling this option can increase the report size and the slow down creation of your builds. To avoid this situation, you can specify some EMMA properties (see http://emma.sourceforge.net/reference_single/reference.html#prop-ref.tables for details).
Coverage Instrumentation Parameters Use this field to specify the filters to be used for creating the code coverage report. These filters define classes to be exempted from instrumentation. For detailed description of filters refer to http://emma.sourceforge.net/reference_single/reference.html#prop-ref.tables.



See Also:

  • System Administrator Reference: Ant

Labels