Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate jacoco.exec file with Gradle Plugin in Android Studio?

I already read some articules related to this, this and this but I could not found the answer. Using the Gradle Plugin in Android Studio, I can't generate the file jacoco.exec (neither *.exec in any subfolder).

What do I have to set in the build.gradle file in order to generate this file?

Note: Remember that I'm using the Gradle Plugin (which is different) and Android Studio.

like image 986
Juan Saravia Avatar asked Sep 22 '14 20:09

Juan Saravia


1 Answers

By default Gradle connectedInstrumentTest task generates test reports in .ec format (Emma). If you need jacoco.exec report file you need Robolectric + JUnit tests instead of Android unit tests (based on InstrumentationTestCase). Here is an example of JaCoCo Gradle plugin configuration.

like image 95
Veaceslav Gaidarji Avatar answered Sep 21 '22 18:09

Veaceslav Gaidarji