Skip to content

Latest commit

 

History

History
85 lines (56 loc) · 4.49 KB

File metadata and controls

85 lines (56 loc) · 4.49 KB

subkt / myaa.subkt.tasks / ItemGroupContext / task

task

fun <T : Task> task(name: String, klass: KClass<T>): TaskGroup<T> (source)

Create a new task group, or returns the task group with the given name if it already exists.

val copyTaskGroup = task("copy", SubCopy::class)

Parameters

name - The name of the task group.

klass - The type of task associated with the task group.fun <T : Task> task(name: String, klass: KClass<T>, action: T.() -> Unit): TaskGroup<T> (source)

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.

task("copy", SubCopy::class) {
    from(mux.item())
    into("downloads")
}

Parameters

name - The name of the task group.

klass - The type of task associated with the task group.

action - A closure operating on a Task. Called once for each entry in the current context.inline fun <reified T : Task> task(name: String): TaskGroup<T> (source)

Creates a new task group, or returns the task group with the given name if it already exists.

val copyTaskGroup = task<SubCopy>("copy")

Parameters

name - The name of the task group.

T - The type of task associated with the task group.inline fun <reified T : Task> task(name: String, noinline action: T.() -> Unit): TaskGroup<T> (source)

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.

task<SubCopy>("copy") {
    from(mux.item())
    into("downloads")
}

Parameters

name - The name of the task group.

T - The type of task associated with the task group.

action - A closure operating on a Task. Called once for each entry in the current context.inline fun <reified T : Task> task(noinline action: (T.() -> Unit)? = null): TaskCreator<T> (source)

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.

val copy by task<SubCopy> {
    from(mux.item())
    into("downloads")
}

Parameters

T - The type of task associated with the task group.

action - A closure operating on a Task. Called once for each entry in the current context.