|
37 | 37 | osgiCompendiumVersion = '5.0.0'
|
38 | 38 | paxExamVersion = '4.12.0'
|
39 | 39 | projectOsgiVersion = project.version.replaceAll("-SNAPSHOT", ".SNAPSHOT")
|
| 40 | + |
| 41 | + jacocoTestProjects = [ |
| 42 | + 'camel-ldp-elasticsearch', |
| 43 | + 'camel-ldp-ldpath', |
| 44 | + 'camel-ldp-triplestore', |
| 45 | + 'camel-ldp-websub', |
| 46 | + 'camel-ldp-osgi' |
| 47 | + ] |
40 | 48 | }
|
41 | 49 |
|
42 | 50 | allprojects { subproj ->
|
@@ -279,6 +287,14 @@ subprojects { subproj ->
|
279 | 287 | html.enabled = true
|
280 | 288 | }
|
281 | 289 | }
|
| 290 | + |
| 291 | + afterEvaluate { |
| 292 | + if (subproj.name in jacocoTestProjects) { |
| 293 | + jacoco { |
| 294 | + applyTo subproj.tasks.matching { it.name == 'junitPlatformTest' } |
| 295 | + } |
| 296 | + } |
| 297 | + } |
282 | 298 | }
|
283 | 299 |
|
284 | 300 | configure(rootProject) {
|
@@ -322,18 +338,28 @@ configure(rootProject) {
|
322 | 338 | }
|
323 | 339 | }
|
324 | 340 |
|
325 |
| - task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { |
326 |
| - dependsOn = subprojects.test |
327 |
| - additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) |
328 |
| - sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) |
329 |
| - classDirectories = files(subprojects.sourceSets.main.output) |
330 |
| - executionData = files(subprojects.jacocoTestReport.executionData) |
331 |
| - reports { |
332 |
| - html.enabled = true |
333 |
| - xml.enabled = true |
334 |
| - csv.enabled = false |
335 |
| - } |
336 |
| - } |
| 341 | + task jacocoMerge(type: JacocoMerge) { |
| 342 | + subprojects.findAll { it.name in jacocoTestProjects } |
| 343 | + .each { subproj -> |
| 344 | + executionData fileTree(dir: "${subproj.buildDir}/jacoco", include: '*.exec') |
| 345 | + dependsOn subproj.tasks.withType(Test) |
| 346 | + } |
| 347 | + } |
| 348 | + |
| 349 | + task jacocoRootReport(type: JacocoReport, dependsOn: jacocoMerge) { |
| 350 | + sourceDirectories = files(subprojects |
| 351 | + .findAll { it.name in jacocoTestProjects } |
| 352 | + .sourceSets.main.allSource.srcDirs) |
| 353 | + classDirectories = files(subprojects |
| 354 | + .findAll { it.name in jacocoTestProjects } |
| 355 | + .sourceSets.main.output) |
| 356 | + executionData jacocoMerge.destinationFile |
| 357 | + reports { |
| 358 | + html.enabled = true |
| 359 | + xml.enabled = true |
| 360 | + csv.enabled = false |
| 361 | + } |
| 362 | + } |
337 | 363 |
|
338 | 364 | coveralls {
|
339 | 365 | sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
|
|
0 commit comments