Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Gradle uses the Gradle graphical user interface


May 25, 2021 Gradle


Table of contents


Use the Gradle graphical user interface

In addition to supporting the traditional command-line interface, Gradle also provides a graphical user interface (GUI). This is a stand-alone user interface that can be started by adding the --gui parameter.

Launching the GUI

gradle --gui  

Note: This command line window will be locked until the Gradle GUI is closed. If you're on a linux/unix system, you can make it run as a background task through (gradle --gui.)

If you run the Gradle GUI in your Gradle project directory, you should see a task tree.

GUI Task Tree

Gradle uses the Gradle graphical user interface

It is a good idea to run this command from the Gradle project directory so that the settings for the UI can be stored in your project directory. Of course, you can also run it first, and then change the working directory by using the Settings tab in the UI.

In Gradle's user interface (UI), there are four tabs above and an output window below.

Task tree

The task tree shows the hierarchy of all projects and their tasks. Double-clicking on a task can execute it.

There is also a filter to hide less-used tasks. Y ou can switch whether to filter or not via the Filter button. B y editing filters, you can configure which tasks and items to display. H idden tasks appear in red. Note: Newly created tasks are displayed (not hidden) by default

The context menu for the task tree provides the following options:

  • The execution ignores the dependency. This allows the rebuild to be built without relying on the project (as with the -a option)
  • Add tasks to your favorites (see Favorites tab)
  • Hide selected tasks. This will add them to the filter.
  • Edit the build.gradle file. N ote: This requires a version of Java 1.6 or higher and requires that the gradle file be associated in your operating system.

Favorites

The Favorites tab is used to store commands that are frequently executed. T hese commands can be complex commands (as long as they conform to Gradle's syntax), and you can give them a display name. I t is used to create a custom command to display skip tests, documents, examples. You can call it "quick build."

You can sort favorites to your preferences, even export them to disk and import them elsewhere. I f you edit them, select Always show live output, which is only valid if you select Show output when an error occurs. It always forces the output to be displayed.

The command line

The command line tab is where a single Gradle command is executed directly. A ll you have to do is enter the commands that you often enter after "Gradle" on the command line. It also provides a place to try first for commands to add to your favorites.

Set up

The Settings tab allows you to configure some general settings

GUI Setup

Gradle uses the Gradle graphical user interface

  • The current directory defines the root of your Gradle project, usually where build.gradle is located.
  • Stack trace output This determines how much information is set to stack trace when an error occurs. Note: If you specify a stack trace level on the command line or favorites tab, the settings here will be overwritten.
  • Show output only in the event of an error Enable this option to hide any output when the task is executed unless the build fails.
  • Use a custom Gradle executor - Advanced features this gives you an alternative way to start the Gradle command line. T his is very useful. If your project needs to do some extra configuration in another batch file or shell script (such as specifying an initialization script).