Currently, only tasks with complete subproject specifier are added to
.gradletasknamecache. Gradle commands can be called for all (sub-)projects
they are defined for, using their name as defined in the subproject, here
called "simple" task names. One example is "gradle clean".
This patch adds support for parsing out those "simple" task names from the list
of fully specified task names. The .gradletasknamecache file will contain
both the fully specified names, and the "simple" names for your autocompletion
pleasure.
* Improve gradle plugin task parsing
Added _gradle and _gradlew as symbolic links to gradle.plugin.zsh,
otherwise the plugin was not properly loaded.
Output from `gradlew tasks --all` is now parsed in two levels,
first we find segments between `------...` and a newline.
Second, all those lines are parsed and cleaned using awk
and added to .gradletasknamecache.
Tested on gradle 2.13, and gradlew 2.14.
* Remove .gradletasknamecache before regenerating it
Remove the .gradletasknamecache file to avoid having an unnecessary
newline at the top of the file when regenerating it.
* Improve gradle task parsing by writing .gradletasknamecache atomically
Previously the .gradletasknamecache file was written line by line inside a parsing loop,
which could cause errors such as half-written cache files if the process was aborted.
This also removes the need of deleting the .gradletasknamecache file before parsing.
* Enhanced gradle plugin to parse tasks from a quick execution of the tool
* Added a duplicated function for gradlew completion that uses gradlew internally. Builds like Gradle itself (built with Gradle) are sensitive to being run with a matching gradlew version.
* Fixed broken caching of gradle task names. Added - and -- argument completions.