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 newDirectoryPropertythat uses the project directory to resolve paths, if required.directoryProperty(Provider<? extends Directory> initialProvider) Creates a newDirectoryPropertythat uses the project directory to resolve paths, if required.Creates aRegularFileprovider whose location is calculated from the givenProvider.Creates a newRegularFilePropertythat uses the project directory to resolve paths, if required.fileProperty(Provider<? extends RegularFile> initialProvider) Creates a newRegularFilePropertythat 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 newDirectoryVarthat uses the project directory to resolve paths, if required. The var has no initial value. -
directoryProperty
DirectoryProperty directoryProperty()Creates a newDirectoryPropertythat uses the project directory to resolve paths, if required. The property has no initial value.- Since:
- 4.3
-
directoryProperty
Creates a newDirectoryPropertythat 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 newRegularFileVarthat uses the project directory to resolve paths, if required. The var has no initial value. -
fileProperty
RegularFileProperty fileProperty()Creates a newRegularFilePropertythat uses the project directory to resolve paths, if required. The property has no initial value.- Since:
- 4.3
-
fileProperty
Creates a newRegularFilePropertythat 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 aRegularFileprovider whose location is calculated from the givenProvider.
-
directoryProperty()instead.