Home > Software engineering >  How to run JaCoCo in other Android Studio sub modules?
How to run JaCoCo in other Android Studio sub modules?

Time:04-06

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?

CodePudding user response:

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.

  • Related