api / org.gradle.api.artifacts.component / ComponentSelector

ComponentSelector

@Incubating interface ComponentSelector

Represents some opaque criteria used to select a component instance during dependency resolution. Various sub-interfaces expose specific details about the criteria.

Since
1.10

Functions

getAttributes

abstract fun getAttributes(): AttributeContainer

The attributes of the module to select the component from. The attributes only include selector specific attributes. This means it typically doesn't include any consumer specific attribute.

getDisplayName

abstract fun getDisplayName(): String

Returns a human-consumable display name for this selector.

matchesStrictly

abstract fun matchesStrictly(identifier: ComponentIdentifier): Boolean

Checks if selector matches component identifier.

Inheritors

LibraryComponentSelector

interface LibraryComponentSelector : ComponentSelector

Criteria for selecting a library instance that is built as part of the current build.

ModuleComponentSelector

interface ModuleComponentSelector : ComponentSelector

Criteria for selecting a component instance that is available as a module version.

ProjectComponentSelector

interface ProjectComponentSelector : ComponentSelector

Criteria for selecting a component instance that is built as part of the current build.