Mendhak Mendhak - 4 months ago 23
Groovy Question

How can I specify a category for a Gradle task?

I am writing a Gradle task in Intellij IDEA. I have noticed that in the Gradle window, the tasks appear under folders like so:

enter image description here

I am wondering, how can you give a task a 'category' so that it appears in a folder as shown in the screenshot?

All the tasks I create usually end up in

. I am also writing a custom plugin and want it to appear under a 'folder' name of my choosing. but I assume it'll be the same answer for when writing a task.


You just need to set the group property of your task. Eg (from

task publish(type: Copy) {
    from "sources"
    into "output"

configure(publish) {   
    group = 'Publishing'
    description = 'Publish source code to output directory'