For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

environmentVariable

abstract fun environmentVariable(variableName: String): Provider<String>(source)

Creates a Provider whose value is fetched from the environment variable with the given name.

Return

The provider. Never returns null.

Since

6.1

Parameters

variableName

The name of the environment variable.


abstract fun environmentVariable(variableName: Provider<String>): Provider<String>(source)

Creates a Provider whose value is fetched from the environment variable with the given name.

Return

The provider. Never returns null.

Since

6.1

Parameters

variableName

The provider for the name of the environment variable; when the given provider has no value, the returned provider has no value.