jmfayard
10/19/2018, 11:32 AMfun Project.doSomethingCool()
that would also works in a Groovy build.gradle
file?
Have a look at this pattern: project.kt.doSomethingCool()
https://github.com/jmfayard/gradledemo/commit/896ea008fea9d792d69dad122addc76d09ebce54Nikky
10/19/2018, 1:18 PMcompile()
or plugins()
much more often than on Project
, any idea how to make those work in groovy ?compile(ktor("engine-cio"))
for examplejmfayard
10/19/2018, 2:07 PMcompile(Config.ktor("engine-cio"))
object Config {
@JvmStatic
fun ktor(module: String): String {
require(module in ktorModules) { "Ktor module=$module not in $ktorModules"}
return "io.ktor:ktor-$module:1.0.0"
}
val ktorModules = listOf("server-core", "client-core" , ...)