Repository for GregTech 6
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gradlew 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #!/usr/bin/env bash
  2. ##############################################################################
  3. ##
  4. ## Gradle start up script for UN*X
  5. ##
  6. ##############################################################################
  7. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  8. DEFAULT_JVM_OPTS=""
  9. APP_NAME="Gradle"
  10. APP_BASE_NAME=`basename "$0"`
  11. # Use the maximum available, or set MAX_FD != -1 to use that value.
  12. MAX_FD="maximum"
  13. warn ( ) {
  14. echo "$*"
  15. read -n1 -r -p "Press any key to continue..."
  16. }
  17. die ( ) {
  18. echo
  19. echo "$*"
  20. echo
  21. read -n1 -r -p "Press any key to continue..."
  22. }
  23. # OS specific support (must be 'true' or 'false').
  24. cygwin=false
  25. msys=false
  26. darwin=false
  27. case "`uname`" in
  28. CYGWIN* )
  29. cygwin=true
  30. ;;
  31. Darwin* )
  32. darwin=true
  33. ;;
  34. MINGW* )
  35. msys=true
  36. ;;
  37. esac
  38. # For Cygwin, ensure paths are in UNIX format before anything is touched.
  39. if $cygwin ; then
  40. [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  41. fi
  42. # Attempt to set APP_HOME
  43. # Resolve links: $0 may be a link
  44. PRG="$0"
  45. # Need this for relative symlinks.
  46. while [ -h "$PRG" ] ; do
  47. ls=`ls -ld "$PRG"`
  48. link=`expr "$ls" : '.*-> \(.*\)$'`
  49. if expr "$link" : '/.*' > /dev/null; then
  50. PRG="$link"
  51. else
  52. PRG=`dirname "$PRG"`"/$link"
  53. fi
  54. done
  55. SAVED="`pwd`"
  56. cd "`dirname \"$PRG\"`/" >&-
  57. APP_HOME="`pwd -P`"
  58. cd "$SAVED" >&-
  59. CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
  60. # Determine the Java command to use to start the JVM.
  61. if [ -n "$JAVA_HOME" ] ; then
  62. if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  63. # IBM's JDK on AIX uses strange locations for the executables
  64. JAVACMD="$JAVA_HOME/jre/sh/java"
  65. else
  66. JAVACMD="$JAVA_HOME/bin/java"
  67. fi
  68. if [ ! -x "$JAVACMD" ] ; then
  69. die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
  70. Please set the JAVA_HOME variable in your environment to match the
  71. location of your Java installation."
  72. fi
  73. else
  74. JAVACMD="java"
  75. which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  76. Please set the JAVA_HOME variable in your environment to match the
  77. location of your Java installation."
  78. fi
  79. # Increase the maximum file descriptors if we can.
  80. if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
  81. MAX_FD_LIMIT=`ulimit -H -n`
  82. if [ $? -eq 0 ] ; then
  83. if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
  84. MAX_FD="$MAX_FD_LIMIT"
  85. fi
  86. ulimit -n $MAX_FD
  87. if [ $? -ne 0 ] ; then
  88. warn "Could not set maximum file descriptor limit: $MAX_FD"
  89. fi
  90. else
  91. warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
  92. fi
  93. fi
  94. # For Darwin, add options to specify how the application appears in the dock
  95. if $darwin; then
  96. GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
  97. fi
  98. # For Cygwin, switch paths to Windows format before running java
  99. if $cygwin ; then
  100. APP_HOME=`cygpath --path --mixed "$APP_HOME"`
  101. CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
  102. # We build the pattern for arguments to be converted via cygpath
  103. ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
  104. SEP=""
  105. for dir in $ROOTDIRSRAW ; do
  106. ROOTDIRS="$ROOTDIRS$SEP$dir"
  107. SEP="|"
  108. done
  109. OURCYGPATTERN="(^($ROOTDIRS))"
  110. # Add a user-defined pattern to the cygpath arguments
  111. if [ "$GRADLE_CYGPATTERN" != "" ] ; then
  112. OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
  113. fi
  114. # Now convert the arguments - kludge to limit ourselves to /bin/sh
  115. i=0
  116. for arg in "$@" ; do
  117. CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
  118. CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
  119. if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
  120. eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
  121. else
  122. eval `echo args$i`="\"$arg\""
  123. fi
  124. i=$((i+1))
  125. done
  126. case $i in
  127. (0) set -- ;;
  128. (1) set -- "$args0" ;;
  129. (2) set -- "$args0" "$args1" ;;
  130. (3) set -- "$args0" "$args1" "$args2" ;;
  131. (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
  132. (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
  133. (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
  134. (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
  135. (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
  136. (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
  137. esac
  138. fi
  139. # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
  140. function splitJvmOpts() {
  141. JVM_OPTS=("$@")
  142. }
  143. eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
  144. JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
  145. exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"