[ANY] Обновление библиотек

This commit is contained in:
Gravit 2019-05-11 16:11:39 +07:00
parent 4e27eca7fa
commit 21434b4ed6
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
3 changed files with 34 additions and 18 deletions

View file

@ -44,13 +44,15 @@
pack project(':libLauncher') pack project(':libLauncher')
pack project(':LauncherAPI') pack project(':LauncherAPI')
bundle project(':Radon') bundle project(':Radon')
bundle 'mysql:mysql-connector-java:8.0.13' bundle 'mysql:mysql-connector-java:8.0.16'
bundle 'jline:jline:2.14.6' bundle 'org.jline:jline:3.11.0'
bundle 'net.sf.proguard:proguard-base:6.0.3' bundle 'org.jline:jline-reader:3.11.0'
bundle 'org.fusesource.jansi:jansi:1.17.1' bundle 'org.jline:jline-terminal:3.11.0'
bundle 'net.sf.proguard:proguard-base:6.1.0'
bundle 'org.fusesource.jansi:jansi:1.18'
bundle 'commons-io:commons-io:2.6' bundle 'commons-io:commons-io:2.6'
bundle 'commons-codec:commons-codec:1.11' bundle 'commons-codec:commons-codec:1.12'
bundle 'org.javassist:javassist:3.24.1-GA' bundle 'org.javassist:javassist:3.25.0-GA'
bundle 'io.netty:netty-all:4.1.36.Final' bundle 'io.netty:netty-all:4.1.36.Final'
bundle 'org.slf4j:slf4j-simple:1.7.25' bundle 'org.slf4j:slf4j-simple:1.7.25'

View file

@ -2,7 +2,9 @@
targetCompatibility = '1.8' targetCompatibility = '1.8'
dependencies { dependencies {
compileOnly 'org.fusesource.jansi:jansi:1.17.1' compileOnly 'org.fusesource.jansi:jansi:1.18'
compileOnly 'jline:jline:2.14.6' compileOnly 'org.jline:jline:3.11.0'
compileOnly 'org.jline:jline-reader:3.11.0'
compileOnly 'org.jline:jline-terminal:3.11.0'
compile 'com.google.code.gson:gson:2.8.5' compile 'com.google.code.gson:gson:2.8.5'
} }

View file

@ -1,13 +1,17 @@
package ru.gravit.utils.command; package ru.gravit.utils.command;
import jline.console.ConsoleReader; import org.jline.reader.LineReader;
import org.jline.reader.LineReaderBuilder;
import org.jline.terminal.Terminal;
import org.jline.terminal.TerminalBuilder;
import org.jline.utils.InfoCmp;
import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.LogHelper.Output; import ru.gravit.utils.helper.LogHelper.Output;
import java.io.IOException; import java.io.IOException;
public class JLineCommandHandler extends CommandHandler { public class JLineCommandHandler extends CommandHandler {
private final class JLineOutput implements Output { /*private final class JLineOutput implements Output {
@Override @Override
public void println(String message) { public void println(String message) {
try { try {
@ -18,30 +22,38 @@ public void println(String message) {
// Ignored // Ignored
} }
} }
} }*/
private final ConsoleReader reader; private final Terminal terminal;
private final TerminalBuilder terminalBuilder;
private final LineReader reader;
public JLineCommandHandler() throws IOException { public JLineCommandHandler() throws IOException {
super(); super();
terminalBuilder = TerminalBuilder.builder();
terminal = terminalBuilder.build();
reader = LineReaderBuilder.builder()
.terminal(terminal)
.build();
// Set reader // Set reader
reader = new ConsoleReader(); //reader = new ConsoleReader();
reader.setExpandEvents(false); //reader.setExpandEvents(false);
// Replace writer // Replace writer
LogHelper.removeStdOutput(); //LogHelper.removeStdOutput();
LogHelper.addOutput(new JLineOutput(), LogHelper.OutputTypes.JANSI); //LogHelper.addOutput(new JLineOutput(), LogHelper.OutputTypes.JANSI);
} }
@Override @Override
public void bell() throws IOException { public void bell() throws IOException {
reader.beep();
//reader.beep();
} }
@Override @Override
public void clear() throws IOException { public void clear() throws IOException {
reader.clearScreen(); terminal.puts(InfoCmp.Capability.clear_screen);
} }
@Override @Override