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:
>...