-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
73 lines (68 loc) · 2.49 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
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
buildscript {
dependencies {
classpath(libs.dagger.hilt.android.gradle.plugin)
classpath(libs.twitter.compose.rules.detekt)
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.plugin.serialization)
alias(libs.plugins.detekt)
alias(libs.plugins.ksp)
alias(libs.plugins.dependency.analysis)
alias(libs.plugins.compose.compiler) apply false
}
// see https://detekt.dev/docs/introduction/reporting/#merging-reports
val reportMerge by tasks.registering(ReportMergeTask::class) {
output.set(rootProject.layout.buildDirectory.file("reports/detekt/merge.xml")) // or "reports/detekt/merge.sarif"
}
subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
dependencies {
detektPlugins(rootProject.project.libs.detekt.formatting)
detektPlugins(rootProject.project.libs.twitter.compose.rules.detekt)
}
detekt {
buildUponDefaultConfig = true
parallel = true
config = files("${project.rootDir}/config/detekt/detekt.yml")
baseline = file("${project.rootDir}/config/detekt/baseline.yml")
ignoreFailures = false
autoCorrect = true
}
plugins.withType<DetektPlugin> {
tasks.withType<Detekt> detekt@{
finalizedBy(reportMerge)
reports.xml.required.set(true)
reportMerge.configure {
input.from([email protected])
}
}
}
}
tasks.withType<Detekt>().configureEach {
jvmTarget = "17"
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = "17"
}
val detektProjectBaseline by tasks.registering(DetektCreateBaselineTask::class) {
description = "Overrides current baseline."
ignoreFailures.set(true)
parallel.set(true)
buildUponDefaultConfig.set(true)
setSource(files(rootDir))
config.setFrom(files("$rootDir/config/detekt/detekt.yml"))
baseline.set(file("$rootDir/config/detekt/baseline.xml"))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
}