Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube : Enterprise EditionVersion 7.9.1 (build 27448) - what are you trying to achieve
For Android project, we are trying to detect new code compared to the Development branch, based on that we are planning to apply quality gates such as code coverage on new and etc
we are using following Sonar configuration on Android
sonarqube {
properties {
if (project.hasProperty(“branch”) && project.branch != “development”) {
property “sonar.branch.name”, branch
property “sonar.branch.target”, “development”
}
property "sonar.projectName", *************
property "sonar.projectVersion", branch
property "sonar.dynamicAnalysis", "reuseReports"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.host.url", "**********"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.scm.disabled", "False"
property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
properties["sonar.sources"] = android.sourceSets.main.java.srcDirs
properties["sonar.tests"] = android.sourceSets.androidTest.java.srcDirs
properties["sonar.java.binaries"] = files("${buildDir}/intermediates/javac/debug/compileDebugJavaWithJavac/classes/")
properties["sonar.java.binaries"] += files("${buildDir}/tmp/kotlin-classes/debug/")
properties['sonar.java.test.binaries'] = files("${buildDir}/intermediates/javac/debugAndroidTest/compileDebugAndroidTestJavaWithJavac/classes/")
}
}
- what have you tried so far to achieve this
In Sonar portal we tried 5 days, 15 days and previous_version for New Code Period.
When we tried previous_version for the first commit we are not getting New Code Difference. Then after New code is detected as the difference between the code used for the first commit we did and on the new commit code.