Skip to content

Commit 8e978aa

Browse files
rebase
1 parent 9ba7400 commit 8e978aa

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

gradlew

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env sh
2+
#
3+
# Copyright 2015 the original author or authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10+
# language governing permissions and limitations under the License.
11+
#
12+
##############################################################################
13+
##
14+
## Gradle start up script for UN*X
15+
##
16+
##############################################################################
17+
# Attempt to set APP_HOME Resolve links: $0 may be a link
18+
PRG="$0"
19+
# Need this for relative symlinks.
20+
while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd
21+
"$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"`
22+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
23+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
24+
# Use the maximum available, or set MAX_FD != -1 to use that value.
25+
MAX_FD="maximum" warn () { echo "$*"
26+
}
27+
die () { echo echo "$*" echo exit 1
28+
}
29+
# OS specific support (must be 'true' or 'false').
30+
cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true
31+
;;
32+
Darwin* ) darwin=true
33+
;;
34+
MSYS* | MINGW* ) msys=true
35+
;;
36+
NONSTOP* ) nonstop=true
37+
;;
38+
esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
39+
# Determine the Java command to use to start the JVM.
40+
if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
41+
# IBM's JDK on AIX uses strange locations for the executables
42+
JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the
43+
location of your Java installation."
44+
fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi
45+
# Increase the maximum file descriptors if we can.
46+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0
47+
] ; then
48+
warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi
49+
# For Darwin, add options to specify how the application appears in the dock
50+
if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi
51+
# For Cygwin or MSYS, switch paths to Windows format before running java
52+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"`
53+
# We build the pattern for arguments to be converted via cygpath
54+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))"
55+
# Add a user-defined pattern to the cygpath arguments
56+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi
57+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
58+
i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path
59+
--ignore --mixed "$arg"`
60+
else eval `echo args$i`="\"$arg\"" fi i=`expr $i + 1` done case $i in 0) set -- ;; 1) set -- "$args0" ;; 2) set -- "$args0" "$args1" ;; 3) set -- "$args0" "$args1" "$args2" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 5) set --
61+
"$args0" "$args1" "$args2" "$args3" "$args4" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 8) set -- "$args0" "$args1" "$args2" "$args3"
62+
"$args4" "$args5" "$args6" "$args7" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
63+
esac fi
64+
# Escape application args
65+
save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " "
66+
}
67+
APP_ARGS=`save "$@"`
68+
# Collect all arguments for the java command, following the shell quoting and substitution rules
69+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
70+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)