Skip to content

Update detekt #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ plugins {

// The kotlin-dsl plugin requires a repository to be declared
repositories {
jcenter()
mavenCentral()
google()
}

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand All @@ -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
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class StaticAnalysisPlugin : Plugin<Project> {

val linters = createLinters()

afterEvaluate {
beforeEvaluate {
linters.forEach { it.setupForProject(target, extensions.getByType()) }
}

Expand Down