build: configure Spotless at top-level only

This commit is contained in:
Harsh Shandilya 2021-08-26 11:24:02 +05:30
parent 03b4e2496a
commit 80fec48ec9
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -23,25 +23,27 @@ group = "dev.msfjarvis.claw"
version = "1.0" version = "1.0"
apply(plugin = "com.diffplug.spotless")
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**")
ktfmt("0.28").googleStyle()
}
kotlinGradle {
target("**/*.gradle.kts")
ktfmt("0.28").googleStyle()
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**", ".idea/**")
prettier(mapOf("prettier" to "2.0.5", "@prettier/plugin-xml" to "0.13.0"))
.config(mapOf("parser" to "xml", "tabWidth" to 2))
}
}
allprojects { allprojects {
apply(plugin = "com.diffplug.spotless")
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**")
ktfmt("0.28").googleStyle()
}
kotlinGradle {
target("*.gradle.kts")
ktfmt("0.28").googleStyle()
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**", ".idea/**")
prettier(mapOf("prettier" to "2.0.5", "@prettier/plugin-xml" to "0.13.0"))
.config(mapOf("parser" to "xml", "tabWidth" to 2))
}
}
tasks.withType<KotlinCompile>().configureEach { tasks.withType<KotlinCompile>().configureEach {
kotlinOptions { kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString() jvmTarget = JavaVersion.VERSION_11.toString()