-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle.kts
60 lines (55 loc) · 2.12 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.kapt) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.googleServicesPlugin) apply false
alias(libs.plugins.firebaseCrashlyticsPlugin) apply false
alias(libs.plugins.firebaseAppDistributionPlugin) apply false
alias(libs.plugins.triplet) apply false
id("com.google.devtools.ksp") version "1.9.24-1.0.20" apply false
id("org.jetbrains.kotlinx.kover") version "0.8.3"
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
val ktlint by configurations.creating
dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.0.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
// ktlint(project(":custom-ktlint-ruleset")) // in case of custom ruleset
}
tasks.register<JavaExec>("ktlintCheck") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style"
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
// see https://pinterest.github.io/ktlint/install/cli/#command-line-usage for more information
args(
"**/src/**/*.kt",
"**.kts",
"!**/build/**",
"--reporter=checkstyle,output=${project.buildDir}/reports/checkstyle/ktlint.xml"
)
}
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")
// see https://pinterest.github.io/ktlint/install/cli/#command-line-usage for more information
args(
"-F",
"**/src/**/*.kt",
"**.kts",
"!**/build/**",
)
}