forked from sephiroth74/ImageViewZoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkstyle.gradle
26 lines (22 loc) · 877 Bytes
/
checkstyle.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
apply plugin: 'checkstyle'
checkstyle {
toolVersion '6.8'
configFile rootProject.file('gradle/checkstyle.xml')
showViolations true
configProperties = [
'checkstyle.cache.file': rootProject.file('build/checkstyle.cache'),
]
}
def variants = (project.plugins.hasPlugin('android-library') ?
project.android.libraryVariants :
project.android.applicationVariants)
variants.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
}