-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
58 lines (54 loc) · 1.68 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
51
52
53
54
55
56
57
58
import com.diffplug.gradle.spotless.SpotlessExtension
buildscript {
dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
}
}
plugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.library").version("7.4.2").apply(false)
kotlin("multiplatform").version("1.9.0").apply(false)
id("org.jlleitschuh.gradle.ktlint") version Version.ktlint
id("com.diffplug.spotless") version "6.17.0"
id("com.vanniktech.maven.publish") version "0.25.2"
id("org.jetbrains.kotlin.jvm") version "1.8.0" apply false
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "com.diffplug.spotless")
configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint().setEditorConfigPath(
"${project.rootDir}/.editorconfig"
)
trimTrailingWhitespace()
endWithNewline()
}
kotlinGradle {
target("*.gradle.kts")
ktlint().setEditorConfigPath(
"${project.rootDir}/.editorconfig"
)
trimTrailingWhitespace()
endWithNewline()
}
format("xml") {
target("**/*.xml")
}
}
ktlint {
debug.set(false)
verbose.set(true)
version.set("0.46.1")
enableExperimentalRules.set(true)
outputToConsole.set(true)
ignoreFailures.set(false)
enableExperimentalRules.set(false)
additionalEditorconfigFile.set(file("$rootDir/.editorconfig"))
filter {
exclude { it.file.path.contains("build/") }
}
}
}