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

Multiplatform: Task '<module1>:koverXmlReport' uses this output of task '<module2>:desktopTest' without declaring an explicit or implicit dependency #650

Closed
realdadfish opened this issue Jul 3, 2024 · 2 comments
Assignees
Labels
Bug Bug issue type S: untriaged Status: issue reported but unprocessed

Comments

@realdadfish
Copy link

realdadfish commented Jul 3, 2024

I'm using Kover 0.8.1 in a multiplatform multi-module environment like so:

afterEvaluate {
    kover {
        reports {
            filters {
                excludes {
                    annotatedBy("*Generated*")
                }
            }

            verify {
                rule {
                    minBound(80)
                    maxBound(90)
                }
            }
        }
    }
}

The multiplatform project is configured to use a JVM ("desktop") and Android target:

fun configureMultiplatform(project: Project) {
    project.plugins.apply("org.jetbrains.kotlin.plugin.compose")
    project.plugins.apply("org.jetbrains.compose")
    project.plugins.apply("com.google.devtools.ksp")

    configure<KotlinMultiplatformExtension> {
        jvm("desktop")
        androidTarget()

        sourceSets {
            val commonMain by getting
            val commonTest by getting

            // if the compose plugin is applied, the compiler also always requests a runtime to be present
            // refactor to use accessors when they become available (https://github.com/gradle/gradle/issues/15383)
            project.extensions.getByType(VersionCatalogsExtension::class.java).find("libs").ifPresent { libs ->
                val composeBom = libs.findLibrary("androidx.compose.bom").get()
                val composeRuntime = libs.findLibrary("androidx.compose.runtime").get()
                commonMain.dependencies {
                    compileOnly(project.dependencies.platform(composeBom))
                    compileOnly(composeRuntime)
                }
                commonTest.dependencies {
                    compileOnly(project.dependencies.platform(composeBom))
                    compileOnly(composeRuntime)
                }
            }
        }
    }

    // ...
}

and there are library and app modules set up that depend on one another.

When then

./gradlew test koverVerify koverXmlReport

is executed, the build fails with

[2024-07-03T12:43:05.700Z] FAILURE: Build failed with an exception.
[2024-07-03T12:43:05.700Z] 
[2024-07-03T12:43:05.700Z] * What went wrong:
[2024-07-03T12:43:05.700Z] Some problems were found with the configuration of task ':inbound-domain:koverXmlReport' (type 'KoverXmlTask').
[2024-07-03T12:43:05.700Z]   - Gradle detected a problem with the following location: '/home/jenkins/workspace/droid-monorepo_inboundend_PR-296/inboundend/inbound-data/build/kover/bin-reports/desktopTest.ic'.
[2024-07-03T12:43:05.700Z]     
[2024-07-03T12:43:05.700Z]     Reason: Task ':inbound-domain:koverXmlReport' uses this output of task ':inbound-data:desktopTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
[2024-07-03T12:43:05.700Z]     
[2024-07-03T12:43:05.700Z]     Possible solutions:
[2024-07-03T12:43:05.700Z]       1. Declare task ':inbound-data:desktopTest' as an input of ':inbound-domain:koverXmlReport'.
[2024-07-03T12:43:05.701Z]       2. Declare an explicit dependency on ':inbound-data:desktopTest' from ':inbound-domain:koverXmlReport' using Task#dependsOn.
[2024-07-03T12:43:05.701Z]       3. Declare an explicit dependency on ':inbound-data:desktopTest' from ':inbound-domain:koverXmlReport' using Task#mustRunAfter.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     For more information, please refer to https://docs.gradle.org/8.9-rc-1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
[2024-07-03T12:43:05.701Z]   - Gradle detected a problem with the following location: '/home/jenkins/workspace/droid-monorepo_inboundend_PR-296/inboundend/inbound-data/build/generated/compose/resourceGenerator/kotlin/desktopMainResourceAccessors'.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     Reason: Task ':inbound-domain:koverXmlReport' uses this output of task ':inbound-data:generateResourceAccessorsForDesktopMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     Possible solutions:
[2024-07-03T12:43:05.701Z]       1. Declare task ':inbound-data:generateResourceAccessorsForDesktopMain' as an input of ':inbound-domain:koverXmlReport'.
[2024-07-03T12:43:05.701Z]       2. Declare an explicit dependency on ':inbound-data:generateResourceAccessorsForDesktopMain' from ':inbound-domain:koverXmlReport' using Task#dependsOn.
[2024-07-03T12:43:05.701Z]       3. Declare an explicit dependency on ':inbound-data:generateResourceAccessorsForDesktopMain' from ':inbound-domain:koverXmlReport' using Task#mustRunAfter.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     For more information, please refer to https://docs.gradle.org/8.9-rc-1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
[2024-07-03T12:43:05.701Z]   - Gradle detected a problem with the following location: '/home/jenkins/workspace/droid-monorepo_inboundend_PR-296/inboundend/inbound-data/build/generated/compose/resourceGenerator/kotlin/commonResClass'.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     Reason: Task ':inbound-domain:koverXmlReport' uses this output of task ':inbound-data:generateComposeResClass' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     Possible solutions:
[2024-07-03T12:43:05.701Z]       1. Declare task ':inbound-data:generateComposeResClass' as an input of ':inbound-domain:koverXmlReport'.
[2024-07-03T12:43:05.701Z]       2. Declare an explicit dependency on ':inbound-data:generateComposeResClass' from ':inbound-domain:koverXmlReport' using Task#dependsOn.
[2024-07-03T12:43:05.701Z]       3. Declare an explicit dependency on ':inbound-data:generateComposeResClass' from ':inbound-domain:koverXmlReport' using Task#mustRunAfter.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     For more information, please refer to https://docs.gradle.org/8.9-rc-1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
[2024-07-03T12:43:05.701Z]   - Gradle detected a problem with the following location: '/home/jenkins/workspace/droid-monorepo_inboundend_PR-296/inboundend/inbound-data/build/generated/compose/resourceGenerator/kotlin/commonMainResourceAccessors'.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     Reason: Task ':inbound-domain:koverXmlReport' uses this output of task ':inbound-data:generateResourceAccessorsForCommonMain' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     Possible solutions:
[2024-07-03T12:43:05.701Z]       1. Declare task ':inbound-data:generateResourceAccessorsForCommonMain' as an input of ':inbound-domain:koverXmlReport'.
[2024-07-03T12:43:05.701Z]       2. Declare an explicit dependency on ':inbound-data:generateResourceAccessorsForCommonMain' from ':inbound-domain:koverXmlReport' using Task#dependsOn.
[2024-07-03T12:43:05.701Z]       3. Declare an explicit dependency on ':inbound-data:generateResourceAccessorsForCommonMain' from ':inbound-domain:koverXmlReport' using Task#mustRunAfter.
[2024-07-03T12:43:05.701Z]     
[2024-07-03T12:43:05.701Z]     For more information, please refer to https://docs.gradle.org/8.9-rc-1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
[2024-07-03T12:43:05.701Z] 
[2024-07-03T12:43:05.701Z] * Try:
[2024-07-03T12:43:05.701Z] > Run with --stacktrace option to get the stack trace.
[2024-07-03T12:43:05.701Z] > Run with --info or --debug option to get more log output.
[2024-07-03T12:43:05.701Z] > Run with --scan to get full insights.
[2024-07-03T12:43:05.701Z] > Get more help at https://help.gradle.org.

@realdadfish realdadfish added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Jul 3, 2024
@realdadfish realdadfish changed the title Multiplatform: Task '<module1>:koverXmlReport' uses this output of task 'module2<:desktopTest' Multiplatform: Task '<module1>:koverXmlReport' uses this output of task '<module2>:desktopTest' without declaring an explicit or implicit dependency Jul 3, 2024
@shanshin
Copy link
Collaborator

shanshin commented Jul 3, 2024

Hi,
have you tried the 0.8.2 version?

Perhaps the same problem as in #633

@realdadfish
Copy link
Author

Yes, indeed, 0.8.2 fixed it. Thanks for the quick response and sorry for the duplicate!

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