proguard icon indicating copy to clipboard operation
proguard copied to clipboard

JDK 19 support

Open boris-petrov opened this issue 3 years ago • 4 comments

JDK 19 is going to land in September and most likely project Loom be previewed there. I am eagerly awaiting it but I'm unsure as to what that means for ProGuard. Will ProGuard have to do any changes to support that?

boris-petrov avatar May 03 '22 18:05 boris-petrov

Hi @boris-petrov ! As far as I can tell, the Loom changes shouldn't impact ProGuard, since there's no bytecode / class file changes involved.

You can already test the preview version with ProGuard by building ProGuard + ProGuardCORE with a bumped max version number (https://github.com/Guardsquare/proguard-core/blob/master/src/main/java/proguard/classfile/VersionConstants.java#L85)

You can checkout both repositories and do a composite build:

$ ./gradlew --include-build ../proguard-core assemble

Or install proguard-core to maven local and use that version in the ProGuard build.

mrjameshamilton avatar May 09 '22 16:05 mrjameshamilton

@mrjameshamilton thanks for the information! That's great news! If you think there are/might be changes in JDK 19 that will require support in ProGuard, you can use this issue for that. If not, you can close it. :) Thanks!

boris-petrov avatar May 09 '22 17:05 boris-petrov

I've tested proguard on JDK 19 with this patch applied to VersionConstants.java:

diff --git a/base/src/main/java/proguard/classfile/VersionConstants.java b/base/src/main/java/proguard/classfile/VersionConstants.java
index 7fad5ea..adb1a98 100644
--- a/base/src/main/java/proguard/classfile/VersionConstants.java
+++ b/base/src/main/java/proguard/classfile/VersionConstants.java
@@ -62,6 +62,8 @@ public class VersionConstants
     public static final int CLASS_VERSION_17_MINOR  = 0;
     public static final int CLASS_VERSION_18_MAJOR  = 62;
     public static final int CLASS_VERSION_18_MINOR  = 65535;
+    public static final int CLASS_VERSION_19_MAJOR  = 63;
+    public static final int CLASS_VERSION_19_MINOR  = 65535;
 
     public static final int CLASS_VERSION_1_0 = (CLASS_VERSION_1_0_MAJOR << 16) | CLASS_VERSION_1_0_MINOR;
     public static final int CLASS_VERSION_1_2 = (CLASS_VERSION_1_2_MAJOR << 16) | CLASS_VERSION_1_2_MINOR;
@@ -81,6 +83,7 @@ public class VersionConstants
     public static final int CLASS_VERSION_16  = (CLASS_VERSION_16_MAJOR  << 16) | CLASS_VERSION_16_MINOR;
     public static final int CLASS_VERSION_17  = (CLASS_VERSION_17_MAJOR  << 16) | CLASS_VERSION_17_MINOR;
     public static final int CLASS_VERSION_18  = (CLASS_VERSION_18_MAJOR  << 16) | CLASS_VERSION_18_MINOR;
+    public static final int CLASS_VERSION_19  = (CLASS_VERSION_19_MAJOR  << 16) | CLASS_VERSION_19_MINOR;
 
-    public static final int MAX_SUPPORTED_VERSION = CLASS_VERSION_18;
+    public static final int MAX_SUPPORTED_VERSION = CLASS_VERSION_19;
 }

It would be great to have a (beta) release with this patch such that I can use it in our CI system.

dougxc avatar Aug 08 '22 08:08 dougxc

Hi @dougxc ! I've made the update in ProGuardCORE, hoping to get a ProGuard version out soon.

mrjameshamilton avatar Aug 09 '22 08:08 mrjameshamilton

Hi @mrjameshamilton I see that ProGuardCORE 9.0.3 is now on maven. Do you have a rough ETA as to when there will be proguard-base and proguard-retrace jars on maven that use proguard-core 9.0.3? I am currently modifying the classpath to use 7.2.0-beta1 of these jars with proguard-core 9.0.3. It seems to work but having jars designed to work together would be more reassuring.

dougxc avatar Aug 18 '22 14:08 dougxc

Hi @dougxc ! Sorry for the delay! We've released 7.3.0-beta1 :)

mrjameshamilton avatar Sep 09 '22 16:09 mrjameshamilton

Thanks! I assume it will show up on maven before too long?

dougxc avatar Sep 09 '22 17:09 dougxc

Thanks! I assume it will show up on maven before too long?

Yes, should be there soon!

mrjameshamilton avatar Sep 09 '22 17:09 mrjameshamilton