Skip to content

Commit 33425f1

Browse files
committed
fix(build): workaround Spotless API regression
1 parent 1d2c3c7 commit 33425f1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import org.gradle.api.Plugin
1414
import org.gradle.api.Project
1515
import org.gradle.kotlin.dsl.apply
1616
import org.gradle.kotlin.dsl.configure
17+
import org.gradle.kotlin.dsl.withGroovyBuilder
1718
import org.gradle.kotlin.dsl.withType
1819

1920
@Suppress("Unused")
@@ -26,13 +27,15 @@ class SpotlessPlugin : Plugin<Project> {
2627
project.pluginManager.apply(SpotlessPlugin::class)
2728
project.extensions.configure<SpotlessExtension> {
2829
kotlin {
29-
ktfmt(KTFMT_VERSION).googleStyle()
30+
// https://github.com/diffplug/spotless/pull/1890#issuecomment-1827263031
31+
@Suppress("INACCESSIBLE_TYPE") ktfmt(KTFMT_VERSION).withGroovyBuilder { "googleStyle"() }
3032
target("**/*.kt")
3133
targetExclude("**/build/", "/spotless/")
3234
licenseHeaderFile(project.file("spotless/license.kt"))
3335
}
3436
kotlinGradle {
35-
ktfmt(KTFMT_VERSION).googleStyle()
37+
// https://github.com/diffplug/spotless/pull/1890#issuecomment-1827263031
38+
@Suppress("INACCESSIBLE_TYPE") ktfmt(KTFMT_VERSION).withGroovyBuilder { "googleStyle"() }
3639
target("**/*.kts")
3740
targetExclude("**/build/")
3841
licenseHeaderFile(project.file("spotless/license.kt"), "import|plugins|@file")

0 commit comments

Comments
 (0)