From 23633a3eebd2a89d6d444c6861dfd1db7eecd7f0 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Tue, 27 Apr 2021 02:34:31 +0200 Subject: [PATCH] Support Java 9 and higher in the proguard task --- build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8144c7d..9117c21 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,9 @@ subprojects { // The following lines are needed at least for the current version of proguard dontwarn("java.**") val homeDir = System.getProperty("java.home") as String - libraryjars("$homeDir/lib/rt.jar") + if (JavaVersion.current().isJava9Compatible()) { + libraryjars("$homeDir/jmods/java.base.jmod") + } else libraryjars("$homeDir/lib/rt.jar") // Note: dontpreverify() should NOT be used, it will cause errors at runtime useuniqueclassmembernames() optimizations("method/inlining/*, code/allocation/variable, class/merging/vertical, class/merging/horizontal, code/removal/advanced, code/simplification/branch, code/merging")