Groovy Documentation

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.bundling.AbstractArchiveTask

class AbstractArchiveTask
extends ConventionTask

author:
Hans Dockter


Property Summary
protected org.gradle.api.tasks.bundling.ArchiveDetector archiveDetector

boolean createIfEmpty

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

 
Constructor Summary
AbstractArchiveTask(Project project, java.lang.String name)

 
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 files(java.io.File srcFiles)

Adds an arbitrary collection of files to the archive.

FileCollection files(FileCollection fileCollection)

Adds an arbitrary collection of files to this archive.

void generateArchive(Task task)

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)

 
Methods inherited from class ConventionTask
conv, conventionMapping, conventionMapping, conventionProperty, getConventionAwareHelper, getConventionMapping, setConventionAwareHelper, setConventionMapping
 
Methods inherited from class DefaultTask
leftShift, methodMissing, propertyMissing
 
Methods inherited from class AbstractTask
captureStandardOutput, compareTo, defineProperty, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doLast, equals, execute, getActions, getAdditionalProperties, getAnt, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuted, getLogger, getName, getPath, getProject, getSkipProperties, getStandardOutputCapture, getTaskDependencies, hasProperty, hashCode, isDidWork, isEnabled, isExecuted, onlyIf, onlyIf, property, setActions, setAdditionalProperties, setDependsOn, setDescription, setDidWork, setEnabled, setExecuted, setName, setProject, setProperty, setSkipProperties, setStandardOutputCapture, toString
 
Methods inherited from class java.lang.Object
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll
 

Property Detail

archiveDetector

protected org.gradle.api.tasks.bundling.ArchiveDetector archiveDetector


createIfEmpty

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


 
Constructor Detail

AbstractArchiveTask

public AbstractArchiveTask(Project project, java.lang.String name)


 
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


files

public FileCollection files(java.io.File srcFiles)
Adds an arbitrary collection of files to the archive. In contrast to a fileset they don't need to have a common basedir.


files

public FileCollection files(FileCollection fileCollection)
Adds an arbitrary collection of files to this archive.


generateArchive

public void generateArchive(Task task)


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

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