io.github.tassiluca.scalaextras.ScalaExtrasExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-scala-extras Show documentation
Show all versions of gradle-scala-extras Show documentation
A plugin to enhance the Scala gradle core plugin with quality assurance tools
package io.github.tassiluca.scalaextras
import org.gradle.api.Project
import org.gradle.api.provider.Property
/**
* The plugin extension.
* @param project the project to apply the extension to.
*/
open class ScalaExtrasExtension(private val project: Project) {
internal val qa = QAExtension()
internal var options: Set = emptySet()
/** The set of additional compiler options. */
fun additionalCompilerOptions(options: Set) {
this.options = options
}
/** DSL entry point for quality assurance configurations. */
fun qa(apply: QAExtension.() -> Unit) = qa.apply()
/** The quality assurance extension. */
inner class QAExtension {
internal val scalafmtConfiguration = ScalafmtConfiguration(project)
internal val scalafixConfiguration = ScalafixConfiguration(project)
/** Whether to treat all warnings as errors. */
val allWarningsAsErrors: Property = project.objects.property(Boolean::class.java)
.apply { convention(true) }
/** DSL entry point for scalafmt configuration. */
fun scalafmt(apply: ScalafmtConfiguration.() -> Unit) {
scalafmtConfiguration.apply()
}
/** DSL entry point for scalafix configuration. */
fun scalafix(apply: ScalafixConfiguration.() -> Unit) {
scalafixConfiguration.apply()
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy