123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- You need
- a POSIX
- -
- compliant shell
- to run
- this script.
- If your
- /bin/
- sh is
- functions;
- var}», «${
- var:-default}», «${
- var+SET}»,
- var#prefix}», «${
- var%suffix}», and «
- $( cmd )
- »;
- compound commands
- having a
- testable exit
- status, especially «case»;
- various built
- -
- in commands
- including «command», «set», and «ulimit».
- This script
- targets any
- POSIX shell, so
- it avoids
- extensions provided
- This script
- is generated
- from the
- Groovy
- template
- app_path = $0
- while
- APP_HOME = ${app_path % "${app_path##*/}"}
- leaves a
- trailing /; empty if
- no leading
- path
- [ -h "$app_path" ]
- do
- ls = $(ls - ld
- "$app_path" )
- link = ${ls#
- *' -> '}
- case
- $link in
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
- done
- APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
- APP_NAME="Gradle"
- APP_BASE_NAME=${0##*/}
- DEFAULT_JVM_OPTS = '"-Xmx64m" "-Xms64m"'
- MAX_FD = maximum
- warn() {
- echo
- "$*"
- }
- >&2
- die() {
- echo
- echo
- "$*"
- echo
- exit
- 1
- }
- >&2
- cygwin = false
- msys = false
- darwin = false
- nonstop = false
- case "$( uname )" in #(
- CYGWIN* )
- cygwin = true;; #(
- Darwin* )
- darwin = true;; #(
- MSYS* | MINGW* )
- msys = true;; #(
- NONSTOP* )
- nonstop = true;;
- esac
- CLASSPATH = $APP_HOME / gradle / wrapper / gradle - wrapper.jar
- if [ -n "$JAVA_HOME" ]; then
- if [ -x "$JAVA_HOME/jre/sh/java" ];
- then
- JAVACMD = $JAVA_HOME / jre / sh / java
- else
- JAVACMD = $JAVA_HOME / bin / java
- fi
- if [ ! -x "$JAVACMD" ];
- then
- die
- "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
- Please set
- the JAVA_HOME
- variable in
- your environment
- to match
- the
- location
- of your
- Java installation
- ."
- fi
- else
- JAVACMD = java
- which java
- >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
- Please set
- the JAVA_HOME
- variable in
- your environment
- to match
- the
- location
- of your
- Java installation
- ."
- fi
- if ! "$cygwin" && ! "$darwin" && ! "$nonstop"; then
- case
- $MAX_FD in
- max*)
- MAX_FD = $(ulimit - H - n) ||
- warn
- "Could not query maximum file descriptor limit"
- esac
- case
- $MAX_FD in
- '' | soft) :;; #(
- *)
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
- fi
- args from
- the command
- line
- the main
- class name
- D...appname
- settings
- path (only
- if needed)
- GRADLE_OPTS environment
- variables.
- if "$cygwin" || "$msys";
- then
- APP_HOME = $(cygpath--
- path --mixed "$APP_HOME" )
- CLASSPATH = $(cygpath--
- path --mixed "$CLASSPATH" )
- JAVACMD = $(cygpath--
- unix "$JAVACMD" )
- for arg do
- if
- case
- $arg in
- -*) false;; # don't mess with options #(
- /?*)
- t = ${arg#
- /}
- t =
- /${
- t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
- fi
- set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
- eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
- exec "$JAVACMD" "$@"
|