4# Copyright © 2015-2021 the original authors.
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
10# https://www.apache.org/licenses/LICENSE-2.0
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
19##############################################################################
21# Gradle start up script for POSIX generated by Gradle.
23##############################################################################
25# Attempt to set APP_HOME
27# Resolve links: $0 may be a link
30# Need this for daisy-chained symlinks.
32 APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
35 ls=$( ls -ld -- "$app_path" )
38 /*) app_path=$link ;; #(
39 *) app_path=$APP_HOME$link ;;
43# This is normally unused
44# shellcheck disable=SC2034
46# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
47APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
49# Use the maximum available, or set MAX_FD != -1 to use that value.
63# OS specific support (must be 'true' or 'false').
68case "$( uname )" in #(
69 CYGWIN* ) cygwin=true ;; #(
70 Darwin* ) darwin=true ;; #(
71 MSYS* | MINGW* ) msys=true ;; #(
72 NonStop* ) nonstop=true ;;
75CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
78# Determine the Java command to use to start the JVM.
79if [ -n "$JAVA_HOME" ] ; then
80 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
81 # IBM's JDK on AIX uses strange locations for the executables
82 JAVACMD=$JAVA_HOME/jre/sh/java
84 JAVACMD=$JAVA_HOME/bin/java
86 if [ ! -x "$JAVACMD" ] ; then
87 die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
89Please set the JAVA_HOME variable in your environment to match the
90location of your Java installation."
94 if ! command -v java >/dev/null 2>&1 ; then
95 die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
97Please set the JAVA_HOME variable in your environment to match the
98location of your Java installation."
102# Increase the maximum file descriptors if we can.
103if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
106 # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
107 # shellcheck disable=SC2039,SC3045
108 MAX_FD=$( ulimit -H -n ) ||
109 warn "Could not query maximum file descriptor limit"
115 # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
116 # shellcheck disable=SC2039,SC3045
117 ulimit -n "$MAX_FD" ||
118 warn "Could not set maximum file descriptor limit to $MAX_FD"
123# Collect all arguments for the java command, stacking://them after any JVM arguments
124# in DEFAULT_JVM_OPTS or JAVA_OPTS.
128 -*=*) set -- "$@" "${arg%%=*}" "${arg#*=}" ;;
129 *) set -- "$@" "$arg" ;;
136# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
137DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
139# Collect all arguments for the java command;
140# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
141# shell script including quotes and variable substitutions, so put them in
142# temporary files and parse them as such
143# * Put all other arguments in the args array
146 "-Dorg.gradle.appname=$APP_BASE_NAME" \
147 -classpath "$CLASSPATH" \
148 org.gradle.wrapper.GradleWrapperMain \
151# Stop when "xargs" is not available.
152if ! command -v xargs >/dev/null 2>&1
154 die "xargs is not available"
157# Use "xargs" to parse quoted args.
159# With -n://1, we get one arg per line, with proper handling of whitespace in each arg
160# and target strings containing spaces in a proper way.
162 printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
164 sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list