aboutsummaryrefslogtreecommitdiff
path: root/build-logic/kotlin-plugins/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'build-logic/kotlin-plugins/src/main')
-rw-r--r--build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/KotlinCommonPlugin.kt15
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()