The following piece of code defines 4 gradle tasks:
4.times { counter ->
task \"task$counter\" << {
println \"I\'m task number $counter\
Basically this is a leftShift
operator - You can find more details here.
In gradle <<
operator is used to add action to a particular task. A task consists of multiple actions that are run (in order they were added) during the execution of the task. <<
just adds an action to tasks collection of actions. More about tasks and actions can be found here.