Skip to content

Consider adding multilple flavors to the app #6

@yuriykulikov

Description

@yuriykulikov

Great guide and examples! Thank you!

I think the example can benefit from adding multiple flavors, or at least some comments related to them. Unfortunately, jacoco does not provide any error messages if folders with execution data are empty or non-existent. This will be the case if a multi-flavor app is tested. Some adjustments are required to the paths:

val javaClasses = fileTree("dir" to "$buildDir/intermediates/javac/developDebug", "excludes" to fileFilter)
val kotlinClasses = fileTree("dir" to "$buildDir/tmp/kotlin-classes/developDebug", "excludes" to fileFilter)
val mainSrc = "$projectDir/src/main/java"

sourceDirectories.setFrom(files(listOf(mainSrc)))
classDirectories.setFrom(files(listOf(javaClasses, kotlinClasses)))
executionData.setFrom(fileTree(
        "dir" to project.buildDir,
        "includes" to listOf(
                "jacoco/testDevelopDebugUnitTest.exec",
                "outputs/code_coverage/developDebugAndroidTest/connected/**/*.ec"
        )
))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions