Are kotlin gradle scripts ready for production? If...
# gradle
z
Are kotlin gradle scripts ready for production? If not how near?
c
depends on definition of ready, I've been using it in our production codebase for couple of months already, that does not mean there are no rough edges.
z
My definition of ready is that I can convert our existing ~ 300 lines script for a spring boot project and convert it to Kotlin and everything works ๐Ÿ˜„
c
I did just that ๐Ÿ™‚ was pretty simple. Not comparing here but since you mentioned LOC, ours was something like 500 Even with centralized and grouped dependencies
On top of that, ours is multi-module project with 4 levels of hierarchy, I only converted three 3rd level build files and some common stuff, the rest is in Groovy because different teams work on those, but interop seems pretty seamless. The app itself is about 1M LOC Spring Boot app.
This here slack was essential in the beginning, so much stuff wasn't obvious from the beginning. But in the end I recommend it, scripts are much cleaner and understandable now, and having proper autocompletion and docs is bliss ๐Ÿ™‚
z
Thank you for your feedback! I will try to push it to my team ๐Ÿ˜„
c
You could do what I did, I created a branch, did all the necessary changes there, and demoed it, everyone liked it, so I had nothing to push (besides git push after merge ๐Ÿ˜„)
z
Ahahah ๐Ÿ˜„ yeah I think I'll do it ๐Ÿ˜„
n
Kotlin source code was migrated to kotlin script. Some scripts are quite large (>600 lines): https://github.com/JetBrains/kotlin/blob/master/build.gradle.kts
e
FWIW, the Gradle team is converting all our build scripts to Kotlin right now. Iโ€™d say we still have some rough edges, but for many small to medium size builds, itโ€™s in beta ๐Ÿ˜‰
j
I've been using Gradle Script Kotlin for over a year now in production builds. It was a lot more rough around the edges when I started. It's since gotten so much cleaner (and my knowledge of how Gradle works has improved significantly). Using the Kotlin DSL will not only make writing your build easier, but it will help you understand what your code is actually doing.
t
@eriwen will Gradle ever decide it no longer wants to support Groovy?
j
They said that they fully plan to continue supporting Groovy as an official language at Kotlin Conf last year.
t
I remember (I was there), but... ok then! Glad to hear it
I find myself sentimentally attached to all the time I've spent learning Groovy, haha. I guess there will always be Spock specs to write....
๐Ÿ‘ 1