[3.4.0-map-sdk] update and new func of code quality
This commit is contained in:
24
codequality/code_inspect.gradle
Normal file
24
codequality/code_inspect.gradle
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user