Skip to content

Instantly share code, notes, and snippets.

@azizbekian
Last active January 12, 2020 13:27
Show Gist options
  • Save azizbekian/623069a262abfe3552d5c72b1b162fcc to your computer and use it in GitHub Desktop.
Save azizbekian/623069a262abfe3552d5c72b1b162fcc to your computer and use it in GitHub Desktop.
sonar.gradle
apply plugin: "org.sonarqube"
sonarqube {
properties {
property "sonar.host.url", "https://sonarqube.yourcompany.com"
property "sonar.login", "your fancy key"
property "sonar.projectName", "Your Awesome Project Name"
property "sonar.projectKey", "my-test-project"
property "sonar.projectVersion", "1.0.0"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.java.coveragePlugin", "jacoco"
// taken from `jacoco.gradle`
property "sonar.coverage.exclusions", "**/test/**,**/androidTest/**,**/R.class,**/BuildConfig.*,**/Manifest*.*,**/*Test*.*,**/com/example/databinding/*,**/com/example/generated/callback/*,**/*Dto*.*,**/android/databinding/*,**/androidx/databinding/*,**/di/module/*,**/*MapperImpl*.*,**/BuildConfig.*,**/*Component*.*,**/*BR*.*,**/Manifest*.*,**/*Companion*.*,**/*Module.*,**/*Dagger*.*,**/*MembersInjector*.*,**/*Extensions*.*,**/InputMethodManagerLeaks.*,**/*_Factory*.*,**/*_Provide*Factory*.*"
}
}
// task named `testDevDebugUnitTestCoverage` is created inside `jacoco.gradle`
tasks.sonarqube.dependsOn ":app:testDevDebugUnitTestCoverage"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment