Skip to end of metadata
Go to start of metadata

NOTE This feature requires SonarQube 7.2+

Import of AndroidLint Reports

SonarKotlin allows to import into SonarQube/SonarCloud issues generated by AndroidLint.

For an Android project using Gradle, execute this to get the report generated in build/reports/lint-results.xml:

gradle lint

In an Android project not relying on Gradle, lint-results.xml file can be generated using:

$ANDROID_HOME/tools/bin/lint --xml lint-results.xml path/to/project

You need then to feed the property "sonar.androidLint.reportPaths" with the path to lint-results.xml file in your sonar-project.properties. This property accepts one or more AndroidLint reports, paths to report files should be absolute or relative to the project base directory.

sonar.androidLint.reportPaths=lint-results.xml

Import of Detekt Reports

SonarKotlin allows to import into SonarQube/SonarCloud issues generated by Detekt. Here is an example of command generating a Detekt report.

java -jar path/to/detekt-cli-1.0.0.RC7-3-all.jar -i path/to/project -o path/to/report-directory

You need then to feed the property "sonar.kotlin.detekt.reportPaths" with the path to detekt-checkstyle.xml file in your sonar-project.properties. This property accepts one or more Detekt reports, paths to report files should be absolute or relative to the project base directory.

sonar.kotlin.detekt.reportPaths=path/to/report-directory/detekt-checkstyle.xml
  • No labels