Skip to content

Commit d1d82ce

Browse files
authored
Update JDK 21 -> 25 in ci.yml (#4429)
* Update JDK 21 -> 25 in ci.yml * Updates to gradle configuration - Update gradle wrapper to 9.3.1 - Update velocity to use Blossom 2.2.0 - Bubblegum fix for common exec-blocks * Add source compatibility 8 to api module
1 parent ac2af0b commit d1d82ce

File tree

11 files changed

+68
-17
lines changed

11 files changed

+68
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
uses: actions/setup-java@v4
5252
with:
5353
distribution: 'temurin'
54-
java-version: '21'
54+
java-version: '25'
5555
- name: 💼 Setup Gradle
5656
uses: gradle/actions/setup-gradle@v4
5757
- name: 🛠 Build jars

Plan/api/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies {
99

1010
compileJava {
1111
options.release = 8
12+
sourceCompatibility = "${JavaVersion.VERSION_1_8}"
1213
}
1314

1415
def apiVersion = "5.7-R0.2"

Plan/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ subprojects {
5151

5252
compileJava {
5353
options.release = 11
54+
sourceCompatibility = "${JavaVersion.VERSION_11}"
5455
}
5556

5657
ext {

Plan/common/build.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ plugins {
99
id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.44"
1010
}
1111

12+
compileTestFixturesJava {
13+
sourceCompatibility = "${JavaVersion.VERSION_17}"
14+
}
15+
1216
configurations {
1317
// Runtime downloading scopes
1418
mysqlDriver
@@ -200,6 +204,12 @@ tasks.named("checkstyleTest").configure {
200204
it.dependsOn(copyYarnBuildResults)
201205
}
202206

207+
// Add support for exec block https://stackoverflow.com/a/79720796/20825073
208+
interface InjectedExecOps {
209+
@Inject
210+
ExecOperations getExecOps()
211+
}
212+
203213
tasks.register("determineAssetModifications") {
204214
// Skip Yarn build on Jitpack since Jitpack doesn't offer gclib version compatible with Node 20
205215
// Jitpack build is used mainly for java dependencies.
@@ -211,14 +221,15 @@ tasks.register("determineAssetModifications") {
211221
inputs.files(fileTree(dir: "src/main/resources/assets/plan/themes"))
212222
outputs.file("build/resources/main/assets/plan/AssetVersion.yml")
213223

224+
def execOps = project.objects.newInstance(InjectedExecOps).execOps
214225
doLast {
215226
mkdir "build/resources/main/assets/plan"
216227
def versionFile = file("build/resources/main/assets/plan/AssetVersion.yml")
217228
versionFile.text = "" // Clear previous build
218229
ConfigurableFileTree tree = fileTree(dir: "src/main/resources/assets/plan/web")
219230
tree.forEach { File f ->
220231
def gitModified = new ByteArrayOutputStream()
221-
exec {
232+
execOps.exec {
222233
commandLine "git", "log", "-1", "--pretty=%ct", f.toString()
223234
standardOutput = gitModified
224235
}
@@ -234,7 +245,7 @@ tasks.register("determineAssetModifications") {
234245
tree = fileTree(dir: "src/main/resources/assets/plan/locale")
235246
tree.forEach { File f ->
236247
def gitModified = new ByteArrayOutputStream()
237-
exec {
248+
execOps.exec {
238249
commandLine "git", "log", "-1", "--pretty=%ct", f.toString()
239250
standardOutput = gitModified
240251
}
@@ -250,7 +261,7 @@ tasks.register("determineAssetModifications") {
250261
tree = fileTree(dir: "src/main/resources/assets/plan/themes")
251262
tree.forEach { File f ->
252263
def gitModified = new ByteArrayOutputStream()
253-
exec {
264+
execOps.exec {
254265
commandLine "git", "log", "-1", "--pretty=%ct", f.toString()
255266
standardOutput = gitModified
256267
}
311 Bytes
Binary file not shown.

Plan/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

Plan/gradlew

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Plan/gradlew.bat

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Plan/velocity/build.gradle

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
plugins {
2-
id "net.kyori.blossom" version "1.3.1"
2+
id "net.kyori.blossom" version "2.2.0"
33
}
44

55
apply plugin: "com.gradleup.shadow"
66

7-
blossom {
8-
replaceTokenIn("src/main/java/com/djrapitops/plan/PlanVelocity.java")
9-
replaceToken("@version@", "$fullVersion")
7+
compileJava {
8+
dependsOn generateTemplates
9+
}
10+
11+
sourceSets {
12+
main {
13+
// java {
14+
// srcDir("src/main/java-templates")
15+
// }
16+
blossom {
17+
javaSources {
18+
property("version", "$fullVersion")
19+
}
20+
}
21+
}
1022
}
1123

1224
repositories {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* This file is part of Player Analytics (Plan).
3+
*
4+
* Plan is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Lesser General Public License v3 as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* Plan is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public License
15+
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
package net.playeranalytics.plan;
18+
19+
public class BuildParameters {
20+
public static final String VERSION = "{{ version }}";
21+
}

0 commit comments

Comments
 (0)