Skip to content

Commit c425739

Browse files
committed
Update after rebase
1 parent 93af51f commit c425739

File tree

9 files changed

+22
-14
lines changed

9 files changed

+22
-14
lines changed

.idea/kotlinx-rpc.iml

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradle-conventions/src/main/kotlin/util/cinterop.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import kotlin.io.resolve
2323
// works with the cinterop-c Bazel project
2424
fun KotlinMultiplatformExtension.configureCLibCInterop(
2525
project: Project,
26-
bazelBuildArg: String,
26+
bazelTask: String,
2727
configureCinterop: NamedDomainObjectContainer<DefaultCInteropSettings>.(cinteropCLib: File) -> Unit,
2828
) {
2929
val globalRootDir: String by project.extra
@@ -46,7 +46,7 @@ fun KotlinMultiplatformExtension.configureCLibCInterop(
4646
val buildCinteropCLib = project.tasks.register<Exec>("buildCinteropCLib") {
4747
group = "build"
4848
workingDir = cinteropCLib
49-
commandLine("bash", "-c", "bazel build $bazelBuildArg --config=release")
49+
commandLine("bash", "-c", "bazel build $bazelTask --config=release")
5050
inputs.files(project.fileTree(cinteropCLib) { exclude("bazel-*/**") })
5151
outputs.dir(cinteropCLib.resolve("bazel-bin"))
5252

gradle-plugin/src/main/kotlin/kotlinx/rpc/protoc/DefaultProtocExtension.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import org.gradle.kotlin.dsl.withType
2727
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
2828
import org.jetbrains.kotlin.gradle.dsl.KotlinBaseExtension
2929
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
30-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
30+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
3131
import javax.inject.Inject
3232

3333
internal open class DefaultProtocExtension @Inject constructor(
@@ -176,7 +176,7 @@ internal open class DefaultProtocExtension @Inject constructor(
176176

177177
protoSourceSet.generateTask.set(bufGenerateTask)
178178

179-
tasks.withType<KotlinCompile>().configureEach {
179+
project.tasks.withType<KotlinCompilationTask<*>>().all {
180180
// compileKotlin - main
181181
// compileTestKotlin - test
182182
// compileKotlinJvm - jvmMain
@@ -191,7 +191,7 @@ internal open class DefaultProtocExtension @Inject constructor(
191191
}
192192
}
193193

194-
tasks.withType<JavaCompile>().configureEach {
194+
project.tasks.withType<JavaCompile>().all {
195195
// compileJvmTestJava - test (java, kmp)
196196
// compileJvmMainJava - main (java, kmp)
197197
// compileJava - main (java)

grpc/grpc-core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ kotlin {
6767
val libgrpcpp_c by creating {
6868
includeDirs(
6969
cinteropCLib.resolve("include"),
70-
cinteropCLib.resolve("bazel-grpcpp-c/external/grpc+/include"),
70+
cinteropCLib.resolve("bazel-cinterop-c/external/grpc+/include"),
7171
)
7272
extraOpts(
7373
"-libraryPath", "${cinteropCLib.resolve("bazel-out/darwin_arm64-opt/bin")}",

protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/ProtobufException.kt

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

5-
package kotlinx.rpc.grpc.pb
5+
package kotlinx.rpc.protobuf.internal
66

77
public sealed class ProtobufException : RuntimeException {
88
protected constructor(message: String, cause: Throwable? = null) : super(message, cause)
@@ -37,4 +37,4 @@ public class ProtobufDecodingException : ProtobufException {
3737

3838
public class ProtobufEncodingException : ProtobufException {
3939
public constructor(message: String, cause: Throwable? = null) : super(message, cause)
40-
}
40+
}

protobuf/protobuf-core/src/commonMain/kotlin/kotlinx/rpc/protobuf/internal/readPacked.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
package kotlinx.rpc.protobuf.internal
66

7-
import kotlinx.rpc.grpc.pb.ProtobufDecodingException
8-
97
internal expect fun WireDecoder.pushLimit(byteLen: Int): Int
108
internal expect fun WireDecoder.popLimit(limit: Int)
119
internal expect fun WireDecoder.bytesUntilLimit(): Int

protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/ProtosTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import kotlinx.rpc.grpc.test.*
1818
import kotlinx.rpc.grpc.test.common.*
1919
import kotlinx.rpc.grpc.test.common.invoke
2020
import kotlinx.rpc.grpc.test.invoke
21+
import kotlinx.rpc.protobuf.internal.ProtobufDecodingException
2122
import kotlinx.rpc.protobuf.internal.WireEncoder
2223
import test.nested.*
2324
import test.nested.invoke

protobuf/protobuf-core/src/commonTest/kotlin/kotlinx/rpc/protobuf/test/WireCodecTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
package kotlinx.rpc.protobuf.test
66

77
import kotlinx.io.Buffer
8+
import kotlinx.rpc.protobuf.internal.ProtobufDecodingException
89
import kotlinx.rpc.protobuf.internal.WireDecoder
910
import kotlinx.rpc.protobuf.internal.WireEncoder
1011
import kotlinx.rpc.protobuf.internal.WireSize
1112
import kotlinx.rpc.protobuf.internal.WireType
13+
import kotlinx.rpc.protobuf.internal.checkForPlatformDecodeException
1214
import kotlinx.rpc.protobuf.internal.packedEnum
1315
import kotlinx.rpc.protobuf.internal.packedInt32
1416
import kotlinx.rpc.protobuf.internal.packedInt64

protoc-gen/protobuf/src/main/kotlin/kotlinx/rpc/protoc/gen/ModelToProtobufKotlinCommonGenerator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class ModelToProtobufKotlinCommonGenerator(
182182
function("encode", modifiers = "override", args = "value: $msgFqName", returnType = sourceFqName) {
183183
code("val buffer = $bufferFqName()")
184184
code("val encoder = $PB_PKG.WireEncoder(buffer)")
185-
scope("${kotlinx.rpc.protobuf.PB_PKG}.checkForPlatformEncodeException", nlAfterClosed = false) {
185+
scope("${PB_PKG}.checkForPlatformEncodeException", nlAfterClosed = false) {
186186
code("value.asInternal().encodeWith(encoder)")
187187
}
188188
code("encoder.flush()")
@@ -192,7 +192,7 @@ class ModelToProtobufKotlinCommonGenerator(
192192
function("decode", modifiers = "override", args = "stream: $sourceFqName", returnType = msgFqName) {
193193
scope("$PB_PKG.WireDecoder(stream as $bufferFqName).use") {
194194
code("val msg = ${declaration.internalClassFullName()}()")
195-
scope("${kotlinx.rpc.protobuf.PB_PKG}.checkForPlatformDecodeException", nlAfterClosed = false) {
195+
scope("${PB_PKG}.checkForPlatformDecodeException", nlAfterClosed = false) {
196196
code("${declaration.internalClassFullName()}.decodeWith(msg, it)")
197197
}
198198
code("msg.checkRequiredFields()")
@@ -525,7 +525,7 @@ class ModelToProtobufKotlinCommonGenerator(
525525

526526
requiredFields.forEach { field ->
527527
ifBranch(condition = "!presenceMask[${field.presenceIdx}]", ifBlock = {
528-
code("throw ${kotlinx.rpc.protobuf.PB_PKG}.ProtobufDecodingException.missingRequiredField(\"${declaration.name.simpleName}\", \"${field.name}\")")
528+
code("throw ${PB_PKG}.ProtobufDecodingException.missingRequiredField(\"${declaration.name.simpleName}\", \"${field.name}\")")
529529
})
530530
}
531531

0 commit comments

Comments
 (0)