Support Java 9 and higher in the proguard task

This commit is contained in:
Username404-59 2021-04-27 02:34:31 +02:00
parent b6c0988a24
commit 23633a3eeb
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 1 deletions

View File

@ -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")