gradle
8.3

# CacheableTransform

@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.TYPE])
annotation class 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) {
            // ...
        }
    }

Content copied to clipboard

#### See also

DisableCachingByDefault

## Functions

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