getParent

@Nullable
abstract fun getParent(): @Nullable Project(source)

Returns the parent project of this project, if any.

There are two cases where a project will not have a parent:

  • The project is the root project of the build.
  • The project is located in a nested directory (not the root of the build), getProjectDir has been used after including the project in order to locate it, and no project has been included that is located in this project's parent directory.

Return

The parent project, or null if this is the root project or a nested project without a parent.