public class PatternSet extends Object implements AntBuilderAware, PatternFilterable
PatternFilterable.| Modifier | Constructor and Description |
|---|---|
|
PatternSet() |
protected |
PatternSet(PatternSet patternSet) |
protected |
PatternSet(org.gradle.api.tasks.util.internal.PatternSpecFactory patternSpecFactory) |
| Modifier and Type | Method and Description |
|---|---|
Object |
addToAntBuilder(Object node,
String childNodeName) |
PatternSet |
copyFrom(PatternFilterable sourcePattern) |
protected PatternSet |
doCopyFrom(PatternSet from) |
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() |
boolean |
isEmpty()
The PatternSet is considered empty when no includes or excludes have been added.
|
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()
@Incubating protected PatternSet(PatternSet patternSet)
@Incubating protected PatternSet(org.gradle.api.tasks.util.internal.PatternSpecFactory patternSpecFactory)
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 Set<String> getIncludes()
PatternFilterablegetIncludes in interface PatternFilterablepublic Set<Spec<FileTreeElement>> getIncludeSpecs()
public PatternSet setIncludes(Iterable<String> includes)
PatternFilterablePatternFilterable.include(Iterable) this replaces any previously
defined includes.setIncludes in interface PatternFilterableincludes - an Iterable providing new include patternsPattern Formatpublic PatternSet include(String... includes)
PatternFilterableinclude in interface PatternFilterableincludes - a vararg list of include patternsPattern Formatpublic PatternSet include(Iterable includes)
PatternFilterableinclude in interface PatternFilterableincludes - a Iterable providing more include patternsPattern Formatpublic PatternSet include(Spec<FileTreeElement> spec)
PatternFilterableinclude in interface PatternFilterablespec - the spec to addPattern Formatpublic Set<String> getExcludes()
PatternFilterablegetExcludes in interface PatternFilterablepublic Set<Spec<FileTreeElement>> getExcludeSpecs()
public PatternSet setExcludes(Iterable<String> excludes)
PatternFilterablePatternFilterable.exclude(Iterable) this replaces any previously
defined excludes.setExcludes in interface PatternFilterableexcludes - an Iterable providing new exclude patternsPattern Formatpublic boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
public PatternSet includeSpecs(Iterable<Spec<FileTreeElement>> includeSpecs)
public PatternSet include(Closure closure)
PatternFilterableFileTreeElement 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 PatternFilterableclosure - the spec to addPattern Formatpublic PatternSet exclude(String... excludes)
PatternFilterableexclude in interface PatternFilterableexcludes - a vararg list of exclude patternsPattern Formatpublic PatternSet exclude(Iterable excludes)
PatternFilterableexclude in interface PatternFilterableexcludes - a Iterable providing new exclude patternsPattern Formatpublic PatternSet exclude(Spec<FileTreeElement> spec)
PatternFilterableexclude in interface PatternFilterablespec - the spec to addPattern Formatpublic PatternSet excludeSpecs(Iterable<Spec<FileTreeElement>> excludes)
public PatternSet exclude(Closure closure)
PatternFilterableFileTreeElement 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 PatternFilterableclosure - the spec to addFileTreeElementpublic Object addToAntBuilder(Object node, String childNodeName)
addToAntBuilder in interface AntBuilderAware