[3.4.0-map-sdk] add pmd rule set

This commit is contained in:
zhongchao
2023-09-18 19:01:52 +08:00
parent e374bf37a6
commit 51f38ae919
3 changed files with 68 additions and 2 deletions

View File

@@ -1 +1,25 @@
//apply plugin:"pmd"
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)
}
}