summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-08-20 16:05:20 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-08-31 15:47:51 +0200
commitdf83c7cb14ee46d73743c1fd053d47a9b0e79e2a (patch)
tree84d73d348f05892248f7d531c49fb1a0f276dba1
parentUpgrade ktlint and re-enable import order check (diff)
downloadseven-wonders-df83c7cb14ee46d73743c1fd053d47a9b0e79e2a.tar.gz
seven-wonders-df83c7cb14ee46d73743c1fd053d47a9b0e79e2a.tar.bz2
seven-wonders-df83c7cb14ee46d73743c1fd053d47a9b0e79e2a.zip
Upgrade to Kotlin 1.4 and corresponding library versions
- Kotlinx Serialization 1.0.0-RC - Coroutines 1.3.9 - Krossbow 0.30.1
-rw-r--r--build.gradle.kts7
-rw-r--r--sw-client/build.gradle.kts14
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt6
-rw-r--r--sw-common-model/build.gradle.kts17
-rw-r--r--sw-engine/build.gradle.kts1
-rw-r--r--sw-server/build.gradle.kts3
-rw-r--r--sw-ui/build.gradle.kts3
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt4
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Store.kt2
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt2
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/router/Router.kt2
11 files changed, 22 insertions, 39 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index d7972105..a28ff9d5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,7 +1,7 @@
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
- val kotlinVersion = "1.3.72"
+ val kotlinVersion = "1.4.0"
kotlin("js") version kotlinVersion apply false
kotlin("jvm") version kotlinVersion apply false
kotlin("multiplatform") version kotlinVersion apply false
@@ -20,6 +20,7 @@ subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
+ version.set("0.38.0-alpha01")
disabledRules.set(setOf("no-wildcard-imports"))
}
@@ -33,6 +34,10 @@ subprojects {
kotlinOptions.freeCompilerArgs = compilerArgs
}
+ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon> {
+ kotlinOptions.freeCompilerArgs = compilerArgs
+ }
+
tasks.withType<AbstractTestTask> {
testLogging {
events(TestLogEvent.FAILED, TestLogEvent.STANDARD_ERROR)
diff --git a/sw-client/build.gradle.kts b/sw-client/build.gradle.kts
index 8412c25d..8e565745 100644
--- a/sw-client/build.gradle.kts
+++ b/sw-client/build.gradle.kts
@@ -2,7 +2,7 @@ plugins {
kotlin("multiplatform")
}
-val krossbowVersion = "0.21.1"
+val krossbowVersion = "0.30.1"
kotlin {
jvm()
@@ -13,8 +13,8 @@ kotlin {
val commonMain by getting {
dependencies {
api(project(":sw-common-model"))
- implementation(kotlin("stdlib-common"))
- api("org.hildan.krossbow:krossbow-stomp-kxserialization-metadata:$krossbowVersion")
+ api("org.hildan.krossbow:krossbow-stomp-kxserialization:$krossbowVersion")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
}
}
val commonTest by getting {
@@ -23,12 +23,6 @@ kotlin {
implementation(kotlin("test-annotations-common"))
}
}
- val jvmMain by getting {
- dependencies {
- implementation(kotlin("stdlib-jdk8"))
- api("org.hildan.krossbow:krossbow-stomp-kxserialization-jvm:$krossbowVersion")
- }
- }
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
@@ -37,8 +31,6 @@ kotlin {
}
val jsMain by getting {
dependencies {
- implementation(kotlin("stdlib-js"))
- api("org.hildan.krossbow:krossbow-stomp-kxserialization-js:$krossbowVersion")
implementation(npm("text-encoding", "0.7.0")) // required by krossbow, because required by kotlinx-io
}
}
diff --git a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
index f438e236..86831b13 100644
--- a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
+++ b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt
@@ -4,8 +4,9 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
import kotlinx.serialization.DeserializationStrategy
+import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerializationStrategy
-import kotlinx.serialization.builtins.list
+import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.builtins.serializer
import org.hildan.krossbow.stomp.StompClient
import org.hildan.krossbow.stomp.config.HeartBeat
@@ -33,6 +34,7 @@ class SevenWondersClient {
heartBeatTolerance = HeartBeatTolerance(0, 10000) // wide margin to account for heroku cold start
}
+ @OptIn(ExperimentalSerializationApi::class)
suspend fun connect(serverUrl: String): SevenWondersSession {
val session = stompClient.connect("$serverUrl$SEVEN_WONDERS_WS_ENDPOINT").withJsonConversions()
return SevenWondersSession(session)
@@ -71,7 +73,7 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat
)
fun watchGames(): Flow<List<LobbyDTO>> =
- stompSession.subscribe("/topic/games", LobbyDTO.serializer().list)
+ stompSession.subscribe("/topic/games", ListSerializer(LobbyDTO.serializer()))
suspend fun createGame(gameName: String): LobbyDTO = stompSession.request(
sendDestination = "/app/lobby/create",
diff --git a/sw-common-model/build.gradle.kts b/sw-common-model/build.gradle.kts
index 14cae06e..a7146bc0 100644
--- a/sw-common-model/build.gradle.kts
+++ b/sw-common-model/build.gradle.kts
@@ -3,7 +3,7 @@ plugins {
kotlin("plugin.serialization")
}
-val kotlinSerialization = "0.20.0"
+val kotlinSerialization = "1.0.0-RC"
kotlin {
jvm()
@@ -13,8 +13,7 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
- implementation(kotlin("stdlib-common"))
- api("org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlinSerialization")
+ api("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinSerialization")
}
}
val commonTest by getting {
@@ -23,24 +22,12 @@ kotlin {
implementation(kotlin("test-annotations-common"))
}
}
- val jvmMain by getting {
- dependencies {
- implementation(kotlin("stdlib-jdk8"))
- api("org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlinSerialization")
- }
- }
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
}
}
- val jsMain by getting {
- dependencies {
- implementation(kotlin("stdlib-js"))
- api("org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$kotlinSerialization")
- }
- }
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
diff --git a/sw-engine/build.gradle.kts b/sw-engine/build.gradle.kts
index ee3421f1..e39d7fd2 100644
--- a/sw-engine/build.gradle.kts
+++ b/sw-engine/build.gradle.kts
@@ -4,7 +4,6 @@ plugins {
dependencies {
implementation(project(":sw-common-model"))
- implementation(kotlin("stdlib-jdk8"))
implementation("com.github.salomonbrys.kotson:kotson:2.5.0")
testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit"))
diff --git a/sw-server/build.gradle.kts b/sw-server/build.gradle.kts
index 9ae670b6..fdcb4935 100644
--- a/sw-server/build.gradle.kts
+++ b/sw-server/build.gradle.kts
@@ -10,9 +10,8 @@ dependencies {
implementation(project(":sw-common-model"))
implementation(project(":sw-engine"))
implementation(project(":sw-bot"))
- implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect")) // required by Spring 5
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
implementation("org.springframework.boot:spring-boot-starter-websocket")
implementation("org.springframework.boot:spring-boot-starter-security")
diff --git a/sw-ui/build.gradle.kts b/sw-ui/build.gradle.kts
index 0753b629..7be87642 100644
--- a/sw-ui/build.gradle.kts
+++ b/sw-ui/build.gradle.kts
@@ -9,7 +9,7 @@ repositories {
maven(url = "https://kotlin.bintray.com/kotlin-js-wrappers")
}
-val kotlinWrappersVersion = "pre.105-kotlin-1.3.72"
+val kotlinWrappersVersion = "pre.112-kotlin-1.4.0"
kotlin {
target {
@@ -19,7 +19,6 @@ kotlin {
sourceSets {
main {
dependencies {
- implementation(kotlin("stdlib-js"))
implementation(project(":sw-client"))
val reactVersion = "16.13.1"
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
index 8b38e010..83e5b593 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
@@ -1,5 +1,7 @@
package org.luxons.sevenwonders.ui
+import kotlinx.browser.document
+import kotlinx.browser.window
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.luxons.sevenwonders.ui.components.application
@@ -13,8 +15,6 @@ import react.redux.provider
import redux.RAction
import redux.Store
import redux.WrapperAction
-import kotlin.browser.document
-import kotlin.browser.window
fun main() {
window.onload = {
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Store.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Store.kt
index 6f50a627..9011f389 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Store.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Store.kt
@@ -1,5 +1,6 @@
package org.luxons.sevenwonders.ui.redux
+import kotlinx.browser.window
import org.luxons.sevenwonders.ui.redux.sagas.SagaManager
import redux.RAction
import redux.Store
@@ -8,7 +9,6 @@ import redux.applyMiddleware
import redux.compose
import redux.createStore
import redux.rEnhancer
-import kotlin.browser.window
val INITIAL_STATE = SwState()
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
index 7b56594c..3f25e826 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
@@ -1,5 +1,6 @@
package org.luxons.sevenwonders.ui.redux.sagas
+import kotlinx.browser.window
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.coroutineScope
@@ -15,7 +16,6 @@ import org.luxons.sevenwonders.ui.router.routerSaga
import redux.RAction
import redux.WrapperAction
import webpack.isProdEnv
-import kotlin.browser.window
typealias SwSagaContext = SagaContext<SwState, RAction, WrapperAction>
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/router/Router.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/router/Router.kt
index 82218ee1..3a22b1ed 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/router/Router.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/router/Router.kt
@@ -1,11 +1,11 @@
package org.luxons.sevenwonders.ui.router
+import kotlinx.browser.window
import kotlinx.coroutines.Job
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import org.luxons.sevenwonders.ui.redux.sagas.SwSagaContext
import redux.RAction
-import kotlin.browser.window
enum class Route(val path: String) {
HOME("/"),
bgstack15