Files
MoGoEagleEye/codequality/pmd.gradle
2023-09-18 19:01:52 +08:00

25 lines
854 B
Groovy
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
apply plugin: "pmd"
def pmdConfigPath = rootProject.file("codequality").path
task pmd(type:Pmd){
//忽略失败如果设置为true检测出bug会停止task
ignoreFailures = false
consoleOutput = true
//filter路径
ruleSetFiles = files("${pmdConfigPath}/custom-pmd-ruleset.xml") // todo 新增rules
ruleSets = []
//检测资源路径
source 'src/main/java','src/jinlvvan/java','src/driverm1/java'
//排除项
exclude '**/gen/**'
reports {
xml.getRequired().set(false)
html.getRequired().set(true)
//结果输出到项目根目录下的 build/reports/pmd 文件夹中只需要html格式的结果文档
def destination = new File(new File("${project.rootProject.buildDir.path}/reports/pmd"), "${project.name}-pmd.html")
html.destination(destination)
}
}