As I upgraded a project to use Kotlin 1.4.10 inste...
# gradle
s
As I upgraded a project to use Kotlin 1.4.10 instead of 1.3.60, I got errors because of a version mismatch (stemming from a library that used 1.3.60). I had to solve it by adding this dependency:
Copy code
implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.10"
I would love for the version string here to not contain another hardcoded "1.4.10", but to use whatever the plugin version is at. Is there anyway to do this? We use Groovy Gradle.
e
the
kotlin()
helper could make it simply
Copy code
implementation(kotlin("reflect"))
but I'm not sure if that's available in the gradle dsl or only the kotlin dsl...
maybe you could try
Copy code
implementation platform("org.jetbrains.kotlin:kotlin-bom")
to align the versions of all kotlin dependencies
g
+1 for Kotlin BOM But if you want override some dependencies in the graph, you should use enforcePlatform, not platform
And you can omit versions everywhere except plugin, BOM will get version from plugin and rest of Kotlin dependencies from BOM
s
Ah yes, BOM is perfect of course! Thanks, both!