From da8ab2f02508a4451d2f168ee5e5357e4bf3c310 Mon Sep 17 00:00:00 2001 From: Punikekk Date: Thu, 7 Mar 2024 20:16:24 +0100 Subject: [PATCH] fix svgs not being loaded while running bot as .jar --- build.gradle.kts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 311e294d5..b0bd5ebcf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -83,7 +83,6 @@ tasks.jar { } tasks.register("proguard") { - allowaccessmodification() dontoptimize() dontobfuscate() dontnote() @@ -93,15 +92,13 @@ tasks.register("proguard") { keep("class com.github.manolo8.** { *; }") keep("class eu.darkbot.** { *; }") keep("class com.formdev.** { *; }") + keep("class com.github.weisj.jsvg.** { *; }") injars(tasks["shadowJar"].outputs.files.singleFile) outjars("build/DarkBot.jar") - if (JavaVersion.current().isJava9Compatible) { - libraryjars("${System.getProperty("java.home")}/jmods") - } else { - libraryjars("${System.getProperty("java.home")}/lib/rt.jar") - } + libraryjars("${System.getProperty("java.home")}/jmods") + libraryjars(configurations.compileClasspath.get().files) dependsOn(tasks.build) }