CacheableTransform

Attaching this annotation to a TransformAction type it indicates that the build cache should be used for artifact transforms of this type.

Only an artifact transform that produces reproducible and relocatable outputs should be marked with CacheableTransform.

Normalization must be specified for each file parameter of a cacheable transform. For example:

import org.gradle.api.artifacts.transform.TransformParameters;

@CacheableTransform
public abstract class MyTransform implements TransformAction<TransformParameters.None> {
    @PathSensitive(PathSensitivity.NAME_ONLY)
    @InputArtifact
    public abstract Provider<FileSystemLocation> getInputArtifact();

    @Classpath
    @InputArtifactDependencies
    public abstract FileCollection getDependencies();

    @Override
    public void transform(TransformOutputs outputs) {
        // ...
    }
}

Since

5.3

See also

Functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun toString(): String