新增多個依賴項

你可以新增多個依賴項。

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