-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
62 lines (54 loc) · 1.66 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
import com.autonomousapps.tasks.BuildHealthTask
import org.orkg.gradle.plugins.PrintCoverageTask
plugins {
id("org.orkg.gradle.root")
base // required, otherwise report aggregation plugins will not work
id("test-report-aggregation")
id("jacoco-report-aggregation")
id("org.orkg.gradle.print-coverage")
}
dependencies {
testReportAggregation(project(":rest-api-server"))
jacocoAggregation(project(":rest-api-server"))
}
// Test reports
reporting {
reports {
val testAggregateTestReport by creating(AggregateTestReport::class) {
testType.set(TestSuiteType.UNIT_TEST)
}
}
}
// JaCoCo Code Coverage Report
reporting {
reports {
val testCodeCoverageReport by registering(JacocoCoverageReport::class) {
testType.set(TestSuiteType.UNIT_TEST)
}
}
}
val testCodeCoverageReport by tasks.getting(JacocoReport::class) {
reports {
xml.required.set(true)
}
}
dependencyAnalysis {
issues {
all {
onAny {
severity("fail")
}
onUnusedDependencies {
// This dependency gets on the classpath of integration and container tests, and causes issue with the
// build health. It is not an issue, so we just exclude it from the analysis.
exclude("org.junit.jupiter:junit-jupiter")
}
}
}
}
tasks.check {
dependsOn(tasks.named<TestReport>("testAggregateTestReport"))
dependsOn(tasks.named<JacocoReport>("testCodeCoverageReport"))
dependsOn(tasks.named<BuildHealthTask>("buildHealth"))
finalizedBy(tasks.named<PrintCoverageTask>("printCoverage"))
}