Skip to content

Commit

Permalink
Upgrade dependencies (including kotlin to 1.8.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Monkopedia committed Dec 29, 2022
1 parent 97c8c56 commit 83c75c0
Show file tree
Hide file tree
Showing 22 changed files with 95 additions and 83 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Kotlin Simple RPCs

[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![Kotlin](https://img.shields.io/badge/kotlin-1.7.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Maven Central](https://img.shields.io/maven-central/v/com.monkopedia.ksrpc/ksrpc-core/0.7.0)](https://search.maven.org/artifact/com.monkopedia.ksrpc/ksrpc-core/0.7.0/pom)
[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://monkopedia.github.io/ksrpc/ksrpc/)

Expand Down
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ buildscript {
mavenLocal()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
classpath("org.jetbrains.dokka:dokka-base:1.7.20")
}
extra["kotlin_plugin_id"] = "com.monkopedia.ksrpc.plugin"
}
plugins {
kotlin("plugin.serialization") version "1.7.20" apply false
kotlin("plugin.serialization") version "1.8.0" apply false
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
id("com.github.hierynomus.license") version "0.16.1"

id("com.github.gmazzo.buildconfig") version "2.0.2" apply false
id("com.github.gmazzo.buildconfig") version "3.1.0" apply false
id("ksrpc-generate-module")
id("com.monkopedia.ksrpc.plugin") apply false
id("org.jetbrains.dokka") version "1.7.20"
Expand Down Expand Up @@ -77,6 +77,7 @@ allprojects {
}

configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
version.set("0.48.0")
android.set(true)
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ buildscript {
mavenLocal()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
}
extra["kotlin_plugin_id"] = "com.monkopedia.ksrpc.plugin"
}
plugins {
kotlin("plugin.serialization") version "1.7.20" apply false
kotlin("plugin.serialization") version "1.8.0" apply false
id("com.github.hierynomus.license") version "0.16.1"
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"

id("com.github.gmazzo.buildconfig") version "2.0.2" apply false
id("com.github.gmazzo.buildconfig") version "3.1.0" apply false
}

group = "com.monkopedia.ksrpc"
Expand Down
2 changes: 1 addition & 1 deletion compiler/local-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("gradle-plugin-api"))
implementation(gradleKotlinDsl())
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0")
api("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
}

Expand Down
12 changes: 6 additions & 6 deletions compiler/local-plugin/src/main/kotlin/GenerateKsrpcProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ fun Project.ksrpcModule(
if (name != "ksrpc-core") {
api(project(":ksrpc-core"))
}
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:atomicfu:0.17.1")
implementation("org.jetbrains.kotlinx:atomicfu:0.18.5")
}
sourceSets["commonTest"].dependencies {
implementation(kotlin("test"))
Expand All @@ -114,14 +114,14 @@ fun Project.ksrpcModule(

implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation("org.slf4j:slf4j-api:1.6.1")
implementation("org.slf4j:slf4j-api:2.0.6")
}
sourceSets["jvmTest"].dependencies {
implementation(kotlin("test-junit"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
}
}
if (supportJs) {
Expand Down
7 changes: 6 additions & 1 deletion compiler/plugin/src/main/java/FqConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*/
package com.monkopedia.ksrpc.plugin

import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name

object FqConstants {
const val PKG = "com.monkopedia.ksrpc"
const val RPC_ENDPOINT_EXCEPTION = "$PKG.RpcEndpointException"
Expand All @@ -36,7 +40,8 @@ object FqConstants {
const val INVOKE = "invoke"

const val KSERIALIZER = "kotlinx.serialization.KSerializer"
const val SERIALIZER = "kotlinx.serialization.serializer"
val SERIALIZER_CALLABLE: CallableId =
CallableId(FqName("kotlinx.serialization"), Name.identifier("serializer"))
const val TYPE_OF = "kotlin.reflect.typeOf"
const val BYTE_READ_CHANNEL = "io.ktor.utils.io.ByteReadChannel"
const val THREAD_LOCAL = "kotlin.native.concurrent.ThreadLocal"
Expand Down
2 changes: 2 additions & 0 deletions compiler/plugin/src/main/java/KsrpcCommandLineProcessor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import com.google.auto.service.AutoService
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
import org.jetbrains.kotlin.compiler.plugin.CliOption
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.CompilerConfigurationKey

@OptIn(ExperimentalCompilerApi::class)
@AutoService(CommandLineProcessor::class)
class KsrpcCommandLineProcessor : CommandLineProcessor {
companion object {
Expand Down
16 changes: 8 additions & 8 deletions compiler/plugin/src/main/java/KsrpcComponentRegistrar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.com.intellij.mock.MockProject
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension

@AutoService(ComponentRegistrar::class)
class KsrpcComponentRegistrar : ComponentRegistrar {
@OptIn(ExperimentalCompilerApi::class)
@AutoService(CompilerPluginRegistrar::class)
class KsrpcComponentRegistrar : CompilerPluginRegistrar() {
override val supportsK2: Boolean
get() = false

override fun registerProjectComponents(
project: MockProject,
configuration: CompilerConfiguration
) {
override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
val messageCollector =
configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)

SyntheticResolveExtension.registerExtension(
project,
KsrpcSyntheticResolveExtension(messageCollector)
)
IrGenerationExtension.registerExtension(
project,
KsrpcIrGenerationExtension(messageCollector)
)
}
Expand Down
7 changes: 4 additions & 3 deletions compiler/plugin/src/main/java/KsrpcGenerationEnvironment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable
import org.jetbrains.kotlin.ir.util.functions
import org.jetbrains.kotlin.ir.util.parentAsClass
import org.jetbrains.kotlin.ir.util.parentClassOrNull
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName

class KsrpcGenerationEnvironment(
Expand All @@ -75,7 +76,7 @@ class KsrpcGenerationEnvironment(
val suspendCloseable = referenceClass(FqConstants.SUSPEND_CLOSEABLE)

val kSerializer = referenceClass(FqConstants.KSERIALIZER)
val serializerMethod = pluginContext.referenceFunctions(FqName(FqConstants.SERIALIZER)).find {
val serializerMethod = pluginContext.referenceFunctions(FqConstants.SERIALIZER_CALLABLE).find {
it.owner.dispatchReceiverParameter == null &&
it.owner.extensionReceiverParameter == null &&
it.owner.typeParameters.size == 1 &&
Expand All @@ -87,7 +88,7 @@ class KsrpcGenerationEnvironment(
val byteReadChannel = FqName(FqConstants.BYTE_READ_CHANNEL)

private fun maybeReferenceClass(name: String): IrClassSymbol? {
val fqName = FqName(name)
val fqName = ClassId.fromString(name)
return pluginContext.referenceClass(fqName)
}

Expand All @@ -103,7 +104,7 @@ class KsrpcGenerationEnvironment(
}

private fun referenceObject(name: String): IrClassSymbol {
val fqName = FqName(name)
val fqName = ClassId.fromString(name)
return pluginContext.referenceClass(fqName)
?: run {
messageCollector.report(
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion ksrpc-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ksrpcModule()

kotlin {
sourceSets["commonMain"].dependencies {
api("io.ktor:ktor-io:2.0.2")
api("io.ktor:ktor-io:2.2.1")
}
sourceSets["jvmMain"].dependencies {
}
Expand Down
2 changes: 1 addition & 1 deletion ksrpc-jsonrpc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ kotlin {
sourceSets["commonMain"].dependencies {
api(project(":ksrpc-packets"))
api(project(":ksrpc-sockets"))
api("io.ktor:ktor-io:2.0.2")
api("io.ktor:ktor-io:2.2.1")
}
sourceSets["jvmMain"].dependencies {
}
Expand Down
16 changes: 8 additions & 8 deletions ksrpc-ktor/client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ ksrpcModule()

kotlin {
sourceSets["commonMain"].dependencies {
implementation("io.ktor:ktor-client-core:2.0.2")
implementation("io.ktor:ktor-http:2.0.2")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.0.2")
implementation("io.ktor:ktor-client-core:2.2.1")
implementation("io.ktor:ktor-http:2.2.1")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.2.1")
}
sourceSets["jvmMain"].dependencies {
compileOnly("io.ktor:ktor-client-core:2.0.2")
compileOnly("io.ktor:ktor-client-core:2.2.1")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
}
sourceSets["jsMain"].dependencies {
compileOnly("io.ktor:ktor-client-core:2.0.2")
compileOnly("io.ktor:ktor-client-core:2.2.1")
}
sourceSets["nativeMain"].dependencies {
implementation("io.ktor:ktor-client-curl:2.0.2")
implementation("io.ktor:ktor-client-curl:2.2.1")
}
}
2 changes: 1 addition & 1 deletion ksrpc-ktor/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ ksrpcModule(

kotlin {
sourceSets["commonMain"].dependencies {
api("io.ktor:ktor-server-core:2.0.2")
api("io.ktor:ktor-server-core:2.2.1")
}
}
2 changes: 1 addition & 1 deletion ksrpc-ktor/websocket/client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ ksrpcModule()
kotlin {
sourceSets["commonMain"].dependencies {
api(project(":ksrpc-ktor-websocket-shared"))
implementation("io.ktor:ktor-client-websockets:2.0.2")
implementation("io.ktor:ktor-client-websockets:2.2.1")
}
}
2 changes: 1 addition & 1 deletion ksrpc-ktor/websocket/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ ksrpcModule(
kotlin {
sourceSets["commonMain"].dependencies {
api(project(":ksrpc-ktor-websocket-shared"))
api("io.ktor:ktor-server-websockets:2.0.2")
api("io.ktor:ktor-server-websockets:2.2.1")
}
}
6 changes: 3 additions & 3 deletions ksrpc-ktor/websocket/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ ksrpcModule()
kotlin {
sourceSets["commonMain"].dependencies {
api(project(":ksrpc-packets"))
api("io.ktor:ktor-websockets:2.0.2")
api("io.ktor:ktor-websocket-serialization:2.0.2")
api("io.ktor:ktor-serialization-kotlinx-json:2.0.2")
api("io.ktor:ktor-websockets:2.2.1")
api("io.ktor:ktor-websocket-serialization:2.2.1")
api("io.ktor:ktor-serialization-kotlinx-json:2.2.1")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ class WebsocketPacketChannel(
override suspend fun receive(): Packet {
receiveLock.lock()
try {
return socketSession.receiveDeserializedBase(converter, Charsets.UTF_8)
return socketSession.receiveDeserializedBase<Packet>(
converter,
Charsets.UTF_8
) as Packet
} finally {
receiveLock.unlock()
}
Expand Down
46 changes: 23 additions & 23 deletions ksrpc-packets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,40 @@ ksrpcModule()

kotlin {
sourceSets["commonMain"].dependencies {
implementation("io.ktor:ktor-client-core:2.0.2")
implementation("io.ktor:ktor-client-websockets:2.0.2")
implementation("io.ktor:ktor-http:2.0.2")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.0.2")
implementation("io.ktor:ktor-client-core:2.2.1")
implementation("io.ktor:ktor-client-websockets:2.2.1")
implementation("io.ktor:ktor-http:2.2.1")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.2.1")
}
sourceSets["jvmMain"].dependencies {
compileOnly("io.ktor:ktor-server-core:2.0.2")
compileOnly("io.ktor:ktor-server-host-common:2.0.2")
compileOnly("io.ktor:ktor-server-netty:2.0.2")
compileOnly("io.ktor:ktor-websockets:2.0.2")
compileOnly("io.ktor:ktor-server-websockets:2.0.2")
compileOnly("io.ktor:ktor-client-core:2.0.2")
compileOnly("io.ktor:ktor-server-cors:2.0.2")
compileOnly("io.ktor:ktor-server-core:2.2.1")
compileOnly("io.ktor:ktor-server-host-common:2.2.1")
compileOnly("io.ktor:ktor-server-netty:2.2.1")
compileOnly("io.ktor:ktor-websockets:2.2.1")
compileOnly("io.ktor:ktor-server-websockets:2.2.1")
compileOnly("io.ktor:ktor-client-core:2.2.1")
compileOnly("io.ktor:ktor-server-cors:2.2.1")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
}
sourceSets["jvmTest"].dependencies {
implementation("io.ktor:ktor-server-core:2.0.2")
implementation("io.ktor:ktor-server-netty:2.0.2")
implementation("io.ktor:ktor-serialization-jackson:2.0.2")
implementation("io.ktor:ktor-server-core:2.2.1")
implementation("io.ktor:ktor-server-netty:2.2.1")
implementation("io.ktor:ktor-serialization-jackson:2.2.1")

implementation("io.ktor:ktor-client-core:2.0.2")
implementation("io.ktor:ktor-client-okhttp:2.0.2")
implementation("io.ktor:ktor-server-websockets:2.0.2")
implementation("io.ktor:ktor-client-websockets:2.0.2")
implementation("io.ktor:ktor-client-core:2.2.1")
implementation("io.ktor:ktor-client-okhttp:2.2.1")
implementation("io.ktor:ktor-server-websockets:2.2.1")
implementation("io.ktor:ktor-client-websockets:2.2.1")
}
sourceSets["jsTest"].dependencies {
implementation("io.ktor:ktor-client-core:2.0.2")
implementation("io.ktor:ktor-client-core:2.2.1")
}
sourceSets["jsMain"].dependencies {
compileOnly("io.ktor:ktor-client-core:2.0.2")
compileOnly("io.ktor:ktor-client-core:2.2.1")
}
sourceSets["nativeMain"].dependencies {
implementation("io.ktor:ktor-client-curl:2.0.2")
implementation("io.ktor:ktor-client-curl:2.2.1")
}
}
12 changes: 6 additions & 6 deletions ksrpc-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ kotlin {
api(project(":ksrpc-ktor-server"))
api(project(":ksrpc-ktor-websocket-server"))
api(project(":ksrpc-sockets"))
api("com.github.ajalt.clikt:clikt:3.5.0")
api("io.ktor:ktor-server-core:2.0.2")
api("io.ktor:ktor-server-cors:2.0.2")
api("io.ktor:ktor-server-host-common:2.0.2")
api("com.github.ajalt.clikt:clikt:3.5.1")
api("io.ktor:ktor-server-core:2.2.1")
api("io.ktor:ktor-server-cors:2.2.1")
api("io.ktor:ktor-server-host-common:2.2.1")
}
sourceSets["jvmMain"].dependencies {
api(project(":ksrpc-sockets"))
api("io.ktor:ktor-server-netty:2.0.2")
api("io.ktor:ktor-server-netty:2.2.1")
}
sourceSets["nativeMain"].dependencies {
api("io.ktor:ktor-server-cio:2.0.2")
api("io.ktor:ktor-server-cio:2.2.1")
}
}
Loading

0 comments on commit 83c75c0

Please sign in to comment.