Gradle ProjectDescriptor

From NovaOrdis Knowledge Base
Revision as of 21:41, 11 October 2020 by Ovidiu (talk | contribs) (→‎Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

External

Internal

Overview

Project information can be accessed from settings.gradle via ProjectDescriptor instances. Project instances are not accessible at this stage. ProjectDescriptor instances are created when a new project is added to the build from the settings script via include or includeFlat.

The ProjectDescriptor instances can be looked up in settings.gradle as follows:

project(':subproject-A')
findProject(':subproject-A')

The methods take a path as arguments and return the corresponding ProjectDescriptor instance. The ProjectDescriptor instance can be use to access and mutate state of the corresponding project.