Description / Features
This plugin enhances the Java Plugin to analyze Android projects within SonarQube:
- Adds a new set of rules based on Android lint
- On top of Java files, Android Manifest and resources (such as layouts or pictures) are analyzed
The Android SDK must be installed on the machine(s) running the SonarQube analyses. The
ANDROID_HOME environment variable should be configured to point to the installation directory of the Android SDK.
Note that you have to install the different Patforms/API that your projects are built with.
- Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
- Restart the SonarQube server
Run an Analysis with the SonarQube Runner (Recommended method)
To run an analysis of your Android project, use the SonarQube Runner.
Run an Analysis with the other Analyzers
To display code coverage data:
- Prior to the SonarQube analysis, execute your unit tests and generate the Emma 2.0 reports (.em and .ec files)
- Import these reports while running the SonarQube analysis by setting the
sonar.android.emma.reportproperty to the path of the directory containing the Emma reports. The path may be absolute or relative to the project base directory for standard projects, relative to the module base directory for multi-module projects.
Extending Coding Rules using XPath
Since the SQALE model for Java is already provided by the Java Ecosystem, the SQALE model for Android has to be applied manually:
- Download the XML file containing the SQALE model
- Log in as a System Administrator
- Go to Settings > SQALE > Back Up / Restore > Merge Model
- Upload the XML file
- Click on Restore