15
15
# See the License for the specific language governing permissions and
16
16
# limitations under the License.
17
17
#
18
+ # SPDX-License-Identifier: Apache-2.0
19
+ #
18
20
19
21
# #############################################################################
20
22
#
55
57
# Darwin, MinGW, and NonStop.
56
58
#
57
59
# (3) This script is generated from the Groovy template
58
- # https://github.com/gradle/gradle/blob/HEAD/subprojects/ plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60
+ # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/ plugins-application /src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59
61
# within the Gradle project.
60
62
#
61
63
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -69,35 +71,36 @@ app_path=$0
69
71
70
72
# Need this for daisy-chained symlinks.
71
73
while
72
- APP_HOME=${app_path% " ${app_path##*/ } " } # leaves a trailing /; empty if no leading path
73
- [ -h " $app_path " ]
74
+ APP_HOME=${app_path% " ${app_path##*/ } " } # leaves a trailing /; empty if no leading path
75
+ [ -h " $app_path " ]
74
76
do
75
- ls=$( ls -ld " $app_path " )
76
- link=${ls#* ' -> ' }
77
- case $link in # (
78
- /* ) app_path=$link ;; # (
79
- * ) app_path=$APP_HOME$link ;;
80
- esac
77
+ ls=$( ls -ld " $app_path " )
78
+ link=${ls#* ' -> ' }
79
+ case $link in # (
80
+ /* ) app_path=$link ;; # (
81
+ * ) app_path=$APP_HOME$link ;;
82
+ esac
81
83
done
82
84
83
85
# This is normally unused
84
86
# shellcheck disable=SC2034
85
87
APP_BASE_NAME=${0##*/ }
86
88
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87
- APP_HOME=$( cd " ${APP_HOME:- ./ } " > /dev/null && pwd -P ) || exit
89
+ APP_HOME=$( cd -P " ${APP_HOME:- ./ } " > /dev/null && printf ' %s
90
+ ' " $PWD " ) || exit
88
91
89
92
# Use the maximum available, or set MAX_FD != -1 to use that value.
90
93
MAX_FD=maximum
91
94
92
95
warn () {
93
- echo " $* "
96
+ echo " $* "
94
97
} >&2
95
98
96
99
die () {
97
- echo
98
- echo " $* "
99
- echo
100
- exit 1
100
+ echo
101
+ echo " $* "
102
+ echo
103
+ exit 1
101
104
} >&2
102
105
103
106
# OS specific support (must be 'true' or 'false').
@@ -106,57 +109,57 @@ msys=false
106
109
darwin=false
107
110
nonstop=false
108
111
case " $( uname ) " in # (
109
- CYGWIN* ) cygwin=true ;; # (
110
- Darwin* ) darwin=true ;; # (
111
- MSYS* | MINGW* ) msys=true ;; # (
112
- NONSTOP* ) nonstop=true ;;
112
+ CYGWIN* ) cygwin=true ;; # (
113
+ Darwin* ) darwin=true ;; # (
114
+ MSYS* | MINGW* ) msys=true ;; # (
115
+ NONSTOP* ) nonstop=true ;;
113
116
esac
114
117
115
118
CLASSPATH=$APP_HOME /gradle/wrapper/gradle-wrapper.jar
116
119
117
120
118
121
# Determine the Java command to use to start the JVM.
119
122
if [ -n " $JAVA_HOME " ] ; then
120
- if [ -x " $JAVA_HOME /jre/sh/java" ] ; then
121
- # IBM's JDK on AIX uses strange locations for the executables
122
- JAVACMD=$JAVA_HOME /jre/sh/java
123
- else
124
- JAVACMD=$JAVA_HOME /bin/java
125
- fi
126
- if [ ! -x " $JAVACMD " ] ; then
127
- die " ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
123
+ if [ -x " $JAVA_HOME /jre/sh/java" ] ; then
124
+ # IBM's JDK on AIX uses strange locations for the executables
125
+ JAVACMD=$JAVA_HOME /jre/sh/java
126
+ else
127
+ JAVACMD=$JAVA_HOME /bin/java
128
+ fi
129
+ if [ ! -x " $JAVACMD " ] ; then
130
+ die " ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
128
131
129
132
Please set the JAVA_HOME variable in your environment to match the
130
133
location of your Java installation."
131
- fi
134
+ fi
132
135
else
133
- JAVACMD=java
134
- if ! command -v java > /dev/null 2>&1
135
- then
136
- die " ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
136
+ JAVACMD=java
137
+ if ! command -v java > /dev/null 2>&1
138
+ then
139
+ die " ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
140
138
141
Please set the JAVA_HOME variable in your environment to match the
139
142
location of your Java installation."
140
- fi
143
+ fi
141
144
fi
142
145
143
146
# Increase the maximum file descriptors if we can.
144
147
if ! " $cygwin " && ! " $darwin " && ! " $nonstop " ; then
145
- case $MAX_FD in # (
146
- max* )
147
- # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148
- # shellcheck disable=SC2039,SC3045
149
- MAX_FD=$( ulimit -H -n ) ||
150
- warn " Could not query maximum file descriptor limit"
151
- esac
152
- case $MAX_FD in # (
153
- ' ' | soft) : ;; # (
154
- * )
155
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156
- # shellcheck disable=SC2039,SC3045
157
- ulimit -n " $MAX_FD " ||
158
- warn " Could not set maximum file descriptor limit to $MAX_FD "
159
- esac
148
+ case $MAX_FD in # (
149
+ max* )
150
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
151
+ # shellcheck disable=SC2039,SC3045
152
+ MAX_FD=$( ulimit -H -n ) ||
153
+ warn " Could not query maximum file descriptor limit"
154
+ esac
155
+ case $MAX_FD in # (
156
+ ' ' | soft) : ;; # (
157
+ * )
158
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
159
+ # shellcheck disable=SC2039,SC3045
160
+ ulimit -n " $MAX_FD " ||
161
+ warn " Could not set maximum file descriptor limit to $MAX_FD "
162
+ esac
160
163
fi
161
164
162
165
# Collect all arguments for the java command, stacking in reverse order:
169
172
170
173
# For Cygwin or MSYS, switch paths to Windows format before running java
171
174
if " $cygwin " || " $msys " ; then
172
- APP_HOME=$( cygpath --path --mixed " $APP_HOME " )
173
- CLASSPATH=$( cygpath --path --mixed " $CLASSPATH " )
174
-
175
- JAVACMD=$( cygpath --unix " $JAVACMD " )
176
-
177
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
178
- for arg do
179
- if
180
- case $arg in # (
181
- -* ) false ;; # don't mess with options #(
182
- /?* ) t=${arg#/ } t=/${t%%/* } # looks like a POSIX filepath
183
- [ -e " $t " ] ;; # (
184
- * ) false ;;
185
- esac
186
- then
187
- arg=$( cygpath --path --ignore --mixed " $arg " )
188
- fi
189
- # Roll the args list around exactly as many times as the number of
190
- # args, so each arg winds up back in the position where it started, but
191
- # possibly modified.
192
- #
193
- # NB: a `for` loop captures its iteration list before it begins, so
194
- # changing the positional parameters here affects neither the number of
195
- # iterations, nor the values presented in `arg`.
196
- shift # remove old arg
197
- set -- " $@ " " $arg " # push replacement arg
198
- done
175
+ APP_HOME=$( cygpath --path --mixed " $APP_HOME " )
176
+ CLASSPATH=$( cygpath --path --mixed " $CLASSPATH " )
177
+
178
+ JAVACMD=$( cygpath --unix " $JAVACMD " )
179
+
180
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
181
+ for arg do
182
+ if
183
+ case $arg in # (
184
+ -* ) false ;; # don't mess with options #(
185
+ /?* ) t=${arg#/ } t=/${t%%/* } # looks like a POSIX filepath
186
+ [ -e " $t " ] ;; # (
187
+ * ) false ;;
188
+ esac
189
+ then
190
+ arg=$( cygpath --path --ignore --mixed " $arg " )
191
+ fi
192
+ # Roll the args list around exactly as many times as the number of
193
+ # args, so each arg winds up back in the position where it started, but
194
+ # possibly modified.
195
+ #
196
+ # NB: a `for` loop captures its iteration list before it begins, so
197
+ # changing the positional parameters here affects neither the number of
198
+ # iterations, nor the values presented in `arg`.
199
+ shift # remove old arg
200
+ set -- " $@ " " $arg " # push replacement arg
201
+ done
199
202
fi
200
203
201
204
@@ -209,15 +212,15 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
209
212
# treated as '${Hostname}' itself on the command line.
210
213
211
214
set -- \
212
- " -Dorg.gradle.appname=$APP_BASE_NAME " \
213
- -classpath " $CLASSPATH " \
214
- org.gradle.wrapper.GradleWrapperMain \
215
- " $@ "
215
+ " -Dorg.gradle.appname=$APP_BASE_NAME " \
216
+ -classpath " $CLASSPATH " \
217
+ org.gradle.wrapper.GradleWrapperMain \
218
+ " $@ "
216
219
217
220
# Stop when "xargs" is not available.
218
221
if ! command -v xargs > /dev/null 2>&1
219
222
then
220
- die " xargs is not available"
223
+ die " xargs is not available"
221
224
fi
222
225
223
226
# Use "xargs" to parse quoted args.
240
243
#
241
244
242
245
eval " set -- $(
243
- printf ' %s\n' " $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS " |
244
- xargs -n1 |
245
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
246
- tr ' \n' ' '
247
- ) " ' "$@"'
246
+ printf ' %s\n' " $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS " |
247
+ xargs -n1 |
248
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
249
+ tr ' \n' ' '
250
+ ) " ' "$@"'
248
251
249
252
exec " $JAVACMD " " $@ "
0 commit comments