Open ctzen opened 5 years ago
I've used the following workaround, it works but it's a bit ugly:
plugins {
id("nebula.optional-base") version "5.0.0"
}
val optional: Closure<*> by extra
dependencies {
// use optional.toAction() as the 2nd parameter
implementation("...", optional.toAction())
}
with toAction
defined like this
fun <T : Any> Closure<*>.toAction(): Action<T> =
ConfigureUtil.configureUsing(this)
Can optional be used with the gradle kotlin DSL? If yes, please provide an example. Thanks.