Skip to content

Commit 37af5f1

Browse files
committed
Added blank KMP targets: JS, Native, WasmJS
1 parent 7e0b40b commit 37af5f1

25 files changed

+269
-39
lines changed

grpc/grpc-core/build.gradle.kts

Lines changed: 2 additions & 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
plugins {
@@ -12,6 +12,7 @@ kotlin {
1212
commonMain {
1313
dependencies {
1414
api(projects.core)
15+
api(projects.utils)
1516
api(libs.coroutines.core)
1617
}
1718
}

grpc/grpc-core/gradle.properties

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +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
kotlinx.rpc.excludeWasmWasi=true
6-
kotlinx.rpc.excludeWasmJs=true
7-
kotlinx.rpc.excludeJs=true
8-
kotlinx.rpc.excludeNative=true

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcServer.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
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.grpc
66

77
import kotlinx.coroutines.SupervisorJob
8-
import kotlinx.coroutines.job
98
import kotlinx.rpc.RpcServer
109
import kotlinx.rpc.descriptor.serviceDescriptorOf
1110
import kotlinx.rpc.grpc.annotations.Grpc
1211
import kotlinx.rpc.grpc.descriptor.GrpcServiceDescriptor
13-
import kotlinx.rpc.grpc.internal.MutableHandlerRegistry
14-
import kotlinx.rpc.grpc.internal.ServerServiceDefinition
1512
import kotlin.coroutines.CoroutineContext
1613
import kotlin.reflect.KClass
1714
import kotlin.time.Duration
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
6+
7+
package kotlinx.rpc.grpc
8+
9+
public expect abstract class HandlerRegistry
10+
11+
@Suppress("RedundantConstructorKeyword")
12+
public expect class MutableHandlerRegistry constructor() : HandlerRegistry {
13+
internal fun addService(@Suppress("unused") service: ServerServiceDefinition): ServerServiceDefinition?
14+
}

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/Server.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
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("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
66

77
package kotlinx.rpc.grpc
88

9-
import kotlinx.rpc.grpc.internal.HandlerRegistry
10-
import kotlinx.rpc.grpc.internal.ServerServiceDefinition
119
import kotlin.time.Duration
1210

1311
public expect abstract class ServerBuilder<T : ServerBuilder<T>> {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
6+
7+
package kotlinx.rpc.grpc
8+
9+
public expect class ServerServiceDefinition

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/descriptor/GrpcServiceDescriptor.kt

Lines changed: 2 additions & 2 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.grpc.descriptor
@@ -8,8 +8,8 @@ import kotlinx.coroutines.Deferred
88
import kotlinx.rpc.RpcCall
99
import kotlinx.rpc.descriptor.RpcServiceDescriptor
1010
import kotlinx.rpc.grpc.ManagedChannel
11+
import kotlinx.rpc.grpc.ServerServiceDefinition
1112
import kotlinx.rpc.grpc.annotations.Grpc
12-
import kotlinx.rpc.grpc.internal.ServerServiceDefinition
1313
import kotlinx.rpc.internal.utils.ExperimentalRpcApi
1414

1515
@ExperimentalRpcApi

grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/internal/MutableHandlerRegistry.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
6+
7+
package kotlinx.rpc.grpc
8+
9+
public actual abstract class ManagedChannelPlatform
10+
11+
public actual abstract class ManagedChannelBuilder<T : ManagedChannelBuilder<T>>
12+
13+
public actual fun ManagedChannelBuilder<*>.buildChannel(): ManagedChannel {
14+
error("JS target is not supported in gRPC")
15+
}
16+
17+
public actual fun ManagedChannelBuilder(name: String, port: Int): ManagedChannelBuilder<*> {
18+
error("JS target is not supported in gRPC")
19+
}
20+
21+
public actual fun ManagedChannelBuilder(target: String): ManagedChannelBuilder<*> {
22+
error("JS target is not supported in gRPC")
23+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
6+
7+
package kotlinx.rpc.grpc
8+
9+
import kotlinx.rpc.internal.utils.InternalRpcApi
10+
11+
@InternalRpcApi
12+
public actual abstract class HandlerRegistry
13+
14+
@InternalRpcApi
15+
public actual class MutableHandlerRegistry : HandlerRegistry() {
16+
public actual fun addService(service: ServerServiceDefinition): ServerServiceDefinition? {
17+
error("JS target is not supported in gRPC")
18+
}
19+
}

0 commit comments

Comments
 (0)