abstract fun <T : TransformParameters?> registerTransform(actionType: Class<out TransformAction<T>>, registrationAction: Action<in TransformSpec<T>>)(source)

Registers an artifact transform.

The registration action needs to specify the from and to attributes. It may also provide parameters for the transform action by using parameters.

For example:

// You have a transform action like this:
abstract class MyTransform implements TransformAction<Parameters> {
    interface Parameters extends TransformParameters {
        Property<String> getStringParameter();
        ConfigurableFileCollection getInputFiles();

    void transform(TransformOutputs outputs) {
        // ...

// Then you can register the action like this:

def artifactType = Attribute.of('artifactType', String)

dependencies.registerTransform(MyTransform) {
    from.attribute(artifactType, "jar")
    to.attribute(artifactType, "java-classes-directory")

    parameters {
        stringParameter.set("Some string")



See also