-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
42 lines (33 loc) · 1.16 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
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
plugins {
idea
`maven-publish`
}
idea {
module.isDownloadJavadoc = true
module.isDownloadSources = true
}
val jdkVersion: String by rootProject.extra
val kotlinVersion: String by extra
logger.lifecycle("Using Kotlin $kotlinVersion, JDK $jdkVersion")
fun createMergeTask(outputName: String): RegisteringDomainObjectDelegateProviderWithTypeAndAction<out TaskContainer, ReportMergeTask> {
return tasks.registering(ReportMergeTask::class) {
output.set(rootProject.buildDir.resolve("reports/$outputName"))
}
}
val reportMergeSarif by createMergeTask("detekt.sarif")
val reportMergeXml by createMergeTask("detekt.xml")
subprojects {
plugins.withType(io.gitlab.arturbosch.detekt.DetektPlugin::class) {
tasks.withType(io.gitlab.arturbosch.detekt.Detekt::class) detekt@{
finalizedBy(reportMergeSarif)
finalizedBy(reportMergeXml)
reportMergeSarif.configure {
input.from([email protected])
}
reportMergeXml.configure {
input.from([email protected])
}
}
}
}