|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
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.
Method Summary | |
---|---|
CopySpec
|
exclude(java.lang.String excludes)
Adds an ANT style exclude pattern to the copy specification. |
CopySpec
|
filter(Map map, java.lang.Class filterType)
Adds a content filter to be used during the copy. |
CopySpec
|
filter(java.lang.Class filterType)
Adds a content filter to be used during the copy. |
CopySpec
|
from(java.lang.Object sourcePaths)
Specifies sources for a copy. |
CopySpec
|
from(java.lang.Object sourcePath, Closure c)
Specifies the source for a copy and creates a child CopySpec. |
CopySpec
|
from(java.lang.Iterable sourcePaths)
Specifies sources for a copy. |
CopySpec
|
from(java.lang.Iterable sourcePaths, Closure c)
Specifies sources for a copy and creates a child CopySpec which is configured with the Closure. |
CopySpec
|
include(java.lang.String includes)
Adds an ANT style include pattern to the copy specification. |
CopySpec
|
into(java.lang.Object destPath)
Specifies the destination directory for a copy. |
CopySpec
|
remapTarget(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. |
Method Detail |
---|
public CopySpec exclude(java.lang.String excludes)
public CopySpec filter(Map map, java.lang.Class 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'])
public CopySpec filter(java.lang.Class filterType)
Examples:
filter(StripJavaComments) filter(com.mycompany.project.CustomFilter)
public CopySpec from(java.lang.Object sourcePaths)
public CopySpec from(java.lang.Object sourcePath, Closure c)
public CopySpec from(java.lang.Iterable sourcePaths)
public CopySpec from(java.lang.Iterable sourcePaths, Closure c)
public CopySpec include(java.lang.String includes)
all files ending with 'jsp' (including subdirectories) **/*.jsp all files beginning with 'template_' in the level1/level2 directory level1/level2/template_* all files (including subdirectories) beneath src/main/webapp src/main/webapp/ all files beneath any CVS directory (including subdirectories) under src/main/java src/main/java/**/CVS/**If this method is not called, then all files beneath the source directory will be included. If this method is called, then a file must match at least one of the include patterns to be copied.
public CopySpec into(java.lang.Object destPath)
public CopySpec remapTarget(Closure closure)
public 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'
Groovy Documentation