Package org.gradle.api.artifacts.dsl
Klasse DependencyModifier
java.lang.Object
org.gradle.api.artifacts.dsl.DependencyModifier
- Bekannte direkte Unterklassen:
PlatformDependencyModifiers.EnforcedPlatformDependencyModifier,PlatformDependencyModifiers.PlatformDependencyModifier,TestFixturesDependencyModifiers.TestFixturesDependencyModifier
A
DependencyModifier defines how to modify a dependency inside a custom dependencies block to select a different variant.- Seit:
- 8.0
- API Note:
- Gradle has specific extensions to make explicit calls to
modify(...)unnecessary from the DSL.- For Groovy DSL, we create
call(...)equivalents for all themodify(...)methods. - For Kotlin DSL, we create
invoke(...)equivalents for all themodify(...)methods.
- For Groovy DSL, we create
- Implementation Requirements:
- The only method that should be implemented is
modifyImplementation(ModuleDependency). Otherabstractmethods are used to inject necessary services and should not be implemented. - Implementation Note:
- All implementations of
modify(...)delegate tomodifyImplementation(ModuleDependency).Changes to this interface may require changes to the
extension module for Groovy DSLorextension functions for Kotlin DSL.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract DependencyFactoryA dependency factory is used to convert supported dependency notations intoDependencyinstances.final <D extends ModuleDependency>
Dmodify(D dependency) Takes a givenModuleDependencyand modifies the dependency to select the variant of the given module.final ExternalModuleDependencymodify(CharSequence dependencyNotation) Create anExternalModuleDependencyfrom the given notation and modifies it to select the variant of the given module as described inmodify(ModuleDependency).final <D extends ModuleDependency>
Provider<D> Takes a givenProviderto aExternalModuleDependencyand modifies the dependency to select the variant of the given module as described inmodify(ModuleDependency).final Provider<? extends MinimalExternalModuleDependency> modify(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency) Takes a givenProviderto aMinimalExternalModuleDependencyand modifies the dependency to select the variant of the given module as described inmodify(ModuleDependency).protected abstract voidmodifyImplementation(ModuleDependency dependency) Modify the given dependency.
-
Konstruktordetails
-
DependencyModifier
protected DependencyModifier()Creates a new instance.- Seit:
- 8.4
-
-
Methodendetails
-
getDependencyFactory
A dependency factory is used to convert supported dependency notations intoDependencyinstances.- Gibt zurück:
- a dependency factory
- Siehe auch:
- Implementation Requirements:
- Do not implement this method. Gradle generates the implementation automatically.
-
modify
Create anExternalModuleDependencyfrom the given notation and modifies it to select the variant of the given module as described inmodify(ModuleDependency).- Parameter:
dependencyNotation- the dependency notation- Gibt zurück:
- the modified dependency
- Siehe auch:
-
modify
@Incubating public final Provider<? extends MinimalExternalModuleDependency> modify(ProviderConvertible<? extends MinimalExternalModuleDependency> providerConvertibleToDependency) Takes a givenProviderto aMinimalExternalModuleDependencyand modifies the dependency to select the variant of the given module as described inmodify(ModuleDependency).- Parameter:
providerConvertibleToDependency- the provider- Gibt zurück:
- a provider to the modified dependency
-
modify
Takes a givenProviderto aExternalModuleDependencyand modifies the dependency to select the variant of the given module as described inmodify(ModuleDependency).- Parameter:
providerToDependency- the provider- Gibt zurück:
- a provider to the modified dependency
-
modify
Takes a givenModuleDependencyand 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.The dependency will be copied, so the original dependency will not be modified.
- Typparameter:
D- the type of theModuleDependency- Parameter:
dependency- the dependency to modify- Gibt zurück:
- the modified dependency
-
modifyImplementation
Modify the given dependency.- Parameter:
dependency- the dependency to modify- Seit:
- 8.4
- Implementation Requirements:
- This method must be implemented.
-