GNG is Not Gradle

Project maintained by gdubw Hosted on GitHub Pages — Theme by mattgraham


GNG is the successor of gdub. It keeps the original gw command and with more features.

It is written totally in bash script.

Quick Start


#Install gng
brew tap gdubw/gng
brew install gng

Self-Extracting Installer

The self-extracting installer is created with makeself. If you are interested in the packaging details , Please see release.yml.

 # Downloading the latest release
 curl -fsSL -o
 sudo bash ./

After Installation is complete:

# Creates a new Gradle project with Gradle wrapper
gng wrapper -d example-project
cd example-project
# From now on, always type `gw` whenever you need to type `gradlew`

GNG is Not Gradle

GNG is a script that automatically search your gradlew when you are inside your Gradle project and execute it. It also contains an official Gradle wrapper. You can create gradle projects from scratch without installing Gradle.

This is originally inspired by gdub and gradlew-bootstrap.

What’s the problem?

I worked with a lot of gradle projects, every project has its own Gradle Wrapper. So the global installed one, normally installed with brew install gradle, is seldom used. In fact, the global installed gradle’s version may conflict with the project you are working on and some weird and unexpected building failures may happen. The best practice is always using Gradle Wrapper comes with a project. It’s better to not keep a copy of global available gradle.

But keep typing ./gradlew is cumbersome. It becoms even worse when you have to type ../gradlew, or ../../gradlew.

I am a heavy Gradle user, I always need to create a new Gradle project for trying some new ideas, without the globally installed gradle , it is not possible installing Gradle Wrapper into a brand-new project.

You might interest in these discussions.

Quoted from gdub


Just type gw whenever you need to type gradle or gradlew, then your life will be easier.

If you don’t have any Gradle or Gradle Wrapper installed, please don’t worry. just type gng wrapper. It will create a Gradle wrapper in your current working directory.

‘gng’ and ‘gw’

There are two commands gw and gng. gw is for your daily use and gng provides extra functions.

gng wrapper -h
Generates a Gradle Wrapper
Usage: gng wrapper [-v|--version <arg>] [-t|--distribution-type <arg>] [-m|--mirror <arg>] [-h|--help] [ -d|--destination-dir <arg>
	-v, --version: Gradle Version (default: 'latest', version information is from, visit for all available versions)
	-t, --distribution-type: Gradle Distribution Type (default: 'all')
	-m, --mirror: Gradle Distribution Mirror URL Prefix(Optional with no default value, The url prefix replaces
	              It replaces the whole distributionUrl except the file part in a URL. For example, if specify '-m ""', then
	              "" will become ""
	-d, --destination-dir : Your Gradle project root directory. (default: 'Your current working directory retrieved using ${PWD}')
	-h, --help: Prints help

Please note that gng wrapper OVERRIDES the original command gradle wrapper that executes Gradle Wrapper task. If you want to execute the Gradle wrapper task instead, please type gw wrapper.

Example: The following command will create a directory ‘test’ and install a copy of Gradle Wrapper with the latest version Gradle.

gng wrapper -d test

It will output like this(version number may vary as time goes by):

Fetching the latest Gradle version from

The latest Gradle version is 6.8.1

Installing Gradle Wrapper in test. (version=6.8.1, distributionType=all, mirrorUrl=<Not Specified>)

More examples

  1. gng wrapper will silently upgrade your existing Gradle Wrapper to the latest version
  2. gng wrapper -v 4.8.1 will silently set your existing Gradle Wrapper to the version 4.8.1
  3. gng wrapper -t all will silently set your existing Gradle Wrapper to the latest version with Gradle source code archive(
  4. gng wrapper -v 4.2.1 -m ' will set your Gradle’s version to 4.2.1 and distributionUrl to
  5. gng wrapper -v 4.2.1 -t all -m ' will set your Gradle’s version to 4.2.1 and distributionUrl to



brew tap gdubw/gng
brew install gng

Installing from source

git clone
cd gng
sudo ./

Aliasing the gradle command

To avoid using any system wide Gradle distribution add a gradle alias to gw to your shell’s configuration file.

Example bash:

echo "alias gradle=gw" >> ~/.bashrc
echo "export PATH=/usr/local/bin:${PATH}" >> ~/.bashrc
source ~/.bashrc usage

sudo ./ [-fhsu]

Install gng from git source tree. See for details.

-u uninstall
-f re-install
-h usage
-s check for update


  1. ./ -f will re-install everything
  2. ./ -s will check for latest updates from remote master
  3. git reset --hard && git pull will keep your copy to the latest

How does GNG install Gradle Wrapper?

It copies the embedded Gradle Wrapper to your project directly. You can trust the embedded gradle-wrapper.jar. It is verified by Gradle Wrapper Validation .