Cacheable Transform
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
Since
5.3