使用 dependsOn 方法的多个依赖项
你可以添加多个依赖项。
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'
}
输出是:
> gradle -q D
Hello from A
Hello from B
Hello from C
Hello from D