What's the operator << (double less than) in gradle?

后端 未结 2 839
南旧
南旧 2020-12-16 09:41

The following piece of code defines 4 gradle tasks:

4.times { counter ->
    task \"task$counter\" << {
        println \"I\'m task number $counter\         


        
2条回答
  •  时光取名叫无心
    2020-12-16 10:19

    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.

提交回复
热议问题