forked from detekt/detekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
88 lines (77 loc) · 2.41 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
plugins {
id("releasing")
id("io.gitlab.arturbosch.detekt")
id("org.jetbrains.dokka") version "1.9.20"
}
tasks.withType<DokkaMultiModuleTask>().configureEach {
outputDirectory = layout.projectDirectory.dir("website/static/kdoc")
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
val detektReportMergeSarif by tasks.registering(ReportMergeTask::class) {
output = layout.buildDirectory.file("reports/detekt/merge.sarif")
}
allprojects {
group = "io.gitlab.arturbosch.detekt"
version = Versions.currentOrSnapshot()
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
buildUponDefaultConfig = true
baseline = file("$rootDir/config/detekt/baseline.xml")
}
dependencies {
detekt(project(":detekt-cli"))
detektPlugins(project(":detekt-formatting"))
detektPlugins(project(":detekt-rules-libraries"))
detektPlugins(project(":detekt-rules-ruleauthors"))
}
tasks.withType<Detekt>().configureEach {
jvmTarget = "1.8"
reports {
xml.required = true
html.required = true
sarif.required = true
md.required = true
}
basePath = rootDir.absolutePath
}
detektReportMergeSarif {
input.from(tasks.withType<Detekt>().map { it.reports.sarif.outputLocation })
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = "1.8"
}
}
subprojects {
tasks.withType<Test>().configureEach {
develocity {
testRetry {
@Suppress("MagicNumber")
if (providers.environmentVariable("CI").isPresent) {
maxRetries = 3
maxFailures = 20
}
}
predictiveTestSelection {
enabled = providers.gradleProperty("enablePTS").map(String::toBooleanStrict)
}
}
}
}
setOf(
"build",
"detektMain",
"detektTest",
"detektFunctionalTest",
"detektFunctionalTestMinSupportedGradle",
"detektTestFixtures",
).forEach { taskName ->
tasks.register(taskName) {
dependsOn(gradle.includedBuild("detekt-gradle-plugin").task(":$taskName"))
}
}