-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
48 lines (43 loc) · 1.24 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import com.diffplug.gradle.spotless.SpotlessExtension
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.spotless) apply false
}
allprojects {
plugins.apply("com.diffplug.spotless")
extensions.configure<SpotlessExtension> {
kotlin {
target("src/**/*.kt")
ktlint(
rootProject.libs.ktlint.get().version,
).setEditorConfigPath(
"${rootProject.rootDir}/.editorconfig",
).editorConfigOverride(
mapOf(
"android" to "true",
"continuation_indent_size" to "2",
),
)
}
kotlinGradle {
ktlint(
rootProject.libs.ktlint.get().version,
).setEditorConfigPath(
"${rootProject.rootDir}/.editorconfig",
)
}
format("xml") {
target("src/**/*.xml")
indentWithSpaces(2)
trimTrailingWhitespace()
endWithNewline()
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
}
}
}
tasks.getByName("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}