org.danilopianini.kotlinqa.KotlinQAExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-kotlin-qa Show documentation
Show all versions of gradle-kotlin-qa Show documentation
Automated Quality Assurance configuration for Kotlin Projects built with Gradle
package org.danilopianini.kotlinqa
import java.io.File
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.property
/**
* Gradle extension for the Kotlin QA Plugin.
*/
open class KotlinQAExtension(project: Project) {
/**
* The folder where the Detekt configuration will be generated.
*/
val workingDirectory: Property = project.objects.property().apply {
set(project.layout.buildDirectory.asFile.map { File(it, "kotlinqa") })
}
/**
* The name of the generated Detekt configuration file.
*/
val detektConfigurationFileName: Property = project.objects.property().apply {
set("detekt.yml")
}
/**
* The generated Detekt configuration file. Read only, use [workingDirectory] and [detektConfigurationFileName]
* to change the value of this property.
*/
val detektConfigurationFile: Provider = workingDirectory.flatMap { workDir ->
detektConfigurationFileName.map { fileName ->
project.file("${workDir.absolutePath}${slash}$fileName")
}
}
private companion object {
private val slash: String = File.separator
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy