1
- <<< <<< < HEAD
2
- #! /bin/sh
3
-
4
- #
5
- # Copyright © 2015-2021 the original authors.
6
- =======
7
1
#! /usr/bin/env sh
8
2
9
3
#
10
4
# Copyright 2015 the original author or authors.
11
- >>>>>>> main
12
5
#
13
6
# Licensed under the Apache License, Version 2.0 (the "License");
14
7
# you may not use this file except in compliance with the License.
22
15
# See the License for the specific language governing permissions and
23
16
# limitations under the License.
24
17
#
25
- <<< <<< < HEAD
26
- # SPDX-License-Identifier: Apache-2.0
27
- #
28
-
29
- # #############################################################################
30
- #
31
- # Gradle start up script for POSIX generated by Gradle.
32
- #
33
- # Important for running:
34
- #
35
- # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
36
- # noncompliant, but you have some other compliant shell such as ksh or
37
- # bash, then to run this script, type that shell name before the whole
38
- # command line, like:
39
- #
40
- # ksh Gradle
41
- #
42
- # Busybox and similar reduced shells will NOT work, because this script
43
- # requires all of these POSIX shell features:
44
- # * functions;
45
- # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
46
- # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
47
- # * compound commands having a testable exit status, especially «case»;
48
- # * various built-in commands including «command», «set», and «ulimit».
49
- #
50
- # Important for patching:
51
- #
52
- # (2) This script targets any POSIX shell, so it avoids extensions provided
53
- # by Bash, Ksh, etc; in particular arrays are avoided.
54
- #
55
- # The "traditional" practice of packing multiple parameters into a
56
- # space-separated string is a well documented source of bugs and security
57
- # problems, so this is (mostly) avoided, by progressively accumulating
58
- # options in "$@", and eventually passing that to Java.
59
- #
60
- # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
61
- # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
62
- # see the in-line comments for details.
63
- #
64
- # There are tweaks for specific operating systems such as AIX, CygWin,
65
- # Darwin, MinGW, and NonStop.
66
- #
67
- # (3) This script is generated from the Groovy template
68
- # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
69
- # within the Gradle project.
70
- #
71
- # You can find Gradle at https://github.com/gradle/gradle/.
72
- #
73
- # #############################################################################
74
-
75
- # Attempt to set APP_HOME
76
-
77
- # Resolve links: $0 may be a link
78
- app_path=$0
79
-
80
- # Need this for daisy-chained symlinks.
81
- while
82
- APP_HOME=${app_path% " ${app_path##*/ } " } # leaves a trailing /; empty if no leading path
83
- [ -h " $app_path " ]
84
- do
85
- ls=$( ls -ld " $app_path " )
86
- link=${ls#* ' -> ' }
87
- case $link in # (
88
- /* ) app_path=$link ;; # (
89
- * ) app_path=$APP_HOME$link ;;
90
- esac
91
- done
92
-
93
- # This is normally unused
94
- # shellcheck disable=SC2034
95
- APP_BASE_NAME=${0##*/ }
96
- # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
97
- APP_HOME=$( cd -P " ${APP_HOME:- ./ } " > /dev/null && printf ' %s
98
- ' " $PWD " ) || exit
99
-
100
- # Use the maximum available, or set MAX_FD != -1 to use that value.
101
- MAX_FD=maximum
102
-
103
- warn () {
104
- echo " $* "
105
- } >&2
106
- =======
107
18
108
19
# #############################################################################
109
20
# #
@@ -141,31 +52,19 @@ MAX_FD="maximum"
141
52
warn () {
142
53
echo " $* "
143
54
}
144
- >>>>>>> main
145
55
146
56
die () {
147
57
echo
148
58
echo " $* "
149
59
echo
150
60
exit 1
151
- <<< <<< < HEAD
152
- } >&2
153
- =======
154
61
}
155
- >>>>>>> main
156
62
157
63
# OS specific support (must be 'true' or 'false').
158
64
cygwin=false
159
65
msys=false
160
66
darwin=false
161
67
nonstop=false
162
- <<< <<< < HEAD
163
- case " $( uname ) " in # (
164
- CYGWIN* ) cygwin=true ;; # (
165
- Darwin* ) darwin=true ;; # (
166
- MSYS* | MINGW* ) msys=true ;; # (
167
- NONSTOP* ) nonstop=true ;;
168
- =======
169
68
case " ` uname` " in
170
69
CYGWIN* )
171
70
cygwin=true
@@ -179,7 +78,6 @@ case "`uname`" in
179
78
NONSTOP* )
180
79
nonstop=true
181
80
;;
182
- >>>>>>> main
183
81
esac
184
82
185
83
CLASSPATH=$APP_HOME /gradle/wrapper/gradle-wrapper.jar
@@ -189,15 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
189
87
if [ -n " $JAVA_HOME " ] ; then
190
88
if [ -x " $JAVA_HOME /jre/sh/java" ] ; then
191
89
# IBM's JDK on AIX uses strange locations for the executables
192
- <<<<<<< HEAD
193
- JAVACMD=$JAVA_HOME/jre/sh/java
194
- else
195
- JAVACMD=$JAVA_HOME/bin/java
196
- =======
197
90
JAVACMD=" $JAVA_HOME /jre/sh/java"
198
91
else
199
92
JAVACMD=" $JAVA_HOME /bin/java"
200
- >>>>>>> main
201
93
fi
202
94
if [ ! -x " $JAVACMD " ] ; then
203
95
die " ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -206,125 +98,6 @@ Please set the JAVA_HOME variable in your environment to match the
206
98
location of your Java installation."
207
99
fi
208
100
else
209
- <<<<<<< HEAD
210
- JAVACMD=java
211
- if ! command -v java >/dev/null 2>&1
212
- then
213
- die "ERROR: JAVA_HOME is not set and no ' java' command could be found in your PATH.
214
-
215
- Please set the JAVA_HOME variable in your environment to match the
216
- location of your Java installation."
217
- fi
218
- fi
219
-
220
- # Increase the maximum file descriptors if we can.
221
- if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
222
- case $MAX_FD in #(
223
- max*)
224
- # In POSIX sh, ulimit -H is undefined. That' s why the result is checked to see if it worked.
225
- # shellcheck disable=SC2039,SC3045
226
- MAX_FD=$( ulimit -H -n ) ||
227
- warn " Could not query maximum file descriptor limit"
228
- esac
229
- case $MAX_FD in #(
230
- ' ' | soft) : ;; # (
231
- * )
232
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
233
- # shellcheck disable=SC2039,SC3045
234
- ulimit -n " $MAX_FD " ||
235
- warn " Could not set maximum file descriptor limit to $MAX_FD "
236
- esac
237
- fi
238
-
239
- # Collect all arguments for the java command, stacking in reverse order:
240
- # * args from the command line
241
- # * the main class name
242
- # * -classpath
243
- # * -D...appname settings
244
- # * --module-path (only if needed)
245
- # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
246
-
247
- # For Cygwin or MSYS, switch paths to Windows format before running java
248
- if " $cygwin " || " $msys " ; then
249
- APP_HOME=$( cygpath --path --mixed " $APP_HOME " )
250
- CLASSPATH=$( cygpath --path --mixed " $CLASSPATH " )
251
-
252
- JAVACMD=$( cygpath --unix " $JAVACMD " )
253
-
254
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
255
- for arg do
256
- if
257
- case $arg in # (
258
- -* ) false ;; # don't mess with options #(
259
- /?* ) t=${arg#/ } t=/${t%%/* } # looks like a POSIX filepath
260
- [ -e " $t " ] ;; # (
261
- * ) false ;;
262
- esac
263
- then
264
- arg=$( cygpath --path --ignore --mixed " $arg " )
265
- fi
266
- # Roll the args list around exactly as many times as the number of
267
- # args, so each arg winds up back in the position where it started, but
268
- # possibly modified.
269
- #
270
- # NB: a `for` loop captures its iteration list before it begins, so
271
- # changing the positional parameters here affects neither the number of
272
- # iterations, nor the values presented in `arg`.
273
- shift # remove old arg
274
- set -- " $@ " " $arg " # push replacement arg
275
- done
276
- fi
277
-
278
-
279
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
280
- DEFAULT_JVM_OPTS=' "-Xmx64m" "-Xms64m"'
281
-
282
- # Collect all arguments for the java command:
283
- # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
284
- # and any embedded shellness will be escaped.
285
- # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
286
- # treated as '${Hostname}' itself on the command line.
287
-
288
- set -- \
289
- " -Dorg.gradle.appname=$APP_BASE_NAME " \
290
- -classpath " $CLASSPATH " \
291
- org.gradle.wrapper.GradleWrapperMain \
292
- " $@ "
293
-
294
- # Stop when "xargs" is not available.
295
- if ! command -v xargs > /dev/null 2>&1
296
- then
297
- die " xargs is not available"
298
- fi
299
-
300
- # Use "xargs" to parse quoted args.
301
- #
302
- # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
303
- #
304
- # In Bash we could simply go:
305
- #
306
- # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
307
- # set -- "${ARGS[@]}" "$@"
308
- #
309
- # but POSIX shell has neither arrays nor command substitution, so instead we
310
- # post-process each arg (as a line of input to sed) to backslash-escape any
311
- # character that might be a shell metacharacter, then use eval to reverse
312
- # that process (while maintaining the separation between arguments), and wrap
313
- # the whole thing up as a single "set" statement.
314
- #
315
- # This will of course break if any of these variables contains a newline or
316
- # an unmatched quote.
317
- #
318
-
319
- eval " set -- $(
320
- printf ' %s\n' " $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS " |
321
- xargs -n1 |
322
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
323
- tr ' \n' ' '
324
- ) " ' "$@"'
325
-
326
- exec " $JAVACMD " " $@ "
327
- =======
328
101
JAVACMD=" java"
329
102
which java > /dev/null 2>&1 || die " ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
330
103
@@ -409,5 +182,4 @@ APP_ARGS=`save "$@"`
409
182
# Collect all arguments for the java command, following the shell quoting and substitution rules
410
183
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS " \" -Dorg.gradle.appname=$APP_BASE_NAME \" " -classpath " \" $CLASSPATH \" " org.gradle.wrapper.GradleWrapperMain " $APP_ARGS "
411
184
412
- exec " $JAVACMD " " $@ "
413
- >>>>>>> main
185
+ exec " $JAVACMD " " $@ "
0 commit comments