Skip to content

Commit

Permalink
Upgrade to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Sep 20, 2023
1 parent bff45ca commit 9335684
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 49 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ jobs:
- name: Git checkout
uses: actions/checkout@v2

- name: Install java
uses: actions/setup-java@v3
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
distribution: 'temurin'
java-version: '19.0.1+10'
token: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
java-version: '21'
distribution: 'graalvm-community'
cache: gradle
github-token: ${{ secrets.JRELEASER_GITHUB_TOKEN }}

- name: Echo JAVA_HOME
run: echo $JAVA_HOME
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ you can join the [Pdx-Unlimiter Discord](https://discord.gg/BVE4vxqFpU).

# Development

To build this project, a JDK for at least Java 19 is required.
To build this project, a JDK for at least Java 21 is required.
You can then build the gradle project using the gradle wrapper with `./gradle/gradlew build` or `.\gradle\gradlew.bat build`.
For running, you can use `./gradle/gradlew run`.
Note here that the gradle wrapper has been moved into the `gradle` subdirectory.
Expand Down
2 changes: 1 addition & 1 deletion canonical_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.4
2.13.5
6 changes: 3 additions & 3 deletions gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

plugins {
id 'org.beryx.jlink' version '2.24.4'
id 'org.beryx.jlink' version '2.26.0'
id 'org.jreleaser' version '1.3.1'
}

Expand Down Expand Up @@ -51,6 +51,7 @@ List<String> runArgs = [
"--add-exports", "javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix",
"--add-opens", "com.google.gson/com.google.gson.internal=io.sentry",
"--add-opens", "java.base/java.lang.reflect=com.jfoenix",
'-XX:+UseZGC',
"-Dfile.encoding=UTF-8",
"-Xmx8G"]

Expand All @@ -65,7 +66,6 @@ jlink {
imageDir = file("$buildDir/image")
options = [
// '--strip-debug',
'--compress', '2',
'--no-header-files',
'--no-man-pages']

Expand Down Expand Up @@ -160,7 +160,7 @@ task copyStartScripts(type: Copy) {

jpackage.finalizedBy(writeVersion, copyResources, copyLang, copyStartScripts)

task createDist(type: Zip, dependsOn: jpackage) {
task createDist(type: Zip, dependsOn: [jpackage, copyResources, copyLang, copyStartScripts]) {
destinationDirectory = buildDir
archivesBaseName = "pdx_unlimiter"
archiveAppendix = DefaultNativePlatform.currentOperatingSystem.windows ? "windows" : DefaultNativePlatform.currentOperatingSystem.linux ? "linux" : "mac"
Expand Down
8 changes: 4 additions & 4 deletions gradle/java.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
modularity.inferModulePath = true
options.encoding = 'UTF-8'
}

javadoc{
source = sourceSets.main.allJava
options {
addStringOption('-release', '17')
addStringOption('link', 'https://docs.oracle.com/en/java/javase/17/docs/api/')
addStringOption('-release', '21')
addStringOption('link', 'https://docs.oracle.com/en/java/javase/21/docs/api/')
addBooleanOption('html5', true)
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 10 additions & 9 deletions pdxu-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {

java {
modularity.inferModulePath = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

compileJava {
Expand All @@ -33,10 +33,10 @@ apply from: "$rootDir/gradle/module_gen.gradle"
apply from: "$rootDir/gradle/jackson.gradle"

dependencies {
implementation "org.openjfx:javafx-base:19:${platform}"
implementation "org.openjfx:javafx-controls:19:${platform}"
implementation "org.openjfx:javafx-graphics:19:${platform}"
implementation "org.openjfx:javafx-media:19:${platform}"
implementation "org.openjfx:javafx-base:21:${platform}"
implementation "org.openjfx:javafx-controls:21:${platform}"
implementation "org.openjfx:javafx-graphics:21:${platform}"
implementation "org.openjfx:javafx-media:21:${platform}"
implementation 'com.jfoenix:jfoenix:9.0.10'

implementation 'com.google.code.gson:gson:2.8.9'
Expand All @@ -54,16 +54,17 @@ dependencies {

implementation project(':pdxu-io')
implementation project(':pdxu-model')
implementation group: 'org.graalvm.polyglot', name: 'polyglot', version: '23.1.0'
implementation group: 'org.graalvm.polyglot', name: 'js-community', version: '23.1.0'

implementation 'org.graalvm.js:js:22.3.0'

implementation 'info.picocli:picocli:4.6.3'
annotationProcessor 'info.picocli:picocli-codegen:4.6.3'
testImplementation 'info.picocli:picocli:4.6.3'
testAnnotationProcessor 'info.picocli:picocli-codegen:4.6.3'

compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'

implementation 'net.java.dev.jna:jna-jpms:5.12.1'
implementation 'net.java.dev.jna:jna-platform-jpms:5.12.1'
Expand Down
2 changes: 1 addition & 1 deletion pdxu-app/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
requires javafx.media;
requires info.picocli;
requires com.sun.jna;
requires org.graalvm.js;
requires org.graalvm.polyglot;
requires com.sun.jna.platform;
requires org.jnativehook;
requires jdk.localedata;
Expand Down
12 changes: 6 additions & 6 deletions pdxu-editor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {

java {
modularity.inferModulePath = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

def currentOS = DefaultNativePlatform.currentOperatingSystem;
Expand All @@ -30,10 +30,10 @@ apply from: "$rootDir/gradle/module_gen.gradle"
apply from: "$rootDir/gradle/jackson.gradle"

dependencies {
compileOnly "org.openjfx:javafx-base:19:${platform}${suffix}"
compileOnly "org.openjfx:javafx-controls:19:${platform}${suffix}"
compileOnly "org.openjfx:javafx-graphics:19:${platform}${suffix}"
compileOnly "org.openjfx:javafx-media:19:${platform}${suffix}"
compileOnly "org.openjfx:javafx-base:21:${platform}${suffix}"
compileOnly "org.openjfx:javafx-controls:21:${platform}${suffix}"
compileOnly "org.openjfx:javafx-graphics:21:${platform}${suffix}"
compileOnly "org.openjfx:javafx-media:21:${platform}${suffix}"
compileOnly 'com.jfoenix:jfoenix:9.0.10'
compileOnly group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: "11.3.5"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected String createName() {

@Override
public void check() {
if (externalEditor.getValue().isBlank()) {
if (externalEditor.getValue() == null || externalEditor.getValue().isBlank()) {
externalEditor.set(getDefaultEditor());
}
}
Expand Down
15 changes: 7 additions & 8 deletions pdxu-io/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
plugins {
id 'java'
id "org.moditect.gradleplugin" version "1.0.0-rc3"
}

java {
modularity.inferModulePath = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

repositories {
mavenCentral()
}

apply from: "$rootDir/gradle/module_gen.gradle"

dependencies {
compileOnly 'org.graalvm.js:js:22.3.0'
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly group: 'org.graalvm.polyglot', name: 'polyglot', version: '23.1.0'
compileOnly group: 'org.graalvm.polyglot', name: 'js-community', version: '23.1.0'

compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
}
2 changes: 1 addition & 1 deletion pdxu-io/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
exports com.crschnick.pdxu.io.savegame;
exports com.crschnick.pdxu.io.node;

requires static org.graalvm.js;
requires static org.graalvm.polyglot;
requires static lombok;
}
8 changes: 4 additions & 4 deletions pdxu-model/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {

java {
modularity.inferModulePath = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

repositories {
Expand All @@ -17,6 +17,6 @@ apply from: "$rootDir/gradle/jackson.gradle"
dependencies {
implementation project(':pdxu-io')

compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
}
6 changes: 3 additions & 3 deletions resources/third_party.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
OpenJDK 19 (http://jdk.java.net/19/) (GPL2 with the Classpath Exception)
OpenJDK 21 (http://jdk.java.net/21/) (GPL2 with the Classpath Exception)

GraalVM Community Edition 22 (https://www.graalvm.org/) (GPL2 with the Classpath Exception)
GraalVM Community Edition 21 (https://www.graalvm.org/) (GPL2 with the Classpath Exception)

JavaFX 19 (https://openjfx.io/) (GPL2 with the Classpath Exception)
JavaFX 21 (https://openjfx.io/) (GPL2 with the Classpath Exception)

Rakaly CLI (https://github.com/rakaly/cli) (MIT License)

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.4
2.13.5-SNAPSHOT

0 comments on commit 9335684

Please sign in to comment.