Kotlin / kotlinx-kover

Apache License 2.0
1.25k stars 46 forks source link

Allow/fix aggregation `includedBuild`s #598

Closed gmazzo closed 3 weeks ago

gmazzo commented 1 month ago

What is your use-case and why do you need this feature? kover integrates with Gradle's dependency resolution system by exposing a kover configuration to aggregate projects

As includedBuilds by convention exposes a dependency coordinate (implicit dependencySubstitution), declaring it as a kover dependency is expected to aggregate the child build into the main report.

dependencies {
    kover(":build-logic")
}

This setup does not break the build, the correct koverArtifact[TOTAL] variant is resolved for the included build, but the report does not aggregate it. image https://scans.gradle.com/s/2nb3nedv4ntsm/dependencies?focusedDependency=WzAsMCwyLFswLDAsWzJdXV0&toggled=W1swXSxbMCwwXV0

Running ./gradlew :koverHtmlReport produces a report only containing main build modules: image

While running ./gradlew :build-logic:koverHtmlReport, is correctly computing the build-logic modules (some now not aggregated in the root one): image

Describe the solution you'd like Included Builds should be transparently resolved as any other kover dependency and included in the aggregated report. Variants are there, it's seems to a matter of the internal plugin resolution strategy.

[!IMPORTANT] I provided a sample project at https://github.com/gmazzo/kover-demo-aggregation-issue/?tab=readme-ov-file#includedbuilds-not-aggregating

shanshin commented 3 weeks ago

Thanks for report! Unfortunately, Composite Builds are not supported at the moment, there are a number of technical limitations why it does not work in its current form.

shanshin commented 3 weeks ago

A task has already been opened to design support for such types of builds.

shanshin commented 3 weeks ago

Closed as a duplicate of https://github.com/Kotlin/kotlinx-kover/issues/487