Offers means to lazily validate user-specified settings that required for certain tasks (like upload tasks require secret Bintray keys). We don't want to validate the presence of those key is every regular build because it would upset the contributor/developer workflow. We want to validate the settings before any task is executed so that no tasks run if all required settings are not supplied. See lazyConfiguration(Task, Runnable). See also DeferredConfiguration.
| Type | Name and description |
|---|---|
static void |
forceConfiguration(org.gradle.api.Task task)Forces lazy configuration to be triggered for given task |
static void |
lazyConfiguration(org.gradle.api.Task task, java.lang.Runnable configuration)Performs configuration only if given task is in the task execution graph. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Forces lazy configuration to be triggered for given task
Performs configuration only if given task is in the task execution graph. Very useful if the task needs information such as secret credentials / api keys. We validate for presence of those secrets only when the task is scheduled in the graph. This way, normal builds don't require users to provide secrets. Only release builds will fail early when secrets are not provided.
Lazy configuration action should not apply other plugins, add tasks or add new task relationships (like dependsOn). It will not work because Gradle does not allow adding tasks after the task graph has be already created.