From bf0985a389b543f431c6b039257f6366225c11ab Mon Sep 17 00:00:00 2001 From: Nel <57587152+nelind3@users.noreply.github.com> Date: Sat, 7 Sep 2024 12:37:43 +0200 Subject: [PATCH] Java 21 and Gradle 8.8 (#194) * Build with Java 21 to ensure compatibility * Update Gradle to 8.8 to support Loom 1.7 and clean up some deprecations in build.gradle --- .github/workflows/fabric-build.yml | 2 +- .github/workflows/fabric-release.yml | 2 +- .github/workflows/javadoc-snapshot.yml | 2 +- .github/workflows/javadoc.yml | 2 +- .github/workflows/maven-publish.yml | 2 +- build.gradle | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/fabric-build.yml b/.github/workflows/fabric-build.yml index 17426e701..9b08fb7ce 100644 --- a/.github/workflows/fabric-build.yml +++ b/.github/workflows/fabric-build.yml @@ -26,7 +26,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 23 + java-version: 21 - name: make gradle wrapper executable run: chmod +x ./gradlew - name: build diff --git a/.github/workflows/fabric-release.yml b/.github/workflows/fabric-release.yml index eda61f9d7..5c4d35d6d 100644 --- a/.github/workflows/fabric-release.yml +++ b/.github/workflows/fabric-release.yml @@ -26,7 +26,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 23 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/.github/workflows/javadoc-snapshot.yml b/.github/workflows/javadoc-snapshot.yml index a6c9cba26..abed0c61d 100644 --- a/.github/workflows/javadoc-snapshot.yml +++ b/.github/workflows/javadoc-snapshot.yml @@ -14,7 +14,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 23 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml index fd117c0bf..975558462 100644 --- a/.github/workflows/javadoc.yml +++ b/.github/workflows/javadoc.yml @@ -18,7 +18,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 23 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index ebeca01cd..3f9a4b7c0 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -12,7 +12,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 23 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle diff --git a/build.gradle b/build.gradle index 9f4213a44..f178edb02 100644 --- a/build.gradle +++ b/build.gradle @@ -83,7 +83,7 @@ processResources { tasks.withType(JavaCompile).configureEach { // One of the big changes to 1.21 is a requirement for at least Java 21, using 22 as it's current at time of dev. - it.options.release = 22 + it.options.release = 21 } java { @@ -92,8 +92,8 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_22 - targetCompatibility = JavaVersion.VERSION_22 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { @@ -135,7 +135,7 @@ curseforge { addGameVersion "Fabric" addGameVersion "Quilt" - mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}-fabric.jar")) { + mainArtifact(file("${project.layout.buildDirectory}/libs/${base.archivesName}-${version}-fabric.jar")) { displayName = "[${project.minecraft_version}] Taterzens ${version}" } @@ -157,7 +157,7 @@ modrinth { changelog = ENV.CHANGELOG ?: "A changelog can be found at https://github.com/samolego/Taterzens/releases/tag/${version}" versionName = "[${project.minecraft_version}] Taterzens ${version} [Fabric]" - uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}-fabric.jar") + uploadFile = file("${project.layout.buildDirectory}/libs/${base.archivesName}-${version}-fabric.jar") gameVersions = ["${project.minecraft_version}"] loaders = ['fabric', 'quilt'] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930..a4413138c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME