Reputation: 24343
Is there a global configuration option for gradle
so that it will use the gradle wrapper if gradlew
is present?
Upvotes: 1
Views: 227
Reputation: 2536
You could install and use gdub
(https://github.com/dougborg/gdub). This will use the gradle wrapper if found for the project, or use globally installed gradle if not found.
Installing it was literally just two lines of code:
$ curl -sLo- http://get.bpkg.sh | bash
$ bpkg install dougborg/gdub -g
And use it like this:
$ gw build
Upvotes: 0
Reputation: 24343
Add the following to ~/.bashrc
or ~/.bash_profile
file:
gradle() {
if [ -f ./gradlew ]; then
./gradlew "$@"
else
command gradle "$@"
fi
}
Upvotes: 2