interface SourceDirectorySet : 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.
abstract fun getFilter(): PatternFilterable
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 |
|
abstract fun getName(): String
A concise name for the source directory set (typically used to identify it in a collection). |
|
abstract fun getOutputDir(): File
Returns the directory to put the output for these sources. |
|
abstract fun getSourceDirectories(): FileCollection
Returns the source directories that make up this set, represented as a FileCollection. Does not filter source directories that do not exist. Generally, it is preferable to use this method instead of The returned collection is live and reflects changes to this source directory set. |
|
abstract fun getSrcDirTrees(): MutableSet<DirectoryTree>
Returns the source directory trees that make up this set. Does not filter source directories that do not exist. |
|
abstract fun getSrcDirs(): MutableSet<File>
Returns the source directories that make up this set. Does not filter source directories that do not exist. |
|
abstract fun setOutputDir(provider: Provider<File>): Unit
Sets the provider that gives the directory to assemble the compiled classes into. abstract fun setOutputDir(outputDir: File): Unit
Sets the directory to assemble the compiled classes into. |
|
abstract fun setSrcDirs(srcPaths: MutableIterable<*>): SourceDirectorySet
Sets the source directories for this set. |
|
abstract fun source(source: SourceDirectorySet): SourceDirectorySet
Adds the given source to this set. |
|
abstract fun srcDir(srcPath: Any): SourceDirectorySet
Adds the given source directory to this set. The given directory does not need to exist. Directories that do not exist are ignored. |
|
abstract fun srcDirs(vararg srcPaths: Any): SourceDirectorySet
Adds the given source directories to this set. The given directories to not need to exist. Directories that do no exist are ignored. |
abstract fun exclude(vararg excludes: String): PatternFilterable abstract fun exclude(excludes: MutableIterable<String>): PatternFilterable
Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed. abstract fun exclude(excludeSpec: Spec<FileTreeElement>): PatternFilterable
Adds an exclude spec. This method may be called multiple times to append new specs. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed. abstract fun exclude(excludeSpec: Closure<Any>): PatternFilterable
Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a org.gradle.api.file.FileTreeElement as its parameter. The closure should return true or false. Example: If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
|
|
abstract fun getAsFileTree(): FileTree
Returns this. |
|
abstract fun getDisplayName(): String
Returns the display name of this object. It is strongly encouraged to compute it lazily, and cache the value if it is expensive. |
|
abstract fun getExcludes(): MutableSet<String>
Returns the set of exclude patterns. |
|
abstract fun getFiles(): MutableSet<File>
Returns the contents of this tree as a flattened Set. |
|
abstract fun getIncludes(): MutableSet<String>
Returns the set of include patterns. |
|
abstract fun include(vararg includes: String): PatternFilterable abstract fun include(includes: MutableIterable<String>): PatternFilterable
Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns to be processed. abstract fun include(includeSpec: Spec<FileTreeElement>): PatternFilterable
Adds an include spec. This method may be called multiple times to append new specs. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns or specs to be included. abstract fun include(includeSpec: Closure<Any>): PatternFilterable
Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a org.gradle.api.file.FileTreeElement as its parameter. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns or specs to be included. |
|
abstract fun matching(filterConfigClosure: Closure<Any>): FileTree
Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree. The given closure is used to configure the filter. A org.gradle.api.tasks.util.PatternFilterable is passed to the closure as its delegate. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree. abstract fun matching(filterConfigAction: Action<in PatternFilterable>): FileTree
Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree. The given action is used to configure the filter. A org.gradle.api.tasks.util.PatternFilterable is passed to the action. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree. abstract fun matching(patterns: PatternFilterable): FileTree
Restricts the contents of this tree to those files matching the given filter. The filtered tree is live, so that any changes to this tree are reflected in the filtered tree. The given pattern set is used to configure the filter. Only files which match the specified include patterns will be included in the filtered tree. Any files which match the specified exclude patterns will be excluded from the filtered tree. |
|
abstract fun plus(fileTree: FileTree): FileTree
Returns a |
|
abstract fun setExcludes(excludes: MutableIterable<String>): PatternFilterable
Set the allowable exclude patterns. Note that unlike |
|
abstract fun setIncludes(includes: MutableIterable<String>): PatternFilterable
Set the allowable include patterns. Note that unlike |
|
abstract fun visit(visitor: FileVisitor): FileTree
Visits the files and directories in this file tree. Files are visited in depth-first prefix order, so that a directory is visited before its children. abstract fun visit(visitor: Closure<Any>): FileTree
Visits the files and directories in this file tree. Files are visited in depth-first prefix order, so that a directory is visited before its children. The file/directory to be visited is passed to the given closure as a abstract fun visit(visitor: Action<in FileVisitDetails>): FileTree
Visits the files and directories in this file tree. Files are visited in depth-first prefix order, so that a directory is visited before its children. The file/directory to be visited is passed to the given action as a |