# copy

abstract fun copy(@DelegatesTo(value = CopySpec::class) closure: Closure): WorkResult(source)

Copies the specified files. The given closure is used to configure a CopySpec, which is then used to copy the files. Example:

    copy {
       from configurations.runtimeClasspath
       into 'build/deploy/lib'
    }

Content copied to clipboard
Note that CopySpecs can be nested:

    copy {
       into 'build/webroot'
       exclude '**/.svn/**'
       from('src/main/webapp') {
          include '**/*.jsp'
          filter(ReplaceTokens, tokens:[copyright:'2009', version:'2.3.1'])
       }
       from('src/main/js') {
          include '**/*.js'
       }
    }

Content copied to clipboard

#### Return

WorkResult that can be used to check if the copy did any work.

#### Since

0.8

#### Parameters

closure

Closure to configure the CopySpec

abstract fun copy(action: Action<in CopySpec>): WorkResult(source)

Copies the specified files. The given action is used to configure a CopySpec, which is then used to copy the files.

#### Return

WorkResult that can be used to check if the copy did any work.

#### Since

2.5

#### Parameters

action

Action to configure the CopySpec

#### See also

copy(Closure)