Skip to content

Add the ability to create custom report variants #463

@shanshin

Description

@shanshin

Motivation

  • it is necessary to generate reports for classes located in the same project and related to the JVM target and several specific android build variants
  • it is necessary to generate merged reports on classes from different subprojects of the same build, while some of these subprojects contain JVM classes, other classes from different Android build variants
  • reports should be generated for classes in such combinations that must be defined by the user himself

Terminology

Report variant - named set of sources and tests grouped by certain conditions: JVM target, Android build variant, their commbination, etc.). It is acceptable to generate reports for each variant.

Solution

A special DSL will be added to create custom report variant that can be filled with classes from JVM target, Android build variants and other custom variants:

// configure report variants (creating custom variants and exports it)
koverVariants {
    // create custom reports variant
    create("customVariantName") {
        // add android or custom report variants
        add("jvm", "apiRelease", "appRelease", "libRelease")

        // flexibly add android variants
        addAndroid(buildType = "release", "api", "app", "lib") // for Android build variants `apiRelease`, `appRelease`, `libRelease`
        // also
        addAndroid(buildType = "release", "*") // for Android build variants `release`, `apiRelease`, `appRelease`, `libRelease`
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions