Hi everyone, we need some suggestion around `kts` ...
# gradle
s
Hi everyone, we need some suggestion around
kts
usage for gradle build. We have 140+ modules and we started migrating to
kts
from groovy. But our configuration time on CI with fresh project has increased a lot. One
kts
file takes almost 1.5 seconds to compile. So it is not scalable, it is not parallel or it doesnt support remote cache. I wonder, is there any planned significant improvement or should we migrate back to groovy?
o
I hear with 1.4 kotlin or beyond the compiler should be much faster, and it's basically expected that the gradle team will attempt to reduce times on the biggest hits such as this additionally, https://github.com/gradle/gradle/issues/9225 is already tracked
s
I talked this one about Nelson, looks like it is not something prioritized in gradle team. Build times are improved with 1.4 but not much. Kts build times are significant
n
What sorts of compilation performance improvements are included in kotiln 1.4? Gradle does yet not use kotlin 1.4.
o
iirc nothing was actually changed in 1.4, only backend work to enable further changes https://blog.jetbrains.com/kotlin/2019/12/what-to-expect-in-kotlin-1-4-and-beyond/#new-compiler
s
I read about script cache and ide impprovements with 1.4
n
@octylFractal that article was written on December 6, 2019. As far as I know no changes to the compiler made it in to 1.4.0.
o
right, hence "1.4 kotlin or beyond" in my original statement, I wasn't sure
c
They said the compiler improvements will come later, 1.5 or 1.6 so...even if Gradle updates to 1.4 it doesn't matter. Configuration cache could help a lot when you run the same command (as you do on CI)
s
Running same command doesn't compile scripts. At least use some cache. Buy for ci builds, It adds a lot. We will migrate back to groovy.
It is superior sad, i think gradle.kts is hyped a lot but it needs to he stated as experiment or not stable until it doesn't spend 1.5 sec per file.
o
in my experience it doesn't but that might be because we don't have ephemeral CI agents, so the gradle cache can retain itself a bit.
c
I haven't made it clear, sorry. The configuration-cache can be cached on ephemeral CI (as long as the absolute path doesn't change) so kts files don't have to be compiled every time, unless you change them.
n
This doesn't have anything to do with configuration cache. The compilation of these scripts is stored in a different cache.
👍🏻 1
c
yes...but IIRC, if it's in the configuration cache it doesn't even recompile them
s
Isnt it because there is different cache for script compilation? I think even if you dont have configuration cache, kts wont get recompiled if they didnt changed.
n
Yeah, Sinan is correct. These script are cached and only recompiled when the script itself changes or the buildscript classpath.
s
@no do you know which folder is script cache?
n
Not sure.
Ask in Gradle community slack.
👍 1