Compare commits
2 Commits
master
...
update_det
| Author | SHA1 | Date |
|---|---|---|
|
|
876555fb19 | |
|
|
55d18e8e6e |
|
|
@ -7,7 +7,7 @@ plugins {
|
|||
|
||||
// The kotlin-dsl plugin requires a repository to be declared
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ dependencies {
|
|||
// android gradle plugin, required by custom plugin
|
||||
implementation("com.android.tools.build:gradle:4.0.1")
|
||||
|
||||
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.10.0")
|
||||
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0")
|
||||
implementation("de.aaschmid:gradle-cpd-plugin:3.1")
|
||||
|
||||
// kotlin plugin, required by custom plugin
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ class DetektLinter : Linter {
|
|||
|
||||
config.setFrom(project.files("${extension.buildScriptDir!!}/static_analysis_configs/detekt-config.yml"))
|
||||
reports {
|
||||
txt.enabled = false
|
||||
html.enabled = false
|
||||
txt.required.set(false)
|
||||
html.required.set(false)
|
||||
xml {
|
||||
enabled = true
|
||||
destination = project.getDetektReportFile()
|
||||
required.set(true)
|
||||
outputLocation.set(project.getDetektReportFile())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import static_analysis.linters.AndroidLinter
|
|||
import static_analysis.linters.CpdLinter
|
||||
import static_analysis.linters.DetektLinter
|
||||
import static_analysis.linters.Linter
|
||||
import java.util.Locale
|
||||
|
||||
class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
|||
project.tasks.register("staticAnalysis") {
|
||||
setupStaticAnalysisTask(
|
||||
linters = linters,
|
||||
buildVariant = applicationVariants.first { it.name.contains("Debug") }.name
|
||||
buildVariant = applicationVariants.first { it.name.toLowerCase(Locale.ROOT).contains("debug") }.name
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ abstract class StaticAnalysisPlugin : Plugin<Project> {
|
|||
|
||||
val linters = createLinters()
|
||||
|
||||
afterEvaluate {
|
||||
beforeEvaluate {
|
||||
linters.forEach { it.setupForProject(target, extensions.getByType()) }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue