Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Kotlin-gRPC client CoroutineStub #2669

Merged
merged 10 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ io.grpc:
- io.netty:netty-handler-proxy
- io.netty:netty-transport
- io.netty:netty-tcnative-boringssl-static
grpc-kotlin-stub: { version: &GRPC_KOTLIN_VERSION '0.1.1' }
protoc-gen-grpc-kotlin: { version: *GRPC_KOTLIN_VERSION }

io.micrometer:
micrometer-core:
Expand Down Expand Up @@ -420,7 +422,7 @@ org.jctools:
- from: org.jctools
to: com.linecorp.armeria.internal.shaded.jctools

# If you want to change `org.jetbrains.kotlin:kotlin-allopen` version,
# If you want to change `org.jetbrains.kotlin:kotlin-allopen` version,
# you also need to change `org.jetbrains.kotlin.jvm` version in `build.gradle`.
org.jetbrains.kotlin:
kotlin-allopen: { version: &KOTLIN_VERSION '1.3.71' }
Expand Down
22 changes: 20 additions & 2 deletions examples/grpc-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ dependencies {
runtimeOnly("org.slf4j:slf4j-simple")

implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation(kotlin("reflect"))
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
implementation("io.grpc:grpc-kotlin-stub")

testImplementation("jakarta.annotation:jakarta.annotation-api")
testImplementation("net.javacrumbs.json-unit:json-unit-fluent")
Expand All @@ -44,3 +46,19 @@ tasks.withType<KotlinCompile> {
freeCompilerArgs = listOf("-Xjsr305=strict", "-java-parameters")
}
}

// TODO(ikhoon): gRPC-Kotlin compiler does not run well in Window. The generated stub files are added
// intentionally. Remove this once gRPC-Kotlin compiler supports Window as well.
ikhoon marked this conversation as resolved.
Show resolved Hide resolved
kotlin {
sourceSets["main"].apply {
kotlin.srcDir("gen-src/main/kotlinGrpc")
}
}

tasks.clean {
for (path in delete) {
if (path == project.ext["genSrcDir"]) {
delete.remove(path)
}
}
}

Large diffs are not rendered by default.

Loading