Interface ProjectLayout
Provides access to several important locations for a project.
An instance of this type can be injected into a task, plugin or other object 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 TypeMethodDescriptionconfigurableFiles(Object... paths) Deprecated.Deprecated.Replaced byObjectFactory.directoryProperty()directoryProperty(Provider<? extends Directory> initialProvider) Deprecated.Replaced byObjectFactory.directoryProperty()Creates aRegularFileprovider whose location is calculated from the givenProvider.Deprecated.Replaced byObjectFactory.fileProperty()fileProperty(Provider<? extends RegularFile> initialProvider) Deprecated.Replaced byObjectFactory.fileProperty()Creates aFileCollectioncontaining the given files, as defined byProject.files(Object...).Returns the build directory for the project.Returns the project directory.
-
Method Details
-
getProjectDirectory
Directory getProjectDirectory()Returns the project directory. -
getBuildDirectory
DirectoryProperty getBuildDirectory()Returns the build directory for the project. -
directoryProperty
Deprecated.Replaced byObjectFactory.directoryProperty()Creates a newDirectoryPropertythat uses the project directory to resolve relative paths, if required. The property has no initial value.- Since:
- 4.3
-
directoryProperty
Deprecated.Replaced byObjectFactory.directoryProperty()Creates a newDirectoryPropertythat uses the project directory to resolve relative paths, if required. The property has the initial provider specified.- Parameters:
initialProvider- initial provider for the property- Since:
- 4.4
-
fileProperty
Deprecated.Replaced byObjectFactory.fileProperty()Creates a newRegularFilePropertythat uses the project directory to resolve relative paths, if required. The property has no initial value.- Since:
- 4.3
-
fileProperty
Deprecated.Replaced byObjectFactory.fileProperty()Creates a newRegularFilePropertythat uses the project directory to resolve relative 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. -
files
Creates a
FileCollectioncontaining the given files, as defined byProject.files(Object...).This method can also be used to create an empty collection, but the collection may not be mutated later.
- Parameters:
paths- The paths to the files. May be empty.- Returns:
- The file collection. Never returns null.
- Since:
- 4.8
-
configurableFiles
Deprecated.Please useObjectFactory.fileCollection()instead.Returns a
ConfigurableFileCollectioncontaining the given files, as defined byProject.files(Object...).This method can also be used to create an empty collection, which can later be mutated to add elements.
- Parameters:
paths- The paths to the files. May be empty.- Returns:
- The file collection. Never returns null.
- Since:
- 4.8
-
ObjectFactory.fileCollection()instead.