Skip to content

Static code analysis plugin for Android projects.

License

Notifications You must be signed in to change notification settings

Simdea/android-quality-verifier

 
 

Repository files navigation

Android Quality Verifier

Download gitcheese.com

Static code analysis plugin for Android projects. This is a fork of the original android-check plugin, which implements a really useful concept.

Build status

Master Build Status
Dev dev

Usage

This plugin is available in jCenter. It attaches itself to the check task if it finds it (that is, you don't use the plugins block and you apply either the application or library Android plugins first) - otherwise you'll need to execute the corresponding tasks manually when desired: androidCheckstyle for CheckStyle, androidFindbugs for FindBugs, CPDTask for CPD and androidPmd for PMD.

Configuration

Install

Add to main build.gradle:
buildscript {
    ...
    dependencies {
        ...
        classpath 'pt.simdea.verifier:verifier:3.6.0'
        ...
    }
    ...
}
add to app build.gradle:
apply plugin: 'pt.simdea.verifier'

Recommended

The default one.

Customized

// Configuration is completely optional, defaults will be used if not present
check {
  // Do absolutely nothing, default: false
  skip true/false
  // Fails build if a violation is found, default: true
  abortOnError true/false //Ignored if all per-tool confs are set to abortOnError false (see below)
  
  // Checkstyle configuration
  checkstyle {
    // Completely skip CheckStyle, default: false
    skip true/false

    // Fails build if CheckStyle rule violation is found, default: false
    abortOnError true/false

    // Configuration file for CheckStyle, default: <project_path>/config/checkstyle.xml, if non-existent then <project_path>/<module_path>/config/checkstyle.xml, if non-existent then plugin/src/main/resources/checkstyle/conf-default.xml
    config 'path/to/checkstyle.xml'

    // Output file for XML reports, default: new File(project.buildDir, 'outputs/checkstyle/checkstyle.xml')
    reportXML new File(project.buildDir, 'path/where/you/want/checkstyle.xml')

    // Output file for HTML reports, default: not generated
    reportHTML new File(project.buildDir, 'path/where/you/want/checkstyle.html')
  }
  
  // Cpd configuration
  cpd {
    // Same options as Checkstyle
  }
  
  // FindBugs configuration
  findbugs {
    // Same options as Checkstyle
  }
  
  // PMD configuration
  pmd {
    // Same options as Checkstyle
  }
  
  // Lint configuration
  lint {
    // Same vars of android lint options
  }
}

Developed By

The original version of this plugin was developed by:

This fork is owned and maintained by Simdea.

License

See LICENSE.txt.

Original work licensed under MIT license.

About

Static code analysis plugin for Android projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • XSLT 52.7%
  • Groovy 47.0%
  • Java 0.3%