api / org.gradle.api.tasks.bundling / AbstractArchiveTask

AbstractArchiveTask

abstract class AbstractArchiveTask : AbstractCopyTask

AbstractArchiveTask is the base class for all archive tasks.

Constructors

<init>

AbstractArchiveTask()

AbstractArchiveTask is the base class for all archive tasks.

Functions

getAppendix

open fun getAppendix(): String

Returns the appendix part of the archive name, if any.

getArchiveName

open fun getArchiveName(): String

Returns the archive name. If the name has not been explicitly set, the pattern for the name is: [baseName]-[appendix]-[version]-[classifier].[extension]

getArchivePath

open fun getArchivePath(): File

The path where the archive is constructed. The path is simply the destinationDir plus the archiveName.

getBaseName

open fun getBaseName(): String

Returns the base name of the archive.

getClassifier

open fun getClassifier(): String

Returns the classifier part of the archive name, if any.

getDestinationDir

open fun getDestinationDir(): File

Returns the directory where the archive is generated into.

getExtension

open fun getExtension(): String

Returns the extension part of the archive name.

getVersion

open fun getVersion(): String

Returns the version part of the archive name, if any.

into

open fun into(destPath: Any): AbstractArchiveTask

Specifies the destination directory *inside* the archive for the files. The destination is evaluated as per org.gradle.api.Project#file(Object). Don't mix it up with #getDestinationDir() which specifies the output directory for the archive.

open fun into(destPath: Any, configureClosure: Closure<Any>): AbstractArchiveTask
open fun into(destPath: Any, copySpec: Action<in CopySpec>): CopySpec

Creates and configures a child CopySpec with a destination directory *inside* the archive for the files. The destination is evaluated as per org.gradle.api.Project#file(Object). Don't mix it up with #getDestinationDir() which specifies the output directory for the archive.

isPreserveFileTimestamps

open fun isPreserveFileTimestamps(): Boolean

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.

isReproducibleFileOrder

open fun isReproducibleFileOrder(): Boolean

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.

setAppendix

open fun setAppendix(appendix: String): Unit

setArchiveName

open fun setArchiveName(name: String): Unit

Sets the archive name.

setBaseName

open fun setBaseName(baseName: String): Unit

setClassifier

open fun setClassifier(classifier: String): Unit

setDestinationDir

open fun setDestinationDir(destinationDir: File): Unit

setExtension

open fun setExtension(extension: String): Unit

setPreserveFileTimestamps

open fun setPreserveFileTimestamps(preserveFileTimestamps: Boolean): Unit

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.

setReproducibleFileOrder

open fun setReproducibleFileOrder(reproducibleFileOrder: Boolean): Unit

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.

setVersion

open fun setVersion(version: String): Unit

Inherited Functions

eachFile

open fun eachFile(action: Action<in FileCopyDetails>): AbstractCopyTask
open fun eachFile(closure: Closure<Any>): AbstractCopyTask

{@inheritDoc}

exclude

open fun exclude(vararg excludes: String): AbstractCopyTask
open fun exclude(excludes: MutableIterable<String>): AbstractCopyTask
open fun exclude(excludeSpec: Spec<FileTreeElement>): AbstractCopyTask
open fun exclude(excludeSpec: Closure<Any>): AbstractCopyTask

{@inheritDoc}

expand

open fun expand(properties: MutableMap<String, *>): AbstractCopyTask

{@inheritDoc}

filesMatching

open fun filesMatching(pattern: String, action: Action<in FileCopyDetails>): AbstractCopyTask
open fun filesMatching(patterns: MutableIterable<String>, action: Action<in FileCopyDetails>): AbstractCopyTask

{@inheritDoc}

filesNotMatching

open fun filesNotMatching(pattern: String, action: Action<in FileCopyDetails>): AbstractCopyTask
open fun filesNotMatching(patterns: MutableIterable<String>, action: Action<in FileCopyDetails>): AbstractCopyTask

{@inheritDoc}

filter

open fun filter(properties: MutableMap<String, *>, filterType: Class<out FilterReader>): AbstractCopyTask
open fun filter(filterType: Class<out FilterReader>): AbstractCopyTask
open fun filter(closure: Closure<Any>): AbstractCopyTask
open fun filter(transformer: Transformer<String, String>): AbstractCopyTask

{@inheritDoc}

from

open fun from(vararg sourcePaths: Any): AbstractCopyTask
open fun from(sourcePath: Any, c: Closure<Any>): AbstractCopyTask
open fun from(sourcePath: Any, configureAction: Action<in CopySpec>): AbstractCopyTask

{@inheritDoc}

getDirMode

open fun getDirMode(): Int

{@inheritDoc}

getDuplicatesStrategy

open fun getDuplicatesStrategy(): DuplicatesStrategy

{@inheritDoc}

getExcludes

open fun getExcludes(): MutableSet<String>

{@inheritDoc}

getFileMode

open fun getFileMode(): Int

{@inheritDoc}

getFilteringCharset

open fun getFilteringCharset(): String

{@inheritDoc}

getIncludeEmptyDirs

open fun getIncludeEmptyDirs(): Boolean

{@inheritDoc}

getIncludes

open fun getIncludes(): MutableSet<String>

{@inheritDoc}

getRootSpec

open fun getRootSpec(): CopySpecInternal

getSource

open fun getSource(): FileCollection

Returns the source files for this task.

include

open fun include(vararg includes: String): AbstractCopyTask
open fun include(includes: MutableIterable<String>): AbstractCopyTask
open fun include(includeSpec: Spec<FileTreeElement>): AbstractCopyTask
open fun include(includeSpec: Closure<Any>): AbstractCopyTask

{@inheritDoc}

isCaseSensitive

open fun isCaseSensitive(): Boolean

{@inheritDoc}

rename

open fun rename(closure: Closure<Any>): AbstractCopyTask
open fun rename(renamer: Transformer<String, String>): AbstractCopyTask
open fun rename(sourceRegEx: String, replaceWith: String): AbstractCopyTask
open fun rename(sourceRegEx: Pattern, replaceWith: String): AbstractCopyTask

{@inheritDoc}

setCaseSensitive

open fun setCaseSensitive(caseSensitive: Boolean): Unit

{@inheritDoc}

setDirMode

open fun setDirMode(mode: Int): AbstractCopyTask

{@inheritDoc}

setDuplicatesStrategy

open fun setDuplicatesStrategy(strategy: DuplicatesStrategy): Unit

{@inheritDoc}

setExcludes

open fun setExcludes(excludes: MutableIterable<String>): AbstractCopyTask

{@inheritDoc}

setFileMode

open fun setFileMode(mode: Int): AbstractCopyTask

{@inheritDoc}

setFilteringCharset

open fun setFilteringCharset(charset: String): Unit

{@inheritDoc}

setIncludeEmptyDirs

open fun setIncludeEmptyDirs(includeEmptyDirs: Boolean): Unit

{@inheritDoc}

setIncludes

open fun setIncludes(includes: MutableIterable<String>): AbstractCopyTask

{@inheritDoc}

with

open fun with(vararg sourceSpecs: CopySpec): CopySpec

{@inheritDoc}

Inheritors

Tar

open class Tar : AbstractArchiveTask

Assembles a TAR archive.

Zip

open class Zip : AbstractArchiveTask

Assembles a ZIP archive. The default is to compress the contents of the zip.