diff --git a/build.gradle b/build.gradle index 23b2252f9..32928b03d 100644 --- a/build.gradle +++ b/build.gradle @@ -151,7 +151,7 @@ configurations { task ktlint(type: JavaExec, group: "verification") { description = "Check Kotlin code style." - main = "com.pinterest.ktlint.Main" + mainClass = "com.pinterest.ktlint.Main" classpath = configurations.ktlint args "src/**/*.kt", "spi/src/main/**/*.kt" } @@ -159,7 +159,7 @@ check.dependsOn ktlint task ktlintFormat(type: JavaExec, group: "formatting") { description = "Fix Kotlin code style deviations." - main = "com.pinterest.ktlint.Main" + mainClass = "com.pinterest.ktlint.Main" classpath = configurations.ktlint args "-F", "src/**/*.kt", "spi/src/main/**/*.kt" // https://github.com/pinterest/ktlint/issues/1391 @@ -216,11 +216,14 @@ dependencies { testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0" testImplementation "org.mockito:mockito-core:${versions.mockito}" - add("ktlint", "com.pinterest:ktlint:0.45.1") { + add("ktlint", "com.pinterest.ktlint:ktlint-cli:1.1.0") { attributes { attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL)) } } + configurations.ktlint { + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22" + } // https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/ opensearchPlugin "org.opensearch.plugin:opensearch-job-scheduler:${job_scheduler_version}@zip"