-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Bug]: Jacoco configuration ignores sourcesets of buildFlavors #682
Comments
try this gradle plugin for jacoco. very easy to use. https://github.com/gmazzo/gradle-android-test-aggregation-plugin @alexvanyo what do you think about the plugin? any limitations to it compared to what we have here? |
I think there's two parts here:
So to solve this issue, we likely shouldn't need to add an external plugin. |
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
The sourceDirectories configuration in Jacoco.kt seems to be simply setting it from main sourceset and ignores other flavors:
sourceDirectories.setFrom(files("$projectDir/src/main/java", "$projectDir/src/main/kotlin"))
Instead I think it should be including all sources of the current variant. This can be done in groovy by
variant.sourceSets.java.srcDirs.collect { it.path }.flatten()
but I'm not sure how this can be done in Kotlin which is using a different variant class. I came across this trying to migrate my own project scripts from groovy to kotlin, so any help is appreciated!Relevant logcat output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: