diff options
Diffstat (limited to 'src/android/gradlew')
| -rwxr-xr-x | src/android/gradlew | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/src/android/gradlew b/src/android/gradlew new file mode 100755 index 000000000..afa127966 --- /dev/null +++ b/src/android/gradlew | |||
| @@ -0,0 +1,175 @@ | |||
| 1 | #!/usr/bin/env sh | ||
| 2 | |||
| 3 | # SPDX-FileCopyrightText: 2023 yuzu Emulator Project | ||
| 4 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 5 | |||
| 6 | ############################################################################## | ||
| 7 | ## | ||
| 8 | ## Gradle start up script for UN*X | ||
| 9 | ## | ||
| 10 | ############################################################################## | ||
| 11 | |||
| 12 | # Attempt to set APP_HOME | ||
| 13 | # Resolve links: $0 may be a link | ||
| 14 | PRG="$0" | ||
| 15 | # Need this for relative symlinks. | ||
| 16 | while [ -h "$PRG" ] ; do | ||
| 17 | ls=`ls -ld "$PRG"` | ||
| 18 | link=`expr "$ls" : '.*-> \(.*\)$'` | ||
| 19 | if expr "$link" : '/.*' > /dev/null; then | ||
| 20 | PRG="$link" | ||
| 21 | else | ||
| 22 | PRG=`dirname "$PRG"`"/$link" | ||
| 23 | fi | ||
| 24 | done | ||
| 25 | SAVED="`pwd`" | ||
| 26 | cd "`dirname \"$PRG\"`/" >/dev/null | ||
| 27 | APP_HOME="`pwd -P`" | ||
| 28 | cd "$SAVED" >/dev/null | ||
| 29 | |||
| 30 | APP_NAME="Gradle" | ||
| 31 | APP_BASE_NAME=`basename "$0"` | ||
| 32 | |||
| 33 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| 34 | DEFAULT_JVM_OPTS="" | ||
| 35 | |||
| 36 | # Use the maximum available, or set MAX_FD != -1 to use that value. | ||
| 37 | MAX_FD="maximum" | ||
| 38 | |||
| 39 | warn () { | ||
| 40 | echo "$*" | ||
| 41 | } | ||
| 42 | |||
| 43 | die () { | ||
| 44 | echo | ||
| 45 | echo "$*" | ||
| 46 | echo | ||
| 47 | exit 1 | ||
| 48 | } | ||
| 49 | |||
| 50 | # OS specific support (must be 'true' or 'false'). | ||
| 51 | cygwin=false | ||
| 52 | msys=false | ||
| 53 | darwin=false | ||
| 54 | nonstop=false | ||
| 55 | case "`uname`" in | ||
| 56 | CYGWIN* ) | ||
| 57 | cygwin=true | ||
| 58 | ;; | ||
| 59 | Darwin* ) | ||
| 60 | darwin=true | ||
| 61 | ;; | ||
| 62 | MINGW* ) | ||
| 63 | msys=true | ||
| 64 | ;; | ||
| 65 | NONSTOP* ) | ||
| 66 | nonstop=true | ||
| 67 | ;; | ||
| 68 | esac | ||
| 69 | |||
| 70 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
| 71 | |||
| 72 | # Determine the Java command to use to start the JVM. | ||
| 73 | if [ -n "$JAVA_HOME" ] ; then | ||
| 74 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
| 75 | # IBM's JDK on AIX uses strange locations for the executables | ||
| 76 | JAVACMD="$JAVA_HOME/jre/sh/java" | ||
| 77 | else | ||
| 78 | JAVACMD="$JAVA_HOME/bin/java" | ||
| 79 | fi | ||
| 80 | if [ ! -x "$JAVACMD" ] ; then | ||
| 81 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
| 82 | |||
| 83 | Please set the JAVA_HOME variable in your environment to match the | ||
| 84 | location of your Java installation." | ||
| 85 | fi | ||
| 86 | else | ||
| 87 | JAVACMD="java" | ||
| 88 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| 89 | |||
| 90 | Please set the JAVA_HOME variable in your environment to match the | ||
| 91 | location of your Java installation." | ||
| 92 | fi | ||
| 93 | |||
| 94 | # Increase the maximum file descriptors if we can. | ||
| 95 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
| 96 | MAX_FD_LIMIT=`ulimit -H -n` | ||
| 97 | if [ $? -eq 0 ] ; then | ||
| 98 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
| 99 | MAX_FD="$MAX_FD_LIMIT" | ||
| 100 | fi | ||
| 101 | ulimit -n $MAX_FD | ||
| 102 | if [ $? -ne 0 ] ; then | ||
| 103 | warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
| 104 | fi | ||
| 105 | else | ||
| 106 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
| 107 | fi | ||
| 108 | fi | ||
| 109 | |||
| 110 | # For Darwin, add options to specify how the application appears in the dock | ||
| 111 | if $darwin; then | ||
| 112 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
| 113 | fi | ||
| 114 | |||
| 115 | # For Cygwin, switch paths to Windows format before running java | ||
| 116 | if $cygwin ; then | ||
| 117 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
| 118 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
| 119 | JAVACMD=`cygpath --unix "$JAVACMD"` | ||
| 120 | |||
| 121 | # We build the pattern for arguments to be converted via cygpath | ||
| 122 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
| 123 | SEP="" | ||
| 124 | for dir in $ROOTDIRSRAW ; do | ||
| 125 | ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
| 126 | SEP="|" | ||
| 127 | done | ||
| 128 | OURCYGPATTERN="(^($ROOTDIRS))" | ||
| 129 | # Add a user-defined pattern to the cygpath arguments | ||
| 130 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
| 131 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
| 132 | fi | ||
| 133 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
| 134 | i=0 | ||
| 135 | for arg in "$@" ; do | ||
| 136 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
| 137 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
| 138 | |||
| 139 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
| 140 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
| 141 | else | ||
| 142 | eval `echo args$i`="\"$arg\"" | ||
| 143 | fi | ||
| 144 | i=$((i+1)) | ||
| 145 | done | ||
| 146 | case $i in | ||
| 147 | (0) set -- ;; | ||
| 148 | (1) set -- "$args0" ;; | ||
| 149 | (2) set -- "$args0" "$args1" ;; | ||
| 150 | (3) set -- "$args0" "$args1" "$args2" ;; | ||
| 151 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
| 152 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
| 153 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
| 154 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
| 155 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
| 156 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
| 157 | esac | ||
| 158 | fi | ||
| 159 | |||
| 160 | # Escape application args | ||
| 161 | save () { | ||
| 162 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
| 163 | echo " " | ||
| 164 | } | ||
| 165 | APP_ARGS=$(save "$@") | ||
| 166 | |||
| 167 | # Collect all arguments for the java command, following the shell quoting and substitution rules | ||
| 168 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
| 169 | |||
| 170 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | ||
| 171 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | ||
| 172 | cd "$(dirname "$0")" | ||
| 173 | fi | ||
| 174 | |||
| 175 | exec "$JAVACMD" "$@" | ||