Warning, /utilities/kairo/src/android/gradlew is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env bash
0002
0003 ##############################################################################
0004 ##
0005 ## Gradle start up script for UN*X
0006 ##
0007 ##############################################################################
0008
0009 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
0010 DEFAULT_JVM_OPTS=""
0011
0012 APP_NAME="Gradle"
0013 APP_BASE_NAME=`basename "$0"`
0014
0015 # Use the maximum available, or set MAX_FD != -1 to use that value.
0016 MAX_FD="maximum"
0017
0018 warn ( ) {
0019 echo "$*"
0020 }
0021
0022 die ( ) {
0023 echo
0024 echo "$*"
0025 echo
0026 exit 1
0027 }
0028
0029 # OS specific support (must be 'true' or 'false').
0030 cygwin=false
0031 msys=false
0032 darwin=false
0033 case "`uname`" in
0034 CYGWIN* )
0035 cygwin=true
0036 ;;
0037 Darwin* )
0038 darwin=true
0039 ;;
0040 MINGW* )
0041 msys=true
0042 ;;
0043 esac
0044
0045 # For Cygwin, ensure paths are in UNIX format before anything is touched.
0046 if $cygwin ; then
0047 [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
0048 fi
0049
0050 # Attempt to set APP_HOME
0051 # Resolve links: $0 may be a link
0052 PRG="$0"
0053 # Need this for relative symlinks.
0054 while [ -h "$PRG" ] ; do
0055 ls=`ls -ld "$PRG"`
0056 link=`expr "$ls" : '.*-> \(.*\)$'`
0057 if expr "$link" : '/.*' > /dev/null; then
0058 PRG="$link"
0059 else
0060 PRG=`dirname "$PRG"`"/$link"
0061 fi
0062 done
0063 SAVED="`pwd`"
0064 cd "`dirname \"$PRG\"`/" >&-
0065 APP_HOME="`pwd -P`"
0066 cd "$SAVED" >&-
0067
0068 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
0069
0070 # Determine the Java command to use to start the JVM.
0071 if [ -n "$JAVA_HOME" ] ; then
0072 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
0073 # IBM's JDK on AIX uses strange locations for the executables
0074 JAVACMD="$JAVA_HOME/jre/sh/java"
0075 else
0076 JAVACMD="$JAVA_HOME/bin/java"
0077 fi
0078 if [ ! -x "$JAVACMD" ] ; then
0079 die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
0080
0081 Please set the JAVA_HOME variable in your environment to match the
0082 location of your Java installation."
0083 fi
0084 else
0085 JAVACMD="java"
0086 which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
0087
0088 Please set the JAVA_HOME variable in your environment to match the
0089 location of your Java installation."
0090 fi
0091
0092 # Increase the maximum file descriptors if we can.
0093 if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
0094 MAX_FD_LIMIT=`ulimit -H -n`
0095 if [ $? -eq 0 ] ; then
0096 if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
0097 MAX_FD="$MAX_FD_LIMIT"
0098 fi
0099 ulimit -n $MAX_FD
0100 if [ $? -ne 0 ] ; then
0101 warn "Could not set maximum file descriptor limit: $MAX_FD"
0102 fi
0103 else
0104 warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
0105 fi
0106 fi
0107
0108 # For Darwin, add options to specify how the application appears in the dock
0109 if $darwin; then
0110 GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
0111 fi
0112
0113 # For Cygwin, switch paths to Windows format before running java
0114 if $cygwin ; then
0115 APP_HOME=`cygpath --path --mixed "$APP_HOME"`
0116 CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
0117
0118 # We build the pattern for arguments to be converted via cygpath
0119 ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
0120 SEP=""
0121 for dir in $ROOTDIRSRAW ; do
0122 ROOTDIRS="$ROOTDIRS$SEP$dir"
0123 SEP="|"
0124 done
0125 OURCYGPATTERN="(^($ROOTDIRS))"
0126 # Add a user-defined pattern to the cygpath arguments
0127 if [ "$GRADLE_CYGPATTERN" != "" ] ; then
0128 OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
0129 fi
0130 # Now convert the arguments - kludge to limit ourselves to /bin/sh
0131 i=0
0132 for arg in "$@" ; do
0133 CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
0134 CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
0135
0136 if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
0137 eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
0138 else
0139 eval `echo args$i`="\"$arg\""
0140 fi
0141 i=$((i+1))
0142 done
0143 case $i in
0144 (0) set -- ;;
0145 (1) set -- "$args0" ;;
0146 (2) set -- "$args0" "$args1" ;;
0147 (3) set -- "$args0" "$args1" "$args2" ;;
0148 (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
0149 (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
0150 (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
0151 (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
0152 (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
0153 (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0154 esac
0155 fi
0156
0157 # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
0158 function splitJvmOpts() {
0159 JVM_OPTS=("$@")
0160 }
0161 eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
0162 JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
0163
0164 exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"