Skip to content

Commit 9471b1e

Browse files
committed
Remove krotodc jar
1 parent 701a27d commit 9471b1e

File tree

4 files changed

+19
-34
lines changed

4 files changed

+19
-34
lines changed

build.gradle

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ dependencies {
2828
implementation "io.grpc:grpc-stub:$grpc_version"
2929
implementation "io.grpc:grpc-services:$grpc_version"
3030
implementation "io.grpc:grpc-kotlin-stub:$gengrpc_version"
31-
implementation "io.github.mscheong01:krotoDC-core:$krotodc_version"
3231
implementation "com.google.protobuf:protobuf-java-util:$protoc_version"
33-
implementation "io.github.oshai:kotlin-logging-jvm:$logging_version"
32+
33+
implementation "io.github.oshai:kotlin-logging:$logging_version"
3434
implementation "ch.qos.logback:logback-classic:$logback_version"
35+
implementation "org.slf4j:jul-to-slf4j:$slf4j_version"
3536

3637
compileOnly "javax.annotation:javax.annotation-api:$annotation_version"
3738

@@ -44,19 +45,6 @@ kotlin {
4445
jvmToolchain(11)
4546
}
4647

47-
//// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
48-
//sourceSets {
49-
// main {
50-
// java {
51-
// srcDirs 'src/main/java'
52-
// srcDirs 'src/main/kotlin'
53-
// srcDirs 'build/generated/source/proto/main/grpc'
54-
// srcDirs 'build/generated/source/proto/main/java'
55-
// srcDirs 'build/generated/source/proto/main/client'
56-
// }
57-
// }
58-
//}
59-
6048
compileKotlin.dependsOn ':generateProto'
6149

6250
protobuf {
@@ -72,29 +60,22 @@ protobuf {
7260
grpckt {
7361
artifact = "io.grpc:protoc-gen-grpc-kotlin:$gengrpc_version:jdk8@jar"
7462
}
75-
76-
krotoDC {
77-
artifact = "io.github.mscheong01:protoc-gen-krotoDC:$krotodc_version:jdk8@jar"
78-
}
7963
}
8064
generateProtoTasks {
8165
all().each { task ->
8266
task.plugins {
8367
grpc {} // Generate Java gRPC classes
8468
grpckt {} // Generate Kotlin gRPC using the custom plugin from library
85-
krotoDC {} // Generate Kotlin data classes
8669
}
8770
}
8871
}
8972
}
9073

91-
kotlin {
92-
jvmToolchain(17)
93-
}
94-
9574
compileKotlin {
96-
kotlinOptions.freeCompilerArgs = ["-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
97-
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi"]
75+
kotlinOptions {
76+
freeCompilerArgs = ["-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
77+
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi"]
78+
}
9879
}
9980
compileTestKotlin {
10081
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ gengrpc_version=1.4.1
1111
grpc_version=1.69.0
1212
junit_version=4.13.2
1313
kotlin_version=2.1.0
14-
krotodc_version=1.1.1
1514
logback_version=1.5.12
1615
logging_version=7.0.3
1716
mockito_version=5.14.2
1817
protoc_version=3.25.3
18+
slf4j_version=2.0.13

src/main/kotlin/org/athenian/kotlin_helloworld/withCR/HelloWorldClient.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import kotlinx.coroutines.delay
77
import kotlinx.coroutines.flow.flow
88
import kotlinx.coroutines.runBlocking
99
import org.athenian.helloworld.GreeterGrpcKt.GreeterCoroutineStub
10-
import org.athenian.helloworld.krotodc.HelloRequest
11-
import org.athenian.helloworld.krotodc.helloreply.toDataClass
12-
import org.athenian.helloworld.krotodc.hellorequest.toProto
10+
import org.athenian.helloworld.HelloRequest
1311
import org.athenian.kotlin_helloworld.msgs.Msgs.helloRequest
1412
import java.io.Closeable
1513
import java.util.concurrent.TimeUnit
@@ -63,15 +61,21 @@ class HelloWorldClient internal constructor(private val channel: ManagedChannel)
6361
flow {
6462
repeat(5) {
6563
delay(Random.nextLong(1_000).milliseconds)
66-
val request = HelloRequest(name = "$name-$it")
64+
val request =
65+
HelloRequest
66+
.newBuilder()
67+
.let { builder ->
68+
builder.name = "$name-$builder"
69+
builder.build()
70+
}
6771
println("sayHelloWithManyRequestsAndReplies() request: $request")
68-
emit(request.toProto())
72+
emit(request)
6973
}
7074
}
7175
val replies = stub.sayHelloWithManyRequestsAndReplies(requests)
7276
replies.collect {
7377
delay(Random.nextLong(1_000).milliseconds)
74-
println("sayHelloWithManyRequestsAndReplies() response: ${it.toDataClass()}")
78+
println("sayHelloWithManyRequestsAndReplies() response: $it")
7579
}
7680
}
7781

src/main/kotlin/org/athenian/kotlin_helloworld/withoutCR/GreeterImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class GreeterImpl : GreeterGrpc.GreeterImplBase() {
3838
HelloReply.newBuilder()
3939
.run {
4040
message = "Hello ${names.joinToString(", ")}"
41-
build()
41+
build()!!
4242
}
4343
onNext(msg)
4444
onCompleted()

0 commit comments

Comments
 (0)