gradle Task dependencies Multiple dependencies with the dependsOn method


Example

You can add multiple dependencies.

task A << {
    println 'Hello from A'
}

task B(dependsOn: A) << {
    println 'Hello from B'
}

task C << {
    println 'Hello from C'
}

task D(dependsOn: ['B', 'C'] << {
    println 'Hello from D'
}

The output is:

> gradle -q D
Hello from A
Hello from B
Hello from C
Hello from D