Marcus Bertilsson Marcus Bertilsson - 3 years ago 358
Android Question

Gradle plugins (findbugs, pmd, jdepend, checkstyle) not working

I have the follow app bulild.gradle for my project. When I run the command gradle check no output is reported in the app/build/ folder. I basically used the same code for a previous project and it seemed to work just fine.

apply plugin: ''
apply plugin: "findbugs"
apply plugin: 'pmd'
apply plugin: "jdepend"
apply plugin: 'checkstyle'

findbugs {
ignoreFailures = false
effort = "max"
reportLevel = "low"

pmd {
ignoreFailures = true

ignoreFailures = true

tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true

tasks.withType(Checkstyle) {
reports {
xml.enabled false
html.enabled true
html.stylesheet resources.text.fromFile('config/xsl/checkstyle-custom.xsl')

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "dat255.refugeeevent"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner ""
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('', {
exclude group: '', module: 'support-annotations'
compile ''
compile ''
compile ''
compile ''
compile ''
testCompile 'junit:junit:4.12'
compile '[4,5)'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile files ('libs/microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar')

spy spy
Answer Source

Check out gradle fury's quality plugin, works on android and non android projects We use it has something to force reports for the site plugin. It's largely based off of work of others with lots of tweaks to make it work correctly for both android and non android projects.

apply it allprojects { apply from: "" }

and then you'll need the contents from here: cloned into your repo. Just the config folder, the rest of the stuff isn't needed.

finally, either call any gradle tasks that requires check. So any one of the following should do the trick

  • gradlew build
  • gradlew check
  • gradlew install (if you're running the maven-support stuff from fury)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download