gradle
8.4

# map

abstract fun <S> map(transformer: Transformer<out @Nullable S, out Any>): Provider<S>(source)

Returns a new Provider whose value is the value of this provider transformed using the given function.

The resulting provider will be live, so that each time it is queried, it queries the original (this) provider and applies the transformation to the result. Whenever the original provider has no value, the new provider will also have no value and the transformation will not be called.

When this provider represents a task or the output of a task, the new provider will be considered an output of the task and will carry dependency information that Gradle can use to automatically attach task dependencies to tasks that use the new provider for input values.

#### Parameters

transformer

The transformer to apply to values. May return `null`, in which case the provider will have no value.