Issue
I configured sonar on my android project that contain many flavors. Sonar works fine except that it doesn't show the test coverage in my app. I set sonar properties in my gradle file like that:
property "sonar.language", "java"
property "sonar.sources", "src"
property "sonar.test", "src/test, src/androidTest/java"
property "sonar.binaries", "build"
property "sonar.jacoco.reportPath", "build/jacoco/testDebugUnitTest.exec"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.junit.reportsPath", "build/test-results/Debug"
property "sonar.android.lint.report", "build/outputs/lint-results.xml"
As i said, I have many flavors, Under the build/intermediates/classes
, I have a folder for every flavor and the test folder.
Note: the same config works in a project without any flavor !
Solution
the problem was with binary path. I must specifie the path with the specific flavor. In my case:
sonarqube {
//noinspection GroovyAssignabilityCheck
properties {
//...
property "sonar.binaries", "build/intermediates/classes/qa/debug"
property "sonar.java.binaries", "build/intermediates/classes/qa/debug"
property "sonar.java.test.binaries", "build/intermediates/classes/qa/debug"
//...
}
}
Where qa is my flavor and debug is the build config.
Answered By - Fakher
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.