1.8 KiB
Executable file
1.8 KiB
Executable file
Bld Extension to Perform Static Code Analysis with PMD
To check all source code using the java quickstart rule.
@BuildCommand
public void pmd() throws Exception {
new PmdOperation()
.fromProject(this)
.execute();
}
./bld pmd test
To check the main source directory using a custom rule, java error prone rule and failing on any violation.
@BuildCommand
public void pmdMain() throws Exception {
new PmdOperation()
.fromProject(this)
.failOnViolation(true)
.inputPaths(this.srcMainDirectory().toPath())
.ruleSets("config/pmd.xml", "category/java/errorprone.xml")
.execute();
}
./bld compile pmdMain
Please check the PmdOperation documentation for all available configuration options.