βœ‚οΈΒ Gradle

Small information nuggets and recipies about Gradle


(most recent on top)

Lifecycle of Gradle tasks

java-plugin-tasks

Log summary of tests skipped or passed

tasks.withType<test> {
    testLogging { events("passed", "skipped", "failed") }
}

Include JUnit 5 tests in all testing tasks

// Affects both `gradlew test` and `gradlew customTestTask`
tasks.withType<test> {
    useJUnitPlatform()
}

Register custom test tasks

tasks.register<Test>("customTestTask") {
    environment("ENV_VAR", "value")
    include("path/to/tests/**")
}