gradle
8.2

# DependencyModifier

@Incubating
@NonExtensible
interface DependencyModifier

A `DependencyModifier` defines how to modify a dependency inside a custom `dependencies` block to select a different variant.

#### Inheritors

TestFixturesDependencyModifier
PlatformDependencyModifier
EnforcedPlatformDependencyModifier

## Functions

getDependencyFactory
Link copied to clipboard
@Inject
abstract fun getDependencyFactory(): DependencyFactory
A dependency factory is used to convert supported dependency notations into org.gradle.api.artifacts.Dependency instances.
invoke
Link copied to clipboard
operator fun <D : ModuleDependency> DependencyModifier.invoke(dependency: D): D
operator fun DependencyModifier.invoke(dependencyNotation: CharSequence): ExternalModuleDependency
operator fun DependencyModifier.invoke(dependency: ProviderConvertible<out MinimalExternalModuleDependency>): Provider<out MinimalExternalModuleDependency>
operator fun DependencyModifier.invoke(dependency: Provider<out ModuleDependency>): Provider<out ModuleDependency>

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

modify
Link copied to clipboard
abstract fun <D : ModuleDependency?> modify(dependency: D): D
Takes a given ModuleDependency and modifies the dependency to select the variant of the given module.
open fun modify(dependencyNotation: CharSequence): ExternalModuleDependency
Create an ExternalModuleDependency from the given notation and modifies it to select the variant of the given module as described in modify.
open fun <D : ModuleDependency?> modify(providerToDependency: Provider<D>): Provider<D>
Takes a given `Provider` to a ExternalModuleDependency and modifies the dependency to select the variant of the given module as described in modify.
open fun modify(providerConvertibleToDependency: ProviderConvertible<out MinimalExternalModuleDependency>): Provider<out MinimalExternalModuleDependency>
Takes a given `Provider` to a MinimalExternalModuleDependency and modifies the dependency to select the variant of the given module as described in modify.