-
-
Save kyonmm/3759ceb96323c4c1e09e to your computer and use it in GitHub Desktop.
PMD for Gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurations { | |
pmdConf | |
} | |
task pmd << { | |
println 'Running PMD static code analysis' | |
ant { | |
taskdef(name:'pmd', classname:'net.sourceforge.pmd.ant.PMDTask', classpath: configurations.pmdConf.asPath) | |
pmd(shortFilenames:'true', failonruleviolation:'true', rulesetfiles:'rulesets/favorites.xml') { | |
formatter(type:'text', toConsole:'true') | |
println sourceSets.main.java.dump() | |
fileset(dir: "src") { | |
include(name: '**/*.java') | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment