-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
49 lines (46 loc) · 1.62 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
plugins {
id("com.pexip.sdk.kotlin.dokka")
alias(libs.plugins.kotlinx.binarycompatibilityvalidator)
alias(libs.plugins.spotless)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.dagger.hilt.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.ksp) apply false
}
group = checkNotNull(property("group")) { "group == null." }
version = checkNotNull(property("version")) { "version == null." }
apiValidation {
ignoredProjects += "sample"
}
spotless {
val ktlintVersion = libs.versions.ktlint.get()
kotlin {
ratchetFrom = "origin/main"
target("**/*.kt")
targetExclude("**/build/**")
val customRuleSets = listOf(libs.ktlint.compose.map { "${it.module}:${it.version}" }.get())
// Spotless doesn't always seem to pick up changes in .editorconfig, so mirror them here
val override = buildMap {
this["max_line_length"] = 100
this["ktlint_code_style"] = "intellij_idea"
this["ktlint_function_naming_ignore_when_annotated_with"] = "Composable"
}
ktlint(ktlintVersion)
.customRuleSets(customRuleSets)
.editorConfigOverride(override)
licenseHeaderFile("LICENSE_HEADER")
}
kotlinGradle {
ratchetFrom = "origin/main"
target("**/*.gradle.kts")
targetExclude("**/build/**")
ktlint(ktlintVersion)
}
format("misc") {
target(".gitignore", "*.md")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}