Skip to content

Commit 0293395

Browse files
rebase
1 parent a2d248e commit 0293395

File tree

1 file changed

+1
-229
lines changed

1 file changed

+1
-229
lines changed

gradlew

Lines changed: 1 addition & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
<<<<<<< HEAD
2-
#!/bin/sh
3-
4-
#
5-
# Copyright © 2015-2021 the original authors.
6-
=======
71
#!/usr/bin/env sh
82

93
#
104
# Copyright 2015 the original author or authors.
11-
>>>>>>> main
125
#
136
# Licensed under the Apache License, Version 2.0 (the "License");
147
# you may not use this file except in compliance with the License.
@@ -22,88 +15,6 @@
2215
# See the License for the specific language governing permissions and
2316
# limitations under the License.
2417
#
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-
=======
10718

10819
##############################################################################
10920
##
@@ -141,31 +52,19 @@ MAX_FD="maximum"
14152
warn () {
14253
echo "$*"
14354
}
144-
>>>>>>> main
14555

14656
die () {
14757
echo
14858
echo "$*"
14959
echo
15060
exit 1
151-
<<<<<<< HEAD
152-
} >&2
153-
=======
15461
}
155-
>>>>>>> main
15662

15763
# OS specific support (must be 'true' or 'false').
15864
cygwin=false
15965
msys=false
16066
darwin=false
16167
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-
=======
16968
case "`uname`" in
17069
CYGWIN* )
17170
cygwin=true
@@ -179,7 +78,6 @@ case "`uname`" in
17978
NONSTOP* )
18079
nonstop=true
18180
;;
182-
>>>>>>> main
18381
esac
18482

18583
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -189,15 +87,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
18987
if [ -n "$JAVA_HOME" ] ; then
19088
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
19189
# 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-
=======
19790
JAVACMD="$JAVA_HOME/jre/sh/java"
19891
else
19992
JAVACMD="$JAVA_HOME/bin/java"
200-
>>>>>>> main
20193
fi
20294
if [ ! -x "$JAVACMD" ] ; then
20395
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
20698
location of your Java installation."
20799
fi
208100
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-
=======
328101
JAVACMD="java"
329102
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
330103
@@ -409,5 +182,4 @@ APP_ARGS=`save "$@"`
409182
# Collect all arguments for the java command, following the shell quoting and substitution rules
410183
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
411184

412-
exec "$JAVACMD" "$@"
413-
>>>>>>> main
185+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)