sonarqube { properties { // recommend to specify the flavor once and dynamically adapt paths to it def flavor = "flavorUnsigned" // flavor we want to have tested. Should be static def Flavor = "FlavorUnsigned" // flavor again, but starting with upper case /* SonarQube needs to be informed about your libraries and the android.jar to understand that methods like * onResume() is called by the Android framework. Without that information SonarQube will very likely create warnings * that those methods are never used and they should be removed. Same applies for libraries where parent classes * are required to understand how a class works and is used. */ def libraries = project.android.sdkDirectory.getPath() + "/platforms/android-26/android.jar," + "build/intermediates/classes-jar/**/classes.jar" property "sonar.projectKey", "BlibliAndroidApp" // some shortcut name property "sonar.projectName", "Blibli Android App" property "sonar.projectVersion", app_version property "sonar.sourceEncoding", "UTF-8" property "sonar.sources", "src/main/java" // Defines where the java files are property "sonar.binaries", "build/intermediates/classes/${flavor},build/tmp/kotlin-classes/${flavor}Debug" property "sonar.libraries", libraries // Defines where the xml files are property "sonar.java.binaries", "build/intermediates/classes/${flavor},build/tmp/kotlin-classes/${flavor}Debug" property "sonar.java.libraries", libraries // Analyze tests classes if (project.plugins.hasPlugin('com.android.application')) { property "sonar.tests", "src/test/java,src/androidTest/java" } else { property "sonar.tests", "src/test/java" } property "sonar.java.test.binaries", "build/intermediates/classes/${flavor},build/tmp/kotlin-classes/${flavor}Debug" property "sonar.java.test.libraries", libraries property "sonar.scm.provider", "git" property "sonar.jacoco.reportPaths", "build/jacoco/test${Flavor}DebugUnitTest.exec" property "sonar.java.coveragePlugin", "jacoco" property "sonar.junit.reportPaths", "build/test-results/test${Flavor}DebugUnitTest" property "sonar.coverage.exclusions", excludeFileFilter.join(',') } }