Hello, World! I'm migrating to `kts`. Let's say ...
# gradle
b
Hello, World! I'm migrating to
kts
. Let's say I want some globally accessible map for dependency versions (for instance
"gradle" to "6.3", "kotlin" to "1.3.70"
and so on) - and I'd like to be able to access it from the root's build.gradle.kts, and also the other module's. What's the simplest way to do this? Currently I have a solution using
extra
but is there a way to simply add my own
object
to the classpath or something like that?
p
i'm new to gradle/kotlin but yes indeed, i just did this: https://github.com/peterfigure/Greetings
b
Thanks a lot! Very simple indeed 🙂
p
np!
m
I'm doing that too. The main drawaback is that changing a lib version invalidates your whole build so the next build will take a loong time.
There's some discussion abouot it (https://github.com/gradle/gradle/issues/9008) but I don't think this will change any time soon.
apollo-android has versions in a
dependencies.gradle
file so it can also be shared with test projects. I believe this will play nicer with incremental builds too.
Itt uses groovy
eval()
to pull that in the
build.gradle.kts
p
thanks for sharing .. i guess that could be annoying if you're working with snapshot dependencies
b
thanks a lot 🙂 👍