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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.7.0-Alpha] Merged report is not generated #319

Closed
mustafaozhan opened this issue Mar 10, 2023 · 3 comments 路 Fixed by #327
Closed

[0.7.0-Alpha] Merged report is not generated #319

mustafaozhan opened this issue Mar 10, 2023 · 3 comments 路 Fixed by #327
Assignees
Labels
Question Support request issue type S: untriaged Status: issue reported but unprocessed

Comments

@mustafaozhan
Copy link

Hello 馃憢

I am currently using kover in my project without any issue with the version 0.6.1

Recently I wanted to update it to 0.7.0-Alpha in order to test one of the issue that has been told fixed in 0.7.0-Alpha, but I got stuck during migration.

Basically I had this block in root build.gradle.kts file for the version 0.6.1

plugins {
    libs.plugins.apply {
        alias(kover)
    }
}

buildscript {
    dependencies {
        libs.classpaths.apply {
            classpath(kover)
        }
    }
}

allprojects {
    apply(plugin = rootProject.libs.plugins.kover.get().pluginId).also {
        koverMerged {
            filters {
                annotations {
                    excludes += listOf(
                        "com.oztechan.ccc.android.ui.compose.annotations.ThemedPreviews",
                        "androidx.compose.ui.tooling.preview.Preview",
                        "androidx.compose.runtime.Composable"
                    )
                }
            }
            enable()
        }
    }
}

Now with the version 0.7.0-Alpha it looks like this:

plugins {
    libs.plugins.apply {
        alias(kover)
    }
}

buildscript {
    dependencies {
        libs.classpaths.apply {
            classpath(kover)
        }
    }
}

allprojects {
    apply(plugin = rootProject.libs.plugins.kover.get().pluginId).also {
        kover {
            disabledForProject = false
            useKoverTool()
        }
        dependencies {
            kover(project(path))
        }
    }
}

koverReport {
    filters {
        excludes {
            annotatedBy("com.oztechan.ccc.android.ui.compose.annotations.ThemedPreviews")
            annotatedBy("androidx.compose.ui.tooling.preview.Preview")
            annotatedBy("androidx.compose.runtime.Composable")
        }
    }
}

I tried many variant but I wasn't able to get merged report for all the sub modules/projects included in a single xml file.

Meanwhile in case you want to check, I have open PR and repository is public: Oztechan/CCC#2155

@mustafaozhan mustafaozhan added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 10, 2023
@shanshin
Copy link
Collaborator

Hi,
To add a dependency to the root project, you need to rewrite this block

allprojects {
    apply(plugin = rootProject.libs.plugins.kover.get().pluginId).also {
        kover {
            disabledForProject = false
            useKoverTool()
        }
        dependencies {
            kover(project(path))
        }
    }
}

in this way

val rootProject = project

allprojects {
    apply(plugin = rootProject.libs.plugins.kover.get().pluginId).also {
        kover {
            disabledForProject = false
            useKoverTool()
        }
        rootProject.dependencies.add("kover", project(path))
    }
}

However, unfortunately, the integration of Android and plain projects has not yet been finalized in the alpha version, so you will encounter such error

Could not determine the dependencies of task ':koverXmlReport'.
> Could not resolve all task dependencies for configuration ':koverAggregatedSetup'.
   > Could not resolve project :android:app.

This is a known problem and development is underway to solve it.

@mustafaozhan
Copy link
Author

@shanshin thank you for the information, I will re-try with the new version when it is available then 馃憤

shanshin added a commit that referenced this issue Mar 27, 2023
- implemented work with build variants with different sets of product flavors
- implemented support of android targets in Kotlin multiplatform
- implemented ability to export and add some Android build variant to the default report
- Kover setups renamed to Kover artifacts
- introduced the concept of Kover namespace

Fixes #316
Fixes #319
@shanshin
Copy link
Collaborator

Fixed in 0.7.0-Beta

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: untriaged Status: issue reported but unprocessed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants