gpt4 book ai didi

gradle - TaskExecutionListeners 的通知顺序是否与 Gradle 中注册的顺序一致?

转载 作者:行者123 更新时间:2023-12-03 05:18:17 25 4
gpt4 key购买 nike

以下是否总是打印 one, two, three如果我运行 gradle three ?

task one {
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(it)) {
println "one"
}
}
}

task two {
dependsOn one
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(it)) {
println "two"
}
}
}

task three {
dependsOn two
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(it)) {
println "three"
}
}
}

最佳答案

是的,因为闭包被放入 LinkedHashMap , 最终变成 BroadcastDispatch当您调用 whenReady
公共(public) api 中没有任何内容说明这一点

关于gradle - TaskExecutionListeners 的通知顺序是否与 Gradle 中注册的顺序一致?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16047316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com