Package org.gradle.api.file
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 Project.getLayout()
.- Since:
- 4.1
-
Method Summary
Modifier and TypeMethodDescriptionCreates a newDirectoryProperty
that uses the project directory to resolve paths, if required.directoryProperty
(Provider<? extends Directory> initialProvider) Creates a newDirectoryProperty
that uses the project directory to resolve paths, if required.Creates aRegularFile
provider whose location is calculated from the givenProvider
.Creates a newRegularFileProperty
that uses the project directory to resolve paths, if required.fileProperty
(Provider<? extends RegularFile> initialProvider) Creates a newRegularFileProperty
that uses the project directory to resolve paths, if required.Returns the build directory for the project.Returns the project directory.Deprecated.Deprecated.UsefileProperty()
instead.
-
Method Details
-
getProjectDirectory
Directory getProjectDirectory()Returns the project directory. -
getBuildDirectory
DirectoryProperty getBuildDirectory()Returns the build directory for the project. -
newDirectoryVar
Deprecated.UsedirectoryProperty()
instead.Creates a newDirectoryVar
that uses the project directory to resolve paths, if required. The var has no initial value. -
directoryProperty
DirectoryProperty directoryProperty()Creates a newDirectoryProperty
that uses the project directory to resolve paths, if required. The property has no initial value.- Since:
- 4.3
-
directoryProperty
Creates a newDirectoryProperty
that uses the project directory to resolve paths, if required. The property has the initial provider specified.- Parameters:
initialProvider
- initial provider for the property- Since:
- 4.4
-
newFileVar
Deprecated.UsefileProperty()
instead.Creates a newRegularFileVar
that uses the project directory to resolve paths, if required. The var has no initial value. -
fileProperty
RegularFileProperty fileProperty()Creates a newRegularFileProperty
that uses the project directory to resolve paths, if required. The property has no initial value.- Since:
- 4.3
-
fileProperty
Creates a newRegularFileProperty
that uses the project directory to resolve paths, if required. The property has the initial provider specified.- Parameters:
initialProvider
- initial provider for the property- Since:
- 4.4
-
file
Creates aRegularFile
provider whose location is calculated from the givenProvider
.
-
directoryProperty()
instead.