[FEATURE] Add ProGuard jvmArgs

This commit is contained in:
Gravita 2024-01-18 00:13:36 +07:00 committed by microwin7
parent 48946d6e74
commit ab884c8d23

View file

@ -34,6 +34,7 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon
private static final Logger logger = LogManager.getLogger();
public String modeAfter = "MainBuild";
public String dir = "proguard";
public List<String> jvmArgs = new ArrayList<>();
public boolean enabled = true;
public boolean mappings = true;
public transient ProguardConf proguardConf;
@ -41,6 +42,10 @@ public class ProGuardComponent extends Component implements AutoCloseable, Recon
private transient ProGuardBuildTask buildTask;
private transient ProGuardMultiReleaseFixer fixerTask;
public ProGuardComponent() {
this.jvmArgs.add("-Xmx512M");
}
public static boolean checkFXJMods(Path path) {
if (!IOHelper.exists(path.resolve("javafx.base.jmod")))
return false;
@ -208,6 +213,7 @@ public Path process(Path inputFile) throws IOException {
try {
List<String> args = new ArrayList<>();
args.add(IOHelper.resolveJavaBin(IOHelper.JVM_DIR).toAbsolutePath().toString());
args.addAll(component.jvmArgs);
args.add("-cp");
try(Stream<Path> files = Files.walk(Path.of("libraries"), FileVisitOption.FOLLOW_LINKS)) {
args.add(files