Gradle tab completion for bash and zsh
md5: too many arguments
is mitigated by being a little smarter about which Gradle scripts are cached (#71)md5: too many arguments
is mitigated by being a little smarter about which Gradle scripts are cached (#71)You can now install gradle-completion
via Homebrew! 🎉
COMP_WORDBREAKS
and therefore no longer interferes with some other completion scripts. (#29)gradle --include-build ../fo<TAB>
) (#26, #35)set -o noclobber
is set. (#40 — thanks @yloiseau)--include-build
, --init-script
, and --system-prop
can be completed multiple times. (#45)You can now complete options and tasks while in a subproject! This should be especially good news for gw
users, who don't have to specify their root build file or path to Gradle wrapper.
Zsh now has completes all options for gradle init
, gradle tasks
, gradle wrapper
and more.
Regenerating the completion cache is now done in the background. You can also trigger it with __gradle-completion-init
. Completion caching and retrieval is much, much faster for large projects (note: large array operations in shell scripts get exponentially slower as the array grows).
For bash, reducing the amount of data being processed by compgen
makes completion 2-20x faster depending on size of project (bigger gains for larger projects).
For zsh, manually managing the completion cache (instead of using zsh's built-in cache) makes completion 1.5-10x faster depending on the size of project (again, larger projects benefit more).
Completion should now occur under 200ms after initial caching for the vast majority of projects and environments. Please file an issue if you see otherwise with details of your build/environment.
Gradle allows you to access tasks of subprojects from the project root implicitly. For example, given these tasks:
:foo
:help
:bar:baz
You can execute gradle baz
from the project root and it will execute :bar:baz
.
gradle-completion will not tab complete these tasks by default because it adds a significant number of completion options, which may not be what you want.
To allow completion of implicit tasks, export GRADLE_COMPLETION_UNQUALIFIED_TASKS=true
.
2 new options here, see details in the README Configuration section.
export GRADLE_COMPLETION_EXCLUDE_PATTERN="(build|integTest|samples)/"
$GRADLE_CACHE_TTL_MINUTES
gradle-completion will now perform completions when you're using the gw
command. Please note that completion from subprojects isn't supported yet (#3). Hoping that will be addressed in v1.2.0.