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:
- 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,- Named,- ExtensionAware,- Task,- PatternFilterable,- Configurable<Task>
@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 SummaryNested classes/interfaces inherited from interface org.gradle.api.TaskTask.Namer
- 
Field SummaryFields inherited from interface org.gradle.api.TaskTASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.gradle.api.internal.file.copy.CopyActionExecuterReturns the appendix part of the archive name, if any.Returns the base name of the archive.Returns the classifier part of the archive name, if any.Returns the extension part of the archive name.TheRegularFilewhere the archive is constructed.Returns the archive name.Deprecated.Returns the version part of the archive name.The directory where the archive will be placed.Specifies the destination directory *inside* the archive for the files.Creates and configures a childCopySpecwith a destination directory *inside* the archive for the files.Creates and configures a childCopySpecwith a destination directory *inside* the archive for the files.booleanSpecifies whether file timestamps should be preserved in the archive.booleanSpecifies whether to enforce a reproducible file order when reading files from directories.voidsetPreserveFileTimestamps(boolean preserveFileTimestamps) Specifies whether file timestamps should be preserved in the archive.voidsetReproducibleFileOrder(boolean reproducibleFileOrder) Specifies whether to enforce a reproducible file order when reading files from directories.Methods inherited from class org.gradle.api.tasks.AbstractCopyTaskcopy, createCopyAction, createRootSpec, dirPermissions, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, expand, filePermissions, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirMode, getDirPermissions, getDocumentationRegistry, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFilePermissions, getFileResolver, getFileSystem, getFilteringCharset, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getObjectFactory, getPropertyFactory, getRootSpec, getSource, include, include, include, include, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setFilteringCharset, setIncludeEmptyDirs, setIncludes, withMethods inherited from class org.gradle.api.internal.ConventionTaskconventionMapping, conventionMapping, getConventionMappingMethods inherited from class org.gradle.api.DefaultTaskcompareTo, 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, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTaskacceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.TaskdoNotTrackState, getConvention, notCompatibleWithConfigurationCache
- 
Constructor Details- 
AbstractArchiveTaskpublic AbstractArchiveTask()
 
- 
- 
Method Details- 
getArchiveFileNameReturns 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
 
- 
getArchiveFileTheRegularFilewhere the archive is constructed. The path is simply thedestinationDirectoryplus thearchiveFileName.- Returns:
- a RegularFileobject with the path to the archive
- Since:
- 5.1
 
- 
getDestinationDirectoryThe directory where the archive will be placed.- Since:
- 5.1
 
- 
getArchivePathDeprecated.UsegetArchiveFile()The path where the archive is constructed. The path is simply thedestinationDirectoryplus thearchiveFileName.- Returns:
- a File object with the path to the archive
 
- 
getArchiveBaseNameReturns the base name of the archive.- Returns:
- the base name. Internal property may be null.
- Since:
- 5.1
 
- 
getArchiveAppendixReturns the appendix part of the archive name, if any.- Returns:
- the appendix. May be null
- Since:
- 5.1
 
- 
getArchiveVersionReturns the version part of the archive name.- Returns:
- the version. Internal property may be null.
- Since:
- 5.1
 
- 
getArchiveExtensionReturns the extension part of the archive name.- Since:
- 5.1
 
- 
getArchiveClassifierReturns the classifier part of the archive name, if any.- Returns:
- The classifier. Internal property may be null.
- Since:
- 5.1
 
- 
intoSpecifies the destination directory *inside* the archive for the files. The destination is evaluated as perProject.file(Object). Don't mix it up withgetDestinationDirectory()which specifies the output directory for the archive.- Specified by:
- intoin interface- CopyProcessingSpec
- Specified by:
- intoin interface- CopySpec
- Overrides:
- intoin class- AbstractCopyTask
- Parameters:
- destPath- destination directory *inside* the archive for the files
- Returns:
- this
 
- 
intoCreates and configures a childCopySpecwith a destination directory *inside* the archive for the files. The destination is evaluated as perProject.file(Object). Don't mix it up withgetDestinationDirectory()which specifies the output directory for the archive.- Specified by:
- intoin interface- CopySpec
- Overrides:
- intoin class- AbstractCopyTask
- Parameters:
- destPath- destination directory *inside* the archive for the files
- configureClosure- The closure to use to configure the child- CopySpec.
- Returns:
- this
 
- 
intoCreates and configures a childCopySpecwith a destination directory *inside* the archive for the files. The destination is evaluated as perProject.file(Object). Don't mix it up withgetDestinationDirectory()which specifies the output directory for the archive.- Specified by:
- intoin interface- CopySpec
- Overrides:
- intoin class- AbstractCopyTask
- Parameters:
- destPath- destination directory *inside* the archive for the files
- copySpec- The closure to use to configure the child- CopySpec.
- Returns:
- this
 
- 
isPreserveFileTimestampsSpecifies whether file timestamps should be preserved in the archive.If falsethis ensures that archive entries have the same time for builds between different machines, Java versions and operating systems.- Returns:
- trueif file timestamps should be preserved for archive entries
- Since:
- 3.4
 
- 
setPreserveFileTimestampspublic void setPreserveFileTimestamps(boolean preserveFileTimestamps) Specifies whether file timestamps should be preserved in the archive.If falsethis ensures that archive entries have the same time for builds between different machines, Java versions and operating systems.- Parameters:
- preserveFileTimestamps-- trueif file timestamps should be preserved for archive entries
- Since:
- 3.4
 
- 
isReproducibleFileOrderSpecifies 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:
- trueif the files should read from disk in a reproducible order.
- Since:
- 3.4
 
- 
setReproducibleFileOrderpublic 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-- trueif the files should read from disk in a reproducible order.
- Since:
- 3.4
 
- 
createCopyActionExecuterprotected org.gradle.api.internal.file.copy.CopyActionExecuter createCopyActionExecuter()- Overrides:
- createCopyActionExecuterin class- AbstractCopyTask
 
 
- 
getArchiveFile()