简体   繁体   中英

How to investigate what other task will run is when running a task on Gradle?

In Android project, every time I run ./gradlew assemble . Gradle will run task such as:

  • :app:preBuild
  • :app:preDebugBuild
  • :app:checkDebugManifest

and so on..

Is there a way to know the list of task that will run each time I run a gradle task?

Maybe there's a gradle command for that, or another options is to silent each task output while keep showing task name.

There is a feature for your use-case called Dry-Run :

4.8 Dry-Run

Sometimes you are interested in which tasks are executed in which order for a given set of tasks specified on the command line, but you don't want the tasks to be executed. You can use the -m option for this. For example, if you run gradle -m clean compile , you'll see all the tasks that would be executed as part of the clean and compile tasks. This is complementary to the tasks task, which shows you the tasks which are available for execution.

Gradle is just a build system, and those tasks are predefined in the gradle wrapper.

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM