I want to migrate a `build.gradle` script from gro...
# gradle
s
I want to migrate a
build.gradle
script from groovy to kotlin. Inside one of my build, I have this:
Copy code
allprojects {
    ext.runProtoGen = { inPath, outPath, kotlinPackage = null, logLevel = null, inSubPath = null ->
      [...]
    }
}
How would I be able to do that with kotlin DSL ? Thanks 🙂
t
Should be something like this:
Copy code
allprojects { subProject ->
    subProject.ext["runProtoGen"] = { ... }
}
s
Thanks! And then, how would I use it inside a subproject?
t
val runProtoGen = project.ext["runProtoGen"] as (Some, Some) -> Some
s
Thanks a lot!
t
There is also
by extra
delegate, probably could be used as well