Package org.gradle.api.file
Interface ProjectLayout
-
@Incubating public 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 withjavax.inject.Inject
. It is also available viaProject.getLayout()
.- Since:
- 4.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DirectoryProperty
directoryProperty()
Creates a newDirectoryProperty
that uses the project directory to resolve paths, if required.DirectoryProperty
directoryProperty(Provider<? extends Directory> initialProvider)
Creates a newDirectoryProperty
that uses the project directory to resolve paths, if required.Provider<RegularFile>
file(Provider<File> file)
Creates aRegularFile
provider whose location is calculated from the givenProvider
.RegularFileProperty
fileProperty()
Creates a newRegularFileProperty
that uses the project directory to resolve paths, if required.RegularFileProperty
fileProperty(Provider<? extends RegularFile> initialProvider)
Creates a newRegularFileProperty
that uses the project directory to resolve paths, if required.DirectoryProperty
getBuildDirectory()
Returns the build directory for the project.Directory
getProjectDirectory()
Returns the project directory.DirectoryVar
newDirectoryVar()
Deprecated.UsedirectoryProperty()
instead.RegularFileVar
newFileVar()
Deprecated.UsefileProperty()
instead.
-
-
-
Method Detail
-
getProjectDirectory
Directory getProjectDirectory()
Returns the project directory.
-
getBuildDirectory
DirectoryProperty getBuildDirectory()
Returns the build directory for the project.
-
newDirectoryVar
@Deprecated DirectoryVar 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
DirectoryProperty directoryProperty(Provider<? extends Directory> initialProvider)
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 RegularFileVar 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
RegularFileProperty fileProperty(Provider<? extends RegularFile> initialProvider)
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
Provider<RegularFile> file(Provider<File> file)
Creates aRegularFile
provider whose location is calculated from the givenProvider
.
-
-