ProjectBuilder (Gradle API 2.14.1)

Package: org.gradle.testfixtures

## [Java] Class ProjectBuilder

- org.gradle.testfixtures.ProjectBuilder

- Creates dummy instances of Project which you can use in testing custom task and plugin implementations.

  To create a project instance:

  1. Create a `ProjectBuilder` instance by calling builder().
  2. Optionally, configure the builder.
  3. Call build() to create the `Project` instance.

  You can reuse a builder to create multiple `Project` instances.

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Project` | `build()` Creates the project.
    `static ProjectBuilder` | `builder()` Creates a project builder.
    `ProjectBuilder` | `withName(String name)` Specifies the name for the project
    `ProjectBuilder` | `withParent(Project parent)` Specifies the parent project.
    `ProjectBuilder` | `withProjectDir(File dir)` Specifies the project directory for the project to build.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Method Detail

    - #### public Project build()

      Creates the project.

      Returns:
        The project

    - #### public static ProjectBuilder builder()

      Creates a project builder.

      Returns:
        The builder

    - #### public ProjectBuilder withName(String name)

      Specifies the name for the project

      Parameters:
        `name` - project name
      Returns:
        The builder

    - #### public ProjectBuilder withParent(Project parent)

      Specifies the parent project. Use it to create multi-module projects.

      Parameters:
        `parent` - parent project
      Returns:
        The builder

    - #### public ProjectBuilder withProjectDir(File dir)

      Specifies the project directory for the project to build.

      Parameters:
        `dir` - The project directory
      Returns:
        The builder