[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

@@ -1,53 +1,40 @@
plugins {
id("io.gitlab.arturbosch.detekt") version "1.15.0"
}
//apply plugin: 'io.gitlab.arturbosch.detekt'
def pmdConfigPath = rootProject.file("codequality").path
detekt{
//将配置文件应用于detekt的默认配置文件之上
buildUponDefaultConfig = true
source = files(
"src/main/kotlin",
"src/main/java",
"src/jinlvvan/java",
"src/jinlvvan/kotlin",
"src/driverm1/java",
"src/driverm1/kotlin"
)
//规则集
config.setFrom("${pmdConfigPath}/detekt.yml")
//指定基准文件。在detekt的后续运行中所有发现都存储在此文件中
baseline = files("${pmdConfigPath}/baseline.xml")
//指定格式化报告中文件路径的基本路径
basePath = projectDir.path
//detekt {
// //将配置文件应用于detekt的默认配置文件之上
// buildUponDefaultConfig = true
// source = files(
// "src/main/kotlin",
// "src/main/java",
// "src/jinlvvan/java",
// "src/jinlvvan/kotlin",
// "src/driverm1/java",
// "src/driverm1/kotlin"
// )
// //规则集
// config.setFrom("${pmdConfigPath}/detekt.yml")
// //指定基准文件。在detekt的后续运行中所有发现都存储在此文件中
// baseline = files("${pmdConfigPath}/baseline.xml")
// //指定格式化报告中文件路径的基本路径
// basePath = projectDir.path
//
// // Android: Don't create tasks for the specified build types (e.g. "release")
//// ignoredBuildTypes = ["release"]
// // Android: Don't create tasks for the specified build flavor (e.g. "production")
//// ignoredFlavors = ["production"]
// // Android: Don't create tasks for the specified build variants (e.g. "productionRelease")
//// ignoredVariants = ["productionRelease"]
//}
// Android: Don't create tasks for the specified build types (e.g. "release")
// ignoredBuildTypes = ["release"]
// Android: Don't create tasks for the specified build flavor (e.g. "production")
// ignoredFlavors = ["production"]
// Android: Don't create tasks for the specified build variants (e.g. "productionRelease")
// ignoredVariants = ["productionRelease"]
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0"
}
tasks.detekt.jvmTarget = "1.8"
tasks.named("detekt").configure {
reports {
// Enable/Disable HTML report (default: true)
def destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.html")
html.required.set(true)
html.outputLocation.set(destination)
}
}
project.afterEvaluate {
if (tasks.findByName("preBuild") != null) {
project.preBuild.dependsOn tasks.findByName("detekt")
println("project.preBuild.dependsOn tasks.findByName(\"detekt\")")
}
}
//tasks.detekt.jvmTarget = "1.8"
//
//tasks.named("detekt").configure {
// reports {
// // Enable/Disable HTML report (default: true)
// def destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.html")
// html.required.set(true)
// html.outputLocation.set(destination)
// }
//}