Interface SourceDirectorySet
- All Superinterfaces:
AntBuilderAware, Buildable, Describable, FileCollection, FileTree, Iterable<File>, Named, PatternFilterable
A SourceDirectorySet represents a set of source files composed from a set of source directories, along
with associated include and exclude patterns.
SourceDirectorySet extends FileTree. The contents of the file tree represent the source files of this set, arranged in a hierarchy. The file tree is live and reflects changes to the source directories and their contents.
-
Nested Class Summary
Nested classes/interfaces inherited from interface FileCollection
FileCollection.AntTypeNested classes/interfaces inherited from interface Named
Named.Namer -
Method Summary
Modifier and TypeMethodDescriptionReturns the filter used to select the source from the source directories.getName()A concise name for the source directory set (typically used to identify it in a collection).Returns the directory to put the output for these sources.Returns the source directories that make up this set, represented as aFileCollection.Returns the source directories that make up this set.Returns the source directory trees that make up this set.voidsetOutputDir(File outputDir) Sets the directory to assemble the compiled classes into.voidsetOutputDir(Provider<File> provider) Sets the provider that gives the directory to assemble the compiled classes into.setSrcDirs(Iterable<?> srcPaths) Sets the source directories for this set.source(SourceDirectorySet source) Adds the given source to this set.Adds the given source directory to this set.Adds the given source directories to this set.Methods inherited from interface Buildable
getBuildDependenciesMethods inherited from interface Describable
getDisplayNameMethods inherited from interface FileCollection
add, addToAntBuilder, addToAntBuilder, asType, contains, filter, filter, getAsPath, getSingleFile, isEmpty, minus, plus, stopExecutionIfEmptyMethods inherited from interface FileTree
getAsFileTree, getFiles, matching, matching, matching, plus, visit, visit, visitMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface PatternFilterable
exclude, exclude, exclude, exclude, getExcludes, getIncludes, include, include, include, include, setExcludes, setIncludes
-
Method Details
-
getName
-
srcDir
Adds the given source directory to this set. The given directory does not need to exist. Directories that do not exist are ignored.- Parameters:
srcPath- The source directory. This is evaluated as perProject.files(Object...)- Returns:
- this
-
srcDirs
Adds the given source directories to this set. The given directories to not need to exist. Directories that do no exist are ignored.- Parameters:
srcPaths- The source directories. These are evaluated as perProject.files(Object...)- Returns:
- this
-
getSrcDirs
-
setSrcDirs
Sets the source directories for this set.- Parameters:
srcPaths- The source directories. These are evaluated as perProject.files(Object...)- Returns:
- this
-
source
Adds the given source to this set.- Parameters:
source- The source to add.- Returns:
- this
-
getSourceDirectories
FileCollection getSourceDirectories()Returns the source directories that make up this set, represented as aFileCollection. Does not filter source directories that do not exist. Generally, it is preferable to use this method instead ofgetSrcDirs(), as this method does not require the source directories to be calculated when it is called. Instead, the source directories are calculated when queried. The return value of this method also maintains dependency information.The returned collection is live and reflects changes to this source directory set.
-
getSrcDirTrees
Set<DirectoryTree> getSrcDirTrees()Returns the source directory trees that make up this set. Does not filter source directories that 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 this source directory set. Generally, the filter patterns are used to restrict the contents to certain types of files, eg*.java.- Returns:
- The filter patterns.
-
getOutputDir
Returns the directory to put the output for these sources.- Returns:
- The output directory for this set of sources.
- Since:
- 4.0
-
setOutputDir
Sets the provider that gives the directory to assemble the compiled classes into.- Parameters:
provider- provides output directory for this source directory set- Since:
- 4.0
-
setOutputDir
Sets the directory to assemble the compiled classes into.- Parameters:
outputDir- output directory for this source directory set- Since:
- 4.0
-