Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Plugin Information

View Android Lint on the plugin site for more information.

Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:

Parses output from the Android lint tool and displays the results for analysis.
See also: Android Emulator Plugin.

Features

Android Lint is a tool which scans your Android projects and reports on potential bugs, performance, security and translation issues, plus more.

This Jenkins plugin parses XML reports produced by running lint, analyses them and displays the results for each build.
Information shown includes a build summary, trend graphs, display of warnings in context, and dashboard portlets.

This plugin builds on the work of the static analysis core plugin; see the Static Code Analysis Plug-ins page for a fuller list of features.

   

Requirements

  • Jenkins 1.409 or newer
  • The Static Analysis Utilities plugin — this will be automatically installed when you install this plugin
  • Android SDK Tools r17 or newer, but at least r21 is recommended

If the Dashboard View plugin is also installed, you will be able to add Lint-specific portlets to your dashboard views.

Configuration

Job configuration

Enable "Publish Android Lint results" in the "Post-build Actions" of your Jenkins job.

By default, the plugin will parse any files called "lint-results.xml", anywhere in your build's workspace.
This behaviour can be overridden by entering a filename or pattern, relative to the root of your build's workspace.

Producing Lint output

Note that this plugin does not run Lint for you — you must provide Lint results in XML format, either by running lint during a build, or by copying the file(s) from somewhere else.

For best results, run Lint in your Android application's directory, e.g.:
cd app; lint --xml lint-results.xml .

Note: When running Jenkins on a headless system, or under a user ID which doesn't have access to a graphical environment, you may see some errors while running Lint.
To combat this, you can run Java in headless mode, as follows:
os_opts="-Djava.awt.headless=true" lint --xml lint-results.xml .

Changing build outcome based on Lint results

You can change mark builds as unstable or failed, if the number of Lint issues found – or introduced in the latest build – exceeds a certain threshold.

e.g. You can fail any builds where "Fatal" Lint warnings are introduced.

Version history

Version 2.0 (November 13, 2012)

  • Issues are now classified according to Lint 'severity' rather than 'priority'
    • "Fatal" Lint errors are now shown as high priority, "Error" and "Warning" have normal priority, "Informational" has low priority
  • Full explanations and context information for all issues are now included, when using SDK Tools r21 or above
  • Removed support for Maven job types, as this doesn't work

Version 1.0.1 (March 22, 2012)

  • Fixed bug where gathering results would fail for builds running on a slave, with Lint XML generated using SDK Tools r17

Version 1.0 (March 21, 2012)

  • Initial release
  • Thanks to ~drulli for writing analysis-core and providing for code samples from his many other static analysis plugins
  • No labels