[3.4.0-map-sdk] update and new func of code quality

This commit is contained in:
zhongchao
2023-09-26 15:46:06 +08:00
parent 2343d61809
commit aebb330e89
5 changed files with 263 additions and 50 deletions

View File

@@ -0,0 +1,24 @@
task runCodeInspect {
group = "codeInspect"
description = "静态代码检查统一触发pmd detekt lint任务"
}
project.afterEvaluate {
bindTask("pmd", "runCodeInspect")
bindTask("detekt", "runCodeInspect")
}
/**
* 绑定任务
* @param taskName 任务名称
* @param targetTaskName 被绑定的任务名称
* @param action taskName指定的任务执行完成后的回调
*/
def bindTask(String taskName, String targetTaskName) {
def task = project.tasks.findByName(taskName)
if (task != null) {
logger.lifecycle("${task} will be run")
def targetTask = project.tasks.findByName(targetTaskName)
targetTask.finalizedBy(task)
}
}