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 SummaryModifier and TypeMethodDescriptionattributes(Action<? super AttributeContainer> configureAction) Mutates the attributes of this constraint.voidSets 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.voidversion(Action<? super MutableVersionConstraint> configureAction) Configures the version constraint for this dependency constraint.Methods inherited from interface org.gradle.api.artifacts.ModuleVersionSelectorgetGroup, getModule, getName, getVersion, matchesStrictly
- 
Method Details- 
versionConfigures the version constraint for this dependency constraint.- Parameters:
- configureAction- the configuration action for the module version
 
- 
getReasonReturns 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
 
- 
becauseSets the reason why this dependency constraint should be used.- Since:
- 4.6
 
- 
getAttributesAttributeContainer getAttributes()Returns the attributes for this constraint. Mutation of the attributes of a constraint must be done through theattributes(Action)method.- Specified by:
- getAttributesin interface- HasAttributes
- Returns:
- the attributes container for this dependency
- Since:
- 4.8
 
- 
attributesMutates 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:
- attributesin interface- HasConfigurableAttributes<DependencyConstraint>
- Parameters:
- configureAction- the attributes mutation action
- Since:
- 4.8
 
- 
getVersionConstraintVersionConstraint getVersionConstraint()Returns the version constraint to be used during selection.- Returns:
- the version constraint
 
 
-