Annotation Type InputArtifactDependencies


  • @Retention(RUNTIME)
    @Target(METHOD)
    @Documented
    @InjectionPointQualifier(supportedTypes=FileCollection.class)
    public @interface InputArtifactDependencies
    Attach this annotation to an abstract getter that should receive the artifact dependencies of the InputArtifact of an artifact transform.

    For example, when a project depends on spring-web, when the project is transformed (i.e. the project is the input artifact), the input artifact dependencies are the file collection containing the spring-web JAR and all its dependencies like e.g. the spring-core JAR. The abstract getter must be declared as type FileCollection. The order of the files matches that of the dependencies declared for the input artifact.

    Example usage:

     import org.gradle.api.artifacts.transform.TransformParameters;
    
     public abstract class MyTransform implements TransformAction<TransformParameters.None> {
    
         @InputArtifact
         public abstract Provider<FileSystemLocation> getInputArtifact();
    
         @InputArtifactDependencies
         public abstract FileCollection getDependencies();
    
         @Override
         public void transform(TransformOutputs outputs) {
             FileCollection dependencies = getDependencies();
             // Do something with the dependencies
         }
     }
     
    Since:
    5.3