ProjectLayout (Gradle API 5.6.1)
Date: 2019-09-03

Package org.gradle.api.file

## Interface ProjectLayout

-     @Incubating
      public 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

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ConfigurableFileCollection` | `configurableFiles​(Object... paths)` | Deprecated. Please use `ObjectFactory.fileCollection()` instead.
    `DirectoryProperty` | `directoryProperty()` | Deprecated. Replaced by `ObjectFactory.directoryProperty()`
    `DirectoryProperty` | `directoryProperty​(Provider<? extends Directory> initialProvider)` | Deprecated. Replaced by `ObjectFactory.directoryProperty()`
    `Provider<RegularFile>` | `file​(Provider<File> file)` | Creates a `RegularFile` provider whose location is calculated from the given `Provider`.
    `RegularFileProperty` | `fileProperty()` | Deprecated. Replaced by `ObjectFactory.fileProperty()`
    `RegularFileProperty` | `fileProperty​(Provider<? extends RegularFile> initialProvider)` | Deprecated. Replaced by `ObjectFactory.fileProperty()`
    `FileCollection` | `files​(Object... paths)` | Creates a `FileCollection` containing the given files, as defined by `Project.files(Object...)`.
    `DirectoryProperty` | `getBuildDirectory()` | Returns the build directory for the project.
    `Directory` | `getProjectDirectory()` | Returns the project directory.

- - ### Method Detail

    - #### getProjectDirectory

          Directory getProjectDirectory()

      Returns the project directory.

    - #### getBuildDirectory

          DirectoryProperty getBuildDirectory()

      Returns the build directory for the project.

    - #### directoryProperty

          @Deprecated
          DirectoryProperty directoryProperty()

      Deprecated.
      Replaced by `ObjectFactory.directoryProperty()`
      Creates a new `DirectoryProperty` that uses the project directory to resolve relative paths, if required. The property has no initial value.
      Since:
        4.3

    - #### directoryProperty

          @Deprecated
          DirectoryProperty directoryProperty​(Provider<? extends Directory> initialProvider)

      Deprecated.
      Replaced by `ObjectFactory.directoryProperty()`
      Creates a new `DirectoryProperty` that 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
          RegularFileProperty fileProperty()

      Deprecated.
      Replaced by `ObjectFactory.fileProperty()`
      Creates a new `RegularFileProperty` that uses the project directory to resolve relative paths, if required. The property has no initial value.
      Since:
        4.3

    - #### fileProperty

          @Deprecated
          RegularFileProperty fileProperty​(Provider<? extends RegularFile> initialProvider)

      Deprecated.
      Replaced by `ObjectFactory.fileProperty()`
      Creates a new `RegularFileProperty` that 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

          Provider<RegularFile> file​(Provider<File> file)

      Creates a `RegularFile` provider whose location is calculated from the given `Provider`.

    - #### files

          FileCollection files​(Object... paths)

      Creates a `FileCollection` containing the given files, as defined by `Project.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
          ConfigurableFileCollection configurableFiles​(Object... paths)

      Deprecated.
      Please use `ObjectFactory.fileCollection()` instead.

      Returns a `ConfigurableFileCollection` containing the given files, as defined by `Project.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