api / org.gradle.api.artifacts / ModuleVersionSelector

ModuleVersionSelector

interface ModuleVersionSelector

Selects a module version. If you need to change this interface, you're probably doing it wrong: it is superceded by org.gradle.api.artifacts.component.ModuleComponentSelector, so check this first, and only add methods here if it's for bridging.

Functions

getGroup

abstract fun getGroup(): String

The group of the module.

getModule

abstract fun getModule(): ModuleIdentifier

The module identifier of the component. Returns the same information as #getGroup() and #getName().

getName

abstract fun getName(): String

The name of the module.

getVersion

abstract fun getVersion(): String

The version of the module

getVersionConstraint

abstract fun getVersionConstraint(): VersionConstraint

Returns the version constraint to be used during selection.

matchesStrictly

abstract fun matchesStrictly(identifier: ModuleVersionIdentifier): Boolean

To match strictly means that the given identifier needs to have equal group, module name and version. It does not smartly match dynamic versions, e.g. '1.+' selector does not strictly match '1.2' identifier.

Inheritors

DependencyConstraint

interface DependencyConstraint : ModuleVersionSelector, HasConfigurableAttributes<DependencyConstraint>

Represents a constraints over all, including transitive, dependencies.

ExternalDependency

interface ExternalDependency : ModuleDependency, ModuleVersionSelector

An ExternalDependency is a Dependency on a source outside the current project hierarchy.