Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.tasks
Class Copy

    java.lang.Object
      org.gradle.api.internal.ConventionTask
          org.gradle.api.tasks.Copy

All Implemented Interfaces:
  CopyAction

    class Copy
    extends ConventionTask

Task for copying files. This task can also rename and filter files as it copies. The task implements org.gradle.api.file.CopySpec CopySpec for specifying what to copy.

Examples:

     task(mydoc, type:Copy) {
        from 'src/main/doc'
        into 'build/target/doc'
     }

     task(initconfig, type:Copy) {
        from('src/main/config') {
           include '**/*.properties'
           include '**/*.xml'
           filter(ReplaceTokens, tokens:[version:'2.3.1'])
        }
        from('src/main/config') {
           exclude '**/*.properties', '**/*.xml'
        }
        from('src/main/languages') {
           rename 'EN_US_(*.)', '$1'
        }
        into 'build/target/config'
        exclude '**/*.bak'
     }

author:
  Steve Appling

Constructor Summary
`Copy()`

Method Summary
`void` | `configureRootSpec()`
`void` | `copy()`
`CopySpec` | `exclude(java.lang.String excludes)` {
`CopySpec` | `exclude(java.lang.Iterable excludes)` {
`CopySpec` | `filter(Map map, java.lang.Class filterType)` {
`CopySpec` | `filter(java.lang.Class filterType)` {
`CopySpec` | `filter(Closure closure)` {
`CopySpec` | `from(java.lang.Object sourcePaths)` {
`CopySpec` | `from(java.lang.Object sourcePath, Closure c)` {
`CopyActionImpl` | `getCopyAction()`
`File` | `getDestinationDir()`
`Set` | `getExcludes()` {
`Set` | `getIncludes()` {
`List` | `getLeafSyncSpecs()`
`java.lang.Object` | `getSrcDirs()`
`CopySpec` | `include(java.lang.String includes)` {
`CopySpec` | `include(java.lang.Iterable includes)` {
`CopySpec` | `into(java.lang.Object destDir)` {
`CopySpec` | `remapTarget(Closure closure)` {
`CopySpec` | `rename(java.lang.String sourceRegEx, java.lang.String replaceWith)` {
`void` | `setCaseSensitive(boolean caseSensitive)` {
`void` | `setCopyAction(CopyActionImpl copyAction)`
`void` | `setDestinationDir(File destinationDir)`
`CopySpec` | `setExcludes(java.lang.Iterable excludes)` {
`CopySpec` | `setIncludes(java.lang.Iterable includes)` {
`void` | `setSrcDirs(java.lang.Object srcDirs)`

Constructor Detail

### Copy

    public Copy()

Method Detail

### configureRootSpec

    public void configureRootSpec()

### copy

    @TaskAction
    public void copy()

### exclude

    public CopySpec exclude(java.lang.String excludes)

  {@inheritDoc}

### exclude

    public CopySpec exclude(java.lang.Iterable excludes)

  {@inheritDoc}

### filter

    public CopySpec filter(Map map, java.lang.Class filterType)

  {@inheritDoc}

### filter

    public CopySpec filter(java.lang.Class filterType)

  {@inheritDoc}

### filter

    public CopySpec filter(Closure closure)

  {@inheritDoc}

### from

    public CopySpec from(java.lang.Object sourcePaths)

  {@inheritDoc}

### from

    public CopySpec from(java.lang.Object sourcePath, Closure c)

  {@inheritDoc}

### getCopyAction

    public CopyActionImpl getCopyAction()

### getDestinationDir

    public File getDestinationDir()

### getExcludes

    public Set getExcludes()

  {@inheritDoc}

### getIncludes

    public Set getIncludes()

  {@inheritDoc}

### getLeafSyncSpecs

    public List getLeafSyncSpecs()

### getSrcDirs

    public java.lang.Object getSrcDirs()

### include

    public CopySpec include(java.lang.String includes)

  {@inheritDoc}

### include

    public CopySpec include(java.lang.Iterable includes)

  {@inheritDoc}

### into

    public CopySpec into(java.lang.Object destDir)

  {@inheritDoc}

### remapTarget

    public CopySpec remapTarget(Closure closure)

  {@inheritDoc}

### rename

    public CopySpec rename(java.lang.String sourceRegEx, java.lang.String replaceWith)

  {@inheritDoc}

### setCaseSensitive

    public void setCaseSensitive(boolean caseSensitive)

  {@inheritDoc}

### setCopyAction

    public void setCopyAction(CopyActionImpl copyAction)

### setDestinationDir

    public void setDestinationDir(File destinationDir)

### setExcludes

    public CopySpec setExcludes(java.lang.Iterable excludes)

  {@inheritDoc}

### setIncludes

    public CopySpec setIncludes(java.lang.Iterable includes)

  {@inheritDoc}

### setSrcDirs

    public void setSrcDirs(java.lang.Object srcDirs)

Groovy Documentation