1
+ <<< <<< < HEAD
1
2
#! /bin/sh
2
3
3
4
#
4
5
# Copyright © 2015-2021 the original authors.
6
+ =======
7
+ #! /usr/bin/env sh
8
+
9
+ #
10
+ # Copyright 2015 the original author or authors.
11
+ >>>>>>> main
5
12
#
6
13
# Licensed under the Apache License, Version 2.0 (the "License");
7
14
# you may not use this file except in compliance with the License.
15
22
# See the License for the specific language governing permissions and
16
23
# limitations under the License.
17
24
#
25
+ <<< <<< < HEAD
18
26
# SPDX-License-Identifier: Apache-2.0
19
27
#
20
28
@@ -95,24 +103,83 @@ MAX_FD=maximum
95
103
warn () {
96
104
echo " $* "
97
105
} >&2
106
+ =======
107
+
108
+ # #############################################################################
109
+ # #
110
+ # # Gradle start up script for UN*X
111
+ # #
112
+ # #############################################################################
113
+
114
+ # Attempt to set APP_HOME
115
+ # Resolve links: $0 may be a link
116
+ PRG=" $0 "
117
+ # Need this for relative symlinks.
118
+ while [ -h " $PRG " ] ; do
119
+ ls=` ls -ld " $PRG " `
120
+ link=` expr " $ls " : ' .*-> \(.*\)$' `
121
+ if expr " $link " : ' /.*' > /dev/null; then
122
+ PRG=" $link "
123
+ else
124
+ PRG=` dirname " $PRG " ` " /$link "
125
+ fi
126
+ done
127
+ SAVED=" ` pwd` "
128
+ cd " ` dirname \" $PRG \" ` /" > /dev/null
129
+ APP_HOME=" ` pwd -P` "
130
+ cd " $SAVED " > /dev/null
131
+
132
+ APP_NAME=" Gradle"
133
+ APP_BASE_NAME=` basename " $0 " `
134
+
135
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
136
+ DEFAULT_JVM_OPTS=' "-Xmx64m" "-Xms64m"'
137
+
138
+ # Use the maximum available, or set MAX_FD != -1 to use that value.
139
+ MAX_FD=" maximum"
140
+
141
+ warn () {
142
+ echo " $* "
143
+ }
144
+ >>>>>>> main
98
145
99
146
die () {
100
147
echo
101
148
echo " $* "
102
149
echo
103
150
exit 1
151
+ <<< <<< < HEAD
104
152
} >&2
153
+ =======
154
+ }
155
+ >>>>>>> main
105
156
106
157
# OS specific support (must be 'true' or 'false').
107
158
cygwin=false
108
159
msys=false
109
160
darwin=false
110
161
nonstop=false
162
+ <<< <<< < HEAD
111
163
case " $( uname ) " in # (
112
164
CYGWIN* ) cygwin=true ;; # (
113
165
Darwin* ) darwin=true ;; # (
114
166
MSYS* | MINGW* ) msys=true ;; # (
115
167
NONSTOP* ) nonstop=true ;;
168
+ =======
169
+ case " ` uname` " in
170
+ CYGWIN* )
171
+ cygwin=true
172
+ ;;
173
+ Darwin* )
174
+ darwin=true
175
+ ;;
176
+ MSYS* | MINGW* )
177
+ msys=true
178
+ ;;
179
+ NONSTOP* )
180
+ nonstop=true
181
+ ;;
182
+ >>>>>>> main
116
183
esac
117
184
118
185
CLASSPATH=$APP_HOME /gradle/wrapper/gradle-wrapper.jar
@@ -122,9 +189,15 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
122
189
if [ -n " $JAVA_HOME " ] ; then
123
190
if [ -x " $JAVA_HOME /jre/sh/java" ] ; then
124
191
# IBM' s JDK on AIX uses strange locations for the executables
192
+ <<<<<<< HEAD
125
193
JAVACMD=$JAVA_HOME/jre/sh/java
126
194
else
127
195
JAVACMD=$JAVA_HOME/bin/java
196
+ =======
197
+ JAVACMD="$JAVA_HOME/jre/sh/java"
198
+ else
199
+ JAVACMD="$JAVA_HOME/bin/java"
200
+ >>>>>>> main
128
201
fi
129
202
if [ ! -x "$JAVACMD" ] ; then
130
203
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -133,6 +206,7 @@ Please set the JAVA_HOME variable in your environment to match the
133
206
location of your Java installation."
134
207
fi
135
208
else
209
+ <<<<<<< HEAD
136
210
JAVACMD=java
137
211
if ! command -v java >/dev/null 2>&1
138
212
then
@@ -250,3 +324,90 @@ eval "set -- $(
250
324
) " ' "$@"'
251
325
252
326
exec " $JAVACMD " " $@ "
327
+ =======
328
+ JAVACMD=" java"
329
+ which java > /dev/null 2>&1 || die " ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
330
+
331
+ Please set the JAVA_HOME variable in your environment to match the
332
+ location of your Java installation."
333
+ fi
334
+
335
+ # Increase the maximum file descriptors if we can.
336
+ if [ " $cygwin " = " false" -a " $darwin " = " false" -a " $nonstop " = " false" ] ; then
337
+ MAX_FD_LIMIT=` ulimit -H -n`
338
+ if [ $? -eq 0 ] ; then
339
+ if [ " $MAX_FD " = " maximum" -o " $MAX_FD " = " max" ] ; then
340
+ MAX_FD=" $MAX_FD_LIMIT "
341
+ fi
342
+ ulimit -n $MAX_FD
343
+ if [ $? -ne 0 ] ; then
344
+ warn " Could not set maximum file descriptor limit: $MAX_FD "
345
+ fi
346
+ else
347
+ warn " Could not query maximum file descriptor limit: $MAX_FD_LIMIT "
348
+ fi
349
+ fi
350
+
351
+ # For Darwin, add options to specify how the application appears in the dock
352
+ if $darwin ; then
353
+ GRADLE_OPTS=" $GRADLE_OPTS \" -Xdock:name=$APP_NAME \" \" -Xdock:icon=$APP_HOME /media/gradle.icns\" "
354
+ fi
355
+
356
+ # For Cygwin or MSYS, switch paths to Windows format before running java
357
+ if [ " $cygwin " = " true" -o " $msys " = " true" ] ; then
358
+ APP_HOME=` cygpath --path --mixed " $APP_HOME " `
359
+ CLASSPATH=` cygpath --path --mixed " $CLASSPATH " `
360
+
361
+ JAVACMD=` cygpath --unix " $JAVACMD " `
362
+
363
+ # We build the pattern for arguments to be converted via cygpath
364
+ ROOTDIRSRAW=` find -L / -maxdepth 1 -mindepth 1 -type d 2> /dev/null`
365
+ SEP=" "
366
+ for dir in $ROOTDIRSRAW ; do
367
+ ROOTDIRS=" $ROOTDIRS$SEP$dir "
368
+ SEP=" |"
369
+ done
370
+ OURCYGPATTERN=" (^($ROOTDIRS ))"
371
+ # Add a user-defined pattern to the cygpath arguments
372
+ if [ " $GRADLE_CYGPATTERN " != " " ] ; then
373
+ OURCYGPATTERN=" $OURCYGPATTERN |($GRADLE_CYGPATTERN )"
374
+ fi
375
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
376
+ i=0
377
+ for arg in " $@ " ; do
378
+ CHECK=` echo " $arg " | egrep -c " $OURCYGPATTERN " -`
379
+ CHECK2=` echo " $arg " | egrep -c " ^-" ` # ## Determine if an option
380
+
381
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then # ## Added a condition
382
+ eval ` echo args$i ` =` cygpath --path --ignore --mixed " $arg " `
383
+ else
384
+ eval ` echo args$i ` =" \" $arg \" "
385
+ fi
386
+ i=` expr $i + 1`
387
+ done
388
+ case $i in
389
+ 0) set -- ;;
390
+ 1) set -- " $args0 " ;;
391
+ 2) set -- " $args0 " " $args1 " ;;
392
+ 3) set -- " $args0 " " $args1 " " $args2 " ;;
393
+ 4) set -- " $args0 " " $args1 " " $args2 " " $args3 " ;;
394
+ 5) set -- " $args0 " " $args1 " " $args2 " " $args3 " " $args4 " ;;
395
+ 6) set -- " $args0 " " $args1 " " $args2 " " $args3 " " $args4 " " $args5 " ;;
396
+ 7) set -- " $args0 " " $args1 " " $args2 " " $args3 " " $args4 " " $args5 " " $args6 " ;;
397
+ 8) set -- " $args0 " " $args1 " " $args2 " " $args3 " " $args4 " " $args5 " " $args6 " " $args7 " ;;
398
+ 9) set -- " $args0 " " $args1 " " $args2 " " $args3 " " $args4 " " $args5 " " $args6 " " $args7 " " $args8 " ;;
399
+ esac
400
+ fi
401
+
402
+ # Escape application args
403
+ save () {
404
+ for i do printf %s\\ n " $i " | sed " s/'/'\\\\ ''/g;1s/^/'/;\$ s/\$ /' \\\\ /" ; done
405
+ echo " "
406
+ }
407
+ APP_ARGS=` save " $@ " `
408
+
409
+ # Collect all arguments for the java command, following the shell quoting and substitution rules
410
+ eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS " \" -Dorg.gradle.appname=$APP_BASE_NAME \" " -classpath " \" $CLASSPATH \" " org.gradle.wrapper.GradleWrapperMain " $APP_ARGS "
411
+
412
+ exec " $JAVACMD " " $@ "
413
+ >>>>>>> main
0 commit comments