it is the same error. required Closure but it is () → String
I have tried to use gradle-kotlin-dsl library was able to use closureOf to construct Closure, but still struggle with building the function part so doCall does not throw exception
In Kotlin (.kt) file, there is variable typed as groovy.lang.Closure
I try to set the value for the variable in Kotlin (.kt) and that is when the issue comes. The closest is to use gradle-kotlin-dsl library and use
closureOf<String> ({
“name”
}) as Closure<String>
but it complains that receiver is null during runtime. so the closureOf function does not help in this case too. But I think it is doable to write a customized function to support this.