Skip to content

Commit

Permalink
Add detektAll task; original detekt task now doesn't depend on detekt…
Browse files Browse the repository at this point in the history
…Others
  • Loading branch information
anti-social committed Oct 8, 2021
1 parent 82a87d8 commit 820c458
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ allprojects {
}
}

tasks.register("listConfigurations") {
println("Available configurations:")
configurations.names.forEach { println("- $it") }
}

val detektConfig = "$rootDir/detekt.yml"
val detektOthers = tasks.register<io.gitlab.arturbosch.detekt.Detekt>("detektOthers") {
config.from(detektConfig)
Expand All @@ -107,7 +112,7 @@ allprojects {
"nativeTest/**/*.kt",
)
}
val detekt = tasks.getByName<io.gitlab.arturbosch.detekt.Detekt>("detekt") {
val detektJvm = tasks.getByName<io.gitlab.arturbosch.detekt.Detekt>("detekt") {
config.from(detektConfig)
source = fileTree("$projectDir/src").apply {
include(
Expand All @@ -123,10 +128,11 @@ allprojects {
configurations.getByName("jvmTestCompileClasspath"),
)
jvmTarget = Versions.jvmTarget.toString()

dependsOn(detektOthers)
}
tasks.getByName("check").dependsOn(detekt)
val detektAll = tasks.register("detektAll") {
dependsOn(detektJvm, detektOthers)
}
tasks.getByName("check").dependsOn(detektAll)
}
}

Expand Down

0 comments on commit 820c458

Please sign in to comment.