-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.gradle.kts
46 lines (41 loc) · 1.15 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
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.kover) apply false
alias(libs.plugins.gradleVersions) apply false
// for release
}
val ktlint: Configuration by configurations.creating
dependencies {
ktlint(libs.ktlint) {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
}
tasks.register<JavaExec>("ktlint") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style"
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
args(
"**/src/**/*.kt",
"**.kts",
"!**/build/**",
)
isIgnoreExitValue = true
}
tasks.register<JavaExec>("ktlintFormat") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style and format"
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
args(
"-F",
"**/src/**/*.kt",
"**.kts",
"!**/build/**",
)
isIgnoreExitValue = true
}