api / org.gradle.api.file / DirectoryVar

DirectoryVar

@Incubating interface DirectoryVar : DirectoryProperty, PropertyState<Directory>

Represents some configurable directory location, whose value is mutable and is not necessarily currently known until later.

Note: This interface is not intended for implementation by build script or plugin authors. An instance of this class can be created using the ProjectLayout#newDirectoryVar() method.

Since
4.1

Inherited Functions

dir

abstract fun dir(path: String): Provider<Directory>
abstract fun dir(path: Provider<out CharSequence>): Provider<Directory>

Returns a Directory whose value is the given path resolved relative to the value of this directory.

file

abstract fun file(path: String): Provider<RegularFile>
abstract fun file(path: Provider<out CharSequence>): Provider<RegularFile>

Returns a RegularFile whose value is the given path resolved relative to the value of this directory.

getAsFile

abstract fun getAsFile(): Provider<File>

Views the location of this directory as a File.

getAsFileTree

abstract fun getAsFileTree(): FileTree

Returns a FileTree that allows the files and directories contained in this directory to be queried.

set

abstract fun set(dir: File): Unit

Sets the location of this directory.