-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
88 lines (78 loc) · 2.61 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
import com.autonomousapps.tasks.BuildHealthTask
import org.orkg.gradle.plugins.PrintCoverageTask
// TODO: Work-around for broken dependencies in AsciiDoctor Gradle plugin. Should be fine for versions >= 4.0.2.
buildscript {
configurations.all {
resolutionStrategy.dependencySubstitution {
// Change group name and version
substitute(module("com.burgstaller:okhttp-digest")).using(module("io.github.rburgst:okhttp-digest:1.21"))
}
}
}
// TODO: Work-around for broken dependencies in AsciiDoctor Gradle plugin. Should be fine for versions >= 4.0.2.
subprojects {
buildscript {
configurations.all {
resolutionStrategy.dependencySubstitution {
// Change group name and version
substitute(module("com.burgstaller:okhttp-digest")).using(module("io.github.rburgst:okhttp-digest:1.21"))
}
}
}
}
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 {
// Configure all projects for test and coverage aggregation. Ignore parent projects, or those without (tested) code.
val parentProjects = subprojects
.map(Project::getPath)
.filter { path -> path.count { it == ':' } < 2 }
.filterNot { it == ":rest-api-server" } // Not a parent project
.toSet()
val ignoredProjects = setOf(":platform", ":testing:kotest", ":testing:spring") union parentProjects
subprojects
.filterNot { it.path in ignoredProjects }
.onEach(::jacocoAggregation)
.onEach(::testReportAggregation)
}
// 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")
}
}
}
}
tasks.check {
dependsOn(tasks.named<TestReport>("testAggregateTestReport"))
dependsOn(tasks.named<JacocoReport>("testCodeCoverageReport"))
dependsOn(tasks.named<BuildHealthTask>("buildHealth"))
finalizedBy(tasks.named<PrintCoverageTask>("printCoverage"))
}