SourceDirectorySet (Gradle API 2.14.1)

org.gradle.api.file

## Interface SourceDirectorySet

- All Superinterfaces:
    AntBuilderAware, Buildable, FileCollection, FileTree, Iterable<File>, Named, PatternFilterable

      public interface SourceDirectorySet
      extends FileTree, PatternFilterable, Named

  A `SourceDirectorySet` represents a set of source files composed from a set of source directories, along with associated include and exclude patterns.

  TODO - configure includes/excludes for individual source dirs, and sync up with CopySpec TODO - allow add FileTree

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.gradle.api.file.FileCollection

      `FileCollection.AntType`

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Named

      `Named.Namer`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PatternFilterable` | `getFilter()` Returns the filter used to select the source from the source directories.
    `String` | `getName()` A concise name for the source directory set (typically used to identify it in a collection).
    `Set<File>` | `getSrcDirs()` Returns the source directories which make up this set.
    `Set<DirectoryTree>` | `getSrcDirTrees()` Returns the source directory trees which make up this set.
    `SourceDirectorySet` | `setSrcDirs(Iterable<?> srcPaths)` Sets the source directories for this set.
    `SourceDirectorySet` | `source(SourceDirectorySet source)` Adds the given source to this set.
    `SourceDirectorySet` | `srcDir(Object srcPath)` Adds the given source directory to this set.
    `SourceDirectorySet` | `srcDirs(Object... srcPaths)` Adds the given source directories to this set.

    - ### Methods inherited from interface org.gradle.api.file.FileTree

      `getAsFileTree, getFiles, matching, matching, plus, visit, visit`

    - ### Methods inherited from interface org.gradle.api.file.FileCollection

      `add, addToAntBuilder, addToAntBuilder, asType, contains, filter, filter, getAsPath, getSingleFile, isEmpty, minus, plus, stopExecutionIfEmpty`

    - ### Methods inherited from interface java.lang.Iterable

      `iterator`

    - ### Methods inherited from interface org.gradle.api.Buildable

      `getBuildDependencies`

    - ### Methods inherited from interface org.gradle.api.tasks.util.PatternFilterable

      `exclude, exclude, exclude, exclude, getExcludes, getIncludes, include, include, include, include, setExcludes, setIncludes`

- - ### Method Detail

    - #### getName

          String getName()

      A concise name for the source directory set (typically used to identify it in a collection).
      Specified by:
        `getName` in interface `Named`
      Returns:
        The name. Never null.

    - #### srcDir

          SourceDirectorySet srcDir(Object srcPath)

      Adds the given source directory to this set.
      Parameters:
        `srcPath` - The source directory. This is evaluated as per `Project.file(Object)`
      Returns:
        this

    - #### srcDirs

          SourceDirectorySet srcDirs(Object... srcPaths)

      Adds the given source directories to this set.
      Parameters:
        `srcPaths` - The source directories. These are evaluated as per `Project.files(Object...)`
      Returns:
        this

    - #### getSrcDirs

          Set<File> getSrcDirs()

      Returns the source directories which make up this set. Does not filter source directories which do not exist.
      Returns:
        The source directories. Returns an empty set when this set contains no source directories.

    - #### setSrcDirs

          SourceDirectorySet setSrcDirs(Iterable<?> srcPaths)

      Sets the source directories for this set.
      Parameters:
        `srcPaths` - The source directories. These are evaluated as per `Project.files(Object...)`
      Returns:
        this

    - #### source

          SourceDirectorySet source(SourceDirectorySet source)

      Adds the given source to this set.
      Parameters:
        `source` - The source to add.
      Returns:
        this

    - #### getSrcDirTrees

          Set<DirectoryTree> getSrcDirTrees()

      Returns the source directory trees which make up this set. Does not filter source directories which do not exist.
      Returns:
        The source directory trees. Returns an empty set when this set contains no source directories.

    - #### getFilter

          PatternFilterable getFilter()

      Returns the filter used to select the source from the source directories. These filter patterns are applied after the include and exclude patterns of the source directory set itself. Generally, the filter patterns are used to select certain types of files, eg `*.java`.
      Returns:
        The filter patterns.