-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle.kts
40 lines (37 loc) · 1.3 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.4" apply false
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
id("com.android.library") version "8.1.4" apply false
id("com.diffplug.spotless") version "6.19.0" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false
}
subprojects {
apply(plugin = "com.diffplug.spotless")
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target(
fileTree(".") {
include("**/*.kt")
exclude("spotless/copyright.kt", "**/build/**")
},
)
ktlint()
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
trimTrailingWhitespace()
endWithNewline()
}
format("kts") {
target("**/*.kts")
targetExclude("$buildDir/**/*.kts")
licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)")
trimTrailingWhitespace()
endWithNewline()
}
}
afterEvaluate {
tasks.named("preBuild") {
dependsOn("spotlessApply")
}
}
}