Package: org.gradle.tooling.model

## [Java] Interface GradleProject

- org.gradle.tooling.model.HierarchicalElement

- All Superinterfaces:
    Model, BuildableElement, Element, HierarchicalElement

  Represents a Gradle project.

  Since:
    1.0-milestone-5

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `GradleProject` | `findByPath(String path)` Searches all descendants (children, grand-children, etc.), including self, by given path.
    `File` | `getBuildDirectory()` Returns the build directory for this project.
    `GradleScript` | `getBuildScript()` Returns the build script for this project.
    `DomainObjectSet<? extends GradleProject>` | `getChildren()` {@inheritDoc}
    `GradleProject` | `getParent()` {@inheritDoc}
    `String` | `getPath()` Returns the path of this project.
    `File` | `getProjectDirectory()` Returns the project directory for this project.
    `ProjectIdentifier` | `getProjectIdentifier()` Returns the identifier for this Gradle project.
    `DomainObjectSet<? extends GradleTask>` | `getTasks()` {@inheritDoc}

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface BuildableElement` | `getTasks`
    `interface HierarchicalElement` | `getChildren, getParent`

- - ### Method Detail

    - #### @Nullable public GradleProject findByPath(String path)

      Searches all descendants (children, grand-children, etc.), including self, by given path.

      Returns:
        Gradle project with matching path or `null` if not found.

    - #### @Incubating public File getBuildDirectory()

      Returns the build directory for this project.

      throws:
        UnsupportedMethodException For Gradle versions older than 2.0, where this method is not supported.
      Returns:
        The build directory.
      Since:
        2.0

    - #### @Incubating public GradleScript getBuildScript()

      Returns the build script for this project.

      throws:
        UnsupportedMethodException For Gradle versions older than 1.8, where this method is not supported.
      Returns:
        The build script.
      Since:
        1.8

    - #### public DomainObjectSet<? extends GradleProject> getChildren()

      {@inheritDoc}

    - #### public GradleProject getParent()

      {@inheritDoc}

    - #### public String getPath()

      Returns the path of this project. This is a unique identifier for this project within the build.

      Returns:
        The path.

    - #### @Incubating public File getProjectDirectory()

      Returns the project directory for this project.

      throws:
        UnsupportedMethodException For Gradle versions older than 2.4, where this method is not supported.
      Returns:
        The project directory.
      Since:
        2.4

    - #### @Incubating public ProjectIdentifier getProjectIdentifier()

      Returns the identifier for this Gradle project.

      Since:
        2.13

    - #### public DomainObjectSet<? extends GradleTask> getTasks()

      {@inheritDoc}