api / org.gradle.api.capabilities / MutableCapabilitiesMetadata

MutableCapabilitiesMetadata

@Incubating interface MutableCapabilitiesMetadata : CapabilitiesMetadata

Describes the capabilities of a component in a mutable way. This interface can be used to adjust the capabilities of a published component via metadata rules (see org.gradle.api.artifacts.dsl.ComponentMetadataHandler.

Since
4.7

Functions

addCapability

abstract fun addCapability(group: String, name: String, version: String): Unit

Adds a new capability. If a capability of the same (group, name) is found with a different version, an error will be thrown.

asImmutable

abstract fun asImmutable(): CapabilitiesMetadata

Returns an immutable vew of the capabilities.

removeCapability

abstract fun removeCapability(group: String, name: String): Unit

Removes a capability.

Inherited Functions

getCapabilities

abstract fun getCapabilities(): MutableList<out Capability>

Returns an immutable view of the capabilities.