I am writing a Gradle task in Intellij IDEA. I have noticed that in the Gradle window, the tasks appear under folders like so:
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 other
. 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.
Gradle determines the subset of the tasks, created and configured during the configuration phase, to be executed. The subset is determined by the task name arguments passed to the gradle command and the current directory. Gradle then executes each of the selected tasks.
You just need to set the group
property of your task. Eg (from http://mrhaki.blogspot.co.uk/2012/06/gradle-goodness-adding-tasks-to.html)
task publish(type: Copy) { from "sources" into "output" } configure(publish) { group = 'Publishing' description = 'Publish source code to output directory' }
Or, shorter syntax:
task publish(type: Copy) { group = "Publishing" description = "Publish source code to output directory" from "sources" into "output" }
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