Slackbot
02/10/2023, 10:57 PMVampire
02/10/2023, 11:05 PMclosureOf
or delegateClosureOf
, or if you don't like either, use a Groovy script plugin that you apply from
if you insist (not recommended).
That it is hard to tell which to use is caused by Groovy being an extremely dynamic and duck-typed language while Kotlin is static and type-safe. Just try out which of the two work for the closure you need to give or make the plugin developer switch to Action
which will then work properly for both DSLs without hassle.Vampire
02/10/2023, 11:06 PMclosureOf
or delegatClosureOf
there is also KotlinClosure{0-3}
actually for cases where it is needed.Mark Maxey
02/10/2023, 11:39 PMval bintrayPackageConfig = delegateClosureOf<BintrayExtension.PackageConfig> { repo = "repossessed" }
bintray.pkg(bintrayPackageConfig)
Both closureOf
and delegatClosureOf
compile. I'll try to apply it to a different DSL and see which works at runtime.
It is a bummer to have to have 2 different approaches that compile but not knowing which one works until I get an NPE at runtime.Vampire
02/10/2023, 11:47 PM