Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Update to Kotlin v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
serebit committed May 8, 2021
1 parent 2496ec0 commit 8a10bbb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
33 changes: 14 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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"))
Expand All @@ -44,14 +43,11 @@ dependencies {

kotlin.sourceSets["main"].languageSettings.apply {
useExperimentalAnnotation("kotlin.RequiresOptIn")
enableLanguageFeature("InlineClasses")
}

tasks {
withType<KotlinCompile>().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"
}

Expand All @@ -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)
}
7 changes: 5 additions & 2 deletions src/main/kotlin/TwitchClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a10bbb

Please sign in to comment.