summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2024-07-14 23:50:34 +0200
committerJoel Klinghed <the_jk@spawned.biz>2024-07-14 23:50:34 +0200
commit6d2393f01054dd01a4bec01b8222386f4218d54a (patch)
tree8cd0f9b11b8be281070ba46c26164c3874719dd6
parent47d3bf13023b3d62ef4530d439c3bd3e1d2baf9e (diff)
Add and configure detekt gradle plugin
Useful when you want to check without AS.
-rw-r--r--app/build.gradle.kts12
-rw-r--r--gradle.properties2
-rw-r--r--gradle/libs.versions.toml1
3 files changed, 15 insertions, 0 deletions
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index f28bc23..782a01b 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.android.application)
+ alias(libs.plugins.arturbosch.detekt)
alias(libs.plugins.jetbrains.kotlin.android)
}
@@ -53,3 +54,14 @@ dependencies {
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
+
+detekt {
+ config.setFrom(rootProject.file("detekt.yaml"))
+}
+
+tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
+ this.jvmTarget = "1.8"
+}
+tasks.withType<io.gitlab.arturbosch.detekt.DetektCreateBaselineTask>().configureEach {
+ this.jvmTarget = "1.8"
+}
diff --git a/gradle.properties b/gradle.properties
index 27ad9bf..6c73fc4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -25,3 +25,5 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
+
+detekt.use.worker.api=true
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index e04d556..6d4c9d2 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -29,5 +29,6 @@ truth = { group = "com.google.truth", name = "truth", version = "1.4.3" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
+arturbosch-detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.3" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }