Skip to content

Commit

Permalink
Merge pull request #2615 from square/bquenaudon.2023-09-06.manualgrpc
Browse files Browse the repository at this point in the history
Update grpc to v1.57.2
  • Loading branch information
oldergod committed Sep 6, 2023
2 parents 76daaf0 + 4390de3 commit 067561d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ buildscript {
classpath(libs.pluginz.kotlinSerialization)
classpath(libs.pluginz.shadow)
classpath(libs.pluginz.buildConfig)
classpath(libs.guava)
}

repositories {
Expand Down
8 changes: 5 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[versions]
android = "4.1.1.4"
assertj = "3.24.2"
checkerQual = "3.38.0"
coroutines = "1.7.3"
dokka = "1.9.0"
grpc = "1.44.1"
grpc = "1.57.2"
gson = "2.10.1"
guava = "31.1-jre"
guava = "32.0.1-jre"
javapoet = "1.13.0"
jimfs = "1.3.0"
jmh = "1.37"
Expand All @@ -17,7 +18,7 @@ ktlint = "0.48.2"
moshi = "1.15.0"
okhttp = "4.11.0"
okio = "3.5.0"
protobuf = "3.19.4"
protobuf = "3.24.2"
protobufGradlePlugin = "0.9.4"

[libraries]
Expand All @@ -29,6 +30,7 @@ androidx-compose = { module = "androidx.activity:activity-compose", version = "1
androidx-constraintLayout = { module = "androidx.constraintlayout:constraintlayout", version = "2.1.4" }
androidx-ktx = { module = "androidx.core:core-ktx", version = "1.10.1" }
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
checker-qual = { module = "org.checkerframework:checker-qual", version.ref = "checkerQual" }
contour = { module = "app.cash.contour:contour", version = "1.1.0" }
dokka-core = { module = "org.jetbrains.dokka:dokka-core", version.ref = "dokka" }
dokka-gradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
Expand Down
1 change: 0 additions & 1 deletion wire-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies {
implementation(projects.wireSwiftGenerator)
implementation(libs.okio.core)
implementation(libs.okio.fakefilesystem)
implementation(libs.guava)
implementation(libs.kotlin.serialization)
implementation(libs.kaml)
testImplementation(libs.junit)
Expand Down
3 changes: 2 additions & 1 deletion wire-grpc-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ dependencies {
implementation(libs.grpc.stub) {
exclude(group = "com.google.guava", module = "guava")
}
implementation("com.google.guava:guava:21.0")
implementation(libs.checker.qual)
implementation(libs.guava)
implementation(libs.kotlin.coroutines.core)
testImplementation(projects.wireTestUtils)
testImplementation(libs.kotlin.test.junit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@
package com.squareup.wire.kotlin.grpcserver

import com.google.common.util.concurrent.Monitor
import com.google.common.util.concurrent.Monitor.Guard
import com.squareup.wire.MessageSource
import io.grpc.stub.StreamObserver

// This is for adapting Google style grpc stubs to Wire style grpc stubs.
@Suppress("UnstableApiUsage")
@Suppress("CheckResult")
class MessageSourceAdapter<T : Any> : MessageSource<T>, StreamObserver<T> {
private var value: T? = null
private var error: Throwable? = null
private var completed = false
private val monitor = Monitor()
private val valuePresent = monitor.newGuard { value != null || error != null || completed }
private val valueAbsent = monitor.newGuard { value == null && error == null && !completed }
private val valuePresent = object : Guard(monitor) {
override fun isSatisfied(): Boolean = value != null || error != null || completed
}
private val valueAbsent = object : Guard(monitor) {
override fun isSatisfied(): Boolean = value == null && error == null && !completed
}

override fun onNext(next: T) {
monitor.enterIf(valueAbsent)
Expand Down
1 change: 0 additions & 1 deletion wire-kotlin-generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies {
implementation(projects.wireGrpcServerGenerator)
implementation(libs.okio.core)
api(libs.kotlinpoet)
implementation(libs.guava)
testImplementation(projects.wireTestUtils)
testImplementation(libs.kotlin.test.junit)
testImplementation(libs.truth)
Expand Down

0 comments on commit 067561d

Please sign in to comment.