File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 201201
202202
203203# Loop in case we encounter an error.
204- REQUIRED_WRAPPER_JAR_CHECKSUM=$( curl -sSL " https://services.gradle.org/distributions/gradle-9.1.0-wrapper.jar.sha256 " )
204+ REQUIRED_WRAPPER_JAR_CHECKSUM=" 76805e32c009c0cf0dd5d206bddc9fb22ea42e84db904b764f3047de095493f3 "
205205for attempt in 1 2 3; do
206206 if [ ! -e " $APP_HOME /gradle/wrapper/gradle-wrapper.jar" ]; then
207207 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
@@ -211,7 +211,8 @@ for attempt in 1 2 3; do
211211 continue
212212 fi
213213 else
214- # Verify checksum of existing wrapper JAR.
214+ # Verify checksum of existing wrapper JAR.
215+ # This prevents developers from running into incompatibility issues when using an outdated wrapper JAR after a Gradle upgrade.
215216 # Use sha256sum or shasum, whichever is available.
216217 if command -v sha256sum > /dev/null 2>&1 ; then
217218 LOCAL_WRAPPER_JAR_CHECKSUM=$( sha256sum " $APP_HOME /gradle/wrapper/gradle-wrapper.jar" | awk ' {print $1}' )
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ task bootstrapWrapper() {
4242 // fetch the jar.
4343 def wrapperBaseUrl = " https://raw.githubusercontent.com/gradle/gradle/v$versions . gradle /gradle/wrapper"
4444 def wrapperJarUrl = wrapperBaseUrl + " /gradle-wrapper.jar"
45- def wrapperJarChecksumUrl = " https://services.gradle.org/distributions/gradle-$versions . gradle -wrapper.jar.sha256"
45+ // IMPORTANT: This checksum **must** be updated whenever the Gradle version changes.
46+ String wrapperChecksum = " 76805e32c009c0cf0dd5d206bddc9fb22ea42e84db904b764f3047de095493f3"
4647
4748 def bootstrapString = """
4849 # Loop in case we encounter an error.
49- REQUIRED_WRAPPER_JAR_CHECKSUM=\$ (curl -sSL " $w rapperJarChecksumUrl ")
50+ REQUIRED_WRAPPER_JAR_CHECKSUM=" $w rapperChecksum "
5051 for attempt in 1 2 3; do
5152 if [ ! -e "$wrapperJarPath " ]; then
5253 if ! curl -s -S --retry 3 -L -o "$wrapperJarPath " "$wrapperJarUrl "; then
@@ -56,7 +57,8 @@ task bootstrapWrapper() {
5657 continue
5758 fi
5859 else
59- # Verify checksum of existing wrapper JAR.
60+ # Verify checksum of existing wrapper JAR.
61+ # This prevents developers from running into incompatibility issues when using an outdated wrapper JAR after a Gradle upgrade.
6062 # Use sha256sum or shasum, whichever is available.
6163 if command -v sha256sum >/dev/null 2>&1; then
6264 LOCAL_WRAPPER_JAR_CHECKSUM=\$ (sha256sum "$wrapperJarPath " | awk '{print \$ 1}')
You can’t perform that action at this time.
0 commit comments