From e46843685c1f337e1266a51c9cae1889c4ae9eba Mon Sep 17 00:00:00 2001 From: Erik Zivkovic Date: Thu, 15 Sep 2016 12:16:46 +0200 Subject: Improve gradle plugin task parsing (#5230) * 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. --- plugins/gradle/_gradle | 1 + 1 file changed, 1 insertion(+) create mode 120000 plugins/gradle/_gradle (limited to 'plugins/gradle/_gradle') diff --git a/plugins/gradle/_gradle b/plugins/gradle/_gradle new file mode 120000 index 000000000..80723f2fc --- /dev/null +++ b/plugins/gradle/_gradle @@ -0,0 +1 @@ +gradle.plugin.zsh \ No newline at end of file -- cgit v1.2.3-70-g09d2