Incorrect 8.4 Tutorial Documentation?

I’m trying to get a better grasp on how were using Gradle in our application so I figured I would start from the ground up and run through the getting started documentation.

I noticed that in the Tutorial > Running Tasks > Understanding Dependencies Between Tasks, the basic example is… wrong? Creating those tasks and running ./gradlew greet doesn’t produce the output order described in this section. I get:

How are you?
Hello!

Not the described:

Hello!
How are you?

Yeah, you are fully right.
But not the expected output is wrong, the code is non-sense.
It should most probably be

tasks.register("hello") {
    doLast {
        println('Hello!')
    }
}

tasks.register("greet") {
    doLast {
        println('How are you?')
    }
    dependsOn("hello")
}
1 Like