/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ allprojects { plugins.withId('jacoco') { jacoco.toolVersion = '0.8.7' // For some reason this dependency isn't getting setup automatically by the jacoco plugin tasks.withType(JacocoReport) { dependsOn tasks.withType(Test) } } } task jacocoReport(type: JacocoReport, group: 'verification') { description = 'Generates an aggregate report from all subprojects' gradle.projectsEvaluated { subprojects.each { jacocoReport.dependsOn it.tasks.withType(JacocoReport) jacocoReport.executionData it.tasks.withType(JacocoReport).collect { it.executionData } } } reports { html.required = true // human readable xml.required = true } gradle.projectsEvaluated { getSourceDirectories().from(files(subprojects.sourceSets.main.allSource.srcDirs)) getClassDirectories().from(files(subprojects.sourceSets.main.output)) } } check.dependsOn jacocoReport