I am working on the SonarQube code coverage...I have implemented locally and able to see jacocoTestReprt and all other necessary files...but when I run the task on Jenkins jacoco not able to generate any files.
In app/build.gradle
task jacocoTestReport(type: JacocoReport, dependsOn: [‘testProdReleaseUnitTest’]) {
reports { xml.enabled = true html.enabled = true }
def fileFilter = ['/R.class', '/R$.class', '**/BuildConfig.', '/Manifest*.*', 'android//.'] def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/prodRelease/classes", excludes: fileFilter) def mainSrc = "${project.projectDir}/src/main/java"
getSourceDirectories().setFrom(files([mainSrc])) getClassDirectories().setFrom(files([debugTree])) getExecutionData().setFrom(fileTree(dir: "$buildDir", includes: ["jacoco/testProdReleaseUnitTest.exec"])
}