mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Возможность отключить Radon.
This commit is contained in:
parent
f20816b9a2
commit
8ed337d709
2 changed files with 16 additions and 11 deletions
|
@ -120,6 +120,7 @@ public static final class Config {
|
||||||
|
|
||||||
public boolean isWarningMissArchJava;
|
public boolean isWarningMissArchJava;
|
||||||
public boolean enabledProGuard;
|
public boolean enabledProGuard;
|
||||||
|
public boolean enabledRadon;
|
||||||
public boolean stripLineNumbers;
|
public boolean stripLineNumbers;
|
||||||
public boolean deleteTempFiles;
|
public boolean deleteTempFiles;
|
||||||
public boolean enableRcon;
|
public boolean enableRcon;
|
||||||
|
@ -641,6 +642,7 @@ private void generateConfigIfNotExists() throws IOException {
|
||||||
newConfig.threadCoreCount = 0; // on your own
|
newConfig.threadCoreCount = 0; // on your own
|
||||||
newConfig.threadCount = JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() >= 4 ? JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() / 2 : JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors();
|
newConfig.threadCount = JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() >= 4 ? JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors() / 2 : JVMHelper.OPERATING_SYSTEM_MXBEAN.getAvailableProcessors();
|
||||||
|
|
||||||
|
newConfig.enabledRadon = true;
|
||||||
newConfig.enabledProGuard = true;
|
newConfig.enabledProGuard = true;
|
||||||
newConfig.stripLineNumbers = true;
|
newConfig.stripLineNumbers = true;
|
||||||
newConfig.deleteTempFiles = true;
|
newConfig.deleteTempFiles = true;
|
||||||
|
|
|
@ -31,17 +31,20 @@ public String getName() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Path process(Path inputFile) throws IOException {
|
public Path process(Path inputFile) throws IOException {
|
||||||
if (!IOHelper.isFile(config)) UnpackHelper.unpack(IOHelper.getResourceURL("ru/gravit/launchserver/defaults/radon.cfg"), config);
|
Path outputFile = srv.launcherBinary.nextLowerPath(this);
|
||||||
Path outputFile = srv.launcherBinary.nextLowerPath(this);
|
if (srv.config.enabledRadon) {
|
||||||
ConfigurationParser p = new ConfigurationParser(IOHelper.newInput(config));
|
if (!IOHelper.isFile(config)) UnpackHelper.unpack(IOHelper.getResourceURL("ru/gravit/launchserver/defaults/radon.cfg"), config);
|
||||||
SessionInfo info = p.createSessionFromConfig();
|
ConfigurationParser p = new ConfigurationParser(IOHelper.newInput(config));
|
||||||
info.setInput(inputFile.toFile());
|
SessionInfo info = p.createSessionFromConfig();
|
||||||
info.setOutput(outputFile.toFile());
|
info.setInput(inputFile.toFile());
|
||||||
List<File> libs = srv.launcherBinary.coreLibs.stream().map(e -> e.toFile()).collect(Collectors.toList());
|
info.setOutput(outputFile.toFile());
|
||||||
libs.addAll(srv.launcherBinary.addonLibs.stream().map(e -> e.toFile()).collect(Collectors.toList()));
|
List<File> libs = srv.launcherBinary.coreLibs.stream().map(e -> e.toFile()).collect(Collectors.toList());
|
||||||
info.setLibraries(libs);
|
libs.addAll(srv.launcherBinary.addonLibs.stream().map(e -> e.toFile()).collect(Collectors.toList()));
|
||||||
Radon r = new Radon(info);
|
info.setLibraries(libs);
|
||||||
r.run();
|
Radon r = new Radon(info);
|
||||||
|
r.run();
|
||||||
|
} else
|
||||||
|
IOHelper.copy(inputFile, outputFile);
|
||||||
return outputFile;
|
return outputFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue