-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
72 lines (62 loc) · 1.8 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
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.1.10" apply false
java
jacoco
id("io.gitlab.arturbosch.detekt") version "1.23.7"
}
allprojects {
repositories {
mavenCentral()
}
apply<JacocoPlugin>()
configure<JacocoPluginExtension> {
toolVersion = "0.8.7"
}
}
subprojects {
apply<DetektPlugin>()
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
detekt {
source.setFrom(
objects.fileCollection().from(
DetektExtension.DEFAULT_SRC_DIR_JAVA,
"src/test/java",
DetektExtension.DEFAULT_SRC_DIR_KOTLIN,
"src/test/kotlin"
)
)
}
}
tasks.register<JacocoReport>("codeCoverageReport") {
subprojects.filter { it != project(":documentation") }.forEach { subproject ->
subproject.plugins.withType<JacocoPlugin>().configureEach {
subproject.tasks.matching { it.extensions.findByType<JacocoTaskExtension>() != null }.configureEach {
val testTask = this
sourceSets(subproject.sourceSets.main.get())
executionData(testTask)
}
}
}
reports {
xml.required.set(true)
xml.outputLocation.set(layout.buildDirectory.file("reports/jacoco/report.xml"))
html.required.set(false)
}
}