invoke

operator fun <T> Action<in T>.invoke(target: T)

Enables function invocation syntax on Action references.


operator fun ArtifactHandler.invoke(configuration: ArtifactHandlerScope.() -> Unit)

Configures the published artifacts for this project.

Since

5.1


operator fun <V> Callable<V>.invoke(): V

Enables function invocation syntax on Callable references.

See also


operator fun <D : ModuleDependency> DependencyModifier.invoke(dependency: D): D

Modifies a dependency to select the variant of the given module.

Since

8.0

See also


operator fun DependencyAdder.invoke(dependencyNotation: CharSequence)

Add a dependency.

Since

8.0

Parameters

dependencyNotation

dependency to add

See also

DependencyFactory.create

operator fun DependencyAdder.invoke(dependencyNotation: CharSequence, configuration: Action<in ExternalModuleDependency>)

Add a dependency.

Since

8.0

Parameters

dependencyNotation

dependency to add

configuration

an action to configure the dependency

See also

DependencyFactory.create

Add a dependency.

Since

8.0

Parameters

files

files to add as a dependency


operator fun DependencyAdder.invoke(files: FileCollection, configuration: Action<in FileCollectionDependency>)

Add a dependency.

Since

8.0

Parameters

files

files to add as a dependency

configuration

an action to configure the dependency


Add a dependency.

Since

8.0

Parameters

externalModule

external module to add as a dependency


Add a dependency.

Since

8.0

Parameters

externalModule

external module to add as a dependency

configuration

an action to configure the dependency


operator fun DependencyAdder.invoke(dependency: Dependency)
operator fun DependencyAdder.invoke(dependency: Provider<out Dependency>)

Add a dependency.

Since

8.0

Parameters

dependency

dependency to add


operator fun <D : Dependency> DependencyAdder.invoke(dependency: D, configuration: Action<in D>)
operator fun <D : Dependency> DependencyAdder.invoke(dependency: Provider<out D>, configuration: Action<in D>)

Add a dependency.

Since

8.0

Parameters

dependency

dependency to add

configuration

an action to configure the dependency


Configures the dependency constraints.

Since

5.0


inline operator fun <T> ExtraPropertiesExtension.invoke(initialValueProvider: () -> T): InitialValueExtraPropertyDelegateProvider<T>

Returns a property delegate provider that will initialize the extra property to the value provided by initialValueProvider.

Usage: val answer by extra { 42 }


Returns a property delegate provider that will initialize the extra property to the given initialValue.

Usage: val answer by extra(42)


operator fun <T> Closure<T>.invoke(): T
operator fun <T> Closure<T>.invoke(x: Any?): T
operator fun <T> Closure<T>.invoke(vararg xs: Any?): T

Enables function invocation syntax on Closure references.


inline operator fun <T : Any, C : NamedDomainObjectContainer<T>> C.invoke(configuration: Action<NamedDomainObjectContainerScope<T>>): C

Allows the container to be configured via an augmented DSL.

Return

The container.

Parameters

configuration

The expression to configure this container with


operator fun <T> NamedDomainObjectProvider<T>.invoke(action: T.() -> Unit)

Allows a NamedDomainObjectProvider to be configured via invocation syntax.

val rebuild by tasks.registering
rebuild { // rebuild.configure {
dependsOn("clean")
}

operator fun <T> Spec<T>.invoke(arg: T): Boolean

Enables function invocation syntax on Spec instances.

See also

Spec.isSatisfiedBy

inline operator fun TaskContainer.invoke(configuration: TaskContainerScope.() -> Unit): TaskContainer

Allows a TaskContainer to be configured via an augmented DSL that includes a shorthand string notation for configuring existing tasks.

tasks {
"build" {
dependsOn("clean")
}
"clean"(Delete::class) {
delete("./build")
}
}

Return

The given TaskContainer.

Parameters

configuration

The expression to configure this TaskContainer with.