Skip to content

Gradle

class Gradle

Plugin to use the Gradle build tool within pipelines.

This plugin automatically configures wrapper caching and test reporting.

Example

gitlabCi {
    val build by job {
        useGradle()

        script {
            gradlew.task("build")
        }
    }
}

Job extensions

  • useGradle: Enables the plugin and preconfigures GitLab to import test reports.

See also

Types

Companion

object Companion

Functions

task

fun task(task: String)

Executes the Gradle task named task.

Example
gitlabCi {
    val build by job {
        useGradle()

        script {
            gradlew.task("build")
        }
    }
}

tasks

fun tasks(vararg tasks: String)

Executes the Gradle tasks named tasks.

Example
gitlabCi {
    val build by job {
        useGradle()

        script {
            gradlew.tasks("assemble", "check")
        }
    }
}
fun tasks(tasks: Iterable<String>)

Executes the Gradle tasks named tasks.