Skip to content

Commit 8cb9b68

Browse files
committed
fix(build): run detektAll during check
1 parent ca41775 commit 8cb9b68

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • build-plugin/plugin/src/main/kotlin/net/thunderbird/gradle/plugin/quality/detekt

build-plugin/plugin/src/main/kotlin/net/thunderbird/gradle/plugin/quality/detekt/DetektPlugin.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import org.gradle.api.Plugin
99
import org.gradle.api.Project
1010
import org.gradle.kotlin.dsl.assign
1111
import org.gradle.kotlin.dsl.dependencies
12+
import org.gradle.kotlin.dsl.named
13+
import org.gradle.kotlin.dsl.register
1214
import org.gradle.kotlin.dsl.withType
1315

1416
/**
@@ -19,6 +21,7 @@ import org.gradle.kotlin.dsl.withType
1921
class DetektPlugin : Plugin<Project> {
2022
override fun apply(target: Project) {
2123
with(target) {
24+
pluginManager.apply("base")
2225
pluginManager.apply("dev.detekt")
2326

2427
dependencies {
@@ -56,8 +59,6 @@ class DetektPlugin : Plugin<Project> {
5659
sarif.required.set(true)
5760
markdown.required.set(true)
5861
}
59-
60-
tasks.getByName("build").dependsOn(this)
6162
}
6263

6364
withType<DetektCreateBaselineTask>().configureEach {
@@ -70,12 +71,16 @@ class DetektPlugin : Plugin<Project> {
7071
exclude(defaultExcludes)
7172
}
7273

73-
register("detektAll") {
74+
val detektAll = register("detektAll") {
7475
group = "verification"
7576
description = "Runs detekt on this project"
7677

7778
dependsOn(tasks.withType<Detekt>())
7879
}
80+
81+
named("check") {
82+
dependsOn(detektAll)
83+
}
7984
}
8085
}
8186
}

0 commit comments

Comments
 (0)