Creating task in root project fails


I’m trying to create a task in root project

allprojects {
task hello << {task -> println “I’m $” }

but it fails with below error

  • What went wrong:
    A problem occurred evaluating root project ‘Test’.

Could not find property ‘hello’ on root project ‘Test’.

Oh, It was a silly mistake
Works well now.
Thanks a lot