Skip to content

Commit 843c749

Browse files
committed
build: refactor code coverage
1 parent 00c2812 commit 843c749

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

build-logic/src/main/groovy/config.coverage-aggregation.gradle renamed to build-logic/src/main/groovy/config.code-coverage.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
plugins {
2-
id 'base'
32
id 'jacoco'
43
}
54

65
extensions.configure(JacocoPluginExtension) {
7-
it.toolVersion = '0.8.12'
6+
it.toolVersion = jacocoVersion
87
}
98

109
// Configuration for declaring which projects contribute coverage data.
@@ -79,6 +78,9 @@ afterEvaluate {
7978
}
8079
}
8180

82-
tasks.named('check') {
83-
dependsOn('jacocoAggregatedReport')
81+
pluginManager.withPlugin('base') {
82+
tasks.named('check') {
83+
dependsOn('jacocoAggregatedReport')
84+
}
8485
}
86+

coverage/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
plugins {
2-
id 'config.coverage-aggregation'
2+
id 'config.code-coverage'
33
}
44

55
dependencies {
66
// The plugin project (always included)
77
coverageDataProjects project(':grails-server-timing')
88

99
// Auto-discover all example apps under examples/
10-
rootDir.toPath().resolve('examples').toFile().list()?.each { example ->
11-
coverageDataProjects project(":$example")
10+
rootDir.toPath().resolve('examples').toFile().list()?.each { exampleApp ->
11+
coverageDataProjects project(":$exampleApp")
1212
}
1313
}

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
projectVersion=0.0.1-SNAPSHOT
22
grailsVersion=7.0.7
3+
4+
# Build dependencies
5+
asciidoctorVersion=4.0.5
36
checkstyleVersion=10.21.4
47
codenarcVersion=3.6.0
8+
jacocoVersion=0.8.12
59
testLoggerVersion=4.0.0
6-
asciidoctorVersion=4.0.5
710

811
org.gradle.caching=true
912
org.gradle.daemon=true

0 commit comments

Comments
 (0)