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

Consider adding multilple flavors to the app #6

Open
yuriykulikov opened this issue Apr 22, 2019 · 1 comment
Open

Consider adding multilple flavors to the app #6

yuriykulikov opened this issue Apr 22, 2019 · 1 comment

Comments

@yuriykulikov
Copy link

yuriykulikov commented Apr 22, 2019

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"
        )
))
@yuriykulikov
Copy link
Author

As you can see, "debug" must be replaced by "developDebug", where "develop" is the name of the flavor which will be used for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant