diff -r fef46dce2812 -r 831cffa9c991 config/android-checkstyle.gradle --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/android-checkstyle.gradle Fri May 08 21:33:19 2020 -0400 @@ -0,0 +1,28 @@ +apply plugin: 'checkstyle' +check.dependsOn 'checkstyle' + +checkstyle { + toolVersion = '6.19' +} + +task checkstyle(type: Checkstyle) { + description = "Check Java style with Checkstyle" + configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml") + source = javaSources() + classpath = files() + ignoreFailures = true +} + +def javaSources() { + def files = [] + android.sourceSets.each { sourceSet -> + sourceSet.java.each { javaSource -> + javaSource.getSrcDirs().each { + if (it.exists()) { + files.add(it) + } + } + } + } + return files +}