what is the latest and greatest way to keep all of...
# gradle
w
what is the latest and greatest way to keep all of your subprojects on the same kotlin version?
g
Depends on your needs, but before version catalog is available, there is no perfect way to do this
If you just want the same version of stdlib and plugin, the easiest way to apply plugin from root project with version and apply false and for all other projects do not specify plugin version or stdlib version
w
Ah OK. I tried the setting.gradle was, but its not kts so it didn't work. Is it possible to make settings.gradle.kts?
f
Yes
g
Could you show some example?
Because it's not clear for me what kind problem you have and what kind approach tried to use. Because what I suggested even doesn't require any changes in settings.gradle Also there is no real difference setting.gradle to use kts or groovy
w
the
Copy code
kotlin("jvm") version "1.4.21"
syntax only works in kts
and instead of doign apply false on root build.gradle, i prefer to use the plugins { } closure in settings.gradle to globally add plugins to theclasspath
g
You don't need this syntax, it's just small shortcut. Just usd standard id("org.jetbtains.kotlin.jvm")
Yes, sure, you can set version in settings.gradle