AntBuilderAware
, PatternFilterable
public class PatternSet extends java.lang.Object implements AntBuilderAware, PatternFilterable
PatternFilterable
.Modifier | Constructor | Description |
---|---|---|
|
PatternSet() |
|
protected |
PatternSet(org.gradle.api.tasks.util.internal.PatternSpecFactory patternSpecFactory) |
|
protected |
PatternSet(PatternSet patternSet) |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
addToAntBuilder(java.lang.Object node,
java.lang.String childNodeName) |
|
PatternSet |
copyFrom(PatternFilterable sourcePattern) |
|
protected PatternSet |
doCopyFrom(PatternSet from) |
|
boolean |
equals(java.lang.Object o) |
|
PatternSet |
exclude(Closure closure) |
Adds an exclude spec.
|
PatternSet |
exclude(java.lang.Iterable excludes) |
Adds an ANT style exclude pattern.
|
PatternSet |
exclude(java.lang.String... excludes) |
Adds an ANT style exclude pattern.
|
PatternSet |
exclude(Spec<FileTreeElement> spec) |
Adds an exclude spec.
|
PatternSet |
excludeSpecs(java.lang.Iterable<Spec<FileTreeElement>> excludes) |
|
Spec<FileTreeElement> |
getAsExcludeSpec() |
|
Spec<FileTreeElement> |
getAsIncludeSpec() |
|
Spec<FileTreeElement> |
getAsSpec() |
|
java.util.Set<java.lang.String> |
getExcludes() |
Returns the set of exclude patterns.
|
java.util.Set<Spec<FileTreeElement>> |
getExcludeSpecs() |
|
java.util.Set<java.lang.String> |
getIncludes() |
Returns the set of include patterns.
|
java.util.Set<Spec<FileTreeElement>> |
getIncludeSpecs() |
|
int |
hashCode() |
|
PatternSet |
include(Closure closure) |
Adds an include spec.
|
PatternSet |
include(java.lang.Iterable includes) |
Adds an ANT style include pattern.
|
PatternSet |
include(java.lang.String... includes) |
Adds an ANT style include pattern.
|
PatternSet |
include(Spec<FileTreeElement> spec) |
Adds an include spec.
|
PatternSet |
includeSpecs(java.lang.Iterable<Spec<FileTreeElement>> includeSpecs) |
|
PatternSet |
intersect() |
|
boolean |
isCaseSensitive() |
|
boolean |
isEmpty() |
The PatternSet is considered empty when no includes or excludes have been added.
|
void |
setCaseSensitive(boolean caseSensitive) |
|
PatternSet |
setExcludes(java.lang.Iterable<java.lang.String> excludes) |
Set the allowable exclude patterns.
|
PatternSet |
setIncludes(java.lang.Iterable<java.lang.String> includes) |
Set the allowable include patterns.
|
public PatternSet()
@Incubating protected PatternSet(PatternSet patternSet)
@Incubating protected PatternSet(org.gradle.api.tasks.util.internal.PatternSpecFactory patternSpecFactory)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public PatternSet copyFrom(PatternFilterable sourcePattern)
protected PatternSet doCopyFrom(PatternSet from)
public PatternSet intersect()
public boolean isEmpty()
public Spec<FileTreeElement> getAsSpec()
public Spec<FileTreeElement> getAsIncludeSpec()
public Spec<FileTreeElement> getAsExcludeSpec()
public java.util.Set<java.lang.String> getIncludes()
PatternFilterable
getIncludes
in interface PatternFilterable
public java.util.Set<Spec<FileTreeElement>> getIncludeSpecs()
public PatternSet setIncludes(java.lang.Iterable<java.lang.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(java.lang.String... includes)
PatternFilterable
include
in interface PatternFilterable
includes
- a vararg list of include patternsPattern Format
public PatternSet include(java.lang.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 java.util.Set<java.lang.String> getExcludes()
PatternFilterable
getExcludes
in interface PatternFilterable
public java.util.Set<Spec<FileTreeElement>> getExcludeSpecs()
public PatternSet setExcludes(java.lang.Iterable<java.lang.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(java.lang.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(java.lang.String... excludes)
PatternFilterable
exclude
in interface PatternFilterable
excludes
- a vararg list of exclude patternsPattern Format
public PatternSet exclude(java.lang.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(java.lang.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
public java.lang.Object addToAntBuilder(java.lang.Object node, java.lang.String childNodeName)
addToAntBuilder
in interface AntBuilderAware