Does anyone know if there have been studies regard...
# android
l
Does anyone know if there have been studies regarding the build speed of a project on kts vs groovy?
o
You will probably have more luck asking in #gradle channel
l
Thanks
c
I know I’ve seen articles on this before, but can’t seem to find them now. The general conclusion is that a clean run is a fair bit slower due to the additional code generation and compilation required for Kotlin scripts (which gets cached), but subsequent runs are comparable in performance.
Personally, I’ve been using the Kotlin DSL for over a year now, and don’t notice the performance impact in day-to-day development, and the type-safety and introspection far outweight the performance hit IMO
l
That is, it is advisable to transfer all projects to kts?
Do you can somehow transfer build scripts from buildSrc between projects?
c
I always use kts for new projects, that’s an easy decision. It’s quite a bit more difficult to migrate existing projects to using it, especially if you’re using shared scripts (
apply from: 'common.gradle'
) or configuration injection (
subprojects { apply plugin: 'java'
)
Precompiled script plugins are the way I like to set up shared configurations among subprojects from buildSrc https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins
l
Thanks