-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle.kts
74 lines (70 loc) · 2.72 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.spotless)
alias(libs.plugins.modulegraph)
}
moduleGraphConfig {
readmePath.set("./README.md")
heading = "### Module Graph"
}
subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
parallel = true
buildUponDefaultConfig = true
allRules = true
config.setFrom("$rootDir/config/detekt/detekt.yml")
}
apply(plugin = "com.diffplug.spotless")
spotless {
kotlin {
ktlint(libs.versions.ktlint.get()).editorConfigOverride(
mapOf(
"android" to "true",
"insert_final_newline" to "true",
"ktlint_standard_string-template-indent" to "disabled",
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
"ktlint_standard_trailing-comma-on-declaration-site" to "disabled",
"ktlint_function_naming_ignore_when_annotated_with" to "Composable",
"ktlint_standard_function-naming" to "disabled",
"ktlint_standard_multiline-expression-wrapping" to "disabled",
"ktlint_standard_comment-wrapping" to "disabled",
"ktlint_standard_parameter-list-wrapping" to "disabled",
"ktlint_standard_argument-list-wrapping" to "disabled",
"ktlint_standard_wrapping" to "disabled",
),
).customRuleSets(
listOf(
"io.nlopez.compose.rules:ktlint:0.4.5"
)
)
target("**/*.kt")
licenseHeaderFile(
rootProject.file("${project.rootDir}/spotless/copyright.kt"),
"^(package|object|import|interface)",
)
trimTrailingWhitespace()
endWithNewline()
}
format("kts") {
target("**/*.kts")
targetExclude("$buildDir/**/*.kts")
licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)")
}
format("misc") {
target("**/*.md", "**/.gitignore")
trimTrailingWhitespace()
indentWithTabs()
endWithNewline()
}
}
}