How to run JaCoCo in other Android Studio sub modules?

1.7k Views Asked by At

I have an Android Studio Project with an app module and several modules as lib (see my settings.gradle):

rootProject.name = "MyApp"

include ":app"
include ":lib1"
include ":lib2"
include ":lib3"

I run gradle createAppDebugCoverageReport which only creates a code coverage report for app level app module. Going through the app\build\reports\coverage\androidTest\app\debug folders show me only sources in app module were considered.

I tried to apply the jacoco plugin to the lib level build.gradle files - in vain. How can I run JaCoCo for the lib level modules?

1

There are 1 best solutions below

1
On BEST ANSWER

I applied the solution from https://thsaravana.github.io/blog/jacoco-single-coverage-for-multi-module/

In the first step for each module reports were generated and in the second step these reports were merged ino one report.

I was not dependant on other libraries than Jacoco.