Skip to content

Commit

Permalink
Simplify detekt configuration kotlin version override.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Aug 10, 2024
1 parent 05283fb commit 8e64ec3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.google.cloud.tools.jib.gradle.BuildImageTask
import com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.getSupportedKotlinVersion
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand Down Expand Up @@ -76,10 +77,10 @@ tasks.withType<Test>().configureEach {
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
}

configurations.configureEach {
configurations.matching { it.name == "detekt" }.configureEach {
resolutionStrategy.eachDependency {
if (this@configureEach.name == "detekt" && requested.group == "org.jetbrains.kotlin") {
useVersion("1.9.23")
if (requested.group == "org.jetbrains.kotlin") {
useVersion(getSupportedKotlinVersion())
}
}
}
Expand Down

0 comments on commit 8e64ec3

Please sign in to comment.