simple_mtglife

diff android/gradlew @ 0:6321cfa2ad62

initial
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 23 Jan 2015 15:24:27 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/android/gradlew	Fri Jan 23 15:24:27 2015 +0200
     1.3 @@ -0,0 +1,164 @@
     1.4 +#!/usr/bin/env bash
     1.5 +
     1.6 +##############################################################################
     1.7 +##
     1.8 +##  Gradle start up script for UN*X
     1.9 +##
    1.10 +##############################################################################
    1.11 +
    1.12 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
    1.13 +DEFAULT_JVM_OPTS=""
    1.14 +
    1.15 +APP_NAME="Gradle"
    1.16 +APP_BASE_NAME=`basename "$0"`
    1.17 +
    1.18 +# Use the maximum available, or set MAX_FD != -1 to use that value.
    1.19 +MAX_FD="maximum"
    1.20 +
    1.21 +warn ( ) {
    1.22 +    echo "$*"
    1.23 +}
    1.24 +
    1.25 +die ( ) {
    1.26 +    echo
    1.27 +    echo "$*"
    1.28 +    echo
    1.29 +    exit 1
    1.30 +}
    1.31 +
    1.32 +# OS specific support (must be 'true' or 'false').
    1.33 +cygwin=false
    1.34 +msys=false
    1.35 +darwin=false
    1.36 +case "`uname`" in
    1.37 +  CYGWIN* )
    1.38 +    cygwin=true
    1.39 +    ;;
    1.40 +  Darwin* )
    1.41 +    darwin=true
    1.42 +    ;;
    1.43 +  MINGW* )
    1.44 +    msys=true
    1.45 +    ;;
    1.46 +esac
    1.47 +
    1.48 +# For Cygwin, ensure paths are in UNIX format before anything is touched.
    1.49 +if $cygwin ; then
    1.50 +    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
    1.51 +fi
    1.52 +
    1.53 +# Attempt to set APP_HOME
    1.54 +# Resolve links: $0 may be a link
    1.55 +PRG="$0"
    1.56 +# Need this for relative symlinks.
    1.57 +while [ -h "$PRG" ] ; do
    1.58 +    ls=`ls -ld "$PRG"`
    1.59 +    link=`expr "$ls" : '.*-> \(.*\)$'`
    1.60 +    if expr "$link" : '/.*' > /dev/null; then
    1.61 +        PRG="$link"
    1.62 +    else
    1.63 +        PRG=`dirname "$PRG"`"/$link"
    1.64 +    fi
    1.65 +done
    1.66 +SAVED="`pwd`"
    1.67 +cd "`dirname \"$PRG\"`/" >&-
    1.68 +APP_HOME="`pwd -P`"
    1.69 +cd "$SAVED" >&-
    1.70 +
    1.71 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
    1.72 +
    1.73 +# Determine the Java command to use to start the JVM.
    1.74 +if [ -n "$JAVA_HOME" ] ; then
    1.75 +    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
    1.76 +        # IBM's JDK on AIX uses strange locations for the executables
    1.77 +        JAVACMD="$JAVA_HOME/jre/sh/java"
    1.78 +    else
    1.79 +        JAVACMD="$JAVA_HOME/bin/java"
    1.80 +    fi
    1.81 +    if [ ! -x "$JAVACMD" ] ; then
    1.82 +        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
    1.83 +
    1.84 +Please set the JAVA_HOME variable in your environment to match the
    1.85 +location of your Java installation."
    1.86 +    fi
    1.87 +else
    1.88 +    JAVACMD="java"
    1.89 +    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
    1.90 +
    1.91 +Please set the JAVA_HOME variable in your environment to match the
    1.92 +location of your Java installation."
    1.93 +fi
    1.94 +
    1.95 +# Increase the maximum file descriptors if we can.
    1.96 +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    1.97 +    MAX_FD_LIMIT=`ulimit -H -n`
    1.98 +    if [ $? -eq 0 ] ; then
    1.99 +        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
   1.100 +            MAX_FD="$MAX_FD_LIMIT"
   1.101 +        fi
   1.102 +        ulimit -n $MAX_FD
   1.103 +        if [ $? -ne 0 ] ; then
   1.104 +            warn "Could not set maximum file descriptor limit: $MAX_FD"
   1.105 +        fi
   1.106 +    else
   1.107 +        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
   1.108 +    fi
   1.109 +fi
   1.110 +
   1.111 +# For Darwin, add options to specify how the application appears in the dock
   1.112 +if $darwin; then
   1.113 +    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
   1.114 +fi
   1.115 +
   1.116 +# For Cygwin, switch paths to Windows format before running java
   1.117 +if $cygwin ; then
   1.118 +    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
   1.119 +    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
   1.120 +
   1.121 +    # We build the pattern for arguments to be converted via cygpath
   1.122 +    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
   1.123 +    SEP=""
   1.124 +    for dir in $ROOTDIRSRAW ; do
   1.125 +        ROOTDIRS="$ROOTDIRS$SEP$dir"
   1.126 +        SEP="|"
   1.127 +    done
   1.128 +    OURCYGPATTERN="(^($ROOTDIRS))"
   1.129 +    # Add a user-defined pattern to the cygpath arguments
   1.130 +    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
   1.131 +        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
   1.132 +    fi
   1.133 +    # Now convert the arguments - kludge to limit ourselves to /bin/sh
   1.134 +    i=0
   1.135 +    for arg in "$@" ; do
   1.136 +        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
   1.137 +        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
   1.138 +
   1.139 +        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
   1.140 +            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
   1.141 +        else
   1.142 +            eval `echo args$i`="\"$arg\""
   1.143 +        fi
   1.144 +        i=$((i+1))
   1.145 +    done
   1.146 +    case $i in
   1.147 +        (0) set -- ;;
   1.148 +        (1) set -- "$args0" ;;
   1.149 +        (2) set -- "$args0" "$args1" ;;
   1.150 +        (3) set -- "$args0" "$args1" "$args2" ;;
   1.151 +        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
   1.152 +        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
   1.153 +        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
   1.154 +        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
   1.155 +        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
   1.156 +        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
   1.157 +    esac
   1.158 +fi
   1.159 +
   1.160 +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
   1.161 +function splitJvmOpts() {
   1.162 +    JVM_OPTS=("$@")
   1.163 +}
   1.164 +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
   1.165 +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
   1.166 +
   1.167 +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"