-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
50 lines (46 loc) · 1.5 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
49
50
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.ktlint)
alias(libs.plugins.spotless)
}
buildscript {
dependencies {
classpath("io.kotzilla:kotzilla-plugin:0.13.5")
}
}
allprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
reporters {
reporter(ReporterType.JSON)
}
filter {
exclude("**/generated/**")
exclude("**/build/**")
}
}
}
subprojects {
apply(plugin = "com.diffplug.spotless")
spotless {
kotlin {
target("**/*.kt")
targetExclude("${project.rootDir}/build-logic/**/*.kt")
licenseHeaderFile(
rootProject.file("${project.rootDir}/spotless/copyright.kt"),
"^(package|object|import|interface)",
)
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
}
}
}