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

net.twisterrob.gradle.common.TaskCreationConfiguration.kt Maven / Gradle / Ivy

There is a newer version: 0.17
Show newest version
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