diff --git a/docs/pages/kotlinx-rpc/topics/platforms.topic b/docs/pages/kotlinx-rpc/topics/platforms.topic index 3fb9cbad2..9fb36571a 100644 --- a/docs/pages/kotlinx-rpc/topics/platforms.topic +++ b/docs/pages/kotlinx-rpc/topics/platforms.topic @@ -77,14 +77,6 @@
  • apple
  • ios
  • iosArm64
  • iosSimulatorArm64
  • iosX64
  • macos
  • macosArm64
  • macosX64
  • watchos
  • watchosArm32
  • watchosArm64
  • watchosDeviceArm64
  • watchosSimulatorArm64
  • watchosX64
  • tvos
  • tvosArm64
  • tvosSimulatorArm64
  • tvosX64
  • linux
  • linuxArm64
  • linuxX64
  • windows
  • mingwX64
  • - -protobuf-plugin -Jvm Only -- -- -- - - utils jvm diff --git a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts index 9cff62f60..d414ca450 100644 --- a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts +++ b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts @@ -9,6 +9,7 @@ import util.other.isPublicModule import util.tasks.ValidatePublishedArtifactsTask val isGradlePlugin = project.name == "gradle-plugin" +val isProtocGen = project.name == "protoc-gen" val publishingExtension = project.extensions.findByType() val globalRootDir: String by extra @@ -53,7 +54,7 @@ fun PublishingExtension.configurePublication() { // mainly for kotlinMultiplatform publication setPublicArtifactId(project) - if (!isGradlePlugin) { + if (!isGradlePlugin && !isProtocGen) { fixModuleMetadata(project) } diff --git a/gradle-conventions/src/main/kotlin/util/publication.kt b/gradle-conventions/src/main/kotlin/util/publication.kt index 09b8dc4d5..ea8cc7e02 100644 --- a/gradle-conventions/src/main/kotlin/util/publication.kt +++ b/gradle-conventions/src/main/kotlin/util/publication.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ @file:Suppress("detekt.MaxLineLength") @@ -17,16 +17,21 @@ import util.other.getSensitiveProperty import java.io.File const val KOTLINX_RPC_PREFIX = "kotlinx-rpc" +const val PROTOC_GEN = "protoc-gen" +const val PROTOC_GEN_KOTLIN_MULTIPLATFORM = "protoc-gen-kotlin-multiplatform" /** * Important to configure inside [KotlinTarget.mavenPublication] * AND in [PublishingExtension.configurePublication] in the conventions-publishing.gradle.kts file. */ -@Suppress("KDocUnresolvedReference") +@Suppress("KDocUnresolvedReference", "LoggingSimilarMessage") fun MavenPublication.setPublicArtifactId(project: Project) { val publication = this - if (!publication.artifactId.startsWith(KOTLINX_RPC_PREFIX)) { + if (publication.artifactId == PROTOC_GEN) { + publication.artifactId = PROTOC_GEN_KOTLIN_MULTIPLATFORM + project.logger.info("Altered artifactId for $name publication: $artifactId") + } else if (!publication.artifactId.startsWith(KOTLINX_RPC_PREFIX)) { publication.artifactId = "$KOTLINX_RPC_PREFIX-$artifactId" project.logger.info("Altered artifactId for $name publication: $artifactId") } @@ -101,6 +106,8 @@ private fun String.updateAvailableAtModuleField(projectName: String): String { // in "available-at" object: // from: "url": "../../krpc-client-iossimulatorarm64/0.2.0/krpc-client-iossimulatorarm64-0.2.0.module", // to: "url": "../../kotlinx-rpc-krpc-client-iossimulatorarm64/0.2.0/kotlinx-rpc-krpc-client-iossimulatorarm64-0.2.0.module", +// +// and same idea for protoc-gen private fun String.updateAvailableAtUrlField(projectName: String, version: String): String { return replace( availableAtUrl(projectName, version, "(\\w+)", "(.+)").toRegex(), diff --git a/grpc/grpc-core/api/grpc-core.api b/grpc/grpc-core/api/grpc-core.api index 52775a07c..facf41e2f 100644 --- a/grpc/grpc-core/api/grpc-core.api +++ b/grpc/grpc-core/api/grpc-core.api @@ -1,5 +1,6 @@ public final class kotlinx/rpc/grpc/GrpcClient : kotlinx/rpc/RpcClient { public final fun awaitTermination-VtjQ1oo (JLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun awaitTermination-VtjQ1oo$default (Lkotlinx/rpc/grpc/GrpcClient;JLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public fun call (Lkotlinx/rpc/RpcCall;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun callServerStreaming (Lkotlinx/rpc/RpcCall;)Lkotlinx/coroutines/flow/Flow; public final fun shutdown ()V diff --git a/grpc/grpc-core/api/grpc-core.klib.api b/grpc/grpc-core/api/grpc-core.klib.api index 730a3f7d5..fb826cf3c 100644 --- a/grpc/grpc-core/api/grpc-core.klib.api +++ b/grpc/grpc-core/api/grpc-core.klib.api @@ -116,7 +116,7 @@ final class kotlinx.rpc.grpc/GrpcClient : kotlinx.rpc/RpcClient { // kotlinx.rpc final fun shutdown() // kotlinx.rpc.grpc/GrpcClient.shutdown|shutdown(){}[0] final fun shutdownNow() // kotlinx.rpc.grpc/GrpcClient.shutdownNow|shutdownNow(){}[0] final suspend fun <#A1: kotlin/Any?> call(kotlinx.rpc/RpcCall): #A1 // kotlinx.rpc.grpc/GrpcClient.call|call(kotlinx.rpc.RpcCall){0ยง}[0] - final suspend fun awaitTermination(kotlin.time/Duration) // kotlinx.rpc.grpc/GrpcClient.awaitTermination|awaitTermination(kotlin.time.Duration){}[0] + final suspend fun awaitTermination(kotlin.time/Duration = ...) // kotlinx.rpc.grpc/GrpcClient.awaitTermination|awaitTermination(kotlin.time.Duration){}[0] } final class kotlinx.rpc.grpc/GrpcServer : kotlinx.rpc.grpc/Server, kotlinx.rpc/RpcServer { // kotlinx.rpc.grpc/GrpcServer|null[0] diff --git a/grpc/grpc-core/build.gradle.kts b/grpc/grpc-core/build.gradle.kts index bc304773d..180fbfcf9 100644 --- a/grpc/grpc-core/build.gradle.kts +++ b/grpc/grpc-core/build.gradle.kts @@ -1,3 +1,11 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import kotlinx.rpc.buf.tasks.BufGenerateTask +import kotlinx.rpc.proto.kxrpc +import org.gradle.kotlin.dsl.withType + /* * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ @@ -34,5 +42,48 @@ kotlin { implementation(libs.protobuf.kotlin) } } + + jvmTest { + dependencies { + implementation(projects.grpc.grpcCore) + implementation(libs.coroutines.core) + implementation(libs.coroutines.test) + implementation(libs.kotlin.test) + + implementation(libs.grpc.stub) + implementation(libs.grpc.netty) + implementation(libs.grpc.protobuf) + implementation(libs.grpc.kotlin.stub) + implementation(libs.protobuf.java.util) + implementation(libs.protobuf.kotlin) + } + } + } +} + + +protoSourceSets { + jvmTest { + proto { + exclude("exclude/**") + } + } +} + +rpc { + grpc { + val globalRootDir: String by extra + + protocPlugins.kxrpc { + local { + javaJar("$globalRootDir/protoc-gen/build/libs/protoc-gen-$version-all.jar") + } + } + + project.tasks.withType().configureEach { + if (name.endsWith("Test")) { + dependsOn(gradle.includedBuild("protoc-gen").task(":jar")) + } + } } } diff --git a/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcClient.kt b/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcClient.kt index 7ba5c588e..570b54fa6 100644 --- a/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcClient.kt +++ b/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcClient.kt @@ -30,7 +30,7 @@ public class GrpcClient internal constructor(private val channel: ManagedChannel channel.shutdownNow() } - public suspend fun awaitTermination(duration: Duration) { + public suspend fun awaitTermination(duration: Duration = Duration.INFINITE) { channel.awaitTermination(duration) } diff --git a/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcServer.kt b/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcServer.kt index f69865b9b..7878fefda 100644 --- a/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcServer.kt +++ b/grpc/grpc-core/src/commonMain/kotlin/kotlinx/rpc/grpc/GrpcServer.kt @@ -18,16 +18,16 @@ import kotlin.time.Duration * providing the ability to host gRPC services. * * @property port Specifies the port used by the server to listen for incoming connections. - * @param builder exposes platform-specific Server builder. + * @param configure exposes platform-specific Server builder. */ public class GrpcServer internal constructor( override val port: Int = 8080, - builder: ServerBuilder<*>.() -> Unit, + configure: ServerBuilder<*>.() -> Unit, ) : RpcServer, Server { private var isBuilt = false private lateinit var internalServer: Server - private val serverBuilder: ServerBuilder<*> = ServerBuilder(port).apply(builder) + private val serverBuilder: ServerBuilder<*> = ServerBuilder(port).apply(configure) private val registry: MutableHandlerRegistry by lazy { MutableHandlerRegistry().apply { serverBuilder.fallbackHandlerRegistry(this) } } diff --git a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/GrpcServerTest.kt b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/GrpcServerTest.kt similarity index 82% rename from protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/GrpcServerTest.kt rename to grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/GrpcServerTest.kt index 35c54554d..7204d639e 100644 --- a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/GrpcServerTest.kt +++ b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/GrpcServerTest.kt @@ -2,7 +2,7 @@ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -package kotlinx.rpc.protobuf.test +package kotlinx.rpc.grpc.core.test import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock @@ -22,14 +22,16 @@ abstract class GrpcServerTest { usePlaintext() } - val grpcServer = GrpcServer(8080) { + val grpcServer = GrpcServer(8080, builder = { registerServices() - } + }) grpcServer.start() test(grpcClient) grpcServer.shutdown() grpcServer.awaitTermination() + grpcClient.shutdown() + grpcClient.awaitTermination() } } } diff --git a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/StreamingTest.kt b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/StreamingTest.kt similarity index 72% rename from protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/StreamingTest.kt rename to grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/StreamingTest.kt index 047f74caf..f5a69160b 100644 --- a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/StreamingTest.kt +++ b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/StreamingTest.kt @@ -2,7 +2,7 @@ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -package kotlinx.rpc.protobuf.test +package kotlinx.rpc.grpc.core.test import StreamingTestService import kotlinx.coroutines.flow.Flow @@ -11,21 +11,22 @@ import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.last import kotlinx.coroutines.flow.toList import kotlinx.rpc.RpcServer +import kotlinx.rpc.grpc.test.invoke import kotlinx.rpc.registerService import kotlinx.rpc.withService import kotlin.test.Test import kotlin.test.assertEquals class StreamingTestServiceImpl : StreamingTestService { - override fun Server(message: References): Flow { + override fun Server(message: kotlinx.rpc.grpc.test.References): Flow { return flow { emit(message); emit(message); emit(message) } } - override suspend fun Client(message: Flow): References { + override suspend fun Client(message: Flow): kotlinx.rpc.grpc.test.References { return message.last() } - override fun Bidi(message: Flow): Flow { + override fun Bidi(message: Flow): Flow { return message } } @@ -38,8 +39,8 @@ class StreamingTest : GrpcServerTest() { @Test fun testServerStreaming() = runGrpcTest { grpcClient -> val service = grpcClient.withService() - service.Server(References { - other = Other { + service.Server(kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field= 42 } }).toList().run { @@ -56,8 +57,8 @@ class StreamingTest : GrpcServerTest() { val service = grpcClient.withService() val result = service.Client(flow { repeat(3) { - emit(References { - other = Other { + emit(kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field = 42 + it } }) @@ -72,8 +73,8 @@ class StreamingTest : GrpcServerTest() { val service = grpcClient.withService() service.Bidi(flow { repeat(3) { - emit(References { - other = Other { + emit(kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field = 42 + it } }) diff --git a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/TestPrimitiveService.kt b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/TestPrimitiveService.kt similarity index 84% rename from protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/TestPrimitiveService.kt rename to grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/TestPrimitiveService.kt index d3856ba96..b15b3ff20 100644 --- a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/TestPrimitiveService.kt +++ b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/TestPrimitiveService.kt @@ -2,9 +2,12 @@ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -package kotlinx.rpc.protobuf.test +package kotlinx.rpc.grpc.core.test import kotlinx.rpc.RpcServer +import kotlinx.rpc.grpc.test.AllPrimitives +import kotlinx.rpc.grpc.test.invoke +import kotlinx.rpc.grpc.test.PrimitiveService import kotlinx.rpc.registerService import kotlinx.rpc.withService import kotlin.test.Test diff --git a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/TestReferenceService.kt b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/TestReferenceService.kt similarity index 87% rename from protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/TestReferenceService.kt rename to grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/TestReferenceService.kt index 250310f92..2b6be5b8e 100644 --- a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/TestReferenceService.kt +++ b/grpc/grpc-core/src/jvmTest/kotlin/kotlinx/rpc/grpc/core/test/TestReferenceService.kt @@ -2,13 +2,21 @@ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -package kotlinx.rpc.protobuf.test +package kotlinx.rpc.grpc.core.test import ReferenceTestService import References -import invoke import Other +import invoke import kotlinx.rpc.RpcServer +import kotlinx.rpc.grpc.test.AllPrimitives +import kotlinx.rpc.grpc.test.Nested +import kotlinx.rpc.grpc.test.OneOf +import kotlinx.rpc.grpc.test.OptionalTypes +import kotlinx.rpc.grpc.test.Repeated +import kotlinx.rpc.grpc.test.TestMap +import kotlinx.rpc.grpc.test.UsingEnum +import kotlinx.rpc.grpc.test.invoke import kotlinx.rpc.registerService import kotlinx.rpc.withService import kotlin.test.Test @@ -17,9 +25,9 @@ import kotlin.test.assertEquals import kotlin.test.assertNotNull class ReferenceTestServiceImpl : ReferenceTestService { - override suspend fun Get(message: References): kotlinx.rpc.protobuf.test.References { - return kotlinx.rpc.protobuf.test.References { - other = kotlinx.rpc.protobuf.test.Other { + override suspend fun Get(message: References): kotlinx.rpc.grpc.test.References { + return kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field = message.other.arg.toInt() } @@ -60,11 +68,13 @@ class TestReferenceService : GrpcServerTest() { @Test fun testReferenceService() = runGrpcTest { grpcClient -> val service = grpcClient.withService() - val result = service.Get(References { + val arg = References { other = Other { arg = "42" } - }) + } + + val result = service.Get(arg) assertEquals("42", result.primitive) assertEquals(42, result.other.field) @@ -74,10 +84,10 @@ class TestReferenceService : GrpcServerTest() { fun testEnum() = runGrpcTest { grpcClient -> val service = grpcClient.withService() val result = service.Enum(UsingEnum { - enum = Enum.ONE + enum = kotlinx.rpc.grpc.test.Enum.ONE }) - assertEquals(Enum.ONE, result.enum) + assertEquals(kotlinx.rpc.grpc.test.Enum.ONE, result.enum) } @Test @@ -86,7 +96,7 @@ class TestReferenceService : GrpcServerTest() { val resultNotNull = service.Optional(OptionalTypes { name = "test" age = 42 - reference = kotlinx.rpc.protobuf.test.Other { + reference = kotlinx.rpc.grpc.test.Other { field = 42 } }) @@ -111,8 +121,8 @@ class TestReferenceService : GrpcServerTest() { val service = grpcClient.withService() val result = service.Repeated(Repeated { listString = listOf("test", "hello") - listReference = listOf(kotlinx.rpc.protobuf.test.References { - other = kotlinx.rpc.protobuf.test.Other { + listReference = listOf(kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field = 42 } }) @@ -212,8 +222,8 @@ class TestReferenceService : GrpcServerTest() { val service = grpcClient.withService() val result = service.Map(TestMap { primitives = mapOf("1" to 2, "2" to 1) - references = mapOf("ref" to kotlinx.rpc.protobuf.test.References { - other = kotlinx.rpc.protobuf.test.Other { + references = mapOf("ref" to kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field = 42 } }) @@ -228,7 +238,7 @@ class TestReferenceService : GrpcServerTest() { val service = grpcClient.withService() val result1 = service.OneOf(OneOf { primitives = OneOf.Primitives.StringValue("42") - references = OneOf.References.Other(kotlinx.rpc.protobuf.test.Other { + references = OneOf.References.Other(kotlinx.rpc.grpc.test.Other { field = 42 }) mixed = OneOf.Mixed.Int64(42L) @@ -242,8 +252,8 @@ class TestReferenceService : GrpcServerTest() { val result2 = service.OneOf(OneOf { primitives = OneOf.Primitives.Bool(true) - references = OneOf.References.InnerReferences(kotlinx.rpc.protobuf.test.References { - other = kotlinx.rpc.protobuf.test.Other { + references = OneOf.References.InnerReferences(kotlinx.rpc.grpc.test.References { + other = kotlinx.rpc.grpc.test.Other { field = 42 } }) diff --git a/protobuf-plugin/src/test/proto/all_primitives.proto b/grpc/grpc-core/src/jvmTest/proto/all_primitives.proto similarity index 91% rename from protobuf-plugin/src/test/proto/all_primitives.proto rename to grpc/grpc-core/src/jvmTest/proto/all_primitives.proto index 10cadf9ef..be698f9e6 100644 --- a/protobuf-plugin/src/test/proto/all_primitives.proto +++ b/grpc/grpc-core/src/jvmTest/proto/all_primitives.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; message AllPrimitives { double double = 1; diff --git a/protobuf-plugin/src/test/proto/enum.proto b/grpc/grpc-core/src/jvmTest/proto/enum.proto similarity index 84% rename from protobuf-plugin/src/test/proto/enum.proto rename to grpc/grpc-core/src/jvmTest/proto/enum.proto index 40a2711b5..83db7b7fe 100644 --- a/protobuf-plugin/src/test/proto/enum.proto +++ b/grpc/grpc-core/src/jvmTest/proto/enum.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; enum Enum { option allow_alias = true; diff --git a/protobuf-plugin/src/test/proto/exclude/empty_deprecated.proto b/grpc/grpc-core/src/jvmTest/proto/exclude/empty_deprecated.proto similarity index 68% rename from protobuf-plugin/src/test/proto/exclude/empty_deprecated.proto rename to grpc/grpc-core/src/jvmTest/proto/exclude/empty_deprecated.proto index ed69217b7..dcb1e64c9 100644 --- a/protobuf-plugin/src/test/proto/exclude/empty_deprecated.proto +++ b/grpc/grpc-core/src/jvmTest/proto/exclude/empty_deprecated.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; message EmptyDeprecated { option deprecated = true; diff --git a/protobuf-plugin/src/test/proto/exclude/enum_options.proto b/grpc/grpc-core/src/jvmTest/proto/exclude/enum_options.proto similarity index 92% rename from protobuf-plugin/src/test/proto/exclude/enum_options.proto rename to grpc/grpc-core/src/jvmTest/proto/exclude/enum_options.proto index 1e85b4fcb..12ecd3723 100644 --- a/protobuf-plugin/src/test/proto/exclude/enum_options.proto +++ b/grpc/grpc-core/src/jvmTest/proto/exclude/enum_options.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; import "google/protobuf/descriptor.proto"; //import "options.proto"; diff --git a/protobuf-plugin/src/test/proto/exclude/example.proto b/grpc/grpc-core/src/jvmTest/proto/exclude/example.proto similarity index 100% rename from protobuf-plugin/src/test/proto/exclude/example.proto rename to grpc/grpc-core/src/jvmTest/proto/exclude/example.proto diff --git a/protobuf-plugin/src/test/proto/exclude/multiple_files.proto b/grpc/grpc-core/src/jvmTest/proto/exclude/multiple_files.proto similarity index 100% rename from protobuf-plugin/src/test/proto/exclude/multiple_files.proto rename to grpc/grpc-core/src/jvmTest/proto/exclude/multiple_files.proto diff --git a/protobuf-plugin/src/test/proto/exclude/options.proto b/grpc/grpc-core/src/jvmTest/proto/exclude/options.proto similarity index 78% rename from protobuf-plugin/src/test/proto/exclude/options.proto rename to grpc/grpc-core/src/jvmTest/proto/exclude/options.proto index 9cf2d2358..df77c8d6d 100644 --- a/protobuf-plugin/src/test/proto/exclude/options.proto +++ b/grpc/grpc-core/src/jvmTest/proto/exclude/options.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; message Options { message Inner { diff --git a/protobuf-plugin/src/test/proto/exclude/with_comments.proto b/grpc/grpc-core/src/jvmTest/proto/exclude/with_comments.proto similarity index 77% rename from protobuf-plugin/src/test/proto/exclude/with_comments.proto rename to grpc/grpc-core/src/jvmTest/proto/exclude/with_comments.proto index e1a7e1323..fe43f59ee 100644 --- a/protobuf-plugin/src/test/proto/exclude/with_comments.proto +++ b/grpc/grpc-core/src/jvmTest/proto/exclude/with_comments.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; // This message has comment message WithComments { diff --git a/protobuf-plugin/src/test/proto/image-recognizer.proto b/grpc/grpc-core/src/jvmTest/proto/image-recognizer.proto similarity index 100% rename from protobuf-plugin/src/test/proto/image-recognizer.proto rename to grpc/grpc-core/src/jvmTest/proto/image-recognizer.proto diff --git a/protobuf-plugin/src/test/proto/nested.proto b/grpc/grpc-core/src/jvmTest/proto/nested.proto similarity index 95% rename from protobuf-plugin/src/test/proto/nested.proto rename to grpc/grpc-core/src/jvmTest/proto/nested.proto index cce13dff9..1c886d6e1 100644 --- a/protobuf-plugin/src/test/proto/nested.proto +++ b/grpc/grpc-core/src/jvmTest/proto/nested.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; message Nested { message Inner1 { diff --git a/protobuf-plugin/src/test/proto/one_of.proto b/grpc/grpc-core/src/jvmTest/proto/one_of.proto similarity index 92% rename from protobuf-plugin/src/test/proto/one_of.proto rename to grpc/grpc-core/src/jvmTest/proto/one_of.proto index 5c9eca5ff..b096aa9d2 100644 --- a/protobuf-plugin/src/test/proto/one_of.proto +++ b/grpc/grpc-core/src/jvmTest/proto/one_of.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; import "all_primitives.proto"; import "reference_package.proto"; diff --git a/protobuf-plugin/src/test/proto/optional.proto b/grpc/grpc-core/src/jvmTest/proto/optional.proto similarity index 82% rename from protobuf-plugin/src/test/proto/optional.proto rename to grpc/grpc-core/src/jvmTest/proto/optional.proto index d440508e4..7bed51cc5 100644 --- a/protobuf-plugin/src/test/proto/optional.proto +++ b/grpc/grpc-core/src/jvmTest/proto/optional.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; import 'reference_package.proto'; diff --git a/protobuf-plugin/src/test/proto/primitive_service.proto b/grpc/grpc-core/src/jvmTest/proto/primitive_service.proto similarity index 79% rename from protobuf-plugin/src/test/proto/primitive_service.proto rename to grpc/grpc-core/src/jvmTest/proto/primitive_service.proto index 844306c38..aac406f19 100644 --- a/protobuf-plugin/src/test/proto/primitive_service.proto +++ b/grpc/grpc-core/src/jvmTest/proto/primitive_service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; import "all_primitives.proto"; diff --git a/protobuf-plugin/src/test/proto/reference.proto b/grpc/grpc-core/src/jvmTest/proto/reference.proto similarity index 100% rename from protobuf-plugin/src/test/proto/reference.proto rename to grpc/grpc-core/src/jvmTest/proto/reference.proto diff --git a/protobuf-plugin/src/test/proto/reference_package.proto b/grpc/grpc-core/src/jvmTest/proto/reference_package.proto similarity index 78% rename from protobuf-plugin/src/test/proto/reference_package.proto rename to grpc/grpc-core/src/jvmTest/proto/reference_package.proto index 8a7905eaf..0f1f76cc8 100644 --- a/protobuf-plugin/src/test/proto/reference_package.proto +++ b/grpc/grpc-core/src/jvmTest/proto/reference_package.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; message Other { int32 field = 1; diff --git a/grpc/grpc-core/src/jvmTest/proto/reference_service.proto b/grpc/grpc-core/src/jvmTest/proto/reference_service.proto new file mode 100644 index 000000000..c3fd1a012 --- /dev/null +++ b/grpc/grpc-core/src/jvmTest/proto/reference_service.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +import "reference.proto"; +import "reference_package.proto"; +import "enum.proto"; +import "optional.proto"; +import "repeated.proto"; +import "nested.proto"; +import "test_map.proto"; +import "one_of.proto"; + +service ReferenceTestService { + rpc Get(References) returns (kotlinx.rpc.grpc.test.References); + + rpc Enum(kotlinx.rpc.grpc.test.UsingEnum) returns (kotlinx.rpc.grpc.test.UsingEnum); + + rpc Optional(kotlinx.rpc.grpc.test.OptionalTypes) returns (kotlinx.rpc.grpc.test.OptionalTypes); + + rpc Repeated(kotlinx.rpc.grpc.test.Repeated) returns (kotlinx.rpc.grpc.test.Repeated); + + rpc Nested(kotlinx.rpc.grpc.test.Nested) returns (kotlinx.rpc.grpc.test.Nested); + + rpc Map(kotlinx.rpc.grpc.test.TestMap) returns (kotlinx.rpc.grpc.test.TestMap); + + rpc OneOf(kotlinx.rpc.grpc.test.OneOf) returns (kotlinx.rpc.grpc.test.OneOf); +} diff --git a/protobuf-plugin/src/test/proto/repeated.proto b/grpc/grpc-core/src/jvmTest/proto/repeated.proto similarity index 81% rename from protobuf-plugin/src/test/proto/repeated.proto rename to grpc/grpc-core/src/jvmTest/proto/repeated.proto index 0c2e26826..4d61a1840 100644 --- a/protobuf-plugin/src/test/proto/repeated.proto +++ b/grpc/grpc-core/src/jvmTest/proto/repeated.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; import 'reference_package.proto'; diff --git a/grpc/grpc-core/src/jvmTest/proto/streaming.proto b/grpc/grpc-core/src/jvmTest/proto/streaming.proto new file mode 100644 index 000000000..042383a65 --- /dev/null +++ b/grpc/grpc-core/src/jvmTest/proto/streaming.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +import "reference_package.proto"; + +service StreamingTestService { + rpc Server(kotlinx.rpc.grpc.test.References) returns (stream kotlinx.rpc.grpc.test.References); + rpc Client(stream kotlinx.rpc.grpc.test.References) returns (kotlinx.rpc.grpc.test.References); + rpc Bidi(stream kotlinx.rpc.grpc.test.References) returns (stream kotlinx.rpc.grpc.test.References); +} diff --git a/protobuf-plugin/src/test/proto/test_map.proto b/grpc/grpc-core/src/jvmTest/proto/test_map.proto similarity index 81% rename from protobuf-plugin/src/test/proto/test_map.proto rename to grpc/grpc-core/src/jvmTest/proto/test_map.proto index 82abcb3d9..cbb3f8e61 100644 --- a/protobuf-plugin/src/test/proto/test_map.proto +++ b/grpc/grpc-core/src/jvmTest/proto/test_map.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package kotlinx.rpc.protobuf.test; +package kotlinx.rpc.grpc.test; import "reference_package.proto"; diff --git a/grpc/grpc-ktor-server/build.gradle.kts b/grpc/grpc-ktor-server/build.gradle.kts index e1e82de8c..30575b09b 100644 --- a/grpc/grpc-ktor-server/build.gradle.kts +++ b/grpc/grpc-ktor-server/build.gradle.kts @@ -46,13 +46,13 @@ rpc { protocPlugins.kxrpc { local { - javaJar("$globalRootDir/protobuf-plugin/build/libs/protobuf-plugin-$version-all.jar") + javaJar("$globalRootDir/protoc-gen/build/libs/protoc-gen-$version-all.jar") } } project.tasks.withType().configureEach { if (name.endsWith("Test")) { - dependsOn(":protobuf-plugin:jar") + dependsOn(gradle.includedBuild("protoc-gen").task(":jar")) } } } diff --git a/protobuf-plugin/build.gradle.kts b/protobuf-plugin/build.gradle.kts deleted file mode 100644 index 4ec6fcb6d..000000000 --- a/protobuf-plugin/build.gradle.kts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -import kotlinx.rpc.buf.tasks.BufGenerateTask -import kotlinx.rpc.proto.kxrpc -import org.gradle.kotlin.dsl.withType -import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode - -plugins { - alias(libs.plugins.conventions.jvm) - alias(libs.plugins.kotlinx.rpc) - alias(libs.plugins.serialization) -} - -dependencies { - implementation(libs.protobuf.java) - - implementation(libs.slf4j.api) - implementation(libs.logback.classic) - - testImplementation(projects.grpc.grpcCore) - testImplementation(libs.coroutines.core) - testImplementation(libs.coroutines.test) - testImplementation(libs.kotlin.test) - - testImplementation(libs.grpc.stub) - testImplementation(libs.grpc.netty) - testImplementation(libs.grpc.protobuf) - testImplementation(libs.grpc.kotlin.stub) - testImplementation(libs.protobuf.java.util) - testImplementation(libs.protobuf.kotlin) -} - -protoSourceSets { - test { - proto { - exclude("exclude/**") - } - } -} - -tasks.jar { - manifest { - attributes["Main-Class"] = "kotlinx.rpc.protobuf.MainKt" - } - - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - archiveClassifier = "all" - - // Protoc plugins are all fat jars basically (the ones built on jvm) - // be really careful of what you put in the classpath here - from( - configurations.runtimeClasspath.map { prop -> - prop.map { if (it.isDirectory()) it else zipTree(it) } - } - ) -} - -rpc { - grpc { - protocPlugins.kxrpc { - local { - javaJar(tasks.jar.map { it.archiveFile.get().asFile.absolutePath }) - } - } - - project.tasks.withType().configureEach { - if (name.endsWith("Test")) { - dependsOn(tasks.jar) - } - } - } -} - -kotlin { - explicitApi = ExplicitApiMode.Disabled -} - -tasks.test { - useJUnitPlatform() -} diff --git a/protobuf-plugin/src/test/proto/reference_service.proto b/protobuf-plugin/src/test/proto/reference_service.proto deleted file mode 100644 index 1f2c27ba8..000000000 --- a/protobuf-plugin/src/test/proto/reference_service.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; - -import "reference.proto"; -import "reference_package.proto"; -import "enum.proto"; -import "optional.proto"; -import "repeated.proto"; -import "nested.proto"; -import "test_map.proto"; -import "one_of.proto"; - -service ReferenceTestService { - rpc Get(References) returns (kotlinx.rpc.protobuf.test.References); - - rpc Enum(kotlinx.rpc.protobuf.test.UsingEnum) returns (kotlinx.rpc.protobuf.test.UsingEnum); - - rpc Optional(kotlinx.rpc.protobuf.test.OptionalTypes) returns (kotlinx.rpc.protobuf.test.OptionalTypes); - - rpc Repeated(kotlinx.rpc.protobuf.test.Repeated) returns (kotlinx.rpc.protobuf.test.Repeated); - - rpc Nested(kotlinx.rpc.protobuf.test.Nested) returns (kotlinx.rpc.protobuf.test.Nested); - - rpc Map(kotlinx.rpc.protobuf.test.TestMap) returns (kotlinx.rpc.protobuf.test.TestMap); - - rpc OneOf(kotlinx.rpc.protobuf.test.OneOf) returns (kotlinx.rpc.protobuf.test.OneOf); -} diff --git a/protobuf-plugin/src/test/proto/streaming.proto b/protobuf-plugin/src/test/proto/streaming.proto deleted file mode 100644 index 061f22458..000000000 --- a/protobuf-plugin/src/test/proto/streaming.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; - -import "reference_package.proto"; - -service StreamingTestService { - rpc Server(kotlinx.rpc.protobuf.test.References) returns (stream kotlinx.rpc.protobuf.test.References); - rpc Client(stream kotlinx.rpc.protobuf.test.References) returns (kotlinx.rpc.protobuf.test.References); - rpc Bidi(stream kotlinx.rpc.protobuf.test.References) returns (stream kotlinx.rpc.protobuf.test.References); -} diff --git a/protoc-gen/build.gradle.kts b/protoc-gen/build.gradle.kts new file mode 100644 index 000000000..fbef3d641 --- /dev/null +++ b/protoc-gen/build.gradle.kts @@ -0,0 +1,48 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode + +plugins { + alias(libs.plugins.conventions.jvm) +} + +group = "org.jetbrains.kotlinx" +version = rootProject.libs.versions.kotlinx.rpc.get() + +dependencies { + implementation(libs.protobuf.java) + + implementation(libs.slf4j.api) + implementation(libs.logback.classic) + + testImplementation(libs.kotlin.test) +} + +tasks.jar { + manifest { + attributes["Main-Class"] = "kotlinx.rpc.protobuf.MainKt" + } + + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + archiveClassifier = "all" + + // Protoc plugins are all fat jars basically (the ones built on jvm) + // be really careful of what you put in the classpath here + from( + configurations.runtimeClasspath.map { prop -> + prop.map { if (it.isDirectory()) it else zipTree(it) } + } + ) +} + +kotlin { + explicitApi = ExplicitApiMode.Disabled +} + +tasks.test { + useJUnitPlatform() +} + +logger.lifecycle("[Protoc Plugin] kotlinx.rpc project version: $version") diff --git a/protoc-gen/gradle.properties b/protoc-gen/gradle.properties new file mode 100644 index 000000000..9792d43e3 --- /dev/null +++ b/protoc-gen/gradle.properties @@ -0,0 +1,44 @@ +# +# Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. +# + +kotlin.code.style=official + +kotlin.native.ignoreDisabledTargets=true + +kotlin.daemon.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError +kotlin.daemon.useFallbackStrategy=false + +org.gradle.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m +org.gradle.daemon=true +org.gradle.parallel=true +org.gradle.workers.max=8 +org.gradle.caching=true +org.gradle.configuration-cache=true +#org.gradle.configureondemand=true // breaks compiler tests + +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true + +# https://youtrack.jetbrains.com/issue/KT-78504 +kotlin.js.yarn=false + +# development mode for kotlinx.rpc gradle plugin. Uses local project paths to apply the compiler plugin +kotlinx.rpc.plugin.internalDevelopment=true + +# uncomment to debug compilation process +#kotlin.compiler.execution.strategy=in-process + +# Uncomment to skip attempts to publish Develocity build scans +# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes +#kotlinx.rpc.develocity.skipBuildScans=true + +# Uncomment to skip adding git tags to Develocity build scan (might be good in docker when there is no git) +# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes +#kotlinx.rpc.develocity.skipGitTags=true + +# Uncomment to sync IDEA when working with Kotlin master builds +#kotlinx.rpc.kotlinMasterBuild=true + +# set to true when building IDE compiler plugin artifacts +kotlinx.rpc.forIdeBuild=false diff --git a/protoc-gen/settings.gradle.kts b/protoc-gen/settings.gradle.kts new file mode 100644 index 000000000..23bec0e46 --- /dev/null +++ b/protoc-gen/settings.gradle.kts @@ -0,0 +1,20 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +rootProject.name = "protoc-gen" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +pluginManagement { + includeBuild("../gradle-conventions") + includeBuild("../gradle-conventions-settings") +} + +plugins { + id("conventions-repositories") + id("conventions-version-resolution") + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" +} + +includeRootAsPublic() diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/CodeGenerator.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/CodeGenerator.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/CodeGenerator.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/CodeGenerator.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/Main.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/Main.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/Main.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/Main.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ModelToKotlinGenerator.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/ModelToKotlinGenerator.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ModelToKotlinGenerator.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/ModelToKotlinGenerator.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/ProtoToModelInterpreter.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/RpcProtobufPlugin.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/RpcProtobufPlugin.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/RpcProtobufPlugin.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/RpcProtobufPlugin.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/EnumDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/EnumDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/EnumDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/EnumDeclaration.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/FieldDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/FieldDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/FieldDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/FieldDeclaration.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/FileDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/FileDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/FileDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/FileDeclaration.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/FqName.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/FqName.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/FqName.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/FqName.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/MessageDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/MessageDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/MessageDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/MessageDeclaration.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/MethodDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/MethodDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/MethodDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/MethodDeclaration.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/Model.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/Model.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/Model.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/Model.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/NameResolver.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/NameResolver.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/NameResolver.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/NameResolver.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/OneOfDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/OneOfDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/OneOfDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/OneOfDeclaration.kt diff --git a/protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/ServiceDeclaration.kt b/protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/ServiceDeclaration.kt similarity index 100% rename from protobuf-plugin/src/main/kotlin/kotlinx/rpc/protobuf/model/ServiceDeclaration.kt rename to protoc-gen/src/main/kotlin/kotlinx/rpc/protobuf/model/ServiceDeclaration.kt diff --git a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/FqNameTest.kt b/protoc-gen/src/test/kotlin/kotlinx/rpc/protobuf/test/FqNameTest.kt similarity index 100% rename from protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/FqNameTest.kt rename to protoc-gen/src/test/kotlin/kotlinx/rpc/protobuf/test/FqNameTest.kt diff --git a/protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/NameResolverTest.kt b/protoc-gen/src/test/kotlin/kotlinx/rpc/protobuf/test/NameResolverTest.kt similarity index 100% rename from protobuf-plugin/src/test/kotlin/kotlinx/rpc/protobuf/test/NameResolverTest.kt rename to protoc-gen/src/test/kotlin/kotlinx/rpc/protobuf/test/NameResolverTest.kt diff --git a/publishLocal.sh b/publishLocal.sh index 006497b9b..de37e4adc 100755 --- a/publishLocal.sh +++ b/publishLocal.sh @@ -9,3 +9,4 @@ set -euxo pipefail ./gradlew publishAllPublicationsToBuildRepoRepository ./gradlew -p compiler-plugin publishAllPublicationsToBuildRepoRepository --no-configuration-cache ./gradlew -p gradle-plugin publishAllPublicationsToBuildRepoRepository --no-configuration-cache +./gradlew -p protoc-gen publishAllPublicationsToBuildRepoRepository --no-configuration-cache diff --git a/settings.gradle.kts b/settings.gradle.kts index 8f60e4429..2436081c9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -25,10 +25,9 @@ plugins { dependencyResolutionManagement { includeBuild("compiler-plugin") includeBuild("dokka-plugin") + includeBuild("protoc-gen") } -includePublic(":protobuf-plugin") - include(":grpc") includePublic(":grpc:grpc-core") includePublic(":grpc:grpc-ktor-server")