b7e544e6f171e3bf754d80e3c5b61b4f8f065622

Author
David Harrigan <dharrigan@users.noreply.github.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

gradle plugin should support kotlin gradle build files (#6529)

This change allows the gradle plugin to recongise build.gradle.kts files and
thus generate the autocomplete entries.

-=david=-

closes #6528

Diff

 1diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
 2index 0adc04a139ef6233857ca7803f7ebdc93aa0a2c3..c7047552de3622fd2ca45197fd6d1075773249fe 100644
 3--- a/plugins/gradle/gradle.plugin.zsh
 4+++ b/plugins/gradle/gradle.plugin.zsh
 5@@ -88,7 +88,7 @@ function _gradle_arguments() {
 6 # and if so, regenerate the .gradle_tasks cache file
 7 ############################################################################
 8 _gradle_does_task_list_need_generating () {
 9-  [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache ]]
10+  [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache || build.gradle.kts -nt .gradletasknamecache ]]
11 }
12 
13 ##############
14@@ -144,7 +144,7 @@ _gradle_parse_and_extract_tasks () {
15 # Discover the gradle tasks by running "gradle tasks --all"
16 ############################################################################
17 _gradle_tasks () {
18-  if [[ -f build.gradle ]]; then
19+  if [[ -f build.gradle || -f build.gradle.kts ]]; then
20     _gradle_arguments
21     if _gradle_does_task_list_need_generating; then
22       _gradle_parse_and_extract_tasks "$(gradle tasks --all)" > .gradletasknamecache
23@@ -154,7 +154,7 @@ _gradle_tasks () {
24 }
25 
26 _gradlew_tasks () {
27-  if [[ -f build.gradle ]]; then
28+  if [[ -f build.gradle || -f build.gradle.kts ]]; then
29     _gradle_arguments
30     if _gradle_does_task_list_need_generating; then
31       _gradle_parse_and_extract_tasks "$(./gradlew tasks --all)" > .gradletasknamecache