我想以编程方式告诉 gradle 从任务中返回,例如:
task ('SetupLibs') << {
if (sometest)
// how to tell gradle to return from this task
// because it is up-to-date
...
}
Run Code Online (Sandbox Code Playgroud)
这在groovy中可能吗?如何?
您可以使用upToDateWhen(){...}
例如:
task foo() << {
outputs.upToDateWhen {
if (sometest) return true
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1812 次 |
| 最近记录: |