mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
Added checkstyle for main and test in Gradle configuration
This commit is contained in:
parent
cd8fc79d22
commit
0c5147e3bc
1 changed files with 16 additions and 0 deletions
16
build.gradle
16
build.gradle
|
@ -75,17 +75,33 @@ tasks.named('test') {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checkstyle configuration - html reports, main classes paths, do not allow http
|
||||||
checkstyle {
|
checkstyle {
|
||||||
configDirectory = project.file('src/checkstyle')
|
configDirectory = project.file('src/checkstyle')
|
||||||
configFile = file('src/checkstyle/nohttp-checkstyle.xml')
|
configFile = file('src/checkstyle/nohttp-checkstyle.xml')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkstyleMain {
|
||||||
|
source ='src/main/java'
|
||||||
|
}
|
||||||
|
checkstyleTest {
|
||||||
|
source ='src/test/java'
|
||||||
|
}
|
||||||
|
|
||||||
checkstyleNohttp {
|
checkstyleNohttp {
|
||||||
configDirectory = project.file('src/checkstyle')
|
configDirectory = project.file('src/checkstyle')
|
||||||
configFile = file('src/checkstyle/nohttp-checkstyle.xml')
|
configFile = file('src/checkstyle/nohttp-checkstyle.xml')
|
||||||
enabled = true
|
enabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(Checkstyle) {
|
||||||
|
reports {
|
||||||
|
xml.enabled false
|
||||||
|
html.enabled true
|
||||||
|
html.stylesheet resources.text.fromFile('config/xsl/checkstyle-custom.xsl')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.named("formatMain").configure { dependsOn("checkstyleMain") }
|
tasks.named("formatMain").configure { dependsOn("checkstyleMain") }
|
||||||
tasks.named("formatMain").configure { dependsOn("checkstyleNohttp") }
|
tasks.named("formatMain").configure { dependsOn("checkstyleNohttp") }
|
||||||
tasks.named("formatTest").configure { dependsOn("checkstyleTest") }
|
tasks.named("formatTest").configure { dependsOn("checkstyleTest") }
|
||||||
|
|
Loading…
Reference in a new issue