# matching

abstract fun matching(@DelegatesTo(value = PatternFilterable::class) filterConfigClosure: Closure): FileTree(source)

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.

#### Return

The filtered tree.

#### Since

0.8

#### Parameters

filterConfigClosure

the closure to use to configure the filter.

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

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.

#### Return

The filtered tree.

#### Since

3.3

#### Parameters

filterConfigAction

Action to use to configure the filter.

abstract fun matching(patterns: PatternFilterable): FileTree(source)

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.

#### Return

The filtered tree.

#### Since

0.8

#### Parameters

patterns

the pattern set to use to configure the filter.