Fix armeria-grpc latest dep test (#12734)

This commit is contained in:
Lauri Tulmin 2024-11-15 12:12:09 +02:00 committed by GitHub
parent 6bafd2b3d5
commit 805ce0a3cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 55 additions and 1 deletions

View File

@ -1,5 +1,8 @@
import com.google.protobuf.gradle.*
plugins {
id("otel.javaagent-instrumentation")
id("com.google.protobuf")
}
muzzle {
@ -18,6 +21,35 @@ dependencies {
testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
testInstrumentation(project(":instrumentation:grpc-1.6:javaagent"))
testImplementation(project(":instrumentation:grpc-1.6:testing"))
testLibrary("com.linecorp.armeria:armeria-junit5:1.14.0")
}
val latestDepTest = findProperty("testLatestDeps") as Boolean
protobuf {
protoc {
val protocVersion = if (latestDepTest) "4.28.2" else "3.19.2"
artifact = "com.google.protobuf:protoc:$protocVersion"
}
plugins {
id("grpc") {
val grpcVersion = if (latestDepTest) "1.43.2" else "1.68.1"
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all().configureEach {
plugins {
id("grpc")
}
}
}
}
afterEvaluate {
// Classpath when compiling protos, we add dependency management directly
// since it doesn't follow Gradle conventions of naming / properties.
dependencies {
add("compileProtoPath", platform(project(":dependencyManagement")))
add("testCompileProtoPath", platform(project(":dependencyManagement")))
}
}

View File

@ -0,0 +1,22 @@
syntax = "proto3";
package example;
service Greeter {
rpc SayHello (Request) returns (Response) {
}
rpc SayMultipleHello (Request) returns (stream Response) {
}
rpc Conversation (stream Response) returns (stream Response) {
}
}
message Request {
string name = 1;
}
message Response {
string message = 1;
}