A tab completion script that works for Bash. Should work on Mac and on Linux.
$ gradle [TAB]
androidDependencies check init properties
assemble clean installDebug signingReport
assembleDebug connectedCheck installDebugTest tasks
assembleDebugTest connectedInstrumentTest installRelease uninstallAll
assembleRelease dependencies lint uninstallDebug
build dependencyInsight lintDebug uninstallDebugTest
buildDependents deviceCheck lintRelease uninstallRelease
buildNeeded help projects wrapper
$ gradle c[TAB]
check clean connectedCheck connectedInstrumentTest
Gives tab completions relevent to the current Gradle project (if any).
curl -L -s https://gist.githubusercontent.com/dokky/10867b9120d4e06555ad5df78965fb41/raw/fde16c3bfcc718712540e0314fc0445be08d85f3/gradle-tab-completion.bash \
-o ~/gradle-tab-completion.bash
Then add to your ~/.bash_profile
:
source ~/gradle-tab-completion.bash
It will be kinda slow the first time you use it. But after that, it'll be super fast, because everything's cached based on the md5sum of your build.gradle
files.
Thanks to @ligi for Linux support!