0e9e5360c400cda5a80c9394583b9acbf7cfe711

Author
Bartek Pacia <barpac02@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(gradle): update completion from upstream (#11485)

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/gradle/_gradle b/plugins/gradle/_gradle
  2index 770723d852c647897a60e0707417a258371c40f7..1da5aebeec1f3eb0f7d1a254501896506ecc5166 100644
  3--- a/plugins/gradle/_gradle
  4+++ b/plugins/gradle/_gradle
  5@@ -1,4 +1,3 @@
  6-#compdef gradle gradlew gw
  7 #
  8 # Taken from https://github.com/gradle/gradle-completion
  9 # Copyright (c) 2017 Eric Wendelin
 10@@ -22,6 +21,8 @@
 11 # SOFTWARE.
 12 # Terms
 13 
 14+#compdef gradle gradlew gw
 15+
 16 __gradle-set-project-root-dir() {
 17     local dir=`pwd`
 18     project_root_dir=`pwd`
 19@@ -96,7 +97,7 @@ __gradle-generate-script-cache() {
 20         zle -R "Generating Gradle build script cache"
 21         # Cache all Gradle scripts
 22         local -a gradle_build_scripts
 23-        gradle_build_scripts=( $(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | grep -E -v "$script_exclude_pattern") )
 24+        gradle_build_scripts=( $(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | egrep -v "$script_exclude_pattern") )
 25         printf "%s\n" "${gradle_build_scripts[@]}" >| $cache_dir/$cache_name
 26     fi
 27 }
 28@@ -116,9 +117,9 @@ __gradle-generate-tasks-cache() {
 29     # Reuse Gradle Daemon if IDLE but don't start a new one.
 30     local gradle_tasks_output
 31     if [[ ! -z "$($gradle_cmd --status 2>/dev/null | grep IDLE)" ]]; then
 32-        gradle_tasks_output="$($gradle_cmd --daemon --build-file $gradle_build_file --console plain -q tasks --all 2>/dev/null)"
 33+        gradle_tasks_output="$($gradle_cmd --daemon --no-scan --build-file $gradle_build_file --console=plain -q tasks --all 2>/dev/null)"
 34     else
 35-        gradle_tasks_output="$($gradle_cmd --no-daemon --build-file $gradle_build_file --console plain -q tasks --all 2>/dev/null)"
 36+        gradle_tasks_output="$($gradle_cmd --no-daemon --no-scan --build-file $gradle_build_file --console=plain -q tasks --all 2>/dev/null)"
 37     fi
 38     local gradle_all_tasks="" root_tasks="" subproject_tasks="" output_line
 39     local -a match
 40@@ -180,7 +181,7 @@ __gradle_tasks() {
 41             local cached_checksum="$(cat $cache_dir/$cache_name.md5)"
 42             local -a cached_tasks
 43             if [[ -z $cur ]]; then
 44-                cached_tasks=(${(f)"$(cat $cache_dir/$cached_checksum)"})
 45+                cached_tasks=(${(f)"$(grep -v "^\\\:" $cache_dir/$cached_checksum)"})
 46             else
 47                 cached_tasks=(${(f)"$(grep "^${cur//:/\\\\:}" $cache_dir/$cached_checksum)"})
 48             fi
 49@@ -191,7 +192,7 @@ __gradle_tasks() {
 50 
 51         # Regenerate tasks cache in the background
 52         if [[ $gradle_files_checksum != "$(cat $cache_dir/$cache_name.md5)" || ! -f $cache_dir/$gradle_files_checksum || $(wc -c < $cache_dir/$gradle_files_checksum) -le 1 ]]; then
 53-            $(__gradle-generate-tasks-cache 1>&2 2>/dev/null &)
 54+            $(__gradle-generate-tasks-cache &> /dev/null &)
 55         fi
 56     else
 57         _describe 'built-in tasks' '(
 58@@ -262,7 +263,10 @@ __gradle_subcommand() {
 59                 {-b,--build-file}'[Specifies the build file.]:build script:_files -g \*.gradle' \
 60                 {-C,--cache}'[Specifies how compiled build scripts should be cached.]:cache policy:(on rebuild)' \
 61                 {-c,--settings-file}'[Specifies the settings file.]:settings file:_files -g \*.gradle' \
 62+                '(--configuration-cache)--no-configuration-cache[Disables the configuration cache. Gradle will not reuse the build configuration from previous builds.]' \
 63+                '--configuration-cache-problems=[Configures how the configuration cache handles problems]:problem handling:(fail warn)' \
 64                 '(--no-configure-on-demand)--configure-on-demand[Only relevant projects are configured in this build run.]' \
 65+                '(--no-configuration-cache)--configuration-cache[Enables the configuration cache. Gradle will try to reuse the build configuration from previous builds.]' \
 66                 '--console=[Specifies which type of console output to generate.]:console output type:(plain auto rich verbose)' \
 67                 '--continue[Continues task execution after a task failure.]' \
 68                 '-Dorg.gradle.cache.reserved.mb=[Reserve Gradle Daemon memory for operations.]' \
 69@@ -276,6 +280,7 @@ __gradle_subcommand() {
 70                 '-Dorg.gradle.logging.level=[Set default Gradle log level.]:log level:(quiet warn lifecycle info debug)' \
 71                 '-Dorg.gradle.parallel=[Set true to enable parallel project builds.]:enable parallel build:(true false)' \
 72                 '-Dorg.gradle.priority=[Set priority for Gradle worker processes.]:priority:(low normal)' \
 73+                '-Dorg.gradle.unsafe.watch-fs=[Set true to enable Gradle file watcher.]:enable watcher:(true false)' \
 74                 '-Dorg.gradle.warning.mode=[Set types of warnings to log.]:warning level:(all summary none)' \
 75                 '-Dorg.gradle.workers.max=[Set the number of workers Gradle is allowed to use.]' \
 76                 '(-i --info -w --warn -q --quiet)'{-d,--debug}'[Log in debug mode (includes normal stacktrace).]' \
 77@@ -314,6 +319,7 @@ __gradle_subcommand() {
 78                 '(--write-locks)--update-locks[Perform a partial update of the dependency lock.]' \
 79                 '(-d --debug -q --quiet -i --info)'{-w,--warn}'[Log warnings and errors only.]' \
 80                 '--warning-mode=[Set types of warnings to log.]:warning mode:(all summary none)' \
 81+                '(--no-watch-fs)--watch-fs[Gradle watches filesystem for incremental builds.]' \
 82                 '(--update-locks)--write-locks[Persists dependency resolution for locked configurations.]' \
 83                 {-x,--exclude-task}'[Specify a task to be excluded from execution.]' && ret=0
 84             ;;
 85@@ -347,6 +353,9 @@ _gradle() {
 86         {-b,--build-file}'[Specifies the build file.]:build script:_files -g \*.gradle' \
 87         {-C,--cache}'[Specifies how compiled build scripts should be cached.]:cache policy:(on rebuild)' \
 88         {-c,--settings-file}'[Specifies the settings file.]:settings file:_files -g \*.gradle:->argument-expected' \
 89+        '(--no-configuration-cache)--configuration-cache[Enables the configuration cache. Gradle will try to reuse the build configuration from previous builds.]' \
 90+        '(--configuration-cache)--no-configuration-cache[Disables the configuration cache. Gradle will not reuse the build configuration from previous builds.]' \
 91+        '--configuration-cache-problems=[Configures how the configuration cache handles problems]:problem handling:(fail warn)' \
 92         '(--no-configure-on-demand)--configure-on-demand[Only relevant projects are configured in this build run.]' \
 93         '--console=[Specifies which type of console output to generate.]:console output type:(plain auto rich verbose)' \
 94         '--continue[Continues task execution after a task failure.]' \
 95@@ -361,6 +370,7 @@ _gradle() {
 96         '-Dorg.gradle.logging.level=[Set default Gradle log level.]:log level:(quiet warn lifecycle info debug)' \
 97         '-Dorg.gradle.parallel=[Set true to enable parallel project builds.]:(true false)' \
 98         '-Dorg.gradle.priority=[Set priority for Gradle worker processes.]:priority:(low normal)' \
 99+        '-Dorg.gradle.unsafe.watch-fs=[Set true to enable Gradle file watcher.]:enable watcher:(true false)' \
100         '-Dorg.gradle.warning.mode=[Set types of warnings to log.]:warning level:(all summary none)' \
101         '-Dorg.gradle.workers.max=[Set the number of workers Gradle is allowed to use.]' \
102         '(-i --info -w --warn -q --quiet)'{-d,--debug}'[Log in debug mode (includes normal stacktrace).]' \
103@@ -404,6 +414,7 @@ _gradle() {
104         '(-d --debug -q --quiet -i --info)'{-w,--warn}'[Log warnings and errors only.]' \