-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle.kts
45 lines (41 loc) · 1.39 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
import com.diffplug.gradle.spotless.SpotlessExtension
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.23" apply false
id("com.google.devtools.ksp") version "1.9.23-1.0.20" apply false
id("com.google.gms.google-services") version "4.4.1" apply false
id("com.google.firebase.crashlytics") version "2.9.9" apply false
id("com.diffplug.spotless") version "6.25.0" apply false
}
subprojects {
apply(plugin = "com.diffplug.spotless")
extensions.configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude(// Build directory
"**/build/**/*.kt",
)
ktfmt("0.49").dropboxStyle()
trimTrailingWhitespace()
endWithNewline()
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**/*.xml")
}
}
}
/**
* Runs ./gradlew spotlessApply with kt-lint/kt-fmt() before commits
*/
task("addCodeStyle") {
println("⚈ ⚈ ⚈ Running Spotless Code Style Analysis ⚈ ⚈ ⚈")
exec {
commandLine("cp", "./.scripts/pre-commit", "./.git/hooks")
}
}