Groovy Documentation

org.gradle.api.tasks.bundling
Class AbstractArchiveTask

java.lang.Object
  org.gradle.api.internal.ConventionTask
      org.gradle.api.tasks.bundling.AbstractArchiveTask

class AbstractArchiveTask
extends ConventionTask

author:
Hans Dockter


Property Summary
protected ArchiveDetector archiveDetector

boolean createIfEmpty

Controls if an archive gets created if no files would go into it.

 
Constructor Summary
AbstractArchiveTask()

 
Method Summary
protected def addFileSetInternal(java.util.Map args, java.lang.Class type, groovy.lang.Closure configureClosure)

AntDirective antDirective(groovy.lang.Closure directive)

protected groovy.lang.Closure createAntArchiveTask()

protected def createFileSetInternal(java.util.Map args, java.lang.Class type, groovy.lang.Closure configureClosure)

FileSet fileSet(groovy.lang.Closure configureClosure)

Adds a fileset.

FileSet fileSet(java.util.Map args = [:], groovy.lang.Closure configureClosure = null)

Add a fileset

FileCollection from(java.lang.Object srcPaths)

Adds an arbitrary collection of files to the archive.

void generateArchive()

FileTree getAllSource()

java.lang.String getAppendix()

java.lang.String getArchiveName()

Returns the archive name.

java.io.File getArchivePath()

The path where the archive is constructed.

java.io.File getBaseDir()

java.lang.String getBaseName()

java.lang.String getClassifier()

java.lang.String getCustomName()

java.io.File getDestinationDir()

java.lang.String getExtension()

java.util.List getMergeFileSets()

java.util.List getMergeGroupFileSets()

java.util.List getResourceCollections()

java.lang.String getVersion()

AbstractArchiveTask merge(java.lang.Object[] archiveFiles)

AbstractArchiveTask mergeGroup(def dir, groovy.lang.Closure configureClosure = null)

Defines a fileset of zip-like archives

AbstractArchiveTask resourceCollections(java.lang.Object elements)

void setAppendix(java.lang.String appendix)

void setBaseDir(java.io.File baseDir)

void setBaseName(java.lang.String baseName)

void setClassifier(java.lang.String classifier)

void setCreateIfEmpty(boolean createIfEmpty)

void setCustomName(java.lang.String customName)

void setDestinationDir(java.io.File destinationDir)

void setExtension(java.lang.String extension)

void setMergeFileSets(java.util.List mergeFileSets)

void setMergeGroupFileSets(java.util.List mergeGroupFileSets)

void setResourceCollections(java.util.List resourceCollections)

void setVersion(java.lang.String version)

 

Property Detail

archiveDetector

protected ArchiveDetector archiveDetector


createIfEmpty

boolean createIfEmpty
Controls if an archive gets created if no files would go into it.


 
Constructor Detail

AbstractArchiveTask

AbstractArchiveTask()


 
Method Detail

addFileSetInternal

protected def addFileSetInternal(java.util.Map args, java.lang.Class type, groovy.lang.Closure configureClosure)


antDirective

public AntDirective antDirective(groovy.lang.Closure directive)


createAntArchiveTask

protected groovy.lang.Closure createAntArchiveTask()


createFileSetInternal

protected def createFileSetInternal(java.util.Map args, java.lang.Class type, groovy.lang.Closure configureClosure)


fileSet

public FileSet fileSet(groovy.lang.Closure configureClosure)
Adds a fileset.
param:
configureClosure configuration instructions
return:
the added fileset


fileSet

public FileSet fileSet(java.util.Map args = [:], groovy.lang.Closure configureClosure = null)
Add a fileset
param:
args constructor arguments for the FileSet to construct
param:
configureClosure configuration instructions
return:
the added fileset


from

public FileCollection from(java.lang.Object srcPaths)
Adds an arbitrary collection of files to the archive. In contrast to a fileset they don't need to have a common basedir. The paths are evaluated as for org.gradle.api.Project#files().


generateArchive

@TaskAction
public void generateArchive()


getAllSource

@InputFiles
public FileTree getAllSource()


getAppendix

public java.lang.String getAppendix()


getArchiveName

public java.lang.String getArchiveName()
Returns the archive name. If the customName is not set, the pattern for the name is: [baseName]-[version].[extension]


getArchivePath

public java.io.File getArchivePath()
The path where the archive is constructed. The path is simply the destinationDir plus the archiveName.
return:
a File object with the path to the archive


getBaseDir

public java.io.File getBaseDir()


getBaseName

public java.lang.String getBaseName()


getClassifier

public java.lang.String getClassifier()


getCustomName

public java.lang.String getCustomName()


getDestinationDir

@OutputDirectory
public java.io.File getDestinationDir()


getExtension

public java.lang.String getExtension()


getMergeFileSets

public java.util.List getMergeFileSets()


getMergeGroupFileSets

public java.util.List getMergeGroupFileSets()


getResourceCollections

public java.util.List getResourceCollections()


getVersion

public java.lang.String getVersion()


merge

public AbstractArchiveTask merge(java.lang.Object[] archiveFiles)


mergeGroup

public AbstractArchiveTask mergeGroup(def dir, groovy.lang.Closure configureClosure = null)
Defines a fileset of zip-like archives


resourceCollections

public AbstractArchiveTask resourceCollections(java.lang.Object elements)


setAppendix

public void setAppendix(java.lang.String appendix)


setBaseDir

public void setBaseDir(java.io.File baseDir)


setBaseName

public void setBaseName(java.lang.String baseName)


setClassifier

public void setClassifier(java.lang.String classifier)


setCreateIfEmpty

public void setCreateIfEmpty(boolean createIfEmpty)


setCustomName

public void setCustomName(java.lang.String customName)


setDestinationDir

public void setDestinationDir(java.io.File destinationDir)


setExtension

public void setExtension(java.lang.String extension)


setMergeFileSets

public void setMergeFileSets(java.util.List mergeFileSets)


setMergeGroupFileSets

public void setMergeGroupFileSets(java.util.List mergeGroupFileSets)


setResourceCollections

public void setResourceCollections(java.util.List resourceCollections)


setVersion

public void setVersion(java.lang.String version)


 

Groovy Documentation