Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a command-line way to get information about a gradle task?

Tags:

gradle

Is there some kind of command like gradlew help <task> that gives documentation about what exactly goes on in a particular task?

like image 921
Matthew Avatar asked Oct 04 '13 22:10

Matthew


People also ask

How do I run a Gradle task in CMD?

The gradle command will run Gradle on the gradle build script located in the same directory as the command prompt is located in. That means, that to run gradle on a specific gradle build script you must change directory in the command prompt into the directory where the build script is located.

How do I open the Gradle command line?

Press ⌃⌃ (macOS), or Ctrl+Ctrl (Windows/Linux), type "gradle" followed by the gradle task name or names. We can, of course, run Gradle commands from the terminal window inside IntelliJ IDEA. Open this with ⌥F12 (macOS), or Alt+F12 (Windows/Linux).

How do I list tasks in Gradle?

To get an overview of all Gradle tasks in our project, we need to run the tasks task. Since Gradle 5.1, we can use the --group option followed by a group name. Gradle will then show all tasks belonging to the group and not the other tasks in the project.


2 Answers

There is

gradle help --task <taskname> 

for exactly this now.

like image 84
amitavk Avatar answered Sep 20 '22 15:09

amitavk


gradlew -dry-run <task>

will show what will be executed for the command. A shortcut version is:

gradlew -m <task>

Also

gradlew tasks

will show a list of all tasks and their dependencies.

like image 32
Kevin Welker Avatar answered Sep 18 '22 15:09

Kevin Welker