-
Notifications
You must be signed in to change notification settings - Fork 70
/
checkstyle.gradle
25 lines (19 loc) · 787 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
apply plugin: "checkstyle"
def checkstyleConfigDir = new File(buildscript.sourceFile.parentFile, "checkstyle")
checkstyle {
configFile = new File(checkstyleConfigDir, "checkstyle.xml")
configProperties.checkstyleConfigDir = checkstyleConfigDir
}
plugins.withType(GroovyBasePlugin) {
sourceSets.all { sourceSet ->
task "${sourceSet.getTaskName("checkstyle", "groovy")}"(type: Checkstyle) {
configFile = new File(checkstyleConfigDir, "checkstyle-groovy.xml")
source sourceSet.allGroovy
classpath = sourceSet.compileClasspath
reports.xml.destination new File(checkstyle.reportsDir, "${sourceSet.name}-groovy.xml")
}
}
}
def checkstyleTasks = tasks.withType(Checkstyle)
task checkstyle(dependsOn: checkstyleTasks)
check.dependsOn checkstyleTasks