-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (89 loc) · 2.87 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
import java.net.URL
plugins {
id("org.jlleitschuh.gradle.ktlint") version "10.0.0" apply false
id("org.jetbrains.dokka") version "1.4.32"
kotlin("jvm") version "1.5.10"
jacoco
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
apply<KtlintPlugin>()
apply<JacocoPlugin>()
apply<DokkaPlugin>()
apply(plugin = "org.jetbrains.kotlin.jvm")
kotlin {
explicitApi()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")
testImplementation("io.kotest:kotest-assertions-core:4.6.0")
testImplementation("io.mockk:mockk:1.11.0")
}
tasks {
withType<KotlinCompile> {
kotlinOptions.allWarningsAsErrors = true
}
test {
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.isEnabled = false
html.isEnabled = false
}
dependsOn(test)
}
withType<DokkaTaskPartial>().configureEach {
if (project.name != "docs") dokkaSourceSets {
named("main") {
moduleName.set("kkafka-${project.name}")
includes.from("Module.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(URL(
"https://github.com/kkafkaorg/kkafka/tree/master/${project.name}/src/main/kotlin"
))
}
externalDocumentationLink(
url = URL("https://javadoc.io/doc/org.apache.kafka/kafka-clients/2.8.0/")
)
externalDocumentationLink(
url = URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/")
)
}
}
}
}
}
allprojects {
group = "io.github.kkafkaorg"
jacoco {
toolVersion = "0.8.7"
}
}
val rootCoverageReport by tasks.registering(JacocoReport::class) {
executionData(fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec"))
subprojects { sourceSets(sourceSets.main.get()) }
reports {
xml.isEnabled = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.isEnabled = true
csv.isEnabled = false
}
}
tasks.check { dependsOn(rootCoverageReport) }
afterEvaluate {
rootCoverageReport {
val testingTasks = subprojects.flatMap { it.tasks.withType<JacocoReport>() }
dependsOn(testingTasks)
}
}