Demo SE2 android repository with Github Actions CI and Sonarcloud for analysis
How to get jacoco plugin and sonar scanner to work within modules:
Important: make sure you use Junit 5 or higher!
you can use the plain 'jacoco' plugin for this to work
move the sonarqube plugin and its properties to your build.gradle in a module (e.g. app/build.gradle)
add a jacocoTestReport task that depends on testDebugUnitTest (you can see the template below)
add testOptions to the android configuration in the build.gradle and finalize the jacocoTestReport task (see template below)
make sure that the xml.destination from the reports attribute of the jacocoTestReport task is the same as the sonar.coverage.jacoco.xmlReportPaths property of the sonaqube task
with that configuration, it is sufficient to run the following command as the last part in your CI pipeline file: run: ./gradlew build sonarqube --info