From 891a046b2fa646b658a5e2fc84a823241109cc22 Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Tue, 27 Aug 2024 15:39:11 -0700 Subject: [PATCH] Added the JVM Dependency Conflict Detection Gradle plugin. --- build-logic/build.gradle.kts | 1 + .../org.sdkotlin.buildlogic.kotlin-project.gradle.kts | 1 + gradle/libs.versions.toml | 11 ++++++++++- tdd-in-kotlin/build.gradle.kts | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 9381bb6..08a4a4f 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { implementation(platform("org.sdkotlin.platforms:plugins-platform")) implementation(libs.dependency.analysis.gradle.plugin.dependency) + implementation(libs.jvm.dependency.conflict.resolution.gradle.plugin.dependency) implementation(libs.kotlin.gradle.plugin.dependency) implementation(libs.ksp.gradle.plugin.dependency) } diff --git a/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts b/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts index 75ce102..bb54a60 100644 --- a/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts +++ b/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts @@ -7,6 +7,7 @@ plugins { // https://github.com/gradle/gradle/issues/15383 // alias(libs.plugins.dependency.analysis.gradle.plugin) id("com.autonomousapps.dependency-analysis") + id("org.gradlex.jvm-dependency-conflict-resolution") } val javaTargetVersion: String = JavaVersion.VERSION_21.toString() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0dbf544..08a76b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,9 +6,10 @@ dependency-analysis-gradle-plugin = "1.33.0" equalsverifier = "3.16.2" jetbrains-annotations = "24.1.0" junit = "5.11.0" +jvm-dependency-conflict-resolution = "2.1.2" koin = "3.5.6" kotest = "5.9.1" -kotlin = "2.0.10" # Must match KSP version below. +kotlin = "2.0.10" # Must match KSP version below. kotlinpoet = "1.18.1" kotlinx-coroutines = "1.8.1" kotlinx-dl = "0.5.2" @@ -56,6 +57,10 @@ version.ref = "junit" [libraries.junit-params] module = "org.junit.jupiter:junit-jupiter-params" +[libraries.jvm-dependency-conflict-resolution-gradle-plugin-dependency] +module = "org.gradlex:jvm-dependency-conflict-resolution" +version.ref = "jvm-dependency-conflict-resolution" + [libraries.koin-bom] module = "io.insert-koin:koin-bom" version.ref = "koin" @@ -202,6 +207,10 @@ mockk-jvm = [ id = "com.autonomousapps.dependency-analysis" version.ref = "dependency-analysis-gradle-plugin" +[plugins.jvm-dependency-conflict-resolution-gradle-plugin] +id = "org.gradlex.jvm-dependency-conflict-resolution" +version.ref = "jvm-dependency-conflict-resolution" + [plugins.kotlin-gradle-plugin] id = "org.jetbrains.kotlin.jvm" version.ref = "kotlin" diff --git a/tdd-in-kotlin/build.gradle.kts b/tdd-in-kotlin/build.gradle.kts index e2a9137..788eaf6 100644 --- a/tdd-in-kotlin/build.gradle.kts +++ b/tdd-in-kotlin/build.gradle.kts @@ -17,7 +17,7 @@ dependencies { testImplementation(libs.kotest.assertions.shared) testImplementation(libs.kotest.framework.api.jvm) - testImplementation(libs.bundles.mockk.jvm) + testImplementation(libs.mockk) testRuntimeOnly(platform("org.sdkotlin.platforms:app-platform"))