-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
70 lines (61 loc) · 1.79 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
plugins {
java
jacoco
id("com.github.johnrengelman.shadow") version "8.1.1"
alias(libs.plugins.gitSemVer)
alias(libs.plugins.javadocAggregate)
}
group = "it.unibo.smartgh"
version = "1.0-SNAPSHOT"
jacoco {
toolVersion = "0.8.12"
reportsDirectory.set(layout.buildDirectory.dir("customJacocoReportDir"))
}
repositories {
mavenCentral()
}
allprojects{
apply(plugin = "java")
apply(plugin = "jacoco")
apply(plugin = "com.github.johnrengelman.shadow")
jacoco {
toolVersion = "0.8.12"
reportsDirectory.set(layout.buildDirectory.dir("customJacocoReportDir"))
}
dependencies {
implementation(rootProject.libs.bundles.vertx.dependencies)
implementation(rootProject.libs.mongodb.driver)
implementation(rootProject.libs.gson)
implementation(rootProject.libs.jacoco)
testImplementation(rootProject.libs.junit.api)
testRuntimeOnly(rootProject.libs.junit.engine)
}
tasks.jacocoTestReport {
reports {
xml.required.set(false)
csv.required.set(false)
html.required.set(true)
}
}
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
val jacocoAggregatedReport by tasks.creating(JacocoReport::class) {
var classDirs: FileCollection = files()
subprojects.forEach {
dependsOn(it.tasks.test)
dependsOn(it.tasks.jacocoTestReport)
sourceSets(it.sourceSets.main.get())
classDirs += files(it.tasks.jacocoTestReport.get().classDirectories)
}
classDirectories.setFrom(classDirs)
executionData.setFrom(
fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
)
reports {
xml.required.set(false)
html.required.set(true)
csv.required.set(false)
}
}