AndroidLintReporter icon indicating copy to clipboard operation
AndroidLintReporter copied to clipboard

Support other vcs sites

Open worker8 opened this issue 4 years ago • 0 comments

Overview

Currently, the parseAndSendLintResult task does too many things.

  1. It takes in lint-results.xml produced ./gradlew lint.
  2. It then parses it.
  3. Then it renders the result into markdown.
  4. Then it sends the markdown result to Github.

The downside of this is that it won't work with other site. Since Github is hardcoded.

To make this work with Bitbucket or Gitlab or others, no 3 and 4 have to be made configurable or extracted as a separate task.

Proposal

It can be further improved by taking in more options:

plugins {
    id('com.worker8.android_lint_reporter')
}
android_lint_reporter {
    lintFilePath = "./src/main/resources/lint-results.xml"
    vcs = "github | bitbucket | gitlab"

    github {
        token = "<your personal github token>"
        username = "worker8"
        repositoryName = "AndroidLintReporter"        
    }
    // OR
    bitbucket {
        token = "<your bitbucket token>"
        username = "worker8"
        repositoryName = "AndroidLintReporter"        
    }
    // OR
    gitlab {
        token = "<your Gitlab token>"
        username = "worker8"
        repositoryName = "AndroidLintReporter"        
    }
}

Then, the rendering of Markdown should be slightly modified because Github flavored markdown is different than others.

After that, the ReadMe has to be changed to provide a sample on how to setup Bitbucket Pipeline and Gitlab Runner.

worker8 avatar Mar 19 '20 08:03 worker8