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

Error trying to generate a single report using the newest beta version (0.8.0-Beta) #570

Closed
igorromcy opened this issue Mar 18, 2024 · 4 comments
Assignees
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed

Comments

@igorromcy
Copy link

Describe the bug
I'm trying to use the latest Kover version since it has some great improvements around the single report approach and I'm facing this weird error when I'm trying to add a variant. Is that something inside the library or I might be missing some kind of configuration?

Errors

Caused by: kotlinx.kover.gradle.plugin.commons.KoverCriticalException: Kover error: An error occurred while executing before Kover finalize action
Please create an issue in Kover Gradle Plugin repository: https://github.com/Kotlin/kotlinx-kover/issues
	at kotlinx.kover.gradle.plugin.appliers.FinalizeKoverKt.finalizing(FinalizeKover.kt:35)
	at kotlinx.kover.gradle.plugin.KoverGradlePlugin$apply$2.invoke(KoverGradlePlugin.kt:35)
	at kotlinx.kover.gradle.plugin.KoverGradlePlugin$apply$2.invoke(KoverGradlePlugin.kt:33)
	at
....

Caused by: org.codehaus.groovy.runtime.metaclass.MissingMethodExecutionFailed: No signature of method: kotlinx.kover.gradle.plugin.appliers.KoverMergeKt$wrap$3.addWithDependencies() is applicable for argument types: (ArrayList, Boolean) values: [[debug, fastdevDebug], false]
Possible solutions: addWithDependencies([Ljava.lang.String;, boolean)
Caused by: groovy.lang.MissingMethodException: No signature of method: kotlinx.kover.gradle.plugin.appliers.KoverMergeKt$wrap$3.addWithDependencies() is applicable for argument types: (ArrayList, Boolean) values: [[debug, fastdevDebug], false]
Possible solutions: addWithDependencies([Ljava.lang.String;, boolean)

Code
I'm applying the plugin to my build.gradle file

    id("org.jetbrains.kotlinx.kover") version "0.8.0-Beta" apply true

and setting the config:

kover {
    merge {
        allProjects()
        createVariant("coverage") {
            it.addWithDependencies(["debug", "fastDebug"], false)
        }
    }
}

Environment

  • Kover Gradle Plugin version: 0.8.0
  • Gradle version: 8.2.0
  • Kotlin project type: Kotlin/Multiplatform + Android
@igorromcy igorromcy added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Mar 18, 2024
@shanshin
Copy link
Collaborator

Hi,
try this way

kover {
    merge {
        allProjects()
        createVariant("coverage") {
            it.addWithDependencies(["debug", "fastDebug"] as String[], false)
        }
    }
}

*an String array is expected, not a list

@shanshin shanshin added S: waiting for clarification Status: additional information required to proceed and removed S: untriaged Status: issue reported but unprocessed labels Mar 19, 2024
@igorromcy
Copy link
Author

looks better, but for some reason doesn't find the variant I'm looking for:

A problem occurred configuring root project 'android'.
> Could not find the provided variant 'debug' to create a custom variant 'coverage'.
  Specify an existing 'jvm' variant or Android build variant name, or delete the merge.

even passing two variants, is it searching for only one?

removing the variant block (just to see what happens) gives me the same error over many modules:

> Task :feature:feature1:kaptDebugUnitTestKotlin
warning: The following options were not recognized by any processor: '[dagger.hilt.disableModulesHaveInstallInCheck, 
dagger.fastInit, dagger.hilt.android.internal.disableAndroidSuperclassValidation, dagger.hilt.android.internal.projectType, 
dagger.hilt.internal.useAggregatingRootProcessor, dagger.validateTransitiveComponentDependencies, 
dagger.strictMultibindingValidation, dagger.hilt.disableCrossCompilationRootValidation, kapt.kotlin.generated]'

@shanshin
Copy link
Collaborator

shanshin commented Mar 19, 2024

looks better, but for some reason doesn't find the variant I'm looking for:

is Android build variant debug exists in all projects of a build including root project?
If not, you should limit merged projects (e.g. by subprojects() instead of allProjects()) or add variant optionally

kover {
    merge {
        allProjects()
        createVariant("coverage") {
            it.add(["debug", "fastDebug"] as String[], true)
        }
    }
}

@igorromcy
Copy link
Author

that worked, amazing!

thank you for the support!

shanshin added a commit that referenced this issue Mar 21, 2024
Previous versions of the functions had vararg parameters, this is not always convenient if the List is presented when or Groovy is used.

Relates #570
shanshin added a commit that referenced this issue Mar 26, 2024
Previous versions of the functions `KoverVariantCreateConfig.add` and `KoverVariantCreateConfig.addWithDependencies` had vararg parameters, this is not always convenient if the List is presented when or Groovy is used.

Relates #570
PR #579

Co-authored-by: Leonid Startsev <sandwwraith@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants