添加多个依赖项

你可以添加多个依赖项。

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

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

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

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

现在你可以定义一组依赖项:

B.dependsOn A
C.dependsOn B
D.dependsOn C

输出是:

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

其他例子:

B.dependsOn A 
D.dependsOn B
D.dependsOn C

输出是:

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