gpt4 book ai didi

gradle - 在Gradle Kotlin DSL中查找现有任务的配置回避选项是什么?

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

使用配置回避API:创建新任务并对其进行配置的方法:

val someLongTaskName by tasks.registering {
// configure action here
}

而配置现有任务的方式:
val anotherVeryLongTaskName = tasks.named("anotherVeryLongTaskName") {
// configure action here
}

在后一种情况下,我不想重复自己,而使用类似于:
val anotherLongTaskName = by tasks.naming {
// configure action here
}

可能吗?

最佳答案

通常,您不需要val anotherLongTaskName

因此,在以下情况下,您不会重复自己的情况:

tasks.named("anotherVeryLongTaskName") {
// configure action here
}

关于gradle - 在Gradle Kotlin DSL中查找现有任务的配置回避选项是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59691969/

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