diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-07-17 00:55:12 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2022-07-17 13:56:54 +0530 |
commit | c2faeffd840aaf3eec138e79151576f010a24f29 (patch) | |
tree | 4b79c7e9b34b6e6abd72cfe2cd767c4d2fbf961b /build-logic/kotlin-plugins/src | |
parent | 6ceedc049c1ca3cd2d18a612e96140d0d58f257e (diff) |
detekt: init
Diffstat (limited to 'build-logic/kotlin-plugins/src')
-rw-r--r-- | build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt b/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt index 50d67e52..7327e8af 100644 --- a/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt +++ b/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt @@ -5,12 +5,15 @@ package app.passwordstore.gradle +import io.gitlab.arturbosch.detekt.DetektPlugin +import io.gitlab.arturbosch.detekt.extensions.DetektExtension import org.gradle.api.JavaVersion import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.compile.JavaCompile 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.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -18,6 +21,18 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile class KotlinCommonPlugin : Plugin<Project> { override fun apply(project: Project) { + project.pluginManager.apply(DetektPlugin::class.java) + project.extensions.configure<DetektExtension> { + parallel = true + ignoredBuildTypes = listOf("release") + ignoredFlavors = listOf("free") + basePath = project.layout.projectDirectory.toString() + baseline = + project.rootProject.layout.projectDirectory + .dir("detekt-baselines") + .file("${project.name}.xml") + .asFile + } project.tasks.run { withType<JavaCompile>().configureEach { sourceCompatibility = JavaVersion.VERSION_11.toString() |