gradle: add detekt as a dependency to the check task

This commit is contained in:
Harsh Shandilya 2022-07-17 13:54:06 +05:30
parent 584670ae5b
commit af362dd6e3
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -15,6 +15,7 @@ import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType
import org.gradle.language.base.plugins.LifecycleBasePlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@Suppress("Unused")
@ -34,6 +35,9 @@ class KotlinCommonPlugin : Plugin<Project> {
.asFile
}
project.tasks.run {
project.pluginManager.withPlugin("base") {
named(LifecycleBasePlugin.CHECK_TASK_NAME).configure { this.dependsOn(named("detekt")) }
}
withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()