Task name abbreviation

Before we look at more Gradle command-line options, it is good to discuss a real-time save feature of Gradle: task name abbreviation. With task name abbreviation, we don't have to type the complete task name on the command line. We only have to type enough of the name to make it unique within the build.

In our first build, we only have one task, so the gradle h command should work just fine. However, we didn't take the built-in help task into account. So, to uniquely identify our helloWorld task, we use the hello abbreviation:

$ gradle -q hello
Hello world.

We can also abbreviate each word in a CamelCase task name. For example, our helloWorld task name can be abbreviated to hW:

$ gradle -q hW
Hello world.

This feature saves ...

Get Gradle Effective Implementations Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.