Upgrade Gradle to 8.14 in CI Workflows and Gradle Wrapper (#3425)

# Description of Changes

This pull request upgrades the Gradle build system from version 8.12 to
8.14 across the Stirling-PDF project to enhance build stability,
compatibility, and performance. The changes include:

- **What was changed**:
- Updated the Gradle wrapper version in
`gradle/wrapper/gradle-wrapper.properties` from `8.12` to `8.14`.
- Modified the `tasks.wrapper` configuration in `build.gradle` to
specify `gradleVersion = "8.14"`.
- Updated Gradle version references in GitHub Actions workflows
(`multiOSReleases.yml`, `push-docker.yml`, `releaseArtifacts.yml`) from
`8.12` to `8.14` to ensure consistent CI/CD builds.

- **Why the change was made**:
- Gradle 8.14 includes bug fixes, performance improvements, and enhanced
compatibility with newer JDK versions (e.g., Java 17 and 21, as
supported by Stirling-PDF).
- Ensures alignment with the latest Gradle features and security
patches, reducing potential build issues in development and CI/CD
environments.
- Supports the project's recommendation to use newer JDK versions (e.g.,
Java 21) and improves integration with the Foojay Toolchains Plugin.

- **Challenges encountered**:
- Verified compatibility of Gradle 8.14 with existing plugins (e.g.,
`org.springframework.boot`, `org.sonarqube`, `com.diffplug.spotless`) to
ensure no breaking changes.
- Tested CI/CD workflows to confirm that the updated Gradle version does
not introduce failures in build, test, or deployment pipelines.
- Ensured the Gradle wrapper distribution URL is correctly updated to
avoid download issues.


---

## Checklist

### General

- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
Ludy 2025-04-27 17:17:07 +02:00 committed by GitHub
parent 29803562eb
commit 0b81dfdf7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 21 additions and 17 deletions

View File

@ -70,7 +70,7 @@ jobs:
- uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
with:
gradle-version: 8.12
gradle-version: 8.14
- name: Generate jar (With Security=${{ matrix.enable_security }})
run: ./gradlew clean createExe
@ -158,7 +158,7 @@ jobs:
- uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
with:
gradle-version: 8.12
gradle-version: 8.14
# Install Windows dependencies
- name: Install WiX Toolset

View File

@ -32,7 +32,7 @@ jobs:
- uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
with:
gradle-version: 8.12
gradle-version: 8.14
- name: Run Gradle Command
run: ./gradlew clean build

View File

@ -37,7 +37,7 @@ jobs:
- uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
with:
gradle-version: 8.12
gradle-version: 8.14
- name: Generate jar (With Security=${{ matrix.enable_security }})
run: ./gradlew clean createExe

View File

@ -404,7 +404,7 @@ sonar {
// rules=['unused-dependency']
// }
tasks.wrapper {
gradleVersion = "8.12"
gradleVersion = "8.14"
distributionType = Wrapper.DistributionType.ALL
}
//tasks.withType(JavaCompile) {

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

6
gradlew vendored
View File

@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

4
gradlew.bat vendored
View File

@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell

View File

@ -1 +1,5 @@
plugins {
// Apply the foojay-resolver plugin to allow automatic download of JDKs
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
}
rootProject.name = 'Stirling-PDF'

View File

@ -26,7 +26,7 @@ check_webpage() {
fi
# Check if response contains HTML
if ! printf '%s' "$BODY" | grep -q "<!DOCTYPE html>\|<html"; then
if ! grep -q "<!DOCTYPE html>\|<html" <<< "$BODY"; then
echo "FAILED - Response is not HTML - $full_url" >> "$result_file"
return 1
fi
@ -75,13 +75,13 @@ test_all_urls() {
((total_count++))
((url_index++))
# Run the check in background
test_url "$url" "$base_url" "$tmp_dir" "$url_index" &
# Track the job
((active_jobs++))
# If we've reached max_parallel, wait for a job to finish
if [ $active_jobs -ge $max_parallel ]; then
wait -n # Wait for any child process to exit
@ -97,7 +97,7 @@ test_all_urls() {
if [ -f "${tmp_dir}/result_${i}.txt" ]; then
cat "${tmp_dir}/result_${i}.txt"
fi
if [ -f "${tmp_dir}/failed_${i}" ]; then
failed_count=$((failed_count + $(cat "${tmp_dir}/failed_${i}")))
fi
@ -171,4 +171,4 @@ main() {
# Run main if script is executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi
fi