This repository was archived by the owner on Jan 26, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 44GRADLE=" ${GRADLE:- gradle} "
55GRADLEW=" ${GRADLEW:- gradlew} "
66GRADLE_BUILDFILE=" ${GRADLE_BUILDFILE:- build.gradle} "
7+ GRADLE_KTS_BUILDFILE=" ${GRADLE_KTS_BUILDFILE:- build.gradle.kts} "
78
89err () {
910 echo -e " ${@ } " >&2
@@ -53,14 +54,21 @@ select_gradle() {
5354
5455execute_gradle () {
5556 local build_gradle=$( lookup " ${GRADLE_BUILDFILE} " )
57+ local build_gradle_kts=$( lookup " ${GRADLE_KTS_BUILDFILE} " )
5658 local gradle=$( select_gradle " ${working_dir} " )
5759 local build_args=( ${BUILD_ARG} " $@ " )
5860
59- if [[ -n " ${build_gradle} " ]]; then
61+ if [ -n " ${build_gradle} " ] || [ -n " ${build_gradle_kts} " ]; then
62+ local ktsDirName=" $( dirname " ${build_gradle_kts} " ) "
63+ local dirName=" $( dirname " ${build_gradle} " ) "
64+ if (( ${# ktsDirName} > ${# dirName} ))
65+ then
66+ build_gradle=${build_gradle_kts}
67+ fi
6068 # We got a good build file, start gradlew there.
6169 cd " $( dirname " ${build_gradle} " ) "
6270 else
63- err " Unable to find a gradle build file named ${GRADLE_BUILDFILE} ."
71+ err " Unable to find a gradle build file named ${GRADLE_BUILDFILE} or ${GRADLE_KTS_BUILDFILE} ."
6472 fi
6573
6674 # Say what we are gonna do, then do it.
You can’t perform that action at this time.
0 commit comments