Hi all.
First of all, apologies if this is not the right forum for this question. Not quite sure where it belongs as it relates to Gradle, Android and Sonar.
I have an Android project with multiple build types and multiple flavors and trying to set up the Sonar runner to do analysis on this. Sonar runs fine currently with a single variant (one build type, one flavor). However, I’d like to get stats for all the flavors in the project. If I try to add sources/classes for more than one flavor, Sonar will complain that there are duplicate sources (as all the shared code from main would be present for each flavor).
Is there any way to set up the Gradle Sonar runner to handle and report on multiple Android flavors?
My current set up looks something like (which currently actually doesn’t include build type specific code),
sonarRunner {
sonarProperties {
property "sonar.sources", "src/main/java"
property "sonar.binaries", "build/intermediates/classes/<flavor>/debug"
property "sonar.libraries", "build/libs/*.jar"
property "sonar.tests", "src/test/java"
property "sonar.jacoco.reportPath", "build/jacoco/test<flavor>Debug.exec"
}
}