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

Kover plugin not found using convention plugin approach #580

Closed
igorromcy opened this issue Mar 22, 2024 · 2 comments
Closed

Kover plugin not found using convention plugin approach #580

igorromcy opened this issue Mar 22, 2024 · 2 comments
Assignees
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed

Comments

@igorromcy
Copy link

Hi once again!

I'm trying to set kover on my convention plugin, like that:

fun Project.configureKover(modules: ArrayList<String>) {
    with(pluginManager) {
        apply(KoverGradlePlugin::class.java)

        kover {
            merge { config ->
                config.allProjects {
                    it.path in modules
                }
                config.createVariant("coverage") {
                    it.addWithDependencies(*arrayOf("fastDebug", "debug"), optional = true)
                }
            }
        }
    }
}

fun Project.kover(block: KoverProjectExtension.() -> Unit) {
    extensions.getByType(KoverProjectExtension::class.java).apply {
        block()
    }
}

but when I use allProjects (which I think is the right choice for me since I want to merge all reports with that filter)

I get this error:

A problem occurred configuring project ':app'.
> Plugin with id 'org.jetbrains.kotlinx.kover' not found.

but changing to use subprojects (only for testing purposes), works fine.

any idea of what I'm doing wrong?

@igorromcy igorromcy added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 22, 2024
@shanshin
Copy link
Collaborator

Hi,
Do you apply your convention plugin in only one project?

Does the error repeat if you specify

plugins {
    // ...
    id ("org.jetbrains.kotlinx.kover") version "0.8.0-Beta" apply false
    // ...
}

in the root project?

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

not, that's what I'm missing.

I'm facing a circular dependency problem right now, but I believe should be easy to solve :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Support request issue type S: waiting for clarification Status: additional information required to proceed
Projects
None yet
Development

No branches or pull requests

2 participants