Hello there folks, I am trying to integrate Kover ...
# code-coverage
j
Hello there folks, I am trying to integrate Kover in my android project and I wrote a very simple gradle plugin to try to integrate it form the root project
Copy code
class VeepeeKoverPlugin : Plugin<Project> {

    override fun apply(project: Project) {
        with(project) {
            pluginManager.apply("org.jetbrains.kotlinx.kover")
            configureReport()
        }
    }

    private fun Project.configureReport() {
        configure<KoverProjectExtension> {
            useJacoco(libs.findVersion("jacoco").get().toString())
            merge.subprojects()
            reports {
                filters {
                    excludes {
                        androidGeneratedClasses()
                    }
                }
            }
        }
    }
}
However I am getting this error
Copy code
* What went wrong:
A problem was found with the configuration of task ':res:res-privalia:koverXmlReportDebug' (type 'KoverXmlTask').
  - Gradle detected a problem with the following location: '/Users/julio.buenocotta/git/android-vente-privee/res/res-recycle/build/kover/bin-reports/testDebugUnitTest.exec'.
    
    Reason: Task ':res:res-privalia:koverXmlReportDebug' uses this output of task ':res:res-recycle:testDebugUnitTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':res:res-recycle:testDebugUnitTest' as an input of ':res:res-privalia:koverXmlReportDebug'.
      2. Declare an explicit dependency on ':res:res-recycle:testDebugUnitTest' from ':res:res-privalia:koverXmlReportDebug' using Task#dependsOn.
      3. Declare an explicit dependency on ':res:res-recycle:testDebugUnitTest' from ':res:res-privalia:koverXmlReportDebug' using Task#mustRunAfter.
Some modules (like the app module) in the project have flavors, Veepee and Privalia and my apps build.gradle.kts looks like this
Copy code
veepeeImplementation(project(":res:res-veepee"))
    privaliaImplementation(project(":res:res-privalia"))
     // For all flavors
    implementation(project(":res:res-recycle"))
I don't understand why I get this error the module
res-privalia
has no dependency on
res-recycle
on my side...
OK, I think I found the issue, the
res-privalia
module has the kotlin and android plugins applied, but there is no kotlin/java code in the module and that causes the issue...