You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even if it sounds bad as it remembers to afterEvaluate, here the schema is deterministic, so I would like to have a callback which is invoked when the whole schema has been processed to allow using flags that will be resolved in configuration phase, but not Property, as they are oriented to configure tasks.
For example, based on an enabled flag, I would like to decide if I apply or not a plugin, and that is done in the configuration phase after the whole schema has been processed to ensure nested values modified by the user are already with the correct value in the callback.
Another valid example could be not registering tasks (note: it is not registering them at all, no disable them with onlyIf).
The text was updated successfully, but these errors were encountered:
Another option could be having the concept of configuration Property, oriented to the configuration phase.
@Restricted
publicinterfaceFoo {
@get:Restricted publicval bar:ConfigurationProperty<Boolean>
}
// called after the `dcl` has been processed
foo.bar.onProcessed {
project.pluginManager.apply(...)
project.tasks.register(...)
}
For this last option, a way to combine multiple options is a must too to avoid multinesting:
// called after the `dcl` has been processed
combineOnProcessed(foo.bar, foo.baz) { bar, baz ->
project.pluginManager.apply(...)
project.tasks.register(...)
}
I don't know until which point this reminds me a lot of Kotlin Coroutines. It can be mad, but maybe Gradle could move to using coroutines so it can get the advantage of async + stream APIs, those coroutines would have a lifecycle for each phase or something so.
Even if it sounds bad as it remembers to
afterEvaluate
, here the schema is deterministic, so I would like to have a callback which is invoked when the whole schema has been processed to allow using flags that will be resolved in configuration phase, but notProperty
, as they are oriented to configure tasks.For example, based on an
enabled
flag, I would like to decide if I apply or not a plugin, and that is done in the configuration phase after the whole schema has been processed to ensure nested values modified by the user are already with the correct value in the callback.Another valid example could be not registering tasks (note: it is not registering them at all, no disable them with
onlyIf
).The text was updated successfully, but these errors were encountered: