Skip to content

Commit

Permalink
Draft: Fix jacoco merge report capability
Browse files Browse the repository at this point in the history
  • Loading branch information
ekigamba committed Jul 29, 2022
1 parent a1ca3cc commit ab02d0e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ext {
compileSdkVersion = 28
volleyVersion = "1.1.0"
targetSdkVersion = 27
jacocoVersion = "0.8.5"
jacocoVersion = "0.8.7"
mapboxSdkVersion = "8.3.3"
mapboxAnnotationPluginVersion = "0.6.0"
}
Expand All @@ -78,6 +78,21 @@ task jacocoFullReport(type: JacocoReport, group: 'Coverage reports') {
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output)

def index = 0
for (dir in additionalSourceDirs) {
System.out.println( (index + 1) + ". " + dir.path)
}

index = 0
for (dir in sourceDirectories) {
System.out.println( (index + 1) + ". " + dir.path)
}

index = 0
for (dir in classDirectories) {
System.out.println( (index + 1) + ". " + dir.path)
}

List<File> executionDataPaths = new ArrayList<>()
for (subModule in subprojects) {
def jacocoTestReportTask = subModule.getTasksByName("jacocoTestReport", false)
Expand All @@ -91,6 +106,9 @@ task jacocoFullReport(type: JacocoReport, group: 'Coverage reports') {

executionData.from = executionDataPaths

getReports().getXml().setDestination(file("${buildDir}/reports/jacoco/jacocoFullReport/merged.xml"))
getReports().getHtml().setDestination(file("${buildDir}/reports/jacoco/jacocoFullReport/html"))

reports {
html.enabled true
xml.enabled true
Expand Down

0 comments on commit ab02d0e

Please sign in to comment.