From eaccc03019be6deaa8440dfef6dcb221ac72ed19 Mon Sep 17 00:00:00 2001 From: Pavel Kunyavskiy Date: Sat, 5 Oct 2024 10:34:37 +0200 Subject: [PATCH] Upgrade dependencies --- .../kotlin/live.app-conventions.gradle.kts | 2 +- gradle/libs.versions.toml | 40 +++++++++---------- .../main/kotlin/org/icpclive/Application.kt | 1 + .../src/main/kotlin/org/icpclive/Config.kt | 3 +- .../src/main/kotlin/Application.kt | 6 ++- .../src/main/kotlin/DumpFileCommand.kt | 8 +++- .../src/main/kotlin/ServerCommand.kt | 5 ++- .../kotlin/org/icpclive/oracle/Application.kt | 1 + .../main/kotlin/org/icpclive/oracle/Config.kt | 3 +- .../main/kotlin/org/icpclive/reacbot/Bot.kt | 2 +- .../org/icpclive/generator/schema/gen.kt | 3 +- 11 files changed, 44 insertions(+), 30 deletions(-) diff --git a/buildSrc/src/main/kotlin/live.app-conventions.gradle.kts b/buildSrc/src/main/kotlin/live.app-conventions.gradle.kts index f7289b4db..44796cbaf 100644 --- a/buildSrc/src/main/kotlin/live.app-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/live.app-conventions.gradle.kts @@ -5,7 +5,7 @@ import org.gradle.kotlin.dsl.register plugins { application id("live.kotlin-conventions") - id("com.github.johnrengelman.shadow") + id("com.gradleup.shadow") } tasks.named("jar") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0217ee36d..540975c55 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,29 +1,29 @@ [versions] ktor = "2.3.12" # https://ktor.io/ -datetime = "0.6.0" # https://github.com/Kotlin/kotlinx-datetime -serialization = "1.7.1" # https://github.com/Kotlin/kotlinx.serialization -kotlin = "2.0.0" -ksp = "2.0.0-1.0.23" # https://github.com/google/ksp -slf4j = "2.0.13" # https://www.slf4j.org/download.html -logback = "1.5.6" # https://logback.qos.ch/download.html -node-plugin = "7.0.2" # https://github.com/node-gradle/gradle-node-plugin -coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines/ -exposed = "0.52.0" # https://github.com/JetBrains/Exposed -telegram-bot = "6.1.0" # https://github.com/kotlin-telegram-bot/kotlin-telegram-bot -shadow-plugin = "8.1.1" # https://github.com/johnrengelman/shadow -sqlite = "3.46.0.0" # https://github.com/xerial/sqlite-jdbc -clikt = "4.4.0" # https://ajalt.github.io/clikt/ -immutable = "0.3.7" # https://github.com/Kotlin/kotlinx.collections.immutable +datetime = "0.6.1" # https://github.com/Kotlin/kotlinx-datetime +serialization = "1.7.3" # https://github.com/Kotlin/kotlinx.serialization +kotlin = "2.0.20" +ksp = "2.0.20-1.0.25" # https://github.com/google/ksp +slf4j = "2.0.16" # https://www.slf4j.org/download.html +logback = "1.5.8" # https://logback.qos.ch/download.html +node-plugin = "7.1.0" # https://github.com/node-gradle/gradle-node-plugin +coroutines = "1.9.0" # https://github.com/Kotlin/kotlinx.coroutines/ +exposed = "0.55.0" # https://github.com/JetBrains/Exposed +telegram-bot = "6.2.0" # https://github.com/kotlin-telegram-bot/kotlin-telegram-bot +shadow-plugin = "8.3.3" # https://github.com/GradleUp/shadow +sqlite = "3.46.1.3" # https://github.com/xerial/sqlite-jdbc +clikt = "5.0.0" # https://ajalt.github.io/clikt/ +immutable = "0.3.8" # https://github.com/Kotlin/kotlinx.collections.immutable protobuf-plugin = "0.9.4" # https://github.com/google/protobuf-gradle-plugin -protobuf = "4.27.1" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-kotlin -grpc = "1.65.0" # https://github.com/grpc/grpc +protobuf = "4.28.2" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-kotlin +grpc = "1.68.0" # https://github.com/grpc/grpc grpc-kotlin = "1.4.1" # https://github.com/grpc/grpc-kotlin dokka = "2.0.0-Beta" # https://github.com/Kotlin/dokka retrofit = "2.11.0" # https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit kxs-ts-gen = "0.2.4" # https://github.com/adamko-dev/kotlinx-serialization-typescript-generator -apache-commons-csv = "1.11.0" # https://commons.apache.org/proper/commons-csv/ -graphql = "7.1.4" # https://github.com/ExpediaGroup/graphql-kotlin/tree/master -bcv = "0.15.1" # https://github.com/Kotlin/binary-compatibility-validator +apache-commons-csv = "1.12.0" # https://commons.apache.org/proper/commons-csv/ +graphql = "8.1.0" # https://github.com/ExpediaGroup/graphql-kotlin/tree/master +bcv = "0.16.3" # https://github.com/Kotlin/binary-compatibility-validator [libraries] @@ -86,7 +86,7 @@ graphql-ktor-client = { version.ref = "graphql", group = "com.expediagroup", nam ksp = { version.ref = "ksp", group = "com.google.devtools.ksp", name = "symbol-processing-api" } gradleplugin-kotlin-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } -gradleplugin-shadow = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadow-plugin" } +gradleplugin-shadow = { group = "com.gradleup.shadow", name = "shadow-gradle-plugin", version.ref = "shadow-plugin" } gradleplugin-dokka = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokka"} gradleplugin-bcv = { group = "org.jetbrains.kotlinx.binary-compatibility-validator", name = "org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin", version.ref = "bcv" } gradleplugin-ksp = { group = "com.google.devtools.ksp", name = "symbol-processing-gradle-plugin", version.ref = "ksp"} diff --git a/src/backend/src/main/kotlin/org/icpclive/Application.kt b/src/backend/src/main/kotlin/org/icpclive/Application.kt index 3a5b6dcfc..6013386b8 100644 --- a/src/backend/src/main/kotlin/org/icpclive/Application.kt +++ b/src/backend/src/main/kotlin/org/icpclive/Application.kt @@ -1,5 +1,6 @@ package org.icpclive +import com.github.ajalt.clikt.core.main import io.ktor.serialization.kotlinx.json.* import org.icpclive.util.completeOrThrow import io.ktor.server.application.* diff --git a/src/backend/src/main/kotlin/org/icpclive/Config.kt b/src/backend/src/main/kotlin/org/icpclive/Config.kt index 8c4b75fc7..f741fecee 100644 --- a/src/backend/src/main/kotlin/org/icpclive/Config.kt +++ b/src/backend/src/main/kotlin/org/icpclive/Config.kt @@ -15,7 +15,8 @@ import org.icpclive.server.LoggingOptions import org.icpclive.server.ServerOptions import org.icpclive.util.FlowLogger -object Config : CliktCommand(name = "java -jar live-v3.jar", printHelpOnEmptyArgs = true) { +object Config : CliktCommand(name = "java -jar live-v3.jar") { + override val printHelpOnEmptyArgs = true val cdsSettings by CdsCommandLineOptions() private val serverSettings by ServerOptions() private val loggingSettings by LoggingOptions(logfileDefaultPrefix = "icpclive") diff --git a/src/cds-converter/src/main/kotlin/Application.kt b/src/cds-converter/src/main/kotlin/Application.kt index 91de20633..3de14a37d 100644 --- a/src/cds-converter/src/main/kotlin/Application.kt +++ b/src/cds-converter/src/main/kotlin/Application.kt @@ -6,6 +6,8 @@ import com.github.ajalt.clikt.core.* import com.github.ajalt.clikt.output.MordantHelpFormatter import com.github.ajalt.clikt.parameters.arguments.argument import com.github.ajalt.clikt.parameters.arguments.multiple +import com.github.ajalt.mordant.terminal.danger +import com.github.ajalt.mordant.terminal.info import io.ktor.http.* import io.ktor.server.application.* import io.ktor.server.response.* @@ -21,12 +23,14 @@ import org.icpclive.server.setupDefaultKtorPlugins import kotlin.system.exitProcess -object MainCommand : CliktCommand(name = "java -jar cds-converter.jar", invokeWithoutSubcommand = true, treatUnknownOptionsAsArgs = true) { +object MainCommand : CliktCommand(name = "java -jar cds-converter.jar") { init { context { helpFormatter = { MordantHelpFormatter(it, showRequiredTag = true, showDefaultValues = true)} } } + override val invokeWithoutSubcommand = true + override val treatUnknownOptionsAsArgs = true val unused by argument().multiple() override fun run() { if (currentContext.invokedSubcommand == null) { diff --git a/src/cds-converter/src/main/kotlin/DumpFileCommand.kt b/src/cds-converter/src/main/kotlin/DumpFileCommand.kt index 3de1dff58..ea85f4cba 100644 --- a/src/cds-converter/src/main/kotlin/DumpFileCommand.kt +++ b/src/cds-converter/src/main/kotlin/DumpFileCommand.kt @@ -1,6 +1,7 @@ package org.icpclive import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context import com.github.ajalt.clikt.parameters.groups.* import com.github.ajalt.clikt.parameters.options.* import com.github.ajalt.clikt.parameters.types.path @@ -18,12 +19,15 @@ import kotlin.io.path.isDirectory abstract class DumpFileCommand( name: String, - help: String, + val help: String, defaultFileName: String, outputHelp: String -) : CliktCommand(name = name, help = help, printHelpOnEmptyArgs = true) { +) : CliktCommand(name = name) { abstract fun format(info: ContestInfo, runs: List): String + override fun help(context: Context) = help + override val printHelpOnEmptyArgs = true + private val cdsOptions by CdsCommandLineOptions() private val loggingOptions by LoggingOptions(logfileDefaultPrefix = "converter") private val output by option("-o", "--output", help = outputHelp).path().convert { diff --git a/src/cds-converter/src/main/kotlin/ServerCommand.kt b/src/cds-converter/src/main/kotlin/ServerCommand.kt index 186db057c..b3df4b87a 100644 --- a/src/cds-converter/src/main/kotlin/ServerCommand.kt +++ b/src/cds-converter/src/main/kotlin/ServerCommand.kt @@ -1,12 +1,15 @@ package org.icpclive import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context import com.github.ajalt.clikt.parameters.groups.provideDelegate import org.icpclive.cds.cli.CdsCommandLineOptions import org.icpclive.server.LoggingOptions import org.icpclive.server.ServerOptions -object ServerCommand : CliktCommand(name = "server", help = "Start as http server", printHelpOnEmptyArgs = true) { +object ServerCommand : CliktCommand(name = "server") { + override val printHelpOnEmptyArgs = true + override fun help(context: Context) = "Start as http server" val cdsOptions by CdsCommandLineOptions() private val serverOptions by ServerOptions() private val loggingOptions by LoggingOptions(logfileDefaultPrefix = "converter") diff --git a/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Application.kt b/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Application.kt index 91ff41c5d..504246469 100644 --- a/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Application.kt +++ b/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Application.kt @@ -1,5 +1,6 @@ package org.icpclive.oracle +import com.github.ajalt.clikt.core.main import io.ktor.serialization.kotlinx.json.* import io.ktor.server.application.* import io.ktor.server.http.content.* diff --git a/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Config.kt b/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Config.kt index cdd3b3076..f6d8a5648 100644 --- a/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Config.kt +++ b/src/oracle-tools/src/main/kotlin/org/icpclive/oracle/Config.kt @@ -10,7 +10,8 @@ import com.github.ajalt.clikt.parameters.types.path import org.icpclive.server.LoggingOptions import org.icpclive.server.ServerOptions -object Config : CliktCommand(name = "java -jar live-v3.jar", printHelpOnEmptyArgs = false) { +object Config : CliktCommand(name = "java -jar live-v3.jar") { + override val printHelpOnEmptyArgs: Boolean = true val configDirectory by option( "-c", "--config-directory", help = "Path to config directory", diff --git a/src/reactions-bot/src/main/kotlin/org/icpclive/reacbot/Bot.kt b/src/reactions-bot/src/main/kotlin/org/icpclive/reacbot/Bot.kt index 98df50fc1..cb65dee82 100644 --- a/src/reactions-bot/src/main/kotlin/org/icpclive/reacbot/Bot.kt +++ b/src/reactions-bot/src/main/kotlin/org/icpclive/reacbot/Bot.kt @@ -1,6 +1,6 @@ package org.icpclive.reacbot -import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.* import com.github.ajalt.clikt.parameters.groups.provideDelegate import com.github.ajalt.clikt.parameters.options.default import com.github.ajalt.clikt.parameters.options.flag diff --git a/src/schema-generator/src/main/kotlin/org/icpclive/generator/schema/gen.kt b/src/schema-generator/src/main/kotlin/org/icpclive/generator/schema/gen.kt index 53834276d..914566c55 100644 --- a/src/schema-generator/src/main/kotlin/org/icpclive/generator/schema/gen.kt +++ b/src/schema-generator/src/main/kotlin/org/icpclive/generator/schema/gen.kt @@ -1,8 +1,7 @@ package org.icpclive.generator.schema -import com.github.ajalt.clikt.core.CliktCommand -import com.github.ajalt.clikt.core.subcommands +import com.github.ajalt.clikt.core.* class MainCommand : CliktCommand() {