Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Multi-Module | No coverage for Kotlin modules #312

Closed
af-hku opened this issue Mar 2, 2023 · 2 comments
Closed

Android Multi-Module | No coverage for Kotlin modules #312

af-hku opened this issue Mar 2, 2023 · 2 comments
Assignees
Labels
Bug Bug issue type S: confirmed Status: bug is reproduced or present

Comments

@af-hku
Copy link

af-hku commented Mar 2, 2023

Description

Kover does not create a report for all modules if there are plain Kotlin modules within an Android project.
-> task koverHtmlReport only creates coverage report for Kotlin modules
-> task koverHtmlReportDebug only creates coverage report for Android modules

Expected behavior

Merged coverage report for all specified modules can be created using one kover Gradle task (e.g. build variant independent gradle kover task)

Example: detekt

  • Android modules: Gradle tasks detekt, detektDebug, detektRelease
  • Kotlin modules: Gradle task detekt
  • -> run detekt to get results for all modules

Reproducer

Use kover's multiproject example and make the lib module a plain Kotlin module (which it actually is)

lib/build.gradle

plugins {
    id ("org.jetbrains.kotlin.jvm")
    id ("org.jetbrains.kotlinx.kover")
}

dependencies {
    testImplementation("junit:junit:4.13.2")
}

-> koverHtmlReport creates report for lib module only
-> koverHtmlReportDebug creates report for app module only
-> no merged report possible with the existing kover gradle tasks

Environment

  • Kover Gradle Plugin version: 0.7.0-Alpha
  • Gradle version: 8.0
  • Kotlin project type: Kotlin/Android - Multi Module
  • Coverage Engine version: KoverTool / JacocoTool (same behavior for both tools)
  • Other context important for this bug: -
@af-hku af-hku added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Mar 2, 2023
@shanshin
Copy link
Collaborator

shanshin commented Mar 2, 2023

Hi,
unfortunately, DSL for integration of multiplatform and Android projects is not implemented at the moment.
The main problem here is that the build variants are known only in Android projects, there is no such information in a plain project and it is impossible to create appropriate tasks for each build variant.

As a solution, we may add a special task for which user can specify in the build script which Android build variant (only one or several?) will be used.

However, the design of such a feature was postponed until receiving feedback on the current implementation of fully Android projects.

@shanshin shanshin added S: confirmed Status: bug is reproduced or present and removed S: untriaged Status: issue reported but unprocessed labels Mar 2, 2023
@shanshin
Copy link
Collaborator

Duplicates #316

@shanshin shanshin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: confirmed Status: bug is reproduced or present
Projects
None yet
Development

No branches or pull requests

2 participants