File tree Expand file tree Collapse file tree
build-plugin/plugin/src/main/kotlin/net/thunderbird/gradle/plugin/quality/detekt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import org.gradle.api.Plugin
99import org.gradle.api.Project
1010import org.gradle.kotlin.dsl.assign
1111import org.gradle.kotlin.dsl.dependencies
12+ import org.gradle.kotlin.dsl.named
13+ import org.gradle.kotlin.dsl.register
1214import org.gradle.kotlin.dsl.withType
1315
1416/* *
@@ -19,6 +21,7 @@ import org.gradle.kotlin.dsl.withType
1921class 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}
You can’t perform that action at this time.
0 commit comments