-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
60 lines (51 loc) · 1.63 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
import io.gitlab.arturbosch.detekt.Detekt
plugins {
kotlin("multiplatform") apply false
kotlin("jvm") apply false
alias(libs.plugins.detekt)
}
group = "love.forte.simbot.component"
version = "0.0.1"
allprojects {
group = "love.forte.simbot.component"
version = "0.0.1"
repositories {
mavenCentral()
}
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${libs.versions.detekt.get()}")
}
// config detekt
detekt {
source.setFrom(subprojects.map { it.projectDir.absoluteFile })
config.setFrom(rootDir.resolve("config/detekt/detekt.yml"))
baseline = rootDir.resolve("config/detekt/baseline.xml")
// buildUponDefaultConfig = true
parallel = true
reportsDir = rootProject.layout.buildDirectory.dir("reports/detekt").get().asFile
if (!isCi) {
autoCorrect = true
}
basePath = projectDir.absolutePath
}
// https://detekt.dev/blog/2019/03/03/configure-detekt-on-root-project/
tasks.withType<Detekt>().configureEach {
// internal 处理器不管
exclude("internal-processors/**")
exclude("simbot-component-kritor-proto/**")
include("**/src/*Main/kotlin/**/*.kt")
include("**/src/*Main/kotlin/**/*.java")
include("**/src/*Main/java/**/*.kt")
include("**/src/*Main/java/**/*.java")
include("**/src/main/kotlin/**/*.kt")
include("**/src/main/kotlin/**/*.java")
include("**/src/main/java/**/*.kt")
include("**/src/main/java/**/*.java")
exclude("**/src/*/resources/")
exclude("**/build/")
exclude("**/*Test/kotlin/")
exclude("**/*Test/java/")
exclude("**/test/kotlin/")
exclude("**/test/java/")
}