Interface ProjectLayout
-
public interface ProjectLayoutProvides 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 viaProject.getLayout().Note: This interface is not intended for implementation by build script or plugin authors.
- Since:
- 4.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Provider<Directory>dir(Provider<java.io.File> file)Provider<RegularFile>file(Provider<java.io.File> file)Creates aRegularFileprovider whose location is calculated from the givenProvider.FileCollectionfiles(java.lang.Object... paths)Creates a read-onlyFileCollectioncontaining the given files, as defined byProject.files(Object...).DirectoryPropertygetBuildDirectory()Returns the build directory for the project.DirectorygetProjectDirectory()Returns the project directory.
-
-
-
Method Detail
-
getProjectDirectory
Directory getProjectDirectory()
Returns the project directory.
-
getBuildDirectory
DirectoryProperty getBuildDirectory()
Returns the build directory for the project.
-
file
Provider<RegularFile> file(Provider<java.io.File> file)
Creates aRegularFileprovider whose location is calculated from the givenProvider.File system locations based on relative paths will be resolved against this layout's reference location, as defined by
getProjectDirectory().
-
dir
Provider<Directory> dir(Provider<java.io.File> file)
Creates aDirectoryprovider whose location is calculated from the givenProvider.File system locations based on relative paths will be resolved against this layout's reference location, as defined by
getProjectDirectory().- Since:
- 6.0
-
files
FileCollection files(java.lang.Object... paths)
Creates a read-only
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
-
-