Interface ResourceFilter
-
public interface ResourceFilterThe gradle DSL model of an Eclipse resource filter. This allows specifying a filter with a custom matcher and configuring whether it is an include/exclude filter that applies to files, folders, or both. The following example excludes the 'node_modules' folder.plugins { id 'java' id 'eclipse' } eclipse { project { resourceFilter { appliesTo = 'FOLDERS' type = 'EXCLUDE_ALL' matcher { id = 'org.eclipse.ui.ide.multiFilter' // to find out which arguments to use, configure the desired // filter with Eclipse's UI and copy the arguments string over arguments = '1.0-name-matches-false-false-node_modules' } } } }- Since:
- 3.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceFilterAppliesTogetAppliesTo()Indicates whether this ResourceFilter applies to files, folders, or both.ResourceFilterMatchergetMatcher()Gets the matcher of this ResourceFilter.ResourceFilterTypegetType()Specifies whether this ResourceFilter is including or excluding resources.booleanisRecursive()Indicates whether this ResourceFilter applies recursively to all children of the project it is created on.ResourceFilterMatchermatcher(Action<? super ResourceFilterMatcher> configureAction)Configures the matcher of this resource filter.voidsetAppliesTo(ResourceFilterAppliesTo appliesTo)Indicates whether this ResourceFilter applies to files, folders, or both.voidsetRecursive(boolean recursive)Sets whether this ResourceFilter applies recursively or not.voidsetType(ResourceFilterType type)Sets the ResourceFilterType
-
-
-
Method Detail
-
getAppliesTo
ResourceFilterAppliesTo getAppliesTo()
Indicates whether this ResourceFilter applies to files, folders, or both. Default is FILES_AND_FOLDERS
-
setAppliesTo
void setAppliesTo(ResourceFilterAppliesTo appliesTo)
Indicates whether this ResourceFilter applies to files, folders, or both. Default is FILES_AND_FOLDERS- Throws:
InvalidUserDataException- if appliesTo is null.
-
getType
ResourceFilterType getType()
Specifies whether this ResourceFilter is including or excluding resources. Default is EXCLUDE_ALL
-
setType
void setType(ResourceFilterType type)
Sets the ResourceFilterType- Throws:
InvalidUserDataException- if type is null.
-
isRecursive
boolean isRecursive()
Indicates whether this ResourceFilter applies recursively to all children of the project it is created on. Default is true.
-
setRecursive
void setRecursive(boolean recursive)
Sets whether this ResourceFilter applies recursively or not.
-
getMatcher
ResourceFilterMatcher getMatcher()
Gets the matcher of this ResourceFilter.
-
matcher
ResourceFilterMatcher matcher(Action<? super ResourceFilterMatcher> configureAction)
Configures the matcher of this resource filter. Will create the matcher if it does not yet exist, or configure the existing matcher if it already exists.- Parameters:
configureAction- The action to use to configure the matcher.
-
-