From 3dd35d082d9bf462e78cde46a84d70b9b9ea3d8f Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 26 Sep 2023 18:41:45 +0800 Subject: [PATCH] [6.1.0] fix bug of detekt --- codequality/detekt.gradle | 67 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/codequality/detekt.gradle b/codequality/detekt.gradle index 196d02a2ba..dffe686e12 100644 --- a/codequality/detekt.gradle +++ b/codequality/detekt.gradle @@ -1,40 +1,39 @@ -//apply plugin: 'io.gitlab.arturbosch.detekt' +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 -// -// // 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"] -//} +detekt { + toolVersion = "1.15.0" + input = objects.fileCollection().from( + "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 = file("${pmdConfigPath}/baseline.xml") + //将配置文件应用于detekt的默认配置文件之上 + buildUponDefaultConfig = true -//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") + // 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"] +} + +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) -// } -//} + } +}