mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-28 13:05:16 +01:00
update kotlin
This commit is contained in:
parent
f7e16a16df
commit
6b23a6e62f
@ -3,9 +3,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
application
|
application
|
||||||
kotlin("jvm") version "1.4.32"
|
kotlin("jvm") version "1.5.0"
|
||||||
id("maven-publish")
|
id("maven-publish")
|
||||||
id("com.github.johnrengelman.shadow") version "6.1.0"
|
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||||
id("com.github.ben-manes.versions") version "0.38.0"
|
id("com.github.ben-manes.versions") version "0.38.0"
|
||||||
id("com.palantir.git-version") version "0.12.3"
|
id("com.palantir.git-version") version "0.12.3"
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ dependencies {
|
|||||||
implementation("org.jline:jline-terminal-jansi:3.19.0")
|
implementation("org.jline:jline-terminal-jansi:3.19.0")
|
||||||
implementation("org.apache.commons:commons-compress:1.20")
|
implementation("org.apache.commons:commons-compress:1.20")
|
||||||
|
|
||||||
val ktorVersion = "1.5.3"
|
val ktorVersion = "1.5.4"
|
||||||
implementation(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
implementation("io.ktor:ktor-network-tls-certificates:$ktorVersion")
|
implementation("io.ktor:ktor-network-tls-certificates:$ktorVersion")
|
||||||
implementation("io.ktor:ktor-server-netty:$ktorVersion")
|
implementation("io.ktor:ktor-server-netty:$ktorVersion")
|
||||||
|
@ -48,7 +48,7 @@ class VIAaaSAddress {
|
|||||||
}?.toString()
|
}?.toString()
|
||||||
if (option != null) {
|
if (option != null) {
|
||||||
val arg = part.substring(2)
|
val arg = part.substring(2)
|
||||||
when (option.toLowerCase(Locale.ROOT)) {
|
when (option.lowercase()) {
|
||||||
"p" -> port = arg.toInt()
|
"p" -> port = arg.toInt()
|
||||||
"o" -> online = when {
|
"o" -> online = when {
|
||||||
arg.startsWith("t", ignoreCase = true) -> true
|
arg.startsWith("t", ignoreCase = true) -> true
|
||||||
|
@ -39,7 +39,7 @@ object VIAaaSConsole : SimpleTerminalConsole(), ViaCommandSender {
|
|||||||
candidates.addAll(commands.keys.filter { it.startsWith(alias, ignoreCase = true) }
|
candidates.addAll(commands.keys.filter { it.startsWith(alias, ignoreCase = true) }
|
||||||
.map { Candidate(it) })
|
.map { Candidate(it) })
|
||||||
} else {
|
} else {
|
||||||
val command = commands[alias.toLowerCase()]
|
val command = commands[alias.lowercase()]
|
||||||
if (command != null) {
|
if (command != null) {
|
||||||
candidates.addAll(command.suggest(this, alias, args).map(::Candidate))
|
candidates.addAll(command.suggest(this, alias, args).map(::Candidate))
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ object VIAaaSConsole : SimpleTerminalConsole(), ViaCommandSender {
|
|||||||
override fun runCommand(commandLine: String) {
|
override fun runCommand(commandLine: String) {
|
||||||
val cmd = commandLine.split(" ")
|
val cmd = commandLine.split(" ")
|
||||||
try {
|
try {
|
||||||
val alias = cmd[0].toLowerCase()
|
val alias = cmd[0].lowercase()
|
||||||
val args = cmd.subList(1, cmd.size)
|
val args = cmd.subList(1, cmd.size)
|
||||||
val command = commands[alias]
|
val command = commands[alias]
|
||||||
if (command == null) {
|
if (command == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user