Subject: Exported From Confluence
Content-Type: text/html; charset=UTF-8
Description / Features
This plugin enhances the Java =
Ecosystem to analyze Android projects within SonarQube:
- Adds a new set of rules based on Andro=
- On top of Java files, Android Manifest and resources (such as layouts o=
r pictures) are analyzed
It is compatible with the SonarQube Eclipse plu=
gin to track issues while coding. It is also compatible with=
the Issues Report plugin
to run pre-commit local analysis.
The Android SDK must be installed on the machi=
ne(s) running the SonarQube analyses. The
OME environment variable should be configured to point to the instal=
lation directory of the Android SDK.
Note that you have to install the different Patforms/API that your proje=
cts are built with.
- Install the plugin through the Update Center or do=
wnload it into the SONARQUBE_HOME/extensions/plugins dir=
- 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.
A sample project is available on GitHub that can be browsed or downlo=
Run an Analysis w=
ith the other Analyzers
Maven and Ant can =
also be used to launch analysis on Android projects.
To display code coverage data:
- Prior to the SonarQube analysis, execute your unit tests and generate t=
he Emma 2.0 reports (.em and .ec files)
- Import these reports while running the SonarQube analysis by setting th=
sonar.android.emma.report property to the path of =
the directory containing the Emma reports. The path may be absolute or rela=
tive to the project base directory for standard projects, relative to the m=
odule base directory for multi-module projects.
See Metrics documenta=
Extending Coding Ru=
les using XPath
See Extending Coding Rules for=
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