public class PatternSet extends Object implements org.gradle.api.tasks.AntBuilderAware, PatternFilterable
PatternFilterable
.Constructor and Description |
---|
PatternSet() |
Modifier and Type | Method and Description |
---|---|
Object |
addToAntBuilder(Object node,
String childNodeName) |
PatternSet |
copyFrom(PatternFilterable sourcePattern) |
boolean |
equals(Object o) |
PatternSet |
exclude(Closure closure)
Adds an exclude spec.
|
PatternSet |
exclude(Iterable excludes)
Adds an ANT style exclude pattern.
|
PatternSet |
exclude(Spec<FileTreeElement> spec)
Adds an exclude spec.
|
PatternSet |
exclude(String... excludes)
Adds an ANT style exclude pattern.
|
PatternSet |
excludeSpecs(Iterable<Spec<FileTreeElement>> excludes) |
Spec<FileTreeElement> |
getAsExcludeSpec() |
Spec<FileTreeElement> |
getAsIncludeSpec() |
Spec<FileTreeElement> |
getAsSpec() |
Set<String> |
getExcludes()
Returns the set of exclude patterns.
|
Set<Spec<FileTreeElement>> |
getExcludeSpecs() |
Set<String> |
getIncludes()
Returns the set of include patterns.
|
Set<Spec<FileTreeElement>> |
getIncludeSpecs() |
int |
hashCode() |
PatternSet |
include(Closure closure)
Adds an include spec.
|
PatternSet |
include(Iterable includes)
Adds an ANT style include pattern.
|
PatternSet |
include(Spec<FileTreeElement> spec)
Adds an include spec.
|
PatternSet |
include(String... includes)
Adds an ANT style include pattern.
|
PatternSet |
includeSpecs(Iterable<Spec<FileTreeElement>> includeSpecs) |
PatternSet |
intersect() |
boolean |
isCaseSensitive() |
void |
setCaseSensitive(boolean caseSensitive) |
PatternSet |
setExcludes(Iterable<String> excludes)
Set the allowable exclude patterns.
|
PatternSet |
setIncludes(Iterable<String> includes)
Set the allowable include patterns.
|
public PatternSet copyFrom(PatternFilterable sourcePattern)
public PatternSet intersect()
public Spec<FileTreeElement> getAsSpec()
public Spec<FileTreeElement> getAsIncludeSpec()
public Spec<FileTreeElement> getAsExcludeSpec()
public Set<String> getIncludes()
PatternFilterable
getIncludes
in interface PatternFilterable
public Set<Spec<FileTreeElement>> getIncludeSpecs()
public PatternSet setIncludes(Iterable<String> includes)
PatternFilterable
PatternFilterable.include(Iterable)
this replaces any previously
defined includes.setIncludes
in interface PatternFilterable
includes
- an Iterable providing new include patternsPattern Format
public PatternSet include(String... includes)
PatternFilterable
include
in interface PatternFilterable
includes
- a vararg list of include patternsPattern Format
public PatternSet include(Iterable includes)
PatternFilterable
include
in interface PatternFilterable
includes
- a Iterable providing more include patternsPattern Format
public PatternSet include(Spec<FileTreeElement> spec)
PatternFilterable
include
in interface PatternFilterable
spec
- the spec to addPattern Format
public Set<String> getExcludes()
PatternFilterable
getExcludes
in interface PatternFilterable
public Set<Spec<FileTreeElement>> getExcludeSpecs()
public PatternSet setExcludes(Iterable<String> excludes)
PatternFilterable
PatternFilterable.exclude(Iterable)
this replaces any previously
defined excludes.setExcludes
in interface PatternFilterable
excludes
- an Iterable providing new exclude patternsPattern Format
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
public PatternSet includeSpecs(Iterable<Spec<FileTreeElement>> includeSpecs)
public PatternSet include(Closure closure)
PatternFilterable
FileTreeElement
as its parameter.
If includes are not provided, then all files in this container will be included. If includes are provided, then a
file must match at least one of the include patterns or specs to be included.include
in interface PatternFilterable
closure
- the spec to addPattern Format
public PatternSet exclude(String... excludes)
PatternFilterable
exclude
in interface PatternFilterable
excludes
- a vararg list of exclude patternsPattern Format
public PatternSet exclude(Iterable excludes)
PatternFilterable
exclude
in interface PatternFilterable
excludes
- a Iterable providing new exclude patternsPattern Format
public PatternSet exclude(Spec<FileTreeElement> spec)
PatternFilterable
exclude
in interface PatternFilterable
spec
- the spec to addPattern Format
public PatternSet excludeSpecs(Iterable<Spec<FileTreeElement>> excludes)
public PatternSet exclude(Closure closure)
PatternFilterable
FileTreeElement
as its parameter. The closure should return true or false. Example:
copySpec { from 'source' into 'destination' //an example of excluding files from certain configuration: exclude { it.file in configurations.someConf.files } }If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
exclude
in interface PatternFilterable
closure
- the spec to addFileTreeElement