Using "terminal-notifier" here: https://github.com/alloy/terminal-notifier
Make a helper script for terminal-notifier to keep you from killing yourself:
$ cat ~/bin/terminal-notifier
#!/bin/bash
/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier "$@"
Then alias "gr" to this script to find the nearest gradlew, run it, and notify you when it's done:
function gr {
if test -x ./gradlew; then
gradlew="./gradlew"
else
if test -x ../gradlew; then
gradlew="../gradlew"
fi
fi
if $gradlew "$@"; then
terminal-notifier -title "gradle" -message "Build succeeded."
else
terminal-notifier -title "gradle" -message "BUILD FAILED :("
fi
}