I have the following setup:
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.7.1.201405082137"
}
def coverageSourceDirs = [
'../app/src/main/java'
]
I have the following task:
task jacocoTestReport(type:JacocoReport, dependsOn: "assembleStagingDebugAndroidTest") {
group = "Reporting"
onlyIf = {
true
}
description = "Generate Jacoco coverage reports for staging debug"
classDirectories = fileTree(
dir: '../app/build/intermediates/classes/staging/debug',
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewInjector*.*',
'**/*$MembersInjector*.*',
'**/BuildConfig.*',
'**/Manifest*.*']
)
additionalSourceDirs = files(coverageSourceDirs)
sourceDirectories = files(coverageSourceDirs)
executionData = files('../app/build/jacoco/testDebug.exc')
reports {
xml.enabled = true
html.enabled = true
}
}
But when executing:
gradle jacocoTestReport --stacktrace --debug --info
I keep getting:
app/build/jacoco/testDebug.exc (No such file or directory)
But:
clean createStagingDebugCoverageReport --stacktrace
works just fine. I was trying to use a custom task to omit some classes from the coverage reporting that were unneeded. What am I doing incorrectly for the exec files to not be generated / how can I find where they are in my package? I’ve looked through the build directory folder and I’m just not finding them.
Thanks in advance!
I’m not sure when the android plug-in is applied (which seems to be the case for you) but the jacoco plug-in normally decorates each task of type Test with jacoco coverage.
Jacoco exec files are therefore created by each test task.
Your custom task depends on ‘assembleStagingDebugAndroidTest’, which I don’t know (is it custom as well?) Can you show us the task graph when you only execute jacocoTestReport?
My app is configured with two product flavors (staging/production) so I was using assembleStagingDebugAndroidTest to pinpoint the staging debug flavor. I think this is what you were asking for (the task graph) but please let me know if it’s not:
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter@5d54b0b7:app:preBuild UP-TO-DATE
:app:preStagingDebugBuild UP-TO-DATE
:app:checkStagingDebugManifest
:app:preProductionDebugBuild UP-TO-DATE
:app:preProductionReleaseBuild UP-TO-DATE
:app:preStagingReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers122Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta112Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics232Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore232Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComMakeramenRoundedimageview211Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric133Library UP-TO-DATE
:app:prepareStagingDebugDependencies
:app:compileStagingDebugAidl UP-TO-DATE
:app:compileStagingDebugRenderscript UP-TO-DATE
:app:generateStagingDebugBuildConfig UP-TO-DATE
:app:generateStagingDebugAssets UP-TO-DATE
:app:mergeStagingDebugAssets UP-TO-DATE
:app:generateStagingDebugResValues UP-TO-DATE
:app:generateStagingDebugResources UP-TO-DATE
:app:mergeStagingDebugResources UP-TO-DATE
:app:processStagingDebugManifest UP-TO-DATE
:app:fabricGenerateResourcesStagingDebug
:app:processStagingDebugResources
:app:generateStagingDebugSources
:app:processStagingDebugJavaRes UP-TO-DATE
:app:compileStagingDebugJava UP-TO-DATE
:app:patchAndroidJar UP-TO-DATE
:app:_compileStagingDebugJava UP-TO-DATE
:app:compileRetrolambdaStagingDebug UP-TO-DATE
:app:preStagingDebugAndroidTestBuild UP-TO-DATE
:app:prepareStagingDebugAndroidTestDependencies
:app:compileStagingDebugAndroidTestAidl UP-TO-DATE
:app:processStagingDebugAndroidTestManifest UP-TO-DATE
:app:compileStagingDebugAndroidTestRenderscript UP-TO-DATE
:app:generateStagingDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateStagingDebugAndroidTestAssets UP-TO-DATE
:app:mergeStagingDebugAndroidTestAssets UP-TO-DATE
:app:generateStagingDebugAndroidTestResValues UP-TO-DATE
:app:generateStagingDebugAndroidTestResources UP-TO-DATE
:app:mergeStagingDebugAndroidTestResources UP-TO-DATE
:app:processStagingDebugAndroidTestResources UP-TO-DATE
:app:generateStagingDebugAndroidTestSources UP-TO-DATE
:app:processStagingDebugAndroidTestJavaRes UP-TO-DATE
:app:compileStagingDebugAndroidTestJava UP-TO-DATE
:app:_compileStagingDebugAndroidTestJava UP-TO-DATE
:app:compileRetrolambdaStagingDebugAndroidTest UP-TO-DATE
:app:compileStagingDebugAndroidTestNdk UP-TO-DATE
:app:compileStagingDebugAndroidTestSources UP-TO-DATE
:app:newRelicInstrumentTask
[newrelic.info] Detected cached instrumentation.
:app:preDexStagingDebugAndroidTest UP-TO-DATE
:app:dexStagingDebugAndroidTest UP-TO-DATE
:app:newRelicDeinstrumentTask
[newrelic.info] Deinstrumenting...
:app:validateDebugSigning
:app:packageStagingDebugAndroidTest UP-TO-DATE
:app:assembleStagingDebugAndroidTest UP-TO-DATE
:app:jacocoTestReport FAILED
I’m reading the android gradle plug-in documentation on the go but from there:
“Each flavor has its own task to run tests: androidTest. For instance:
androidTestFlavor1Debug
androidTestFlavor2Debug
Similarly, test APK building tasks and install/uninstall tasks are per variant:
assembleFlavor1Test
installFlavor1Debug
installFlavor1Test
uninstallFlavor1Debug”
So maybe you should depend on “androidTestStagingDebug” to actually rub the test, and probably the jacoco coverage as well.
Right now you only depend on the “test APK building” task, not on the test execution task
So, I changed my dependency to app:connectedAndroidTestStagingDebug and it’s still not able to find the exec file. Is there any insight into what createStagingDebugCoverageReport does with Jacoco opposed to running the tests as a dependency of this task the way I’ve been trying? Here’s the execution from that run that was successful:
:app:clean
:app:preBuild UP-TO-DATE
:app:preStagingDebugBuild UP-TO-DATE
:app:checkStagingDebugManifest
:app:preProductionDebugBuild UP-TO-DATE
:app:preProductionReleaseBuild UP-TO-DATE
:app:preStagingReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library
:app:prepareComAndroidSupportSupportV42220Library
:app:prepareComCrashlyticsSdkAndroidAnswers122Library
:app:prepareComCrashlyticsSdkAndroidBeta112Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics232Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore232Library
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library
:app:prepareComMakeramenRoundedimageview211Library
:app:prepareIoFabricSdkAndroidFabric133Library
:app:prepareStagingDebugDependencies
:app:compileStagingDebugAidl
:app:compileStagingDebugRenderscript
:app:generateStagingDebugBuildConfig
:app:generateStagingDebugAssets UP-TO-DATE
:app:mergeStagingDebugAssets
:app:generateStagingDebugResValues UP-TO-DATE
:app:generateStagingDebugResources
:app:mergeStagingDebugResources
:app:processStagingDebugManifest
:app:fabricGenerateResourcesStagingDebug
:app:processStagingDebugResources
:app:generateStagingDebugSources
:app:processStagingDebugJavaRes UP-TO-DATE
:app:compileStagingDebugJava
:app:patchAndroidJar
:app:_compileStagingDebugJavawarning: File for type 'ollie.AdapterHolderImpl' created in the last round will not be subject to annotation processing.
Note: /Users/apps/tools/jenkins/workspace/Yale Digital Door Viewer Android - Integration/app/src/main/java/com/yale/digitaldoorviewer/api/UserService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
:app:compileRetrolambdaStagingDebug
:app:compileStagingDebugNdk UP-TO-DATE
:app:compileStagingDebugSources
:app:unzipJacocoAgent
:app:instrumentStagingDebug
:app:newRelicInstrumentTask
:app:preDexStagingDebugobjc[22429]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22430]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22433]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22434]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22436]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22432]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22431]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22437]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22438]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22435]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22440]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22439]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22444]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22441]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22443]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22445]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22447]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22442]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22446]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22451]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22448]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22452]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22450]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22454]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22453]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22457]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22456]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22455]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22458]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22460]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22461]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22459]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22463]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22465]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22449]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22462]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22466]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22468]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22467]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22469]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22464]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
:app:dexStagingDebugobjc[22470]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
:app:preStagingDebugAndroidTestBuild UP-TO-DATE
:app:prepareStagingDebugAndroidTestDependencies
:app:compileStagingDebugAndroidTestAidl
:app:processStagingDebugAndroidTestManifest
:app:compileStagingDebugAndroidTestRenderscript
:app:generateStagingDebugAndroidTestBuildConfig
:app:generateStagingDebugAndroidTestAssets UP-TO-DATE
:app:mergeStagingDebugAndroidTestAssets
:app:generateStagingDebugAndroidTestResValues UP-TO-DATE
:app:generateStagingDebugAndroidTestResources
:app:mergeStagingDebugAndroidTestResources
:app:processStagingDebugAndroidTestResources
:app:generateStagingDebugAndroidTestSources
:app:processStagingDebugAndroidTestJavaRes UP-TO-DATE
:app:compileStagingDebugAndroidTestJava
:app:_compileStagingDebugAndroidTestJavaNote: /Users/apps/tools/jenkins/workspace/Yale Digital Door Viewer Android - Integration/app/build/generated/source/apt/androidTest/staging/debug/com/yale/digitaldoorviewer/test/dagger/DaggerTestComponent.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileRetrolambdaStagingDebugAndroidTestobjc[22472]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
:app:preDexStagingDebugAndroidTestobjc[22473]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22475]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22478]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22474]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22477]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
objc[22476]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
:app:dexStagingDebugAndroidTestobjc[22479]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
:app:newRelicDeinstrumentTask
[newrelic.info] Deinstrumenting...
:app:validateDebugSigning
:app:packageStagingDebug
:app:zipalignStagingDebug
:app:assembleStagingDebug
:app:compileStagingDebugAndroidTestNdk UP-TO-DATE
:app:compileStagingDebugAndroidTestSources
:app:packageStagingDebugAndroidTest
:app:assembleStagingDebugAndroidTest
:app:connectedAndroidTestStagingDebug
:app:createStagingDebugCoverageReport
BUILD SUCCESSFUL
Maybe I should be asking the Jacoco guys if there’s a better way to filter out the class/methods I don’t want instead of bugging you gradle guys?
Just to be sure:
When you run ‘gradle clean createStagingDebugCoverageReport’, does this generate a jacoco exec file with path ‘app/build/jacoco/testDebug.exc’ ?
I assume this is the case since you wrote in your custom task:
‘executionData = files(’…/app/build/jacoco/testDebug.exc’)’
Otherwise i’m running out of ideas for today
That would be the root issue, that path is invalid so gradle is correct in chocking because that directory and file aren’t there but I can’t seem to find where createStagingDebugCoverageReport is sticking the executable What’s interesting is if I make the task depend on createStagingDebugCoverageReport the exe gets generated and the custom task is successful but I never see it in the dir (shrug). I’m clueless at this point.
Just run ‘gradle clean createStagingDebugCoverageReport’ once, and search in the buildDir for ‘.ec’ or ‘.exec’ or ‘.exc’ files.
In a regular java project, the execution file is by default in $buildDir/jacoco/test.exec
So it was an .ec file stuffed in /build/outputs/code-coverage/connected/flavors/staging/ and I had to adjust the task to look at ‘…/app/build/intermediates/coverage-instrumented-classes/classes/staging/debug’ to generate the report, but I finally have it working…now I have to work on excluding the classes I don’t want. Thanks for putting your eyes on this!
task jacocoStagingDebugTestReport(type:JacocoReport, dependsOn: ["spoonStagingDebugAndroidTest"]) {
group = "Reporting"
onlyIf = {
true
}
description = "Generate Jacoco coverage reports for staging debug"
classDirectories = fileTree(
dir: '../app/build/intermediates/coverage-instrumented-classes/classes/staging/debug',
excludes: ['/ollie/*$ModelAdapter.*']
)
additionalSourceDirs = files(coverageSourceDirs)
sourceDirectories = files(coverageSourceDirs)
executionData = files('build/outputs/code-coverage/connected/flavors/staging/coverage.ec')
reports {
xml.enabled = true
html.enabled = true
}
}