# BuildFeature

interface BuildFeature

Status of a Gradle feature in the current invocation, such as Configuration Cache.

Gradle features can be enabled or disabled via build options, but in some cases other flags or features can affect that. For this reason, the getRequested status represents the configuration of a feature in isolation, and the getActive status represents the final result, after everything has been taken into account.

Some flags disable features. For instance, `--export-keys` flag always disables Configuration Cache. If `--configuration-cache` is provided at the same time, then `configurationCache.requested.get() == true`, but `configurationCache.active.get() == false`.

Some features automatically enable other features. For instance, enabling Isolated Projects enables Configuration Cache. So that `configurationCache.requested` has no value, but `configurationCache.active.get() == true`.

#### Since

8.5

#### See also

BuildFeatures

## Functions

getActive
Link copied to clipboard
abstract fun getActive(): Provider<Boolean>
Effective status of the feature:

- true - the feature is active and taking effect
- false - the feature is deactivated

This method provides only generic information about the status of the feature.
getRequested
Link copied to clipboard
abstract fun getRequested(): Provider<Boolean>
How the feature was requested:

- true - explicitly enabled (e.g. `--configuration-cache`)
- false - explicitly disabled (e.g. `--no-configuration-cache`)
- provider has no value - no preference, default behavior

Use getOrNull to safely retrieve a nullable value or check isPresent as the provider can have no value in the case there is no explicit request.