fix proguard maybe

This commit is contained in:
wagyourtail 2021-07-05 15:09:15 -06:00
parent 683e987b1d
commit c7d210bfd6
No known key found for this signature in database
GPG Key ID: E6E3EB7DCD4EB017
1 changed files with 2 additions and 4 deletions

View File

@ -236,10 +236,8 @@ public class ProguardTask extends BaritoneGradleTask {
template.add(0, "-injars " + this.artifactPath.toString()); template.add(0, "-injars " + this.artifactPath.toString());
template.add(1, "-outjars " + this.getTemporaryFile(PROGUARD_EXPORT_PATH)); template.add(1, "-outjars " + this.getTemporaryFile(PROGUARD_EXPORT_PATH));
// Acquire the RT jar using "java -verbose". This doesn't work on Java 9+ template.add(2, "-libraryjars <java.home>/jmods/java.base.jmod(!**.jar;!module-info.class)");
Process p = new ProcessBuilder(this.getJavaBinPathForProguard(), "-verbose").start(); template.add(3, "-libraryjars <java.home>/jmods/java.desktop.jmod(!**.jar;!module-info.class)");
String out = IOUtils.toString(p.getInputStream(), "UTF-8").split("\n")[0].split("Opened ")[1].replace("]", "");
template.add(2, "-libraryjars '" + out + "'(!META-INF/versions/**)");
{ {
final Stream<File> libraries; final Stream<File> libraries;