From b728cab15c72d9685dab2b8d45a90fa3015f4d90 Mon Sep 17 00:00:00 2001 From: Jan Vales Date: Sat, 26 Sep 2015 18:10:18 +0200 Subject: [PATCH] Added lint, checkstyle and findbugs reporting. --- app/build.gradle | 43 +++++++++- config/checkstyle/checkstyle.xml | 126 ++++++++++++++++++++++++++++ config/findbugs/findbugs-filter.xml | 10 +++ 3 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 config/checkstyle/checkstyle.xml create mode 100644 config/findbugs/findbugs-filter.xml diff --git a/app/build.gradle b/app/build.gradle index 2694265..1595260 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,8 @@ apply plugin: 'com.android.application' +apply plugin: 'checkstyle' +apply plugin: 'findbugs' + +check.dependsOn 'checkstyle', 'findbugs' android { compileSdkVersion 22 @@ -8,8 +12,8 @@ android { applicationId "org.somenet.android.helloworld2" minSdkVersion 19 targetSdkVersion 22 - versionCode 10 - versionName "2.1.2" + versionCode 12 + versionName "2.1.3a" } buildTypes { release { @@ -18,14 +22,45 @@ android { } } - if(new File("${System.properties['user.home']}/.android/release.gradle").exists()) { + if (new File("${System.properties['user.home']}/.android/release.gradle").exists()) { apply from: "${System.properties['user.home']}/.android/release.gradle"; - }else{ + } else { logger.warn('SigningConfig not found!') } + + lintOptions { + abortOnError false + } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.+' } + + +task checkstyle(type: Checkstyle) { + source 'src' + include '**/*.java' + exclude '**/gen/**' + classpath = files() + + configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml") +} + +task findbugs(type: FindBugs) { + source 'src' + include '**/*.java' + exclude '**/gen/**' + classpath = files() + + excludeFilter file("${project.rootDir}/config/findbugs/findbugs-filter.xml") + classes = files("${project.rootDir}/app/build/intermediates/classes/") + + ignoreFailures = true + + reports { + xml.enabled = true + html.enabled = false + } +} diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000..05d3c45 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/findbugs/findbugs-filter.xml b/config/findbugs/findbugs-filter.xml new file mode 100644 index 0000000..8b034a5 --- /dev/null +++ b/config/findbugs/findbugs-filter.xml @@ -0,0 +1,10 @@ + + + + + + + + + + -- 2.43.0