From c89bd732b2d322e71b9bb5dbc60ea918d5bef1c7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 28 Mar 2019 01:14:55 +0100 Subject: [PATCH] Correctly apply checkstyle plugin --- app/build.gradle | 15 +++++++++++++++ build.gradle | 7 ------- config/{ => checkstyle}/checkstyle.xml | 0 3 files changed, 15 insertions(+), 7 deletions(-) rename config/{ => checkstyle}/checkstyle.xml (100%) diff --git a/app/build.gradle b/app/build.gradle index 04e587a..233df83 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'checkstyle' android { compileSdkVersion 27 @@ -24,6 +25,20 @@ android { } } +task checkstyle(type: Checkstyle) { + configFile = rootProject.file('config/checkstyle/checkstyle.xml') + + source 'src/main/java' + include '**/*.java' + exclude '**/gen/**' + + classpath = files() +} + +checkstyle { + toolVersion = '8.17' +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.1' diff --git a/build.gradle b/build.gradle index e0a5a3d..51a8a52 100644 --- a/build.gradle +++ b/build.gradle @@ -29,13 +29,6 @@ allprojects { url 'https://igniterealtime.org/repo/' } } - - apply plugin: 'checkstyle' - - checkstyle { - configFile = new File(rootConfigDir, 'checkstyle.xml') - toolVersion = '8.10' - } } task clean(type: Delete) { diff --git a/config/checkstyle.xml b/config/checkstyle/checkstyle.xml similarity index 100% rename from config/checkstyle.xml rename to config/checkstyle/checkstyle.xml