From 164e02cbcec38f572a2843eee984f7174615b4c3 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 15 Mar 2020 15:15:34 +0000 Subject: [PATCH] Switch to JDK11 I'm very keen on being able to use the jdk.jartool module (which is only available in JDK11 onwards) as it allows us to avoid shelling out to jarsigner entirely. 11 is the current LTS release and is already widespread in Linux distributions, so I think it's reasonable to require it. This commit removes the jsobject module. We might need to re-add it in the future (if jdk.jsobject is removed from the JDK). However, it was only necessary in 8 because modern versions of 8 tended to be distributed without plugin.jar. JDK11 is distributed with the jdk.jsobject module. Signed-off-by: Graham --- README.md | 2 +- build.gradle.kts | 6 +++--- jsobject/build.gradle.kts | 20 ------------------- .../java/netscape/javascript/JSObject.java | 12 ----------- settings.gradle.kts | 3 +-- 5 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 jsobject/build.gradle.kts delete mode 100644 jsobject/src/main/java/netscape/javascript/JSObject.java diff --git a/README.md b/README.md index 21a9143ca5..b5eacd88e7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ released in late 2009. ## Prerequisites -OpenRS2 requires version 8 or later of the [Java Development Kit][jdk]. +OpenRS2 requires version 11 or later of the [Java Development Kit][jdk]. The JDK is required even if a pre-built copy of OpenRS2 is used, as it depends on JDK-only tools, such as `jarsigner`, at runtime. diff --git a/build.gradle.kts b/build.gradle.kts index 9ad7c08a8e..73f5ae4015 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,14 +41,14 @@ allprojects { configure { withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } tasks.withType { kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" freeCompilerArgs = listOf("-Xjsr305=strict") } } diff --git a/jsobject/build.gradle.kts b/jsobject/build.gradle.kts deleted file mode 100644 index 876b8eb221..0000000000 --- a/jsobject/build.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -plugins { - `java-library` - `maven-publish` -} - -publishing { - publications.create("maven") { - from(components["java"]) - - pom { - packaging = "jar" - name.set("OpenRS2 JavaScript Object") - description.set( - """ - Stubs for the netscape.javascript package. - """.trimIndent() - ) - } - } -} diff --git a/jsobject/src/main/java/netscape/javascript/JSObject.java b/jsobject/src/main/java/netscape/javascript/JSObject.java deleted file mode 100644 index e91b86f37e..0000000000 --- a/jsobject/src/main/java/netscape/javascript/JSObject.java +++ /dev/null @@ -1,12 +0,0 @@ -package netscape.javascript; - -import java.applet.Applet; - -public abstract class JSObject { - public static JSObject getWindow(Applet applet) { - return null; - } - - public abstract Object call(String methodName, Object... args); - public abstract Object eval(String s); -} diff --git a/settings.gradle.kts b/settings.gradle.kts index 79a1403ba9..39291edba4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,8 +11,7 @@ include( "deob", "deob-annotations", "deob-ast", - "game", - "jsobject" + "game" ) if (Files.exists(rootProject.projectDir.toPath().resolve("nonfree/build.gradle.kts"))) {