<@U1UQX3JCC> I use my plugin `buildSrcVersions` fo...
# gradle
j
@Marc Knaup I use my plugin
buildSrcVersions
for that. It extracts all dependencies with their exact version. So you only have to define which dependencies you want
val forceDependencies = listOf(Libs.kotlin_reflect, Libs.kotlin_stdlib_jdk7)
and then the
resolutionStrategy
block is always the same and straightforward https://github.com/jmfayard/buildSrcVersions/issues/28
m
Thanks @jmfayard. Where is
Libs
coming from? I don't want to set a specific version but use the one from the Kotlin Gradle Plugin. Also I don't want to list all possible Kotlin libraries but just state "whatever kotlin libraries there are, pin them to the same version".
j
@Marc Knaup they are generated by my plugin and correspond to whatever version that you are using in your build https://github.com/jmfayard/buildSrcVersions/blob/35b44c9e8386d5f68fe35eb330b464e763e00e00/sample-kotlin/buildSrc/src/main/kotlin/Versions.kt
m
@jmfayard doesn't that cause a recursion? The Gradle file can't compile without
Libs
present but for that you have to compile the Gradle file first?
j
Nope because the buildSrc module is compiled before anything else and is then available to all Gradle files
m
@jmfayard but how does the buildSrc know my dependencies? Or do I have to enter them all manually?
j
@Marc Knaup You have an existing Gradle project with dependency versions. You add the Gradle plugin. It reads the information from your build and generates those
Libs.kt
and
Versions.kt
. You can then use
<http://Libs.xxx|Libs.xxx>
in your builds. For a longer version, see the README. Tell me if there is something unclear https://github.com/jmfayard/buildSrcVersions