api / org.gradle.api.artifacts / ConfigurationPublications

ConfigurationPublications

@Incubating interface ConfigurationPublications : HasConfigurableAttributes<ConfigurationPublications>

Represents the outgoing artifacts associated with a configuration. These artifacts are used when the configuration is referenced during dependency resolution.

You can use this interface associate artifacts with a configuration using the #artifact(Object) methods. You can also define several variants of the configuration's artifacts. Each variant represents a set of artifacts that form some mutually exclusive usage of the component.

An implicit variant is defined for a configuration whenever any artifacts are attached directly to this object or inherited from another configuration.

Since
3.3

Functions

artifact

abstract fun artifact(notation: Any): Unit

Adds an outgoing artifact to this configuration. This artifact is included in all variants.

See org.gradle.api.artifacts.dsl.ArtifactHandler for details of the supported notations.

abstract fun artifact(notation: Any, configureAction: Action<in ConfigurablePublishArtifact>): Unit

Adds an outgoing artifact to this configuration, configuring it using the given action. This artifact is included in all variants.

See org.gradle.api.artifacts.dsl.ArtifactHandler for details of the supported notations.

capability

abstract fun capability(notation: Any): Unit

Declares a capability for this configuration.

getArtifacts

abstract fun getArtifacts(): PublishArtifactSet

Returns the artifacts associated with this configuration. When an artifact is added to this set, an implicit variant is defined for the configuration. These artifacts are also inherited by all configurations that extend this configuration.

getCapabilities

abstract fun getCapabilities(): MutableCollection<out Capability>

Returns the capabilities declared for this configuration.

getVariants

abstract fun getVariants(): NamedDomainObjectContainer<ConfigurationVariant>

Returns the variants of this configuration, if any.

variants

abstract fun variants(configureAction: Action<in NamedDomainObjectContainer<ConfigurationVariant>>): Unit

Configures the variants of this configuration.

Inherited Functions

attributes

abstract fun attributes(action: Action<in AttributeContainer>): SELF

Configure the attribute container that provides the attributes associated with this domain object.