2

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?

Chriki
  • 15,638
  • 3
  • 51
  • 66
Edna Krabappel
  • 362
  • 1
  • 2
  • 16
  • Without further details about your project, it’s not clear how to solve this. Are your library modules traditional Java libraries (→ producing JARs) or Android libraries (→ producing AARs)? Where does the `createAppDebugCoverageReport` task come from, or how have you applied JaCoCo to the `app` module? – Chriki Apr 04 '22 at 20:02

1 Answers1

1

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.

Edna Krabappel
  • 362
  • 1
  • 2
  • 16
  • Could you please elaborate or quote the most relevant part of that solution, in case that resource is unreachable or goes offline? – Chriki Apr 05 '22 at 18:34