I recently started integrating android-gradle-plugin
1.1.0 in one of my projects. The project uses robolectric 2.4
to run unit tests.
It\'s
You can try to use this Gradle plugin: https://github.com/arturdm/jacoco-android-gradle-plugin
Basically, all you need to do is apply it like this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1'
}
}
apply plugin: 'com.android.library' // or 'com.android.application'
apply plugin: 'jacoco-android'
As a result you should get a JacocoReport
task for each variant. Run the command below to generate code coverage reports for all of them.
$ ./gradlew jacocoTestReport