api / org.gradle.api.file / FileTree / matching

matching

abstract fun matching(filterConfigClosure: Closure<Any>): FileTree

Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree.

The given closure is used to configure the filter. A org.gradle.api.tasks.util.PatternFilterable is passed to the closure as its delegate. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree.

Parameters

filterConfigClosure - the closure to use to configure the filter.

Return
The filtered tree.

abstract fun matching(filterConfigAction: Action<in PatternFilterable>): FileTree

Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree.

The given action is used to configure the filter. A org.gradle.api.tasks.util.PatternFilterable is passed to the action. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree.

Parameters

filterConfigAction - Action to use to configure the filter.

Return
The filtered tree.

Since
3.3

abstract fun matching(patterns: PatternFilterable): FileTree

Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree.

The given pattern set is used to configure the filter. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree.

Parameters

patterns - the pattern set to use to configure the filter.

Return
The filtered tree.