TaskCollection.matching
needs more elaborate description regarding task-configuration avoidance
#26047
Labels
TaskCollection.matching
needs more elaborate description regarding task-configuration avoidance
#26047
Issue type
Wrong or misleading information
Problem description
Up to (including) 7.2, the task configuration avoidance documentation stated:
For 7.3 this was changed in #17885 to
Besides the discrepancy of argument types in left and right column, while it affects both overloads the same,
both variants are misleading and it needs more elaborate description or instructions.
If you put the following into an empty build script (DSL doesn't matter):
Then execute
gw help
, the output isIf you without further change execute
gw :foo
the output isSo, whether
TaskCollection.matching
is fine or not, depends on the concrete usage.If you pair it with
configureEach
to only configure matching tasks, it behaves perfectly fine regarding configuration avoidance.But if you enumerate the task collection, for example by using it in
dependsOn
, each and every task gets realized to check the predicate, even if it results in an empty task collection like in the given example.Page with the problem
https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
The text was updated successfully, but these errors were encountered: