keylogger
keylogger

Reputation: 872

Why "gradle tasks" doesn't show the tasks?

I only have this in my build.gradle file

project.task ("Task1")
task("Task2")
task Task3

I am using Gradle version 3.5 and when I execute

gradle tasks

in command line, no tasks are shown. But when I do

gradle tasks --all

, then I can see my tasks

Other tasks
-----------
Task1
Task2
Task3

Do we need to always use gradle tasks --all to see all the tasks? In some tutorial website, they just use gradle tasks and all tasks will be shown. Wondering where do I do wrongly here. Thanks.

Upvotes: 3

Views: 4287

Answers (1)

Stanislav
Stanislav

Reputation: 28106

I think, the reason is that according to the documentation the gradle tasks command:

shows only those tasks which have been assigned to a task group, so-called visible tasks. You can do this by setting the group property for the task. You can also set the description property, to provide a description to be included in the report.

You can read about it in the official documentation here.

P.S.: in my case, with Grdale 2.14.1, command gradle tasks lists all the tasks, even though documentation for this version says the same as for 3.5, that it should lists only grouped tasks by default.

Upvotes: 6

Related Questions