I’m unable to get the .exec file generated when running code coverage on connectedAndroidTest. I’m able to get a code coverage report, even though the last thing that’s printed when I run ‘./gradlew jacocoTestReport’ (or ‘./gradlew connectedAndroidTest jacocoTestReport’) is:
‘’’ :dexAppDebugTest UP-TO-DATE :packageAppDebugTest UP-TO-DATE :assembleAppDebugTest UP-TO-DATE :connectedAndroidTestAppDebug :createAppNewDebugCoverageReport :createAppDebugCoverageReport :connectedAndroidTest UP-TO-DATE :jacocoTestReport SKIPPED
BUILD SUCCESSFUL
Total time: 1 mins 36.719 secs ‘’’
My gradle file for jacoco-related things looks like this:
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.7.1.201405082137"
}
def coverageSourceDirs = [
'src/main/java/com/app/authentication',
'src/main/java/com/app/model',
'src/main/java/com/app/net',
'src/main/java/com/app/provider',
'src/main/java/com/app/service',
'src/main/java/com/app/text',
'src/main/java/com/app/util'
]
task jacocoTestReport(type: JacocoReport, dependsOn: "connectedAndroidTest") {
group = "Reporting"
description = "Generates Jacoco coverage reports"
reports {
xml.enabled = true
html.enabled = true
}
classDirectories = fileTree(
dir: 'build/intermediates/classes',
excludes: ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Activity*.*',
'**/*Fragment*.*'
]
)
sourceDirectories = files(coverageSourceDirs)
additionalSourceDirs = files(coverageSourceDirs)
executionData = files('build/jacoco/connectedAndroidTest.exec')
}
An xml file and html file are generated in build/outputs/reports/coverage/app/debug, but the exec file is nowhere to be found (even when I try running ‘./gradlew build jacocoTestReport’). I need the exec file to publish the code coverage report on Jenkins.