From d1bdd60a9c15517b3d7a4866832af020814b244a Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 23 Mar 2018 17:07:44 -0500 Subject: [PATCH] Add checkstyle task with google_checks --- app/build.gradle | 21 ++++ app/google_checks.xml | 240 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 261 insertions(+) create mode 100644 app/google_checks.xml diff --git a/app/build.gradle b/app/build.gradle index 819765113..17800280d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'checkstyle' task wrapper(type: Wrapper) { gradleVersion = '4.6' @@ -82,6 +83,26 @@ android { } } +task checkstyle(type: Checkstyle) { + source fileTree('src/main/java') + include '**/*.java' + exclude '**/gen/**' + + classpath = files() + showViolations true + + reports { + xml.enabled = true + html.enabled = true + html.destination = "$project.buildDir/reports/checkstyle/checkstyle.html" + } +} + +checkstyle { + configFile project.file('google_checks.xml') + toolVersion = '8.8' +} + configurations { all*.exclude group: 'com.google.guava', module: 'guava-jdk5' all*.exclude group: 'org.apache.httpcomponents', module: 'httpclient' diff --git a/app/google_checks.xml b/app/google_checks.xml new file mode 100644 index 000000000..04286da6e --- /dev/null +++ b/app/google_checks.xml @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +