api / org.gradle.api.tasks.util

Package org.gradle.api.tasks.util

Types

PatternFilterable

interface PatternFilterable

A PatternFilterable represents some file container which Ant-style include and exclude patterns or specs can be applied to.

Patterns may include:

  • '*' to match any number of characters
  • '?' to match any single character
  • '**' to match any number of directories or files

Either '/' or '\' may be used in a pattern to separate directories. Patterns ending with '/' or '\' will have '**' automatically appended.

Examples:

 all files ending with 'jsp' (including subdirectories) **/*.jsp all files beginning with 'template_' in the level1/level2 directory level1/level2/template_* all files (including subdirectories) beneath src/main/webapp src/main/webapp/ all files beneath any .svn directory (including subdirectories) under src/main/java src/main/java/**/.svn/** 

You may also use a closure or Spec to specify which files to include or exclude. The closure or Spec is passed a org.gradle.api.file.FileTreeElement, and must return a boolean value.

If no include patterns or specs are specified, then all files in this container will be included. If any include patterns or specs are specified, then a file is included if it matches any of the patterns or specs.

If no exclude patterns or spec are specified, then no files will be excluded. If any exclude patterns or specs are specified, then a file is include only if it matches none of the patterns or specs.

PatternSet

open class PatternSet : AntBuilderAware, PatternFilterable

Standalone implementation of PatternFilterable.