Skip to content

Commit

Permalink
Add resolutionStrategy to limit ktlint version (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler authored Sep 11, 2022
1 parent f438a57 commit 0e9c1ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ buildscript {
classpath(libs.gradlePlugin.kotlin)
classpath(libs.gradlePlugin.mavenPublish)
}

configurations.classpath {
resolutionStrategy.eachDependency {
when (requested.group) {
libs.ktlint.get().module.group -> useVersion(libs.versions.ktlint.get())
}
}
}
}

// https://youtrack.jetbrains.com/issue/KTIJ-19369
Expand Down Expand Up @@ -52,7 +60,6 @@ allprojects {
apply(plugin = "org.jmailen.kotlinter")

kotlinter {
version = rootProject.libs.versions.ktlint
disabledRules = arrayOf(
"annotation",
"argument-list-wrapping",
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ androidx-test = "1.4.0"
compose = "1.2.1"
composeCompiler = "1.3.1"
coroutines = "1.6.4"
ktlint = "0.47.0"
ktlint = "0.47.1"
okhttp = "4.10.0"
okio = "3.2.0"

Expand Down Expand Up @@ -51,6 +51,8 @@ junit = "junit:junit:4.13.2"
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test-junit" }

ktlint = { module = "com.pinterest.ktlint:ktlint-core", version.ref = "ktlint" }

material = "com.google.android.material:material:1.6.1"

okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
Expand Down

0 comments on commit 0e9c1ab

Please # to comment.