Reputation: 2037
I'm a Android developer. As result I use Gradle for build android projects. I write (about 2 years) gradle scripts on Groovy. As result scripts is very compact, clear and easy to support. It is very good.
But in new version of Gradle is introduce new language - Kotlin.
My question is: What is the benefit (for writing Gradle scripts) if I switch from Groovy to Kotlin?
Upvotes: 54
Views: 38052
Reputation: 81929
Kotlin is statically typed, whereas Groovy is not. Statically typed languages like Kotlin enable IDEs to support particular tasks much better:
This is a great advantage that Gradle sees and therefore started with Kotlin as an alternative to Groovy.
There are also some official statements which you can find here.
Kotlin has become a standard scripting language in the Gradle ecosystem as you can see in their documentation.
Upvotes: 58
Reputation: 1149
I found this blog which explains some advantages to use Gradle Kotlin compare to Gradle Groovy: https://gradlehero.com/5-reasons-to-switch-to-the-gradle-kotlin-dsl/.
Quick resume of these advantages:
Hope it's could help.
Upvotes: 3