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
|
// The kotlin-dsl plugin requires a repository to be declared
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ dependencies {
|
||||||
// android gradle plugin, required by custom plugin
|
// android gradle plugin, required by custom plugin
|
||||||
implementation("com.android.tools.build:gradle:4.0.1")
|
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")
|
implementation("de.aaschmid:gradle-cpd-plugin:3.1")
|
||||||
|
|
||||||
// kotlin plugin, required by custom plugin
|
// 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"))
|
config.setFrom(project.files("${extension.buildScriptDir!!}/static_analysis_configs/detekt-config.yml"))
|
||||||
reports {
|
reports {
|
||||||
txt.enabled = false
|
txt.required.set(false)
|
||||||
html.enabled = false
|
html.required.set(false)
|
||||||
xml {
|
xml {
|
||||||
enabled = true
|
required.set(true)
|
||||||
destination = project.getDetektReportFile()
|
outputLocation.set(project.getDetektReportFile())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import static_analysis.linters.AndroidLinter
|
||||||
import static_analysis.linters.CpdLinter
|
import static_analysis.linters.CpdLinter
|
||||||
import static_analysis.linters.DetektLinter
|
import static_analysis.linters.DetektLinter
|
||||||
import static_analysis.linters.Linter
|
import static_analysis.linters.Linter
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
||||||
|
|
||||||
|
|
@ -24,7 +25,7 @@ class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
||||||
project.tasks.register("staticAnalysis") {
|
project.tasks.register("staticAnalysis") {
|
||||||
setupStaticAnalysisTask(
|
setupStaticAnalysisTask(
|
||||||
linters = linters,
|
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()
|
val linters = createLinters()
|
||||||
|
|
||||||
afterEvaluate {
|
beforeEvaluate {
|
||||||
linters.forEach { it.setupForProject(target, extensions.getByType()) }
|
linters.forEach { it.setupForProject(target, extensions.getByType()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue