Package org.gradle.api.artifacts.transform

## Class ArtifactTransform

- java.lang.Object
- - org.gradle.api.artifacts.transform.ArtifactTransform

-     public abstract class ArtifactTransform
      extends Object

  Base class for artifact transforms.

  Implementations must provide a public constructor. The constructor may optionally accept parameters, in which case it must be annotated with `Inject`. The following parameters are available:

  - `ArtifactTransformDependencies` parameter to receive the dependencies of the file to be transformed.
  - The object provided by `ArtifactTransformSpec.getConfiguration()`.
  - The objects provided to `ActionConfiguration.setParams(Object...)`.

  A property annotated with `Inject` and whose type is `ArtifactTransformDependencies` will receive the dependencies of the file to be transformed.

  A property annotated with `PrimaryInput` will receive the primary input location, which is the file or directory that the transform should be applied to.

  A property annotated with `Workspace` will receive the workspace location, which is the directory that the transform should write its output files to.

  Since:
    3.4

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ArtifactTransform()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `File` | `getOutputDirectory()` | Returns the workspace location for this transform, which is the directory that the transform should write its output files to.
    `void` | `setOutputDirectory​(File outputDirectory)` |
    `abstract List<File>` | `transform​(File input)` | Transforms the given primary input file or directory and returns the result.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ArtifactTransform

          public ArtifactTransform()

  - ### Method Detail

    - #### getOutputDirectory

          public File getOutputDirectory()

      Returns the workspace location for this transform, which is the directory that the transform should write its output files to.

    - #### setOutputDirectory

          public void setOutputDirectory​(File outputDirectory)

    - #### transform

          public abstract List<File> transform​(File input)

      Transforms the given primary input file or directory and returns the result.
      Parameters:
        `input` - The primary input file or directory.
      Returns:
        The output files or directories. Can return an empty list.