From ab02d0eade8defa98ee49ddf63ac0833451ad04d Mon Sep 17 00:00:00 2001 From: Ephraim Kigamba Date: Fri, 29 Jul 2022 12:46:50 +0300 Subject: [PATCH] Draft: Fix jacoco merge report capability --- build.gradle | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 18548356..8c183878 100644 --- a/build.gradle +++ b/build.gradle @@ -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" } @@ -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 executionDataPaths = new ArrayList<>() for (subModule in subprojects) { def jacocoTestReportTask = subModule.getTasksByName("jacocoTestReport", false) @@ -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