Gradle, gretty - How to run a task in farm task?

I would like to run a task in farm task

   farm {
        // run my task here.
   }

Can anyone help me with this? Thank you very much.

Since this question is about the third-party Gretty plugin, you will probably get a better/faster answer there.