Package org.gradle.api.artifacts
Interface DependencyConstraint
- All Superinterfaces:
HasAttributes
,HasConfigurableAttributes<DependencyConstraint>
,ModuleVersionSelector
public interface DependencyConstraint
extends ModuleVersionSelector, HasConfigurableAttributes<DependencyConstraint>
Represents a constraints over all, including transitive, dependencies.
- Since:
- 4.5
-
Method Summary
Modifier and TypeMethodDescriptionattributes
(Action<? super AttributeContainer> configureAction) Mutates the attributes of this constraint.void
Sets the reason why this dependency constraint should be used.Returns the attributes for this constraint.Returns a reason why this dependency constraint should be used, in particular with regards to its version.Returns the version constraint to be used during selection.void
version
(Action<? super MutableVersionConstraint> configureAction) Configures the version constraint for this dependency constraint.Methods inherited from interface org.gradle.api.artifacts.ModuleVersionSelector
getGroup, getModule, getName, getVersion, matchesStrictly
-
Method Details
-
version
Configures the version constraint for this dependency constraint.- Parameters:
configureAction
- the configuration action for the module version
-
getReason
Returns a reason why this dependency constraint should be used, in particular with regards to its version. The dependency report will use it to explain why a specific dependency was selected, or why a specific dependency version was used.- Returns:
- a reason to use this dependency constraint
- Since:
- 4.6
-
because
Sets the reason why this dependency constraint should be used.- Since:
- 4.6
-
getAttributes
AttributeContainer getAttributes()Returns the attributes for this constraint. Mutation of the attributes of a constraint must be done through theattributes(Action)
method.- Specified by:
getAttributes
in interfaceHasAttributes
- Returns:
- the attributes container for this dependency
- Since:
- 4.8
-
attributes
Mutates the attributes of this constraint. Attributes are used during dependency resolution to select the appropriate target variant, in particular when a single component provides different variants.- Specified by:
attributes
in interfaceHasConfigurableAttributes<DependencyConstraint>
- Parameters:
configureAction
- the attributes mutation action- Since:
- 4.8
-
getVersionConstraint
VersionConstraint getVersionConstraint()Returns the version constraint to be used during selection.- Returns:
- the version constraint
-