From 7bf9f31c952c5980eaf6defc0d935ff9b314fffe Mon Sep 17 00:00:00 2001 From: ghidra4 <48601690+ghidra4@users.noreply.github.com> Date: Fri, 26 Apr 2019 09:22:05 -0400 Subject: [PATCH] Moved jacocoReport configs to doFirst --- gradle/root/jacoco.gradle | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gradle/root/jacoco.gradle b/gradle/root/jacoco.gradle index 84a1c9c55f..9ee464546d 100644 --- a/gradle/root/jacoco.gradle +++ b/gradle/root/jacoco.gradle @@ -120,10 +120,10 @@ List excludesList = generateExcludesList() xml.enabled = false } - // Output info before execution. doFirst { // Only report on subprojects with Java sourceSets + // This configuration in doFirst to let all subprojects configuration to evaluate. def subprojectsWithJava = [] subprojects { p -> p.plugins.withType(JavaPlugin) { @@ -167,7 +167,16 @@ List excludesList = generateExcludesList() dependsOn ":jacocoMerge" executionData new File(jacocoRootExecPath) + reports { + html.enabled = true + xml.enabled = false + html.destination = new File(project.ext.reportDir + "/jacocoReport") + } + + doFirst { + // Only report on subprojects with Java sourceSets + // This configuration in doFirst to let all subprojects configuration to evaluate. def subprojectsWithJava = [] subprojects { p -> p.plugins.withType(JavaPlugin) { @@ -177,18 +186,11 @@ List excludesList = generateExcludesList() sourceDirectories = files(subprojectsWithJava.sourceSets.main.allSource.srcDirs) classDirectories = files(subprojectsWithJava.sourceSets.main.output) - classDirectories = files(classDirectories.files.collect { fileTree(dir: it, exclude: excludesList) }) - reports { - html.enabled = true - xml.enabled = false - html.destination = new File(project.ext.reportDir + "/jacocoReport") - } - doFirst { if (numFoundExecutionFiles == 0) { println "jacocoReport: No execution data files found." println "jacocoReport: No report written to $reports.html.destination.absolutePath."