api / org.gradle.api / Project / project

project

abstract fun project(path: String): Project

Locates a project by path. If the path is relative, it is interpreted relative to this project.

Parameters

path - The path.

Exceptions

UnknownProjectException - If no project with the given path exists.

Return
The project with the given path. Never returns null.

abstract fun project(path: String, configureClosure: Closure<Any>): Project

Locates a project by path and configures it using the given closure. If the path is relative, it is interpreted relative to this project. The target project is passed to the closure as the closure's delegate.

Parameters

path - The path.

configureClosure - The closure to use to configure the project.

Exceptions

UnknownProjectException - If no project with the given path exists.

Return
The project with the given path. Never returns null.

abstract fun project(path: String, configureAction: Action<in Project>): Project

Locates a project by path and configures it using the given action. If the path is relative, it is interpreted relative to this project.

Parameters

path - The path.

configureAction - The action to use to configure the project.

Exceptions

UnknownProjectException - If no project with the given path exists.

Return
The project with the given path. Never returns null.

Since
3.4