view raw
LordRaydenMK LordRaydenMK - 6 months ago 102
Android Question

Publish Android Lint results from Pipeline project

I am building an Android project with Jenkins (2.0 Beta) as a Pipeline.

From a Freestyle job I can archive the build results using a post build action Publish Android Lint Results.

My Pipeline script is:

node {
stage 'Checkout'
git branch: 'final', url: ''

stage 'Build'
sh './gradlew clean assemble'

stage 'Android Lint'
sh './gradlew lint'

stage 'Lint Results'
//How to archive the results ?

stage 'Test'
sh './gradlew test'

stage 'JUnit tests'
step([$class: 'JUnitResultArchiver', testResults: 'app/build/test-results/*/TEST-*.xml'])

I am running lint and the results are saved in a file. I don't know how to publish the results so the Android Lint Plugin can pick them up.

JUnit results are archived fine.


After looking trough the source code I realized the published version (2.2) is not compatible with Pipeline.

Version 2.3 with pipeline compatibility is not released yet.

Update: Version 2.3 of the Android Lint Plugin was released. To archive the results you can use

step([$class: 'LintPublisher', pattern: 'app/build/outputs/lint-results*.xml'])