@Incubating interface ProjectLayout
Provides access to several important locations for a project. An instance of the factory can be injected into a task or plugin by annotating a public constructor or method with javax.inject.Inject
. It is also available via org.gradle.api.Project#getLayout()
.
Since
4.1
abstract fun configurableFiles(vararg paths: Any): ConfigurableFileCollection
Returns a ConfigurableFileCollection containing the given files. You can pass any of the following types to this method:
The returned file collection is lazy, so that the paths are evaluated only when the contents of the file collection are queried. The file collection is also live, so that it evaluates the above each time the contents of the collection is queried. The returned file collection maintains the iteration order of the supplied paths. The returned file collection maintains the details of the tasks that produce the files, so that these tasks are executed if this file collection is used as an input to some task. This method can also be used to create an empty collection, which can later be mutated to add elements. |
|
abstract fun directoryProperty(): DirectoryProperty
Creates a new DirectoryProperty that uses the project directory to resolve paths, if required. The property has no initial value. abstract fun directoryProperty(initialProvider: Provider<out Directory>): DirectoryProperty
Creates a new DirectoryProperty that uses the project directory to resolve paths, if required. The property has the initial provider specified. |
|
abstract fun file(file: Provider<File>): Provider<RegularFile>
Creates a RegularFile provider whose location is calculated from the given Provider. |
|
abstract fun fileProperty(): RegularFileProperty
Creates a new RegularFileProperty that uses the project directory to resolve paths, if required. The property has no initial value. abstract fun fileProperty(initialProvider: Provider<out RegularFile>): RegularFileProperty
Creates a new RegularFileProperty that uses the project directory to resolve paths, if required. The property has the initial provider specified. |
|
abstract fun files(vararg paths: Any): FileCollection
Creates a FileCollection for the given targets. You can pass any of the following types to this method:
The returned file collection is lazy, so that the paths are evaluated only when the contents of the file collection are queried. The file collection is also live, so that it evaluates the above each time the contents of the collection is queried. The returned file collection maintains the iteration order of the supplied paths. The returned file collection maintains the details of the tasks that produce the files, so that these tasks are executed if this file collection is used as an input to some task. This method can also be used to create an empty collection, but the collection may not be mutated later. |
|
abstract fun getBuildDirectory(): DirectoryProperty
Returns the build directory for the project. |
|
abstract fun getProjectDirectory(): Directory
Returns the project directory. |
|
abstract fun newDirectoryVar(): DirectoryVar
Creates a new DirectoryVar that uses the project directory to resolve paths, if required. The var has no initial value. |
|
abstract fun newFileVar(): RegularFileVar
Creates a new RegularFileVar that uses the project directory to resolve paths, if required. The var has no initial value. |