AbstractArchiveTask (Gradle API 7.6.3)

Package org.gradle.api.tasks.bundling

## Class AbstractArchiveTask

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.api.internal.ConventionTask
      - - org.gradle.api.tasks.AbstractCopyTask
        - - org.gradle.api.tasks.bundling.AbstractArchiveTask

- All Implemented Interfaces:
    `java.lang.Comparable<Task>`, `ContentFilterable`, `CopyProcessingSpec`, `CopySourceSpec`, `CopySpec`, `org.gradle.api.internal.DynamicObjectAware`, `org.gradle.api.internal.file.copy.CopySpecSource`, `org.gradle.api.internal.IConventionAware`, `org.gradle.api.internal.TaskInternal`, `ExtensionAware`, `Task`, `PatternFilterable`, `Configurable<Task>`
  Direct Known Subclasses:
    `Tar`, `Zip`

      @DisableCachingByDefault(because="Abstract super-class, not to be instantiated directly")
      public abstract class AbstractArchiveTask
      extends AbstractCopyTask

  `AbstractArchiveTask` is the base class for all archive tasks.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Task

      `Task.Namer`

  - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected org.gradle.api.internal.file.copy.CopyActionExecuter` | `createCopyActionExecuter()` |
    `java.lang.String` | `getAppendix()` | Deprecated. Use `getArchiveAppendix()`
    `Property<java.lang.String>` | `getArchiveAppendix()` | Returns the appendix part of the archive name, if any.
    `Property<java.lang.String>` | `getArchiveBaseName()` | Returns the base name of the archive.
    `Property<java.lang.String>` | `getArchiveClassifier()` | Returns the classifier part of the archive name, if any.
    `Property<java.lang.String>` | `getArchiveExtension()` | Returns the extension part of the archive name.
    `Provider<RegularFile>` | `getArchiveFile()` | The `RegularFile` where the archive is constructed.
    `Property<java.lang.String>` | `getArchiveFileName()` | Returns the archive name.
    `java.lang.String` | `getArchiveName()` | Deprecated. Use `getArchiveFileName()`
    `java.io.File` | `getArchivePath()` | Deprecated. Use `getArchiveFile()`
    `Property<java.lang.String>` | `getArchiveVersion()` | Returns the version part of the archive name.
    `java.lang.String` | `getBaseName()` | Deprecated. Use `getArchiveBaseName()`
    `java.lang.String` | `getClassifier()` | Deprecated. Use `getArchiveClassifier()`
    `java.io.File` | `getDestinationDir()` | Deprecated. Use `getDestinationDirectory()`
    `DirectoryProperty` | `getDestinationDirectory()` | The directory where the archive will be placed.
    `java.lang.String` | `getExtension()` | Deprecated. Use `getArchiveExtension()`
    `java.lang.String` | `getVersion()` | Deprecated. Use `getArchiveVersion()`
    `AbstractArchiveTask` | `into​(java.lang.Object destPath)` | Specifies the destination directory *inside* the archive for the files.
    `AbstractArchiveTask` | `into​(java.lang.Object destPath, Closure configureClosure)` | Creates and configures a child `CopySpec` with a destination directory *inside* the archive for the files.
    `CopySpec` | `into​(java.lang.Object destPath, Action<? super CopySpec> copySpec)` | Creates and configures a child `CopySpec` with a destination directory *inside* the archive for the files.
    `boolean` | `isPreserveFileTimestamps()` | Specifies whether file timestamps should be preserved in the archive.
    `boolean` | `isReproducibleFileOrder()` | Specifies whether to enforce a reproducible file order when reading files from directories.
    `void` | `setAppendix​(java.lang.String appendix)` | Deprecated. Use `getArchiveAppendix()`
    `void` | `setArchiveName​(java.lang.String name)` | Deprecated. Use `getArchiveFileName()`
    `void` | `setBaseName​(java.lang.String baseName)` | Deprecated. Use `getArchiveBaseName()`
    `void` | `setClassifier​(java.lang.String classifier)` | Deprecated. Use `getArchiveClassifier()`
    `void` | `setDestinationDir​(java.io.File destinationDir)` | Deprecated. Use `getDestinationDirectory()`
    `void` | `setExtension​(java.lang.String extension)` | Deprecated. Use `getArchiveExtension()`
    `void` | `setPreserveFileTimestamps​(boolean preserveFileTimestamps)` | Specifies whether file timestamps should be preserved in the archive.
    `void` | `setReproducibleFileOrder​(boolean reproducibleFileOrder)` | Specifies whether to enforce a reproducible file order when reading files from directories.
    `void` | `setVersion​(java.lang.String version)` | Deprecated. Use `getArchiveVersion()`

    - ### Methods inherited from class org.gradle.api.tasks.AbstractCopyTask

      `copy, createCopyAction, createRootSpec, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, expand, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirMode, getDocumentationRegistry, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFileResolver, getFileSystem, getFilteringCharset, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getObjectFactory, getRootSpec, getSource, include, include, include, include, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setFilteringCharset, setIncludeEmptyDirs, setIncludes, with`

    - ### Methods inherited from class org.gradle.api.internal.ConventionTask

      `conventionMapping, conventionMapping, getConventionMapping`

    - ### Methods inherited from class org.gradle.api.DefaultTask

      `compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService`

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects`

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

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

    - ### Methods inherited from interface org.gradle.api.Task

      `doNotTrackState, getConvention, notCompatibleWithConfigurationCache`

- - ### Constructor Detail

    - #### AbstractArchiveTask

          public AbstractArchiveTask()

  - ### Method Detail

    - #### getArchiveName

          @Deprecated
          @ReplacedBy("archiveFileName")
          public java.lang.String getArchiveName()

      Deprecated.
      Use `getArchiveFileName()`
      Returns the archive name. If the name has not been explicitly set, the pattern for the name is: `[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]`
      Returns:
        the archive name.

    - #### setArchiveName

          @Deprecated
          public void setArchiveName​(java.lang.String name)

      Deprecated.
      Use `getArchiveFileName()`
      Sets the archive name.
      Parameters:
        `name` - the archive name.

    - #### getArchiveFileName

          @Internal("Represented as part of archiveFile")
          public Property<java.lang.String> getArchiveFileName()

      Returns the archive name. If the name has not been explicitly set, the pattern for the name is: `[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]`
      Returns:
        the archive name.
      Since:
        5.1

    - #### getArchivePath

          @Deprecated
          @ReplacedBy("archiveFile")
          public java.io.File getArchivePath()

      Deprecated.
      Use `getArchiveFile()`
      The path where the archive is constructed. The path is simply the `destinationDirectory` plus the `archiveFileName`.
      Returns:
        a File object with the path to the archive

    - #### getArchiveFile

          @OutputFile
          public Provider<RegularFile> getArchiveFile()

      The `RegularFile` where the archive is constructed. The path is simply the `destinationDirectory` plus the `archiveFileName`.
      Returns:
        a `RegularFile` object with the path to the archive
      Since:
        5.1

    - #### getDestinationDir

          @Deprecated
          @ReplacedBy("destinationDirectory")
          public java.io.File getDestinationDir()

      Deprecated.
      Use `getDestinationDirectory()`
      Returns the directory where the archive is generated into.
      Returns:
        the directory

    - #### setDestinationDir

          @Deprecated
          public void setDestinationDir​(java.io.File destinationDir)

      Deprecated.
      Use `getDestinationDirectory()`
      Sets the destination dir.

    - #### getDestinationDirectory

          @Internal("Represented by the archiveFile")
          public DirectoryProperty getDestinationDirectory()

      The directory where the archive will be placed.
      Since:
        5.1

    - #### getBaseName

          @Nullable
          @Deprecated
          @ReplacedBy("archiveBaseName")
          public java.lang.String getBaseName()

      Deprecated.
      Use `getArchiveBaseName()`
      Returns the base name of the archive.
      Returns:
        the base name. May be null.

    - #### setBaseName

          @Deprecated
          public void setBaseName​(@Nullable
                                  java.lang.String baseName)

      Deprecated.
      Use `getArchiveBaseName()`
      Sets the base name.

    - #### getArchiveBaseName

          @Internal("Represented as part of archiveFile")
          public Property<java.lang.String> getArchiveBaseName()

      Returns the base name of the archive.
      Returns:
        the base name. Internal property may be null.
      Since:
        5.1

    - #### getAppendix

          @Nullable
          @Deprecated
          @ReplacedBy("archiveAppendix")
          public java.lang.String getAppendix()

      Deprecated.
      Use `getArchiveAppendix()`
      Returns the appendix part of the archive name, if any.
      Returns:
        the appendix. May be null

    - #### setAppendix

          @Deprecated
          public void setAppendix​(@Nullable
                                  java.lang.String appendix)

      Deprecated.
      Use `getArchiveAppendix()`
      Sets the appendix.

    - #### getArchiveAppendix

          @Internal("Represented as part of archiveFile")
          public Property<java.lang.String> getArchiveAppendix()

      Returns the appendix part of the archive name, if any.
      Returns:
        the appendix. May be null
      Since:
        5.1

    - #### getVersion

          @Nullable
          @Deprecated
          @ReplacedBy("archiveVersion")
          public java.lang.String getVersion()

      Deprecated.
      Use `getArchiveVersion()`
      Returns the version part of the archive name, if any.
      Returns:
        the version. May be null.

    - #### setVersion

          @Deprecated
          public void setVersion​(@Nullable
                                 java.lang.String version)

      Deprecated.
      Use `getArchiveVersion()`
      Sets the version.

    - #### getArchiveVersion

          @Internal("Represented as part of archiveFile")
          public Property<java.lang.String> getArchiveVersion()

      Returns the version part of the archive name.
      Returns:
        the version. Internal property may be null.
      Since:
        5.1

    - #### getExtension

          @Nullable
          @Deprecated
          @ReplacedBy("archiveExtension")
          public java.lang.String getExtension()

      Deprecated.
      Use `getArchiveExtension()`
      Returns the extension part of the archive name.

    - #### setExtension

          @Deprecated
          public void setExtension​(@Nullable
                                   java.lang.String extension)

      Deprecated.
      Use `getArchiveExtension()`
      Sets the extension.

    - #### getArchiveExtension

          @Internal("Represented as part of archiveFile")
          public Property<java.lang.String> getArchiveExtension()

      Returns the extension part of the archive name.
      Since:
        5.1

    - #### getClassifier

          @Nullable
          @Deprecated
          @ReplacedBy("archiveClassifier")
          public java.lang.String getClassifier()

      Deprecated.
      Use `getArchiveClassifier()`
      Returns the classifier part of the archive name, if any.
      Returns:
        The classifier. May be null.

    - #### setClassifier

          @Deprecated
          public void setClassifier​(@Nullable
                                    java.lang.String classifier)

      Deprecated.
      Use `getArchiveClassifier()`
      Sets the classifier.

    - #### getArchiveClassifier

          @Internal("Represented as part of archiveFile")
          public Property<java.lang.String> getArchiveClassifier()

      Returns the classifier part of the archive name, if any.
      Returns:
        The classifier. Internal property may be null.
      Since:
        5.1

    - #### into

          public AbstractArchiveTask into​(java.lang.Object destPath)

      Specifies the destination directory *inside* the archive for the files. The destination is evaluated as per `Project.file(Object)`. Don't mix it up with `getDestinationDirectory()` which specifies the output directory for the archive.
      Specified by:
        `into` in interface `CopyProcessingSpec`
      Specified by:
        `into` in interface `CopySpec`
      Overrides:
        `into` in class `AbstractCopyTask`
      Parameters:
        `destPath` - destination directory *inside* the archive for the files
      Returns:
        this

    - #### into

          public AbstractArchiveTask into​(java.lang.Object destPath,
                                          Closure configureClosure)

      Creates and configures a child `CopySpec` with a destination directory *inside* the archive for the files. The destination is evaluated as per `Project.file(Object)`. Don't mix it up with `getDestinationDirectory()` which specifies the output directory for the archive.
      Specified by:
        `into` in interface `CopySpec`
      Overrides:
        `into` in class `AbstractCopyTask`
      Parameters:
        `destPath` - destination directory *inside* the archive for the files
        `configureClosure` - The closure to use to configure the child `CopySpec`.
      Returns:
        this

    - #### into

          public CopySpec into​(java.lang.Object destPath,
                               Action<? super CopySpec> copySpec)

      Creates and configures a child `CopySpec` with a destination directory *inside* the archive for the files. The destination is evaluated as per `Project.file(Object)`. Don't mix it up with `getDestinationDirectory()` which specifies the output directory for the archive.
      Specified by:
        `into` in interface `CopySpec`
      Overrides:
        `into` in class `AbstractCopyTask`
      Parameters:
        `destPath` - destination directory *inside* the archive for the files
        `copySpec` - The closure to use to configure the child `CopySpec`.
      Returns:
        this

    - #### isPreserveFileTimestamps

          @Input
          public boolean isPreserveFileTimestamps()

      Specifies whether file timestamps should be preserved in the archive.

      If `false` this ensures that archive entries have the same time for builds between different machines, Java versions and operating systems.

      Returns:
        `true` if file timestamps should be preserved for archive entries
      Since:
        3.4

    - #### setPreserveFileTimestamps

          public void setPreserveFileTimestamps​(boolean preserveFileTimestamps)

      Specifies whether file timestamps should be preserved in the archive.

      If `false` this ensures that archive entries have the same time for builds between different machines, Java versions and operating systems.

      Parameters:
        `preserveFileTimestamps` - `true` if file timestamps should be preserved for archive entries
      Since:
        3.4

    - #### isReproducibleFileOrder

          @Input
          public boolean isReproducibleFileOrder()

      Specifies whether to enforce a reproducible file order when reading files from directories.

      Gradle will then walk the directories on disk which are part of this archive in a reproducible order independent of file systems and operating systems. This helps Gradle reliably produce byte-for-byte reproducible archives.

      Returns:
        `true` if the files should read from disk in a reproducible order.
      Since:
        3.4

    - #### setReproducibleFileOrder

          public void setReproducibleFileOrder​(boolean reproducibleFileOrder)

      Specifies whether to enforce a reproducible file order when reading files from directories.

      Gradle will then walk the directories on disk which are part of this archive in a reproducible order independent of file systems and operating systems. This helps Gradle reliably produce byte-for-byte reproducible archives.

      Parameters:
        `reproducibleFileOrder` - `true` if the files should read from disk in a reproducible order.
      Since:
        3.4

    - #### createCopyActionExecuter

          protected org.gradle.api.internal.file.copy.CopyActionExecuter createCopyActionExecuter()

      Overrides:
        `createCopyActionExecuter` in class `AbstractCopyTask`