All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.twisterrob.gradle.quality.QualityExtension.kt Maven / Gradle / Ivy

The newest version!
package net.twisterrob.gradle.quality

import net.twisterrob.gradle.checkstyle.CheckStyleExtension
import net.twisterrob.gradle.pmd.PmdExtension
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.ExtensionContainer
import org.gradle.kotlin.dsl.getByType

@Suppress("detekt.UnnecessaryAbstractClass") // Gradle convention.
abstract class QualityExtension(
	val project: Project
) {

	private val extensions: ExtensionContainer
		get() = (this as ExtensionAware).extensions

	fun checkstyle(closure: Action) {
		closure.execute(extensions.getByType())
	}

	fun pmd(closure: Action) {
		closure.execute(extensions.getByType())
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy