Mon, 09 Aug 2021 16:22:56 +0200
#153 adds comment box to issues form
universe@147 | 1 | #!/usr/bin/env sh |
universe@147 | 2 | |
universe@147 | 3 | # |
universe@147 | 4 | # Copyright 2015 the original author or authors. |
universe@147 | 5 | # |
universe@147 | 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
universe@147 | 7 | # you may not use this file except in compliance with the License. |
universe@147 | 8 | # You may obtain a copy of the License at |
universe@147 | 9 | # |
universe@147 | 10 | # https://www.apache.org/licenses/LICENSE-2.0 |
universe@147 | 11 | # |
universe@147 | 12 | # Unless required by applicable law or agreed to in writing, software |
universe@147 | 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
universe@147 | 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
universe@147 | 15 | # See the License for the specific language governing permissions and |
universe@147 | 16 | # limitations under the License. |
universe@147 | 17 | # |
universe@147 | 18 | |
universe@147 | 19 | ############################################################################## |
universe@147 | 20 | ## |
universe@147 | 21 | ## Gradle start up script for UN*X |
universe@147 | 22 | ## |
universe@147 | 23 | ############################################################################## |
universe@147 | 24 | |
universe@147 | 25 | # Attempt to set APP_HOME |
universe@147 | 26 | # Resolve links: $0 may be a link |
universe@147 | 27 | PRG="$0" |
universe@147 | 28 | # Need this for relative symlinks. |
universe@147 | 29 | while [ -h "$PRG" ] ; do |
universe@147 | 30 | ls=`ls -ld "$PRG"` |
universe@147 | 31 | link=`expr "$ls" : '.*-> \(.*\)$'` |
universe@147 | 32 | if expr "$link" : '/.*' > /dev/null; then |
universe@147 | 33 | PRG="$link" |
universe@147 | 34 | else |
universe@147 | 35 | PRG=`dirname "$PRG"`"/$link" |
universe@147 | 36 | fi |
universe@147 | 37 | done |
universe@147 | 38 | SAVED="`pwd`" |
universe@147 | 39 | cd "`dirname \"$PRG\"`/" >/dev/null |
universe@147 | 40 | APP_HOME="`pwd -P`" |
universe@147 | 41 | cd "$SAVED" >/dev/null |
universe@147 | 42 | |
universe@147 | 43 | APP_NAME="Gradle" |
universe@147 | 44 | APP_BASE_NAME=`basename "$0"` |
universe@147 | 45 | |
universe@147 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
universe@147 | 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' |
universe@147 | 48 | |
universe@147 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
universe@147 | 50 | MAX_FD="maximum" |
universe@147 | 51 | |
universe@147 | 52 | warn () { |
universe@147 | 53 | echo "$*" |
universe@147 | 54 | } |
universe@147 | 55 | |
universe@147 | 56 | die () { |
universe@147 | 57 | echo |
universe@147 | 58 | echo "$*" |
universe@147 | 59 | echo |
universe@147 | 60 | exit 1 |
universe@147 | 61 | } |
universe@147 | 62 | |
universe@147 | 63 | # OS specific support (must be 'true' or 'false'). |
universe@147 | 64 | cygwin=false |
universe@147 | 65 | msys=false |
universe@147 | 66 | darwin=false |
universe@147 | 67 | nonstop=false |
universe@147 | 68 | case "`uname`" in |
universe@147 | 69 | CYGWIN* ) |
universe@147 | 70 | cygwin=true |
universe@147 | 71 | ;; |
universe@147 | 72 | Darwin* ) |
universe@147 | 73 | darwin=true |
universe@147 | 74 | ;; |
universe@147 | 75 | MINGW* ) |
universe@147 | 76 | msys=true |
universe@147 | 77 | ;; |
universe@147 | 78 | NONSTOP* ) |
universe@147 | 79 | nonstop=true |
universe@147 | 80 | ;; |
universe@147 | 81 | esac |
universe@147 | 82 | |
universe@147 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
universe@147 | 84 | |
universe@147 | 85 | # Determine the Java command to use to start the JVM. |
universe@147 | 86 | if [ -n "$JAVA_HOME" ] ; then |
universe@147 | 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
universe@147 | 88 | # IBM's JDK on AIX uses strange locations for the executables |
universe@147 | 89 | JAVACMD="$JAVA_HOME/jre/sh/java" |
universe@147 | 90 | else |
universe@147 | 91 | JAVACMD="$JAVA_HOME/bin/java" |
universe@147 | 92 | fi |
universe@147 | 93 | if [ ! -x "$JAVACMD" ] ; then |
universe@147 | 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
universe@147 | 95 | |
universe@147 | 96 | Please set the JAVA_HOME variable in your environment to match the |
universe@147 | 97 | location of your Java installation." |
universe@147 | 98 | fi |
universe@147 | 99 | else |
universe@147 | 100 | JAVACMD="java" |
universe@147 | 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
universe@147 | 102 | |
universe@147 | 103 | Please set the JAVA_HOME variable in your environment to match the |
universe@147 | 104 | location of your Java installation." |
universe@147 | 105 | fi |
universe@147 | 106 | |
universe@147 | 107 | # Increase the maximum file descriptors if we can. |
universe@147 | 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then |
universe@147 | 109 | MAX_FD_LIMIT=`ulimit -H -n` |
universe@147 | 110 | if [ $? -eq 0 ] ; then |
universe@147 | 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then |
universe@147 | 112 | MAX_FD="$MAX_FD_LIMIT" |
universe@147 | 113 | fi |
universe@147 | 114 | ulimit -n $MAX_FD |
universe@147 | 115 | if [ $? -ne 0 ] ; then |
universe@147 | 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" |
universe@147 | 117 | fi |
universe@147 | 118 | else |
universe@147 | 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" |
universe@147 | 120 | fi |
universe@147 | 121 | fi |
universe@147 | 122 | |
universe@147 | 123 | # For Darwin, add options to specify how the application appears in the dock |
universe@147 | 124 | if $darwin; then |
universe@147 | 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" |
universe@147 | 126 | fi |
universe@147 | 127 | |
universe@147 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java |
universe@147 | 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then |
universe@147 | 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` |
universe@147 | 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` |
universe@147 | 132 | JAVACMD=`cygpath --unix "$JAVACMD"` |
universe@147 | 133 | |
universe@147 | 134 | # We build the pattern for arguments to be converted via cygpath |
universe@147 | 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` |
universe@147 | 136 | SEP="" |
universe@147 | 137 | for dir in $ROOTDIRSRAW ; do |
universe@147 | 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" |
universe@147 | 139 | SEP="|" |
universe@147 | 140 | done |
universe@147 | 141 | OURCYGPATTERN="(^($ROOTDIRS))" |
universe@147 | 142 | # Add a user-defined pattern to the cygpath arguments |
universe@147 | 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then |
universe@147 | 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" |
universe@147 | 145 | fi |
universe@147 | 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh |
universe@147 | 147 | i=0 |
universe@147 | 148 | for arg in "$@" ; do |
universe@147 | 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` |
universe@147 | 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option |
universe@147 | 151 | |
universe@147 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition |
universe@147 | 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` |
universe@147 | 154 | else |
universe@147 | 155 | eval `echo args$i`="\"$arg\"" |
universe@147 | 156 | fi |
universe@147 | 157 | i=`expr $i + 1` |
universe@147 | 158 | done |
universe@147 | 159 | case $i in |
universe@147 | 160 | 0) set -- ;; |
universe@147 | 161 | 1) set -- "$args0" ;; |
universe@147 | 162 | 2) set -- "$args0" "$args1" ;; |
universe@147 | 163 | 3) set -- "$args0" "$args1" "$args2" ;; |
universe@147 | 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; |
universe@147 | 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; |
universe@147 | 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; |
universe@147 | 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; |
universe@147 | 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; |
universe@147 | 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; |
universe@147 | 170 | esac |
universe@147 | 171 | fi |
universe@147 | 172 | |
universe@147 | 173 | # Escape application args |
universe@147 | 174 | save () { |
universe@147 | 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done |
universe@147 | 176 | echo " " |
universe@147 | 177 | } |
universe@147 | 178 | APP_ARGS=`save "$@"` |
universe@147 | 179 | |
universe@147 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules |
universe@147 | 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" |
universe@147 | 182 | |
universe@147 | 183 | exec "$JAVACMD" "$@" |