|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
org.gradle.api.file.CopyProcessingSpecorg.gradle.api.file.CopySpec
org.gradle.api.file.ContentFilterable
org.gradle.api.tasks.util.PatternFilterable
org.gradle.api.file.CopySourceSpec
@HasInternalProtocol public interface CopySpec extends CopyProcessingSpec, CopySourceSpec, PatternFilterable
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
|
eachFile(Action action)
{@inheritDoc} |
CopySpec
|
eachFile(Closure closure)
{@inheritDoc} |
CopySpec
|
exclude(String... excludes)
{@inheritDoc} |
CopySpec
|
exclude(Iterable excludes)
{@inheritDoc} |
CopySpec
|
exclude(Spec excludeSpec)
{@inheritDoc} |
CopySpec
|
exclude(Closure excludeSpec)
{@inheritDoc} |
CopySpec
|
expand(Map properties)
{@inheritDoc} |
CopySpec
|
filesMatching(String pattern, Action action)
Configure the FileCopyDetails for each file whose path matches the specified Ant-style pattern. |
CopySpec
|
filesNotMatching(String pattern, Action action)
Configure the FileCopyDetails for each file whose path does not match the specified Ant-style pattern. |
CopySpec
|
filter(Map properties, Class filterType)
{@inheritDoc} |
CopySpec
|
filter(Class filterType)
{@inheritDoc} |
CopySpec
|
filter(Closure closure)
{@inheritDoc} |
CopySpec
|
from(Object... sourcePaths)
{@inheritDoc} |
CopySpec
|
from(Object sourcePath, Closure c)
{@inheritDoc} |
DuplicatesStrategy
|
getDuplicatesStrategy()
Returns the strategy to use when trying to copy more than one file to the same destination. |
boolean
|
getIncludeEmptyDirs()
Tells if empty target directories will be included in the copy. |
CopySpec
|
include(String... includes)
{@inheritDoc} |
CopySpec
|
include(Iterable includes)
{@inheritDoc} |
CopySpec
|
include(Spec includeSpec)
{@inheritDoc} |
CopySpec
|
include(Closure includeSpec)
{@inheritDoc} |
CopySpec
|
into(Object destPath)
{@inheritDoc} |
CopySpec
|
into(Object destPath, Closure configureClosure)
Creates and configures a child CopySpec with the given destination path. |
boolean
|
isCaseSensitive()
Specifies whether case-sensitive pattern matching should be used. |
CopySpec
|
rename(Closure closure)
{@inheritDoc} |
CopySpec
|
rename(String sourceRegEx, String replaceWith)
{@inheritDoc} |
CopyProcessingSpec
|
rename(Pattern sourceRegEx, String replaceWith)
{@inheritDoc} |
void
|
setCaseSensitive(boolean caseSensitive)
Specifies whether case-sensitive pattern matching should be used for this CopySpec. |
void
|
setDuplicatesStrategy(DuplicatesStrategy strategy)
The strategy to use when trying to copy more than one file to the same destination. |
CopySpec
|
setExcludes(Iterable excludes)
{@inheritDoc} |
void
|
setIncludeEmptyDirs(boolean includeEmptyDirs)
Controls if empty target directories should be included in the copy. |
CopySpec
|
setIncludes(Iterable includes)
{@inheritDoc} |
CopySpec
|
with(CopySpec... sourceSpecs)
Adds the given specs as a child of this spec. |
Methods inherited from interface CopyProcessingSpec | |
---|---|
eachFile, eachFile, getDirMode, getFileMode, into, rename, rename, rename, setDirMode, setFileMode |
Methods inherited from interface PatternFilterable | |
---|---|
exclude, exclude, exclude, exclude, getExcludes, getIncludes, include, include, include, include, setExcludes, setIncludes |
Methods inherited from interface CopySourceSpec | |
---|---|
from, from |
Method Detail |
---|
public CopySpec eachFile(Action action)
public CopySpec eachFile(Closure closure)
public CopySpec exclude(String... excludes)
public CopySpec exclude(Iterable excludes)
public CopySpec exclude(Spec excludeSpec)
public CopySpec exclude(Closure excludeSpec)
public CopySpec expand(Map properties)
@Incubating public CopySpec filesMatching(String pattern, Action action)
pattern
- Ant-style pattern used to match against files' relative pathsaction
- action called for the FileCopyDetails of each file matching pattern
@Incubating public CopySpec filesNotMatching(String pattern, Action action)
pattern
- Ant-style pattern used to match against files' relative pathsaction
- action called for the FileCopyDetails of each file that does not match pattern
public CopySpec filter(Map properties, Class filterType)
public CopySpec filter(Class filterType)
public CopySpec filter(Closure closure)
public CopySpec from(Object... sourcePaths)
public CopySpec from(Object sourcePath, Closure c)
@Incubating public DuplicatesStrategy getDuplicatesStrategy()
The value can be set with a case insensitive string of the enum value (e.g. 'exclude' for DuplicatesStrategy#EXCLUDE#EXCLUDE).
This strategy can be overridden for individual files by using eachFile(org.gradle.api.Action) or filesMatching(String, org.gradle.api.Action).
public boolean getIncludeEmptyDirs()
public CopySpec include(String... includes)
public CopySpec include(Iterable includes)
public CopySpec include(Spec includeSpec)
public CopySpec include(Closure includeSpec)
public CopySpec into(Object destPath)
public CopySpec into(Object destPath, Closure configureClosure)
destPath
- Path to the destination directory for a CopyconfigureClosure
- The closure to use to configure the child CopySpec.
public boolean isCaseSensitive()
public CopySpec rename(Closure closure)
public CopySpec rename(String sourceRegEx, String replaceWith)
public CopyProcessingSpec rename(Pattern sourceRegEx, String replaceWith)
public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- true for case-sensitive matching.
@Incubating public void setDuplicatesStrategy(@Nullable DuplicatesStrategy strategy)
public CopySpec setExcludes(Iterable excludes)
public void setIncludeEmptyDirs(boolean includeEmptyDirs)
includeEmptyDirs
- true if empty target directories should be included in the copy, false otherwise
public CopySpec setIncludes(Iterable includes)
public CopySpec with(CopySpec... sourceSpecs)
sourceSpecs
- The specs to add
Gradle API 1.12