Files
allwpilib/shared/java/javastyle.gradle
Austin Shalit 1e17e40868 [build] Add a javaFormat Gradle task (#2805)
This task allows developers to run all of the Java code quality tools at once.
2020-10-24 20:18:19 -07:00

26 lines
628 B
Groovy

apply plugin: 'checkstyle'
checkstyle {
toolVersion = "8.12"
configDirectory = file("${project.rootDir}/styleguide")
config = resources.text.fromFile(new File(configDirectory.get().getAsFile(), "checkstyle.xml"))
}
if (!project.hasProperty('skipPMD')) {
apply plugin: 'pmd'
pmd {
toolVersion = '6.7.0'
consoleOutput = true
reportsDir = file("$project.buildDir/reports/pmd")
ruleSetFiles = files(new File(rootDir, "styleguide/pmd-ruleset.xml"))
ruleSets = []
}
}
task javaFormat {
dependsOn(tasks.withType(Checkstyle))
dependsOn(tasks.withType(Pmd))
}