Skip to content

Commit 027cdf9

Browse files
Mr3zeerenovate[bot]
andcommitted
Samples 0.5.0 (#255)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent ff2d46e commit 027cdf9

File tree

31 files changed

+113
-106
lines changed

31 files changed

+113
-106
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"gradle.autoImportOnSave": false
3+
}

samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import androidx.compose.animation.AnimatedVisibility
@@ -14,7 +14,7 @@ import androidx.compose.ui.Alignment
1414
import androidx.compose.ui.Modifier
1515
import io.ktor.client.*
1616
import io.ktor.http.*
17-
import kotlinx.rpc.krpc.ktor.client.installRPC
17+
import kotlinx.rpc.krpc.ktor.client.installKrpc
1818
import kotlinx.rpc.krpc.ktor.client.rpc
1919
import kotlinx.rpc.krpc.ktor.client.rpcConfig
2020
import kotlinx.rpc.krpc.serialization.json.json
@@ -28,7 +28,7 @@ expect val DEV_SERVER_HOST: String
2828

2929
val client by lazy {
3030
HttpClient {
31-
installRPC()
31+
installKrpc()
3232
}
3333
}
3434

samples/ktor-all-platforms-app/gradle/libs.versions.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versions]
2-
kotlin = "2.0.21"
2+
kotlin = "2.1.0"
33

4-
agp = "8.7.2"
4+
agp = "8.8.0-alpha05"
55
android-compileSdk = "35"
66
android-minSdk = "24"
77
android-targetSdk = "35"
@@ -12,14 +12,14 @@ androidx-core-ktx = "1.15.0"
1212
androidx-espresso-core = "3.6.1"
1313
androidx-material = "1.12.0"
1414
androidx-test-junit = "1.2.1"
15-
compose = "1.7.5"
16-
compose-plugin = "1.7.0"
15+
compose = "1.7.6"
16+
compose-plugin = "1.8.0-alpha01"
1717
junit = "4.13.2"
18-
ktor = "3.0.1"
19-
logback = "1.5.12"
20-
serialization = "1.7.3"
21-
coroutines = "1.9.0"
22-
kotlinx-rpc = "0.4.0"
18+
ktor = "3.0.3"
19+
logback = "1.5.16"
20+
serialization = "1.8.0"
21+
coroutines = "1.10.1"
22+
kotlinx-rpc = "0.5.0"
2323

2424
[libraries]
2525
# kotlin

samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

samples/ktor-all-platforms-app/gradlew

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum

samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.sample
@@ -10,15 +10,15 @@ import io.ktor.server.application.*
1010
import io.ktor.server.netty.*
1111
import io.ktor.server.plugins.cors.routing.*
1212
import io.ktor.server.routing.*
13-
import kotlinx.rpc.krpc.ktor.server.RPC
13+
import kotlinx.rpc.krpc.ktor.server.Krpc
1414
import kotlinx.rpc.krpc.ktor.server.rpc
1515
import kotlinx.rpc.krpc.serialization.json.json
1616

1717
fun main(args: Array<String>): Unit = EngineMain.main(args)
1818

1919
@Suppress("unused")
2020
fun Application.module() {
21-
install(RPC)
21+
install(Krpc)
2222

2323
installCORS()
2424

samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.sample
@@ -8,7 +8,7 @@ import UserData
88
import UserService
99
import io.ktor.server.testing.*
1010
import kotlinx.coroutines.flow.toList
11-
import kotlinx.rpc.krpc.ktor.client.installRPC
11+
import kotlinx.rpc.krpc.ktor.client.installKrpc
1212
import kotlinx.rpc.krpc.ktor.client.rpc
1313
import kotlinx.rpc.krpc.ktor.client.rpcConfig
1414
import kotlinx.rpc.krpc.serialization.json.json
@@ -21,7 +21,7 @@ class ApplicationTest {
2121
@Test
2222
fun testRoot() = testApplication {
2323
val service = createClient {
24-
installRPC()
24+
installKrpc()
2525
}.rpc("/api") {
2626
rpcConfig {
2727
serialization {

samples/ktor-all-platforms-app/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
@file:Suppress("UnstableApiUsage")

samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/data/Client.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.sample.data
66

77
import io.ktor.client.HttpClient
88
import io.ktor.client.engine.okhttp.OkHttp
99
import io.ktor.client.request.url
10-
import kotlinx.rpc.RPCClient
11-
import kotlinx.rpc.krpc.ktor.client.installRPC
10+
import kotlinx.rpc.RpcClient
11+
import kotlinx.rpc.krpc.ktor.client.installKrpc
1212
import kotlinx.rpc.krpc.ktor.client.rpc
1313
import kotlinx.rpc.krpc.ktor.client.rpcConfig
1414
import kotlinx.rpc.krpc.serialization.json.json
1515

16-
suspend fun createRpcClient(): RPCClient {
16+
suspend fun createRpcClient(): RpcClient {
1717
return HttpClient(OkHttp) {
18-
installRPC()
18+
installKrpc()
1919
}.rpc {
2020
url("ws://10.0.2.2:8080/api")
2121

samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.sample.ui
@@ -14,14 +14,14 @@ import kotlinx.coroutines.delay
1414
import kotlinx.coroutines.flow.MutableStateFlow
1515
import kotlinx.coroutines.flow.StateFlow
1616
import kotlinx.coroutines.launch
17-
import kotlinx.rpc.RPCClient
17+
import kotlinx.rpc.RpcClient
1818
import kotlinx.rpc.krpc.streamScoped
1919
import kotlinx.rpc.withService
2020
import kotlinx.rpc.sample.MyService
2121
import kotlinx.rpc.sample.UserData
2222

2323
class AppViewModel : ViewModel() {
24-
private var rpcClient: RPCClient? = null
24+
private var rpcClient: RpcClient? = null
2525
private var apiService: MyService? = null
2626

2727
private val _uiState = MutableStateFlow<WelcomeData?>(null)
@@ -64,4 +64,4 @@ class AppViewModel : ViewModel() {
6464
}
6565
}
6666
}
67-
}
67+
}

0 commit comments

Comments
 (0)