What is "task" from a groovy standpoint?

newbie question - what is “task” from a groovy standpoint? I tried exploring by creating a task like this - task Hello << { println “hello” } println Hello.class

This printed out class org.gradle.api.DefaultTask_Decorated

However I could not figure out what “task” is. It does not appear to be a function since Hello becomes a symbol. I’d appreciate any pointers very much.

Take a look at my answer to this question

TL;DR : task is a method on an instance of Project

There is a Groovy compiler plugin (AST transform) involved here which rewrites ‘task Hello’ to ‘project.task(“Hello”)’.

Thank you so much Perryn and Peter. Just what I was looking for.

Regards, Kashyap