io.appmetrica.gradle.aarcheck.tasks.TaskManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aar-check Show documentation
Show all versions of aar-check Show documentation
Provides plugin for check aar
The newest version!
package io.appmetrica.gradle.aarcheck.tasks
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.TaskProvider
import kotlin.reflect.KClass
class TaskManager(private val project: Project) {
companion object {
const val GROUP_NAME = "aar check"
}
fun registerIfNotExists(name: String, createAction: TaskProvider.() -> Unit = {}): TaskProvider {
return if (name in project.tasks.names) {
project.tasks.named(name)
} else {
register(name).also(createAction)
}
}
inline fun register(name: String, noinline configuration: T.() -> Unit = {}): TaskProvider =
register(name, T::class, configuration)
fun register(name: String, type: KClass, configuration: T.() -> Unit = {}): TaskProvider =
project.tasks.register(name, type.java) {
group = GROUP_NAME
configuration()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy