Question

With the command gradle tasks one can get a report of all available tasks. Is there any way to add a parameter to this command and filter tasks by their task group.

I would like to issue a command like gradle tasks group:Demo to filter all tasks and retrieve a list of only those tasks that belong to the task group called Demo.

Was it helpful?

Solution

There is no such feature. Feel free to suggest new features at http://forums.gradle.org.

OTHER TIPS

You can do so by adding the following task to your build script:

task showOnlyMyTasks << {
    tasks.each {
        task -> if (task.group == 'My task group name') {
        println(task.name)
        }
    }
}

And then run:gradle showOnlyMyTasks

If you need only the list, you can use gradle -q

From v5.1, you can do this: gradle tasks --group=<group-name>

Gradle docs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top