// tag::all[]
// tag::task-rule[]
tasks.addRule("Pattern: ping<ID>") {
    val taskName = this
    if (startsWith("ping")) {
        tasks.register(taskName) {
            doLast {
                println("Pinging: " + (taskName.replace("ping", "")))
            }
        }
    }
}
// end::task-rule[]

tasks.register("groupPing") {
    dependsOn("pingServer1", "pingServer2")
}
// end::all[]

// tag::all[]
// tag::task-rule[]
tasks.addRule("Pattern: ping<ID>") {
    val taskName = this
    if (startsWith("ping")) {
        task(taskName) {
            doLast {
                println("Pinging: " + (taskName.replace("ping", "")))
            }
        }
    }
}
// end::task-rule[]

task("groupPing") {
    dependsOn("pingServer1", "pingServer2")
}
// end::all[]

Revert addRule sample to eager API
Revert addRule sample to eager API

gradle/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,robinverduijn/gradle,blindpirate/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle