From 8a10bbbae403af7c4633db6de299d505c19a11e5 Mon Sep 17 00:00:00 2001 From: Campbell Jones Date: Sat, 8 May 2021 14:53:06 -0400 Subject: [PATCH] Update to Kotlin v1.5 --- build.gradle.kts | 33 ++++++++++++++------------------- src/main/kotlin/TwitchClient.kt | 7 +++++-- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f028c4d..cce35aa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,31 +1,30 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "1.4.32" - kotlin("plugin.serialization") version "1.4.32" + kotlin("jvm") version "1.5.0" + kotlin("plugin.serialization") version "1.5.0" id("com.github.ben-manes.versions") version "0.38.0" - id("com.github.johnrengelman.shadow") version "6.1.0" + id("com.github.johnrengelman.shadow") version "7.0.0" id("com.palantir.docker") version "0.26.0" application } group = "io.streamcord" -version = "1.0.0-RC" +version = "1.0.0-RC2" repositories { mavenCentral() } dependencies { - // HTTP Server - implementation("io.ktor", "ktor-server-cio", "1.5.3") - - // HTTP Client - implementation("io.ktor", "ktor-client-java", "1.5.3") + // HTTP Server and Client + implementation("io.ktor", "ktor-server-cio", "1.5.4") + implementation("io.ktor", "ktor-client-java", "1.5.4") + implementation(kotlin("reflect")) // for explicit v1.5 // Serialization - implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.1.0") - implementation("com.charleskorn.kaml", "kaml", "0.30.0") + implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.2.0") + implementation("com.charleskorn.kaml", "kaml", "0.31.0") // DB implementation("org.mongodb", "mongodb-driver", "3.12.8") @@ -34,8 +33,8 @@ dependencies { implementation("com.rabbitmq", "amqp-client", "5.12.0") // Logging - implementation("org.tinylog", "slf4j-tinylog", "2.3.0") - implementation("org.tinylog", "tinylog-impl", "2.3.0") + implementation("org.tinylog", "slf4j-tinylog", "2.3.1") + implementation("org.tinylog", "tinylog-impl", "2.3.1") // Tests testImplementation(kotlin("test-junit5")) @@ -44,14 +43,11 @@ dependencies { kotlin.sourceSets["main"].languageSettings.apply { useExperimentalAnnotation("kotlin.RequiresOptIn") - enableLanguageFeature("InlineClasses") } tasks { withType().configureEach { kotlinOptions.jvmTarget = "11" // require Java 11 so we can use the built-in HttpClient - kotlinOptions.useIR = true - kotlinOptions.languageVersion = "1.5" // for sealed interfaces and value classes kotlinOptions.freeCompilerArgs += "-Xallow-result-return-type" } @@ -67,11 +63,10 @@ tasks { } application { - @Suppress("DEPRECATED") // this has to be used for the time being to avoid pissing off shadowJar - mainClassName = "io.streamcord.spyglass.AppKt" + mainClass.set("io.streamcord.spyglass.AppKt") } docker { - name = "spyglass:$version" + name = "serebit/spyglass:$version" files(tasks.shadowJar.get().outputs) } diff --git a/src/main/kotlin/TwitchClient.kt b/src/main/kotlin/TwitchClient.kt index c612051..9106ccd 100644 --- a/src/main/kotlin/TwitchClient.kt +++ b/src/main/kotlin/TwitchClient.kt @@ -183,8 +183,11 @@ class TwitchClient private constructor( } } -inline class ClientSecret(val value: String) -inline class ClientID(val value: String) +@JvmInline +value class ClientSecret(val value: String) + +@JvmInline +value class ClientID(val value: String) object ResponseBody { @Serializable