api / org.gradle.api.artifacts.transform / VariantTransform

VariantTransform

@Incubating interface VariantTransform

Registration of an variant transform.

Since
3.5

Functions

artifactTransform

abstract fun artifactTransform(type: Class<out ArtifactTransform>): Unit

Action to transform artifacts for this variant transform.

An instance of the specified type is created for each file that is to be transformed. The class should provide a public zero-args constructor.

abstract fun artifactTransform(type: Class<out ArtifactTransform>, configAction: Action<in ActionConfiguration>): Unit

Action to transform artifacts for this variant transform, potentially supplying some configuration to inject into the transform.

An instance of the specified type is created for each file that is to be transformed. The class should provide a public constructor that accepts the provided configuration.

getFrom

abstract fun getFrom(): AttributeContainer

Attributes that match the variant that is consumed.

getTo

abstract fun getTo(): AttributeContainer

Attributes that match the variant that is produced.