T- The type of value obtained from this source.
P- The source specific parameter type.
@Incubating public interface ValueSource<T,P extends ValueSourceParameters>
Representing external sources as
ValueSources allows Gradle to transparently manage
the configuration cache
as values obtained from those sources change.
For example, a build might run a different set of tasks depending on whether the
environment variable is set or not.
To integrate a new type of value source, create an abstract subclass of this interface
ProviderFactory.of(Class, Action) to get a provider to a configured source.
Provider can be passed to tasks or queried
by build logic during the configuration phase, in which case the source would be automatically
considered as an input to the work graph cache.
A value source implementation will most likely take parameters. To do this create a
ValueSourceParameters and declare this type as the type parameter
to the value source implementation.
A value source implementation doesn't have to be thread-safe, as the single call
obtain() is synchronized.
@Inject P getParameters()
This method must be implemented in the subclass.
This method is only called if the provider value is requested and only once in that case.
nullif the value is not present.