# invoke

operator fun <T : Any> ERROR CLASS: Symbol not found for Action<in T>.invoke(target: T): ERROR CLASS: Unresolved name: execute(source)

Enables function invocation syntax on Action references.

operator fun ERROR CLASS: Symbol not found for ArtifactHandler.invoke(configuration: ArtifactHandlerScope.() -> Unit)(source)

Configures the published artifacts for this project.

#### Since

5.1

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

Enables function invocation syntax on Callable references.

#### See also

Callable.call

inline operator fun ERROR CLASS: Symbol not found for ConfigurationContainer.invoke(configuration: ERROR CLASS: Symbol not found for Action<org/gradle/kotlin/dsl/ConfigurationContainerScope>): ERROR CLASS: Symbol not found for ConfigurationContainer(source)

Allows the container to be configured via an augmented DSL.

#### Return

The container.

#### Since

8.4

#### Parameters

configuration

The expression to configure this container with

operator fun <D : ERROR CLASS: Symbol not found for ModuleDependency> ERROR CLASS: Symbol not found for DependencyModifier.invoke(dependency: D): D(source)
operator fun ERROR CLASS: Symbol not found for DependencyModifier.invoke(dependencyNotation: CharSequence): ERROR CLASS: Symbol not found for ExternalModuleDependency(source)
operator fun ERROR CLASS: Symbol not found for DependencyModifier.invoke(dependency: ERROR CLASS: Symbol not found for ProviderConvertible<out ERROR CLASS: Symbol not found for MinimalExternalModuleDependency>): ERROR CLASS: Symbol not found for Provider<out ERROR CLASS: Symbol not found for MinimalExternalModuleDependency>(source)
operator fun ERROR CLASS: Symbol not found for DependencyModifier.invoke(dependency: ERROR CLASS: Symbol not found for Provider<out ERROR CLASS: Symbol not found for ModuleDependency>): ERROR CLASS: Symbol not found for Provider<out ERROR CLASS: Symbol not found for ModuleDependency>(source)

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

#### Since

8.0

#### See also

DependencyModifier

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependencyNotation: CharSequence): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

dependencyNotation

dependency to add

#### See also

DependencyFactory.create

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependencyNotation: CharSequence, configuration: ERROR CLASS: Symbol not found for Action<in ERROR CLASS: Symbol not found for ExternalModuleDependency>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

dependencyNotation

dependency to add

configuration

an action to configure the dependency

#### See also

DependencyFactory.create

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(files: ERROR CLASS: Symbol not found for FileCollection): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

files

files to add as a dependency

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(files: ERROR CLASS: Symbol not found for FileCollection, configuration: ERROR CLASS: Symbol not found for Action<in ERROR CLASS: Symbol not found for FileCollectionDependency>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

files

files to add as a dependency

configuration

an action to configure the dependency

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(externalModule: ERROR CLASS: Symbol not found for ProviderConvertible<out ERROR CLASS: Symbol not found for MinimalExternalModuleDependency>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

externalModule

external module to add as a dependency

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(externalModule: ERROR CLASS: Symbol not found for ProviderConvertible<out ERROR CLASS: Symbol not found for MinimalExternalModuleDependency>, configuration: ERROR CLASS: Symbol not found for Action<in ERROR CLASS: Symbol not found for ExternalModuleDependency>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

externalModule

external module to add as a dependency

configuration

an action to configure the dependency

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependency: ERROR CLASS: Symbol not found for Dependency): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)
operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependency: ERROR CLASS: Symbol not found for Provider<out ERROR CLASS: Symbol not found for Dependency>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

dependency

dependency to add

operator fun <D : ERROR CLASS: Symbol not found for Dependency> ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependency: D, configuration: ERROR CLASS: Symbol not found for Action<in D>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)
operator fun <D : ERROR CLASS: Symbol not found for Dependency> ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependency: ERROR CLASS: Symbol not found for Provider<out D>, configuration: ERROR CLASS: Symbol not found for Action<in D>): ERROR CLASS: Ambiguity: add, [org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add, org/gradle/kotlin/dsl/add](source)

Add a dependency.

#### Since

8.6

#### Parameters

dependency

dependency to add

configuration

an action to configure the dependency

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependencyConstraint: ERROR CLASS: Symbol not found for DependencyConstraint): ERROR CLASS: Unresolved name: addConstraint(source)
@JvmName(name = "invokeConstraint")
operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependencyConstraint: ERROR CLASS: Symbol not found for Provider<out ERROR CLASS: Symbol not found for DependencyConstraint>): ERROR CLASS: Unresolved name: addConstraint(source)

Add a dependency constraint.

#### Since

8.7

#### Parameters

dependencyConstraint

dependency constraint to add

operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependencyConstraint: ERROR CLASS: Symbol not found for DependencyConstraint, configuration: ERROR CLASS: Symbol not found for Action<in ERROR CLASS: Symbol not found for DependencyConstraint>): ERROR CLASS: Unresolved name: addConstraint(source)
@JvmName(name = "invokeConstraint")
operator fun ERROR CLASS: Symbol not found for DependencyCollector.invoke(dependencyConstraint: ERROR CLASS: Symbol not found for Provider<out ERROR CLASS: Symbol not found for DependencyConstraint>, configuration: ERROR CLASS: Symbol not found for Action<in ERROR CLASS: Symbol not found for DependencyConstraint>): ERROR CLASS: Unresolved name: addConstraint(source)

Add a dependency constraint.

#### Since

8.7

#### Parameters

dependencyConstraint

dependency constraint to add

configuration

an action to configure the dependency constraint

operator fun ERROR CLASS: Symbol not found for DependencyConstraintHandler.invoke(configuration: DependencyConstraintHandlerScope.() -> Unit)(source)

Configures the dependency constraints.

#### Since

5.0

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

Enables function invocation syntax on Closure references.

inline operator fun <T : Any, C : ERROR CLASS: Symbol not found for NamedDomainObjectContainer<T>> C.invoke(configuration: ERROR CLASS: Symbol not found for Action<org/gradle/kotlin/dsl/NamedDomainObjectContainerScope<T>>): C(source)

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 : Any> ERROR CLASS: Symbol not found for NamedDomainObjectProvider<T>.invoke(action: T.() -> Unit): ERROR CLASS: Ambiguity: configure, [org/gradle/kotlin/dsl/configure, org/gradle/kotlin/dsl/configure, org/gradle/kotlin/dsl/configure, org/gradle/kotlin/dsl/configure, org/gradle/kotlin/dsl/configure, org/gradle/kotlin/dsl/configure](source)

Allows a NamedDomainObjectProvider to be configured via invocation syntax.

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

Content copied to clipboard

operator fun <T> ERROR CLASS: Symbol not found for Spec<T>.invoke(arg: T): Boolean(source)

Enables function invocation syntax on Spec instances.

#### See also

Spec.isSatisfiedBy

inline operator fun ERROR CLASS: Symbol not found for TaskContainer.invoke(configuration: TaskContainerScope.() -> Unit): ERROR CLASS: Symbol not found for TaskContainer(source)

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")
        }
    }

Content copied to clipboard

#### Return

The given TaskContainer.

#### Parameters

configuration

The expression to configure this TaskContainer with.

inline operator fun <T> ERROR CLASS: Symbol not found for ExtraPropertiesExtension.invoke(initialValueProvider: () -> T): InitialValueExtraPropertyDelegateProvider<T>(source)

### Deprecated

Use 'extra.set(name, value)' instead. See the Gradle 9.6 upgrading guide.

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

Usage: `val answer by extra { 42 }`

operator fun <T> ERROR CLASS: Symbol not found for ExtraPropertiesExtension.invoke(initialValue: T): InitialValueExtraPropertyDelegateProvider<T>(source)

### Deprecated

Use 'extra.set(name, value)' instead. See the Gradle 9.6 upgrading guide.

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

Usage: `val answer by extra(42)`