Settings
Declares the configuration required to instantiate and configure the hierarchy of instances which are to participate in a build.
There is a one-to-one correspondence between a Settings
instance and a {@value
* #DEFAULT_SETTINGS_FILE}
settings file. Before Gradle assembles the projects for a build, it creates a Settings
instance and executes the settings file against it.
Assembling a Multi-Project Build
One of the purposes of the Settings
object is to allow you to declare the projects which are to be included in the build. You add projects to the build using the include method. There is always a root project included in a build. It is added automatically when the Settings
object is created. The root project's name defaults to the name of the directory containing the settings file. The root project's project directory defaults to the directory containing the settings file.
When a project is included in the build, a ProjectDescriptor is created. You can use this descriptor to change the default values for several properties of the project.
Using Settings in a Settings File
Dynamic Properties
In addition to the properties of this interface, the Settings
object makes some additional read-only properties available to the settings script. This includes properties from the following sources:
- Defined in the {@value org.gradle.api.Project#GRADLE_PROPERTIES} file located in the settings directory of the build.
- Defined the {@value org.gradle.api.Project#GRADLE_PROPERTIES} file located in the user's
.gradle
directory. - Provided on the command-line using the -P option.
Properties
Functions
Applies the plugin of the given type T. Does nothing if the plugin has already been applied.
Kotlin extension function for org.gradle.api.plugins.PluginAware.apply.
Applies the given plugin or script.
Locates a property on Settings.
Returns the extension of the specified type.
Returns the extension of the specified extensionType.