From 5e8e00561dfbe486d4a61fe86755687105c66102 Mon Sep 17 00:00:00 2001 From: Cameron Mace Date: Thu, 1 Sep 2016 10:21:49 -0400 Subject: [PATCH] [android] introduce checkstyle (#6214) --- .../android/MapboxGLAndroidSDK/build.gradle | 5 - platform/android/build.gradle | 2 + platform/android/checks.xml | 185 --------------- platform/android/checkstyle.gradle | 16 ++ platform/android/checkstyle.xml | 217 ++++++++++++++++++ 5 files changed, 235 insertions(+), 190 deletions(-) delete mode 100644 platform/android/checks.xml create mode 100644 platform/android/checkstyle.gradle create mode 100644 platform/android/checkstyle.xml diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index fff80e5b6..7c76e0227 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -102,11 +102,6 @@ android.libraryVariants.all { variant -> } } -checkstyle { - configFile project.file('../checks.xml') - showViolations true -} - /* task cleanJNIBuilds { def jniLibsDir = new File("MapboxGLAndroidSDK/src/main/jniLibs") diff --git a/platform/android/build.gradle b/platform/android/build.gradle index 644986a74..aed761c83 100644 --- a/platform/android/build.gradle +++ b/platform/android/build.gradle @@ -18,6 +18,8 @@ allprojects { } } +apply from: 'checkstyle.gradle' + task wrapper(type: Wrapper) { gradleVersion = '2.14.1' } diff --git a/platform/android/checks.xml b/platform/android/checks.xml deleted file mode 100644 index 0ee271678..000000000 --- a/platform/android/checks.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/platform/android/checkstyle.gradle b/platform/android/checkstyle.gradle new file mode 100644 index 000000000..69f7f41ff --- /dev/null +++ b/platform/android/checkstyle.gradle @@ -0,0 +1,16 @@ +apply plugin: 'checkstyle' + +checkstyle.toolVersion = '7.1' + +task checkstyle(type: Checkstyle) { + description 'Checks if the code adheres to coding standards' + group 'verification' + + configFile = new File(rootDir, "checkstyle.xml") + source 'src' + include '**/*.java' + exclude '**/gen/**' + + classpath = files() + ignoreFailures = false +} diff --git a/platform/android/checkstyle.xml b/platform/android/checkstyle.xml new file mode 100644 index 000000000..3b4fba7b2 --- /dev/null +++ b/platform/android/checkstyle.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +