api / org.gradle.api.tasks.bundling / Tar

Tar

open class Tar : AbstractArchiveTask

Assembles a TAR archive.

Constructors

<init>

Tar()

Functions

getCompression

open fun getCompression(): Compression

Returns the compression that is used for this archive.

setCompression

open fun setCompression(compression: Compression): Unit

Configures the compressor based on passed in compression.

Inherited 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