kotlin-dsl/Gradle.xml (133 lines of code) (raw):

<?xml version="1.0" encoding="UTF-8"?> <dsl-extension kind="buildStep" type="gradle-runner" generateDslJar="true" pipelineCompatible="true"> <class name="GradleBuildStep"> <description> A [build step](https://www.jetbrains.com/help/teamcity/?Gradle) running gradle script </description> </class> <function name="gradle"> <description> Adds a [build step](https://www.jetbrains.com/help/teamcity/?Gradle) running gradle script @see GradleBuildStep </description> </function> <params> <param name="ui.gradleRunner.gradle.tasks.names" dslName="tasks"> <description>Space-separated task names. TeamCity runs the 'default' task if this field is empty.</description> </param> <param name="ui.gradleRUnner.gradle.build.file" dslName="buildFile"> <description> The path to a custom Gradle build file. Leave this field empty if your build file is build.gradle located in the root directory. This property is deprecated for Gradle versions 9.0 and higher, use the additional `-p &lt;path-relative-to-checkout-directory&gt;` command line parameter instead. </description> </param> <param name="ui.gradleRunner.gradle.incremental" dslName="incremental" type="boolean" trueValue="true" falseValue=""> <description>Enable this option to allow TeamCity to detect Gradle modules affected by a modified build, and run the :buildDependents only for these affected modules.</description> </param> <param name="teamcity.build.workingDir" dslName="workingDir" description="Custom working directory for the Gradle script" yamlName="working-directory"/> <param name="ui.gradleRunner.gradle.home" dslName="gradleHome"> <description>The path to a custom Gradle version. This version will be used instead of the default Gradle version referenced by the GRADLE_HOME environment variable.</description> </param> <param name="ui.gradleRunner.additional.gradle.cmd.params" dslName="gradleParams"> <description>Optional space-separated command-line parameters</description> </param> <param name="ui.gradleRunner.gradle.wrapper.useWrapper" dslName="useGradleWrapper" type="boolean" trueValue="true" falseValue=""> <description> Enable this setting if TeamCity should look for a [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) script in the project directory. </description> </param> <param name="ui.gradleRunner.gradle.wrapper.path" dslName="gradleWrapperPath"> <description>The path (relative to the working directory) to a Gradle Wrapper script</description> </param> <param name="ui.gradleRunner.gradle.debug.enabled" dslName="enableDebug" type="boolean" trueValue="true" falseValue=""> <description> Runs Gradle with the 'debug' (-d) log level. See also: [Logging Sensitive Information](https://docs.gradle.org/current/userguide/logging.html#sec:debug_security). </description> </param> <param name="ui.gradleRunner.gradle.stacktrace.enabled" dslName="enableStacktrace" type="boolean" trueValue="true" falseValue=""> <description> Allows Gradle to print [truncated stacktraces](https://docs.gradle.org/current/userguide/logging.html#stacktraces). </description> </param> <param name="target.jdk.home" dslName="jdkHome"> <description> Custom [JDK](https://www.jetbrains.com/help/teamcity/?Predefined+Build+Parameters#PredefinedBuildParameters-DefiningJava-relatedEnvironmentVariables) to use. The default is JAVA_HOME environment variable or the agent's own Java. </description> </param> <param name="jvmArgs"> <description> Space-separated list of additional arguments for JVM </description> </param> </params> <examples> <example> <description> Adds a simple Gradle step with custom tasks and a build file determined by Gradle. The Gradle Wrapper located in the checkout directory is used. </description> <code> gradle { name = "Build myproject" tasks = ":myproject:clean :myproject:build" } </code> </example> <example> <description> Add a Gradle build step with a custom Gradle task and a build file in a custom [working directory](https://www.jetbrains.com/help/teamcity/?Build+Working+Directory). Gradle incremental building feature is enabled. Additional Gradle command line parameters are specified with a reference to a [configuration parameter](https://www.jetbrains.com/help/teamcity/?Using+Build+Parameters). Gralde build step is set up not to use Gradle Wrapper, so Gradle will be taken from the agent's GRADLE_HOME environment variable. Additional [run parameter](https://www.jetbrains.com/help/teamcity/?Gradle#Run+Parameters) for printing stacktrace is enabled. This step will be run inside a [Docker](https://www.jetbrains.com/help/teamcity/?Gradle#Docker+Settings) container. IDEA-based [code coverage](https://www.jetbrains.com/help/teamcity/?Gradle#Code+Coverage) is enabled. </description> <code> gradle { name = "Test my project in Docker" tasks = "clean test" buildFile = "build-test.gradle" incremental = true workingDir = "tests/" gradleParams = "%myproject.version%" useGradleWrapper = false enableStacktrace = true coverageEngine = idea { includeClasses = """ org.group.example.* org.group.common """.trimIndent() excludeClasses = "org.group.common.test.*" } dockerImage = "gradle:jdk11" dockerImagePlatform = GradleBuildStep.ImagePlatform.Linux } </code> </example> <example> <description> Adds a Gradle build step with 'default' Gradle task and custom Gradle build file. Gradle Wrapper using is disabled, so Gradle will be taken with reference to an [environment variable](https://www.jetbrains.com/help/teamcity/?Using+Build+Parameters). JDK is set to the [environment variable](https://www.jetbrains.com/help/teamcity/?Using+Build+Parameters) value with custom command line [parameters](https://www.jetbrains.com/help/teamcity/?Gradle#Java+Parameters). This build step will run even if some previous build steps failed. </description> <code> gradle { name = "Default run on JDK 11" executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE buildFile = "build-dev.gradle" gradleHome = "%env.GRADLE_DEV_HOME%" useGradleWrapper = false jdkHome = "%env.JDK_11_0%" jvmArgs = "-Xmx2048m" } </code> </example> </examples> </dsl-extension>