← 返回命令列表

Linux command

gradle-tasks 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List main tasks

gradle tasks

List all tasks including internal ones

gradle tasks --all

List with Gradle wrapper

./gradlew tasks

List tasks for a subproject

gradle :app:tasks

List tasks in a specific group

gradle tasks --group [build]

Get help on a specific task

gradle help --task [taskName]

说明

gradle tasks displays available tasks for the selected project. By default, it shows only tasks assigned to a task group that have descriptions. Use --all to include ungrouped, internal, and lifecycle tasks. Use --group to filter by a specific task group. Use gradle help --task to get detailed information about a specific task including its type, path, and options. Tasks are organized into groups such as build, verification, documentation, and help. Custom task groups defined in build scripts also appear in the output.

参数

--all
Show all tasks including internal and lifecycle tasks without a group.
--group _name_
Show only tasks belonging to the specified group.
--no-report
Hide the task rule report at the bottom of the output.

FAQ

What is the gradle-tasks command used for?

gradle tasks displays available tasks for the selected project. By default, it shows only tasks assigned to a task group that have descriptions. Use --all to include ungrouped, internal, and lifecycle tasks. Use --group to filter by a specific task group. Use gradle help --task to get detailed information about a specific task including its type, path, and options. Tasks are organized into groups such as build, verification, documentation, and help. Custom task groups defined in build scripts also appear in the output.

How do I run a basic gradle-tasks example?

Run `gradle tasks` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --all do in gradle-tasks?

Show all tasks including internal and lifecycle tasks without a group.