Skip to content

Instantly share code, notes, and snippets.

@kyonmm
Created May 13, 2011 03:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyonmm/3759ceb96323c4c1e09e to your computer and use it in GitHub Desktop.
Save kyonmm/3759ceb96323c4c1e09e to your computer and use it in GitHub Desktop.
PMD for Gradle
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