aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/java/Spotless.kt
diff options
context:
space:
mode:
Diffstat (limited to 'buildSrc/src/main/java/Spotless.kt')
-rw-r--r--buildSrc/src/main/java/Spotless.kt32
1 files changed, 22 insertions, 10 deletions
diff --git a/buildSrc/src/main/java/Spotless.kt b/buildSrc/src/main/java/Spotless.kt
index 859faf73..bab6f58d 100644
--- a/buildSrc/src/main/java/Spotless.kt
+++ b/buildSrc/src/main/java/Spotless.kt
@@ -4,16 +4,28 @@
*/
import com.diffplug.gradle.spotless.SpotlessExtension
+import org.gradle.api.Project
+import org.gradle.kotlin.dsl.apply
+import org.gradle.kotlin.dsl.configure
-internal fun SpotlessExtension.configureSpotless() {
- kotlin {
- ktfmt().googleStyle()
- target("src/**/*.kt", "**/*.kts")
- }
- format("xml") {
- target("**/*.xml")
- trimTrailingWhitespace()
- indentWithSpaces()
- endWithNewline()
+fun Project.configureSpotless() {
+ apply(plugin = "com.diffplug.spotless")
+ configure<SpotlessExtension> {
+ kotlin {
+ ktfmt().googleStyle()
+ target("**/*.kt")
+ targetExclude("**/build/")
+ }
+ kotlinGradle {
+ ktfmt().googleStyle()
+ target("**/*.kts")
+ }
+ format("xml") {
+ target("**/*.xml")
+ targetExclude("**/build/", ".idea/")
+ trimTrailingWhitespace()
+ indentWithSpaces()
+ endWithNewline()
+ }
}
}