Groovy Documentation

org.gradle.api.file
Interface SourceDirectorySet

org.gradle.api.file.FileCollection
  org.gradle.api.file.SourceDirectorySet
      org.gradle.api.file.FileTree
All Superinterfaces:
FileCollection, FileTree

interface SourceDirectorySet
extends FileTree

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


Method Summary
PatternFilterable getFilter()

Returns the filter used to select the source from the source directories.

Set getSrcDirs()

Returns the source directories which make up this set.

SourceDirectorySet setSrcDirs(java.lang.Iterable srcPaths)

Sets the source directories for this set.

SourceDirectorySet srcDir(java.lang.Object srcPath)

Adds the given source directory to this set.

SourceDirectorySet srcDirs(java.lang.Object srcPaths)

Adds the given source directories to this set.

 
Methods inherited from interface FileTree
matching, matching, plus, visit, visit
 
Methods inherited from interface FileCollection
add, addToAntBuilder, addToAntBuilder, asType, getAsFileTree, getAsPath, getFiles, getSingleFile, plus, stopExecutionIfEmpty
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from class java.lang.Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Method Detail

getFilter

public 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.
return:
The filter patterns.


getSrcDirs

public Set getSrcDirs()
Returns the source directories which make up this set.
return:
The source directories. Returns an empty set when this set contains no source directories.


setSrcDirs

public SourceDirectorySet setSrcDirs(java.lang.Iterable srcPaths)
Sets the source directories for this set.
param:
srcPaths The source directories. These are evaluated as for org.gradle.api.Project#files(Object...)
return:
this


srcDir

public SourceDirectorySet srcDir(java.lang.Object srcPath)
Adds the given source directory to this set.
param:
srcPath The source directory. This is evaluated as for org.gradle.api.Project#file(Object)
return:
this


srcDirs

public SourceDirectorySet srcDirs(java.lang.Object srcPaths)
Adds the given source directories to this set.
param:
srcPaths The source directories. These are evaluated as for org.gradle.api.Project#files(Object...)
return:
this


 

Groovy Documentation