Skip to content

Missing task dependency for koverCachedVerify when Java sources are present #735

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

Open
obecker opened this issue Feb 26, 2025 · 0 comments
Open
Assignees
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed

Comments

@obecker
Copy link

obecker commented Feb 26, 2025

Describe the bug
I'm using the kover plugin with the following configuration:

kover {
    reports {
        total {
            html {
                onCheck = true
            }
        }
    }
}

The project has Kotlin sources as well as generated Java sources.

When running the build task without the test task, gradle terminates with an error message.

Errors
Running gradle build -x test produces

* What went wrong:
A problem was found with the configuration of task ':example:koverCachedVerify' (type 'KoverDoVerifyTask').
  - Gradle detected a problem with the following location: '/xxx/example/build/generated'.

    Reason: Task ':example:koverCachedVerify' uses this output of task ':example:compileTestJava' 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 ':example:compileTestJava' as an input of ':example:koverCachedVerify'.
      2. Declare an explicit dependency on ':example:compileTestJava' from ':example:koverCachedVerify' using Task#dependsOn.
      3. Declare an explicit dependency on ':example:compileTestJava' from ':example:koverCachedVerify' using Task#mustRunAfter.

    For more information, please refer to https://docs.gradle.org/8.12.1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

Expected behavior
The task is executed without errors.

I can solve this by myself by adding

afterEvaluate {
    tasks["koverGenerateArtifactJvm"].dependsOn("compileTestJava")
}

but it would be great of the plugin could take care of that.

Environment

  • Kover Gradle Plugin version: [e.g. 0.9.1]
  • Gradle version: [e.g. 8.12.1]
  • Kotlin project type: Kotlin/JVM
@obecker obecker added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed
Projects
None yet
Development

No branches or pull requests

2 participants