How to create the "total report" in an Android MultiModule project
Closed this issue · 2 comments
Describe what you would like to clarify about Kover
I sucessfully added kover to my Android mutlimodule project as convention plugin (see below). The Kover documentation states multiple times that Kover is able to create a "total report" containing all results from all modules in one report. This is exactly what I want, but I cannot find how to get to this kind of report. Currently each module gets its own report.
An example or more information about that in the documentation would be highly appreciated!
applied to each feature module (JVM/Kotlin-only as well as Android-modules):
class KoverPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("org.jetbrains.kotlinx.kover")
subprojects {
pluginManager.apply("org.jetbrains.kotlinx.kover")
}
}
}
}
libs.version.toml
kover = "0.8.3"
[libraries]
kover-gradlePlugin = { module = "org.jetbrains.kotlinx:kover-gradle-plugin", version.ref = "kover" }
[plugins]
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
app.build.gradle
plugins {
alias(libs.plugins.kover)
}
Hi,
please refer to the documentation chapter Kotlin multi-module Android project, there is section Merging reports from different modules.
To generate a merged report in one project, you need to add kover dependencies to all other modules, for example in build.gradle[.kts]
dependencies {
kover(project(":feature-1"))
kover(project(":feature-2"))
// etc
}
And it is also important to call the report generation only for this project, to which this dependencies
block was added.
for example, if it is added to the :app
project, then you need to run the :app:koverHtmlReport
task
Awesome, thank you very much. That was the last missing piece.