file Tree
Creates a new ConfigurableFileTree
using the given base directory. The given baseDir path is evaluated as per file.
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried.
def myTree = fileTree("src")
myTree.include "**/*.java"
myTree.builtBy "someTask"
task copy(type: Copy) {
from myTree
}
The order of the files in a FileTree
is not stable, even on a single computer.
Return
the file tree. Never returns null.
Parameters
The base directory of the file tree. Evaluated as per file.
Creates a new ConfigurableFileTree
using the given base directory. The given baseDir path is evaluated as per file. The closure will be used to configure the new file tree. The file tree is passed to the closure as its delegate. Example:
def myTree = fileTree('src') {
exclude '**/.data/**'
builtBy 'someTask'
}
task copy(type: Copy) {
from myTree
}
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried.
The order of the files in a FileTree
is not stable, even on a single computer.
Return
the configured file tree. Never returns null.
Parameters
The base directory of the file tree. Evaluated as per file.
Closure to configure the ConfigurableFileTree
object.
Creates a new ConfigurableFileTree
using the given base directory. The given baseDir path is evaluated as per file. The action will be used to configure the new file tree. Example:
def myTree = fileTree('src') {
exclude '**/.data/**'
builtBy 'someTask'
}
task copy(type: Copy) {
from myTree
}
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried.
The order of the files in a FileTree
is not stable, even on a single computer.
Return
the configured file tree. Never returns null.
Since
3.5
Parameters
The base directory of the file tree. Evaluated as per file.
Action to configure the ConfigurableFileTree
object.
Creates a new ConfigurableFileTree
using the provided map of arguments. The map will be applied as properties on the new file tree. Example:
def myTree = fileTree(dir:'src', excludes:['**/ignore/**', '**/.data/**'])
task copy(type: Copy) {
from myTree
}
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried.
The order of the files in a FileTree
is not stable, even on a single computer.
Return
the configured file tree. Never returns null.
Parameters
map of property assignments to ConfigurableFileTree
object