net.twisterrob.gradle.common.TaskCreationConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twister-quality-common Show documentation
Show all versions of twister-quality-common Show documentation
Shared classes between checkers. (Not to be consumed directly.)
package net.twisterrob.gradle.common
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.register
interface TaskCreationConfiguration {
fun preConfigure(project: Project, taskProvider: TaskProvider)
fun configure(task: T)
}
inline fun Project.registerTask(
name: String,
configuration: TaskCreationConfiguration
): TaskProvider {
val provider = this.tasks.register(name) {
configuration.configure(this)
}
configuration.preConfigure(this, provider)
return provider
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy