Unable to render embedded object: File (TeamCity48.png) not found.

TeamCity 10.x and 2017.x Documentation

Icon

You are viewing the documentation of TeamCity 10.x and 2017.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The Gradle Build Runner runs Gradle projects.

Icon

To run builds with Gradle, you need to have Gradle 0.9-rc-1 or higher installed on all the agent machines.
Alternatively, if you use Gradle wrapper, you should have properly configured Gradle Wrapper scripts checked in to your Version Control.

In this section:

Gradle Parameters

Option

Description

Gradle tasks

Specify Gradle task names separated by space. For example: :myproject:clean :myproject:build or clean build. If this field is left blank, the 'default' is used. Note, that TeamCity currently supports building Java projects with Gradle. Groovy/Scala/etc. projects building has not been tested.

Incremental building

TeamCity can make use of Gradle :buildDependents feature. If the Incremental building checkbox is enabled, TeamCity will detect Gradle modules affected by changes in the build, and start the :buildDependents command for them only. This will cause Gradle to fully build and test only the modules affected by changes.

Gradle home path

Specify here the path to the Gradle home directory (the parent of the bin directory). If not specified, TeamCity will use the Gradle from an agent's GRADLE_HOME environment variable. If you don't have Gradle installed on agents, you can use Gradle wrapper instead.

Additional Gradle command line parameters

Optionally, specify the space-separated list of command line parameters to be passed to Gradle.

Gradle Wrapper

If this checkbox is selected, TeamCity will look for Gradle Wrapper scripts in the checkout directory, and launch the appropriate script with Gradle tasks and additional command line parameters specified in the fields above. In this case, the Gradle specified in Gradle home path and the one installed on agent, are ignored.

Run Parameters

Option

Description

Debug

Selecting the Log debug messages check box is equivalent to adding the -d Gradle command line parameter.

Stacktrace

Selecting the Print stacktrace check box is equivalent to adding the -s Gradle command line parameter.

Java Parameters

Option

Description

JDK home path

The option is available when <Custom> is selected above. Use this field to specify the path to your custom JDK 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 the 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.

JVM command line parameters

You can specify such JVM command line parameters as, e.g., maximum heap size or parameters enabling remote debugging. These values are passed by the JVM used to run your build.
Example:

 

Build properties

The TeamCity system parameters can be accessed in Gradle build scripts in the same way as Gradle properties. The recommended way to reference properties is as follows:

or if the system property's name is a legal Groovy name identifier (e.g. system.myPropertyName = myPropertyValue):

An alternative way is using the teamcity property (deprecated since 9.1.5). The property contains the map with all defined system properties (see Defining and Using Build Parameters for details).
The example below contains a task that will print all available build properties to the build log (it must be executed by the buildserver):


Code Coverage

Code coverage with IDEA code coverage engine and JaCoCo is supported.



See also:

Administrator's Guide: IntelliJ IDEA Code Coverage

  • No labels