Kotlin / kotlinx-kover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kover 0.7.5 breaks with merging

r4phab opened this issue · comments

Describe the bug
A clear and concise description of what the bug is.
I have multiple modules, some are JVM only (domain) and others and Android modules. With the latest version 0.7.5 the reports merging with JVM and Android modules is broken.
Worked fine in 0.7.3

Errors
If present, stacktraces or files from build/kover/errors directory

Execution failed for task ':app:koverGenerateArtifact'.

> Failed to notify dependency resolution listener.

   > Kover android variant 'prodRelease' was not matched with any variant from dependency ':domain' of project ':app'. Check that the Kover plugin is applied in the ':domain' project and there is a variant compatible with 'prodRelease' in it.

Expected behavior
Skip the mergedWith instruction if not found in the JVM module ?

Reproducer
A link to your project, if it is open source. Otherwise, please try to reproduce the problem on a small project.
If this is not feasible, give an example of the code on which the problem manifests itself.

Reports
If applicable, report files or screenshots.

Environment

  • Kover Gradle Plugin version: [e.g. 0.7.0]
    0.7.5
  • Gradle version: [e.g. 8.1.1]
    8.1.4
  • Kotlin project type: [e.g. Kotlin/JVM, Kotlin/Multiplatform, Kotlin/Android, Kotlin/Multiplatform + Android]
    Kotlin/JVM/Android
  • Coverage Toolset (if customized in build script): [e.g. Kover, JaCoCo, JaCoCo("0.8.10")]
    Kover default
  • Other context important for this bug: [e.g. OS version]
    Here is my Kover configuration in Groovy :
dependencies {
   kover project(":domain")
}

koverReport {
   filters {
       excludes {
           classes(koverExcludes)
           annotatedBy(*koverAnnotationsExcludes)
       }
   }
   defaults {
       mergeWith("prodRelease")

       xml {
           onCheck = false
           setReportFile(layout.buildDirectory.file("reports/kover/xml/result.xml"))
       }

       html {
           onCheck = false
           setReportDir(layout.buildDirectory.dir("reports/kover/html"))
       }
   }
}

Hi,
in version 0.7.5, an additional configuration correctness check was added, so now an error is displayed indicating that the configuration is incorrect.

The uncontrolled using of mergeWith can lead to unexpected consequences, optionality feature will be implemented in the next version of DSL.

Now you can use the steps described in this comment to specify a more correct configuration.

@shanshin Indeed we updated our configuration following the comment you mentioned and it works now ! Thank you very much for guiding us in the right direction 🥳