Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 7.76 KB

File metadata and controls

41 lines (29 loc) · 7.76 KB

subkt / myaa.subkt.tasks / ItemGroupContext

ItemGroupContext

abstract class ItemGroupContext (source)

Context for defining groups of objects such as tasks.

Provides convenience functions for defining tasks and other objects for all entries associated with this context.

Constructors

Name Summary
<init> ItemGroupContext()
Context for defining groups of objects such as tasks.

Properties

Name Summary
entries abstract val entries: Provider<out Iterable<String>>
A list of entries (episodes or batches) this context should generate tasks for.
subs abstract val subs: Subs
The Subs instance all tasks created in this context should be associated with.
taskGroups abstract val taskGroups: MutableMap<String, TaskGroup<*>>
The map to store TaskGroup objects created in this context.

Functions

Name Summary
episodes abstract fun episodes(entry: String): List<String>
The episodes associated with entry.
invoke operator fun <T : Task> TaskGroup<T>.invoke(action: T.() -> Unit): Unit
Create and/or configure tasks of type T for all entries in entries.operator fun <T : Task> String.invoke(action: T.() -> Unit): TaskGroup<T>
Creates a new task group with the name given by the string the function is invoked on, or returns the task group with the given name if it already exists, and configures a task for each entry in the current context using the given closure.operator fun <T : Task> KClass<T>.invoke(action: T.() -> Unit): TaskCreator<T>
Returns a delegate that when accessed returns a task group with the same name as the property it is bound to. Also configures one task for each entry in the current context using the given closure.
isBatch abstract fun isBatch(entry: String): Boolean
True if entry corresponds to a batch entry.
provider fun <T> provider(action: ValueClosure<*>.() -> T): ProviderGroup<T>
Creates a ProviderGroup that evaluates the given closure lazily, returning a Provider when an item is requested for a given entry. The closure is evaluated by running Provider.get on the returned provider.
task fun <T : Task> task(name: String, klass: KClass<T>): TaskGroup<T>
Create a new task group, or returns the task group with the given name if it already exists.fun <T : Task> task(name: String, klass: KClass<T>, action: T.() -> Unit): TaskGroup<T>
fun <T : Task> task(name: String, action: T.() -> Unit): TaskGroup<T>
Creates a new task group, or returns the task group with the given name if it already exists, and configures a task for each entry in the current context using the given closure.fun <T : Task> task(name: String): TaskGroup<T>
Creates a new task group, or returns the task group with the given name if it already exists.fun <T : Task> task(action: (T.() -> Unit)? = null): TaskCreator<T>
Returns a delegate that when accessed returns a task group with the same name as the property it is bound to. Optionally configures one task for each entry in the current context using the given closure.
value fun <T> value(action: ValueClosure<*>.() -> T): ValueGroup<T>
Creates a ValueGroup, evaluating the given closure immediately for each entry in the given context.

Inheritors

Name Summary
Subs open class Subs : ItemGroupContext
Central object that keeps track of episodes, batches, tasks and user-loaded properties. For tasks to be generated correctly, episodes and optionally batches should be set. Set release if you wish to be able to differentiate between different releases when looking up properties.