From 791dd96cf9eaf7e80d93763b7b1ed64fe2661abf Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Mon, 19 Sep 2016 12:55:34 -0700 Subject: [PATCH] Use soter for checkstyle/pmd/findbugs check --- android/PhysicalWeb/app/build.gradle | 78 +++++-------------- .../app/config/checkstyle/checkstyle.xml | 3 +- android/PhysicalWeb/build.gradle | 4 + 3 files changed, 26 insertions(+), 59 deletions(-) diff --git a/android/PhysicalWeb/app/build.gradle b/android/PhysicalWeb/app/build.gradle index 7032e6dd..fc213904 100644 --- a/android/PhysicalWeb/app/build.gradle +++ b/android/PhysicalWeb/app/build.gradle @@ -1,10 +1,5 @@ -plugins { - id 'checkstyle' - id 'findbugs' - id 'pmd' -} - apply plugin: 'com.android.application' +apply plugin: 'si.dlabs.soter' android { compileSdkVersion 24 @@ -80,64 +75,31 @@ dependencies { compile 'com.android.support:appcompat-v7:24.0.0' compile 'com.youview:tinydnssd:1.2.7' compile 'org.nanohttpd:nanohttpd:2.3.0' -} -checkstyle { - toolVersion = "6.19" + checkstyleRules files('config/checkstyle/checkstyle.xml') + findbugsRules files('config/findbugs/exclude-filter.xml') + pmdRules files('config/pmd/pmd-ruleset.xml') } -task checkstyle(type: Checkstyle) { - configProperties.checkstyleSuppressionsPath = new File(rootDir, "app/config/checkstyle/suppressions.xml").absolutePath - source 'src' - include '**/*.java' - exclude '**/gen/**' - classpath = files() -} - -task findbugs(type: FindBugs, dependsOn: assembleDebug) { - ignoreFailures = false - effort = "max" - reportLevel = "high" - classes = files("${project.rootDir}/app/build/intermediates/classes") - excludeFilter = file("${project.rootDir}/app/config/findbugs/exclude-filter.xml") - - source 'src' - include '**/*.java' - exclude '**/gen/**' - - reports { - xml.enabled = false - html.enabled = true - xml { - destination "$project.buildDir/reports/findbugs/findbugs.xml" - } - html { - destination "$project.buildDir/reports/findbugs/findbugs.html" - } +soter { + checkstyle { + enabled true + toolVersion "6.19" } - classpath = files() -} - -task pmd(type: Pmd, dependsOn: assembleDebug) { - ignoreFailures = false - ruleSetFiles = files("${project.rootDir}/app/config/pmd/pmd-ruleset.xml") - ruleSets = [] - - source 'src' - include '**/*.java' - exclude '**/gen/**' + findbugs { + enabled true + effort = "max" + reportLevel "high" + reportType "html" + ignoreFailures false + } - reports { - xml.enabled = false - html.enabled = true - xml { - destination "$project.buildDir/reports/pmd/pmd.xml" - } - html { - destination "$project.buildDir/reports/pmd/pmd.html" - } + pmd { + enabled true + ignoreFailures false } } -check.dependsOn 'checkstyle', 'findbugs', 'lint', 'pmd' + +check.dependsOn 'lint' diff --git a/android/PhysicalWeb/app/config/checkstyle/checkstyle.xml b/android/PhysicalWeb/app/config/checkstyle/checkstyle.xml index c44bdb12..056de257 100644 --- a/android/PhysicalWeb/app/config/checkstyle/checkstyle.xml +++ b/android/PhysicalWeb/app/config/checkstyle/checkstyle.xml @@ -332,7 +332,8 @@ page at http://checkstyle.sourceforge.net/config.html --> - + + diff --git a/android/PhysicalWeb/build.gradle b/android/PhysicalWeb/build.gradle index 713420b5..de3b6b30 100644 --- a/android/PhysicalWeb/build.gradle +++ b/android/PhysicalWeb/build.gradle @@ -3,9 +3,13 @@ buildscript { repositories { jcenter() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'gradle.plugin.si.dlabs.gradle:soter:1.0.8' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files