Skip to content

Commit 34452da

Browse files
committed
invent and simplify
1 parent fbbd4a9 commit 34452da

File tree

1 file changed

+9
-1
lines changed
  • build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/dsl

1 file changed

+9
-1
lines changed

build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/dsl/CodeStyle.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package aws.sdk.kotlin.gradle.dsl
66

77
import aws.sdk.kotlin.gradle.util.verifyRootProject
88
import org.gradle.api.Project
9+
import org.gradle.api.artifacts.VersionCatalogsExtension
910
import org.gradle.api.attributes.Bundling
1011
import org.gradle.api.tasks.JavaExec
1112
import org.gradle.kotlin.dsl.*
@@ -15,7 +16,7 @@ import org.gradle.language.base.plugins.LifecycleBasePlugin
1516
* Configure lint rules for the project
1617
* @param lintPaths list of paths relative to the project root to lint (or not lint).
1718
*/
18-
fun Project.configureLinting(lintPaths: List<String>, repoToolsVersion: String) {
19+
fun Project.configureLinting(lintPaths: List<String>) {
1920
verifyRootProject { "Kotlin SDK lint configuration is expected to be configured on the root project" }
2021

2122
val ktlintVersion = object {} // Can't use Project.javaClass because that's using the Gradle classloader
@@ -24,6 +25,13 @@ fun Project.configureLinting(lintPaths: List<String>, repoToolsVersion: String)
2425
?.readText()
2526
?: error("Missing ktlint-version.txt")
2627

28+
val repoToolsVersion = extensions
29+
.getByType<VersionCatalogsExtension>()
30+
.named("libs")
31+
.findVersion("aws-kotlin-repo-tools-version")
32+
.get()
33+
.requiredVersion
34+
2735
val ktlint by configurations.creating
2836

2937
dependencies {

0 commit comments

Comments
 (0)