|
1 | 1 | #!/bin/sh
|
2 | 2 |
|
3 | 3 | #
|
4 |
| -# Copyright (c) 2023. Smart Operating Block |
| 4 | +# Copyright © 2015-2021 the original authors. |
5 | 5 | #
|
6 |
| -# Use of this source code is governed by an MIT-style |
7 |
| -# license that can be found in the LICENSE file or at |
8 |
| -# https://opensource.org/licenses/MIT. |
| 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 |
| 9 | +# |
| 10 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 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. |
9 | 17 | #
|
10 | 18 |
|
11 | 19 | ##############################################################################
|
|
47 | 55 | # Darwin, MinGW, and NonStop.
|
48 | 56 | #
|
49 | 57 | # (3) This script is generated from the Groovy template
|
50 |
| -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
| 58 | +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
51 | 59 | # within the Gradle project.
|
52 | 60 | #
|
53 | 61 | # You can find Gradle at https://github.com/gradle/gradle/.
|
|
72 | 80 | esac
|
73 | 81 | done
|
74 | 82 |
|
75 |
| -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit |
76 |
| - |
77 |
| -APP_NAME="Gradle" |
| 83 | +# This is normally unused |
| 84 | +# shellcheck disable=SC2034 |
78 | 85 | APP_BASE_NAME=${0##*/}
|
| 86 | +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit |
79 | 87 |
|
80 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
81 | 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
135 | 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
136 | 144 | case $MAX_FD in #(
|
137 | 145 | max*)
|
| 146 | + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. |
| 147 | + # shellcheck disable=SC3045 |
138 | 148 | MAX_FD=$( ulimit -H -n ) ||
|
139 | 149 | warn "Could not query maximum file descriptor limit"
|
140 | 150 | esac
|
141 | 151 | case $MAX_FD in #(
|
142 | 152 | '' | soft) :;; #(
|
143 | 153 | *)
|
| 154 | + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. |
| 155 | + # shellcheck disable=SC3045 |
144 | 156 | ulimit -n "$MAX_FD" ||
|
145 | 157 | warn "Could not set maximum file descriptor limit to $MAX_FD"
|
146 | 158 | esac
|
@@ -197,6 +209,12 @@ set -- \
|
197 | 209 | org.gradle.wrapper.GradleWrapperMain \
|
198 | 210 | "$@"
|
199 | 211 |
|
| 212 | +# Stop when "xargs" is not available. |
| 213 | +if ! command -v xargs >/dev/null 2>&1 |
| 214 | +then |
| 215 | + die "xargs is not available" |
| 216 | +fi |
| 217 | + |
200 | 218 | # Use "xargs" to parse quoted args.
|
201 | 219 | #
|
202 | 220 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
0 commit comments