I have a question (I'm using Kotlin Gradle plugin ...
# gradle
e
I have a question (I'm using Kotlin Gradle plugin 1.4.21): If my only dependency is
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
, it seems that I don't have to specify a version! Why? I don't have the Kotlin BOM specified either. Only the
kotlin-test
dep. And of course the Kotlin Gradle plugin. I know that this version automatically provides the
kotlin-stdlib
version including the variant (e.g. JDK8), but judging by this behaviour, it also seems that it provides some kind of Kotlin BOM platform (or at least version constraints) for the
kotlin-test
dep (and who knows what others). How does this work? And is it ok to rely on the Kotlin Gradle Plugin version for the
kotlin-test
dependency?
1
t
Single safe mode - use similar versions of: 1. Kotlin Gradle plugin 2. Kotlin Gradle serialization plugin 3. Kotlin stdlibs 4. Kotlin standard test libs Other combinations - “lucky mode”
I don’t have the Kotlin BOM specified either
Plugins can add resolution strategies for such cases
e
Thanks, that makes sense. So is there any source where that sort-of Kotlin BOM is defined in the plugin can be found?
Btw, the actual version of the stdlib and test deps is equal to the Gradle plugin version, which is nice.
For more details you can check Kotlin sources
e
The Kotlin sources are hard to browse for the exact definition of these dependencies/constraints. At least for me.
Because the Kotlin repo is so large and modular, such constraints are likely defined dynamically or even generated
e
Thanks