How to run JaCoCo in other Android Studio sub modules?
Asked Answered
P

1

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?

Prying answered 29/3, 2022 at 22:8 Comment(1)
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?Bedsore
P
2

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.

Prying answered 5/4, 2022 at 9:17 Comment(1)
Could you please elaborate or quote the most relevant part of that solution, in case that resource is unreachable or goes offline?Bedsore

© 2022 - 2024 — McMap. All rights reserved.