-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
47 lines (45 loc) · 1.56 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
import com.diffplug.gradle.spotless.SpotlessExtension
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.dagger.hilt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.junit5) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.spotless)
alias(libs.plugins.kotlin.compose.compiler) apply false
}
subprojects {
apply(
plugin =
rootProject.libs.plugins.spotless
.get()
.pluginId,
)
extensions.configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("${layout.buildDirectory}/**/*.kt")
ktlint()
.setEditorConfigPath("${project.rootDir}/spotless/.editorconfig")
licenseHeaderFile(rootProject.file("spotless/spotless.license.kt"))
trimTrailingWhitespace()
endWithNewline()
}
format("kts") {
target("**/*.kts")
targetExclude("${project.rootDir}/**/*.kts")
licenseHeaderFile(
rootProject.file("spotless/spotless.license.kt"),
"(^(?![\\/ ]\\*).*$)",
)
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**/*.xml")
licenseHeaderFile(rootProject.file("spotless/spotless.license.xml"), "(<[^!?])")
}
}
}