PlatformDependencyModifiers.EnforcedPlatformDependencyModifier, PlatformDependencyModifiers.PlatformDependencyModifier, TestFixturesDependencyModifiers.TestFixturesDependencyModifier@Incubating @NonExtensible public interface DependencyModifier
DependencyModifier defines how to modify a dependency inside a custom dependencies block to select a different variant.modify(...) unnecessary from the DSL.
call(...) equivalents for all the modify(...) methods.invoke(...) equivalents for all the modify(...) methods.modify(ModuleDependency). This method must be implemented.modify(...) delegate to modify(ModuleDependency).
Changes to this interface may require changes to the
extension module for Groovy DSL or
extension functions for Kotlin DSL.
| Modifier and Type | Method | Description |
|---|---|---|
DependencyFactory |
getDependencyFactory() |
A dependency factory is used to convert supported dependency notations into
Dependency instances. |
<D extends ModuleDependency> |
modify(D dependency) |
Takes a given
ModuleDependency and modifies the dependency to select the variant of the given module. |
default ExternalModuleDependency |
modify(java.lang.CharSequence dependencyNotation) |
Create an
ExternalModuleDependency from the given notation and modifies it to select the variant of the given module as described in modify(ModuleDependency). |
default <D extends ModuleDependency> |
modify(Provider<D> providerToDependency) |
Takes a given
Provider to a ExternalModuleDependency and modifies the dependency to select the variant of the given module as described in modify(ModuleDependency). |
default Provider<? extends MinimalExternalModuleDependency> |
modify(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency) |
Takes a given
Provider to a MinimalExternalModuleDependency and modifies the dependency to select the variant of the given module as described in modify(ModuleDependency). |
@Inject DependencyFactory getDependencyFactory()
Dependency instances.DependencyFactorydefault ExternalModuleDependency modify(java.lang.CharSequence dependencyNotation)
ExternalModuleDependency from the given notation and modifies it to select the variant of the given module as described in modify(ModuleDependency).dependencyNotation - the dependency notationDependencyFactory.create(CharSequence)default Provider<? extends MinimalExternalModuleDependency> modify(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency)
Provider to a MinimalExternalModuleDependency and modifies the dependency to select the variant of the given module as described in modify(ModuleDependency).providerConvertibleToDependency - the providerdefault <D extends ModuleDependency> Provider<D> modify(Provider<D> providerToDependency)
Provider to a ExternalModuleDependency and modifies the dependency to select the variant of the given module as described in modify(ModuleDependency).providerToDependency - the provider<D extends ModuleDependency> D modify(D dependency)
ModuleDependency and modifies the dependency to select the variant of the given module. Dependency resolution may fail if the given module does not have a compatible variant.
D - the type of the ModuleDependencydependency - the dependency to modify