mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Support preserve-class option in CLI
This commit is contained in:
parent
85c686c72a
commit
09d857f572
|
@ -32,6 +32,7 @@ import java.nio.file.WatchKey;
|
||||||
import java.nio.file.WatchService;
|
import java.nio.file.WatchService;
|
||||||
import java.nio.file.attribute.BasicFileAttributes;
|
import java.nio.file.attribute.BasicFileAttributes;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -130,6 +131,12 @@ public final class TeaVMRunner {
|
||||||
.withDescription("Additional classpath that will be reloaded by TeaVM each time in wait mode")
|
.withDescription("Additional classpath that will be reloaded by TeaVM each time in wait mode")
|
||||||
.withLongOpt("classpath")
|
.withLongOpt("classpath")
|
||||||
.create('p'));
|
.create('p'));
|
||||||
|
options.addOption(OptionBuilder
|
||||||
|
.withArgName("class name")
|
||||||
|
.hasArgs()
|
||||||
|
.withDescription("Tell optimizer to not remove class, so that it can be found by Class.forName")
|
||||||
|
.withLongOpt("preserve-class")
|
||||||
|
.create());
|
||||||
options.addOption(OptionBuilder
|
options.addOption(OptionBuilder
|
||||||
.withLongOpt("wasm-version")
|
.withLongOpt("wasm-version")
|
||||||
.withArgName("version")
|
.withArgName("version")
|
||||||
|
@ -167,6 +174,7 @@ public final class TeaVMRunner {
|
||||||
parseTargetOption();
|
parseTargetOption();
|
||||||
parseOutputOptions();
|
parseOutputOptions();
|
||||||
parseDebugOptions();
|
parseDebugOptions();
|
||||||
|
parsePreserveClassOptions();
|
||||||
parseOptimizationOption();
|
parseOptimizationOption();
|
||||||
parseIncrementalOptions();
|
parseIncrementalOptions();
|
||||||
parseJavaScriptOptions();
|
parseJavaScriptOptions();
|
||||||
|
@ -240,6 +248,12 @@ public final class TeaVMRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void parsePreserveClassOptions() {
|
||||||
|
if (commandLine.hasOption("preserve-class")) {
|
||||||
|
tool.getClassesToPreserve().addAll(Arrays.asList(commandLine.getOptionValues("preserve-class")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void parseOptimizationOption() {
|
private void parseOptimizationOption() {
|
||||||
if (commandLine.hasOption("O")) {
|
if (commandLine.hasOption("O")) {
|
||||||
int level;
|
int level;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user