The Gradle User Guide shows a syntax for creating a task that I don't understand:
task hello << {
println 'Hello world!'
}
What is the <<
doing there?
The question/answer was a little enlightening but I still don't know exactly what <<
is. Is <<
a groovy thing or a gradle thing?
Bob's answer covers the Groovy side. For the Gradle portion, << corresponds to doLast on task, adding another action to the end of the task's list of actions.
It's a groovy thing. Operators can be overloaded in Groovy by declaring a method on the object the operator is applied on. In this case, the method is leftShift().
See http://groovy.codehaus.org/Operator+Overloading for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With