|
1 | 1 | #!/bin/sh
|
2 | 2 |
|
3 | 3 | #
|
4 |
| -# Copyright © 2015-2021 the original authors. |
| 4 | +# Copyright © 2015 the original authors. |
5 | 5 | #
|
6 | 6 | # Licensed under the Apache License, Version 2.0 (the "License");
|
7 | 7 | # you may not use this file except in compliance with the License.
|
|
15 | 15 | # See the License for the specific language governing permissions and
|
16 | 16 | # limitations under the License.
|
17 | 17 | #
|
| 18 | +# SPDX-License-Identifier: Apache-2.0 |
| 19 | +# |
18 | 20 |
|
19 | 21 | ##############################################################################
|
20 | 22 | #
|
|
55 | 57 | # Darwin, MinGW, and NonStop.
|
56 | 58 | #
|
57 | 59 | # (3) This script is generated from the Groovy template
|
58 |
| -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
| 60 | +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
59 | 61 | # within the Gradle project.
|
60 | 62 | #
|
61 | 63 | # You can find Gradle at https://github.com/gradle/gradle/.
|
|
84 | 86 | # shellcheck disable=SC2034
|
85 | 87 | APP_BASE_NAME=${0##*/}
|
86 | 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
87 |
| -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit |
| 89 | +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit |
88 | 90 |
|
89 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
|
90 | 92 | MAX_FD=maximum
|
@@ -113,20 +115,6 @@ case "$( uname )" in #(
|
113 | 115 | esac
|
114 | 116 |
|
115 | 117 |
|
116 |
| -# Loop in case we encounter an error. |
117 |
| -for attempt in 1 2 3; do |
118 |
| - if [ ! -e "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" ]; then |
119 |
| - if ! curl -s -S --retry 3 -L -o "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" "https://raw.githubusercontent.com/gradle/gradle/v8.14.3/gradle/wrapper/gradle-wrapper.jar"; then |
120 |
| - rm -f "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" |
121 |
| - # Pause for a bit before looping in case the server throttled us. |
122 |
| - sleep 5 |
123 |
| - continue |
124 |
| - fi |
125 |
| - fi |
126 |
| -done |
127 |
| - |
128 |
| -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
129 |
| - |
130 | 118 |
|
131 | 119 | # Determine the Java command to use to start the JVM.
|
132 | 120 | if [ -n "$JAVA_HOME" ] ; then
|
|
183 | 171 | # For Cygwin or MSYS, switch paths to Windows format before running java
|
184 | 172 | if "$cygwin" || "$msys" ; then
|
185 | 173 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
186 |
| - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) |
187 | 174 |
|
188 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" )
|
189 | 176 |
|
@@ -212,19 +199,31 @@ if "$cygwin" || "$msys" ; then
|
212 | 199 | fi
|
213 | 200 |
|
214 | 201 |
|
| 202 | + |
| 203 | +# Loop in case we encounter an error. |
| 204 | +for attempt in 1 2 3; do |
| 205 | + if [ ! -e "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" ]; then |
| 206 | + if ! curl -s -S --retry 3 -L -o "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" "https://raw.githubusercontent.com/gradle/gradle/v9.1.0/gradle/wrapper/gradle-wrapper.jar"; then |
| 207 | + rm -f "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" |
| 208 | + # Pause for a bit before looping in case the server throttled us. |
| 209 | + sleep 5 |
| 210 | + continue |
| 211 | + fi |
| 212 | + fi |
| 213 | +done |
| 214 | + |
215 | 215 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
216 | 216 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
217 | 217 |
|
218 | 218 | # Collect all arguments for the java command:
|
219 |
| -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, |
| 219 | +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, |
220 | 220 | # and any embedded shellness will be escaped.
|
221 | 221 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
222 | 222 | # treated as '${Hostname}' itself on the command line.
|
223 | 223 |
|
224 | 224 | set -- \
|
225 | 225 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
|
226 |
| - -classpath "$CLASSPATH" \ |
227 |
| - org.gradle.wrapper.GradleWrapperMain \ |
| 226 | + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ |
228 | 227 | "$@"
|
229 | 228 |
|
230 | 229 | # Stop when "xargs" is not available.
|
|
0 commit comments