blob: 2e7c512c1e584ec190a513449bebb90bb5317f62 [file] [log] [blame]
apply plugin: 'checkstyle'
checkstyle {
configFile rootProject.file('checkstyle.xml')
showViolations true
}
android.libraryVariants.all { variant ->
def name = variant.buildType.name
def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle
checkstyle.dependsOn variant.javaCompile
checkstyle.source variant.javaCompile.source
checkstyle.classpath = project.fileTree(variant.javaCompile.destinationDir)
checkstyle.exclude('**/BuildConfig.java')
checkstyle.exclude('**/R.java')
project.tasks.getByName("check").dependsOn checkstyle
}