Alex Woods

01/31/2020, 3:20 PM
Hey there guys! We’re making an architecture decision at my company—should we use Groovy or Kotlin for Gradle? What are the strong and weak points of the Kotlin DSL for Gradle?

Esau Betancourt

01/31/2020, 3:49 PM
IMO, the Kotlin DSL is more readable and easy to adopt, I always had a hard time when working with Groovy. My only complain is that I feel that Intellij is so much slower when working with kotlin but if you just disabled the auto import you should be ok.
👍 3

Ray Eldath

01/31/2020, 5:30 PM
the auto completion of kotlin dsl is much faster than it used be, i think currently it's not a big problem. so i use kotlin dsl nearly in all my kotlin project, but if the project is not dominated by kotlin, i still use groovy. notice that some plugins are only works well with groovy, for example, jooq.


01/31/2020, 8:12 PM
here's a kotlin plugin for jOOQ:


01/31/2020, 9:07 PM
Use what your strong language is. If you're used to groovy, do groovy. But if your codebase is java/kotlin, having autocompletion is a real treat.
Also I tend to not rely on generated accessors too much, I have the feeling it somehow "helps" intelliJ run faster

Ran Magen

01/31/2020, 11:05 PM
We're in the process of converting all Groovy to Kotlin because Groovy was hard to maintain as complexity grew, the lack of strong types, no completion / validation resulted in too many runtime issues, etc.


02/01/2020, 12:20 PM
Cons for Kotlin build.gradle: - slower initial build because it has to compile the Gradle file first... This slows you down if you're editing the files - less examples - quirky usage of some plugins (jooq as mentioned) Pros: - code completion - compile time safety