AntBuilderAware
, Buildable
, Describable
, FileCollection
, FileTree
, Iterable<File>
, Named
, PatternFilterable
public interface SourceDirectorySet extends FileTree, PatternFilterable, Named, Describable
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.
You can create an instance of SourceDirectorySet
using the ObjectFactory.sourceDirectorySet(String, String)
method.
FileCollection.AntType
Named.Namer
Modifier and Type | Method | 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).
|
File |
getOutputDir() |
Returns the directory to put the output for these sources.
|
FileCollection |
getSourceDirectories() |
Returns the source directories that make up this set, represented as a
FileCollection . |
Set<File> |
getSrcDirs() |
Returns the source directories that make up this set.
|
Set<DirectoryTree> |
getSrcDirTrees() |
Returns the source directory trees that make up this set.
|
void |
setOutputDir(File outputDir) |
Sets the directory to assemble the compiled classes into.
|
void |
setOutputDir(Provider<File> provider) |
Sets the provider that gives the directory to assemble the compiled classes into.
|
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.
|
getBuildDependencies
getDisplayName
addToAntBuilder, addToAntBuilder, contains, filter, filter, getAsPath, getSingleFile, isEmpty, minus, plus
getAsFileTree, getFiles, matching, matching, matching, plus, visit, visit, visit
forEach, iterator, spliterator
exclude, exclude, exclude, exclude, getExcludes, getIncludes, include, include, include, include, setExcludes, setIncludes
String getName()
SourceDirectorySet srcDir(Object srcPath)
srcPath
- The source directory. This is evaluated as per Project.files(Object...)
SourceDirectorySet srcDirs(Object... srcPaths)
srcPaths
- The source directories. These are evaluated as per Project.files(Object...)
Set<File> getSrcDirs()
SourceDirectorySet setSrcDirs(Iterable<?> srcPaths)
srcPaths
- The source directories. These are evaluated as per Project.files(Object...)
SourceDirectorySet source(SourceDirectorySet source)
source
- The source to add.FileCollection getSourceDirectories()
FileCollection
. Does not filter source directories that do not exist.
Generally, it is preferable to use this method instead of getSrcDirs()
, 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.
Set<DirectoryTree> getSrcDirTrees()
PatternFilterable getFilter()
*.java
.@Incubating File getOutputDir()
@Incubating void setOutputDir(Provider<File> provider)
provider
- provides output directory for this source directory set@Incubating void setOutputDir(File outputDir)
outputDir
- output directory for this source directory set