hello! what is the proper way to share constants (...
# gradle
d
hello! what is the proper way to share constants (e.g. some common dependency version) between gradle modules, e.g. given
Copy code
project
| build.gradle.kts
|- childA
  | build.gradle.kts
|- childB
  | build.gradle.kts
how can i define some values in root build file so i can reference them from child modules build files? If I define them as
val
it works fine in single file but cannot be accessed outside. Guess I'm looking for K equivalent of
ext
block from Groovy
m
You could also use
buildSrc
to have everything compile-time checked
d
just to double check -> without going with the
buildSrc
route I will need to redefine the
val someLibVersion: String by extra
in all build files?
m
I usually just use
val someLibVersion = project.extra["someLibVersion"]
d
same thing I guess
👍 1
thanks!