|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CopySpec
A set of specifications for copying files. This includes:
into('webroot') exclude('**/.svn/**') from('src/main/webapp') { include '**/*.jsp' } from('src/main/js') { include '**/*.js' }In this example, the
into
and exclude
specifications at the
root level are inherited by the two child CopySpecs.
Copy Task
,
Project.copy()
Method Summary | |
---|---|
CopySpec |
exclude(java.lang.Iterable<java.lang.String> excludes)
Adds an ANT style exclude pattern. |
CopySpec |
exclude(java.lang.String... excludes)
Adds an ANT style exclude pattern. |
CopySpec |
filter(java.lang.Class<java.io.FilterReader> filterType)
Adds a content filter to be used during the copy. |
CopySpec |
filter(groovy.lang.Closure closure)
Adds a content filter based on the provided closure. |
CopySpec |
filter(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.Class<java.io.FilterReader> filterType)
Adds a content filter to be used during the copy. |
CopySpec |
from(java.lang.Object... sourcePaths)
Specifies source files or directories for a copy. |
CopySpec |
from(java.lang.Object sourcePath,
groovy.lang.Closure c)
Specifies the source for a copy and creates a child CopySourceSpec. |
CopySpec |
include(java.lang.Iterable<java.lang.String> includes)
Adds an ANT style include pattern. |
CopySpec |
include(java.lang.String... includes)
Adds an ANT style include pattern. |
CopySpec |
into(java.lang.Object destPath)
Specifies the destination directory for a copy. |
CopySpec |
remapTarget(groovy.lang.Closure closure)
Maps a source file to a different relative location under the target directory. |
CopySpec |
rename(java.lang.String sourceRegEx,
java.lang.String replaceWith)
Renames files based on a regular expression. |
CopySpec |
setExcludes(java.lang.Iterable<java.lang.String> excludes)
Set the allowable exclude patterns. |
CopySpec |
setIncludes(java.lang.Iterable<java.lang.String> includes)
Set the allowable include patterns. |
Methods inherited from interface org.gradle.api.tasks.util.PatternFilterable |
---|
getExcludes, getIncludes |
Method Detail |
---|
CopySpec from(java.lang.Object... sourcePaths)
Project.file()
.
Relative paths will be evaluated relative to the project directory.
from
in interface CopySourceSpec
sourcePaths
- Paths to source directories for the copyCopySpec from(java.lang.Object sourcePath, groovy.lang.Closure c)
Project.file()
.
from
in interface CopySourceSpec
sourcePath
- Path to source for the copyc
- closure for configuring the child CopySourceSpecCopySpec setIncludes(java.lang.Iterable<java.lang.String> includes)
PatternFilterable.include(Iterable)
this replaces any previously defined includes.
setIncludes
in interface PatternFilterable
includes
- an Iterable providing new include patternsPattern Format
CopySpec setExcludes(java.lang.Iterable<java.lang.String> excludes)
PatternFilterable.exclude(Iterable)
this replaces any previously defined excludes.
setExcludes
in interface PatternFilterable
excludes
- an Iterable providing new exclude patternsPattern Format
CopySpec include(java.lang.String... includes)
include
in interface PatternFilterable
includes
- a vararg list of include patternsPattern Format
CopySpec include(java.lang.Iterable<java.lang.String> includes)
include
in interface PatternFilterable
includes
- a Iterable providing more include patternsPattern Format
CopySpec exclude(java.lang.String... excludes)
exclude
in interface PatternFilterable
excludes
- a vararg list of exclude patternsPattern Format
CopySpec exclude(java.lang.Iterable<java.lang.String> excludes)
exclude
in interface PatternFilterable
excludes
- a Iterable providing new exclude patternsPattern Format
CopySpec into(java.lang.Object destPath)
into
in interface CopyProcessingSpec
destPath
- Path to the destination directory for a Copy
CopySpec remapTarget(groovy.lang.Closure closure)
remapTarget
in interface CopyProcessingSpec
closure
- remap closure
CopySpec rename(java.lang.String sourceRegEx, java.lang.String replaceWith)
Example:
rename '(.*)_OEM_BLUE_(.*)', '$1$2'would map the file 'style_OEM_BLUE_.css' to 'style.css'
rename
in interface CopyProcessingSpec
sourceRegEx
- Source regular expressionreplaceWith
- Replacement string (use $ syntax for capture groups)
CopySpec filter(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.Class<java.io.FilterReader> filterType)
Filter parameters may be specified using groovy map syntax.
Examples:
filter(HeadFilter, lines:25, skip:2) filter(ReplaceTokens, tokens:[copyright:'2009', version:'2.3.1'])
filter
in interface CopyProcessingSpec
map
- map of filter parametersfilterType
- Class of filter to add
CopySpec filter(java.lang.Class<java.io.FilterReader> filterType)
Examples:
filter(StripJavaComments) filter(com.mycompany.project.CustomFilter)
filter
in interface CopyProcessingSpec
filterType
- Class of filter to add
CopySpec filter(groovy.lang.Closure closure)
filter
in interface CopyProcessingSpec
closure
- to implement line based filtering
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |