mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
chore(sidecar): wire grpc + protobuf-gradle-plugin + maestro
Generates Java stubs from proto/driverpb/driver.proto via the protobuf plugin (sourceSets points at the shared root proto dir). Pulls in dev.mobile:maestro-client:1.40.0, grpc-netty-shaded, slf4j-simple, and the JUnit vintage engine so the gRPC test rules work alongside JUnit Jupiter.
This commit is contained in:
1 parent
d856c40d7c
commit
d9800b648f
1 file changed
+50
@@ -1,7 +1,10 @@
|
|||||||
|
import com.google.protobuf.gradle.id
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.1.21"
|
kotlin("jvm") version "2.1.21"
|
||||||
application
|
application
|
||||||
id("com.gradleup.shadow") version "9.0.0-rc2"
|
id("com.gradleup.shadow") version "9.0.0-rc2"
|
||||||
|
id("com.google.protobuf") version "0.9.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
@@ -14,15 +17,62 @@ kotlin {
|
|||||||
jvmToolchain(17)
|
jvmToolchain(17)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val grpcVersion = "1.68.0"
|
||||||
|
val protobufVersion = "3.25.5"
|
||||||
|
val maestroVersion = "1.40.0"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation("dev.mobile:maestro-client:$maestroVersion")
|
||||||
|
|
||||||
|
implementation("io.grpc:grpc-netty-shaded:$grpcVersion")
|
||||||
|
implementation("io.grpc:grpc-protobuf:$grpcVersion")
|
||||||
|
implementation("io.grpc:grpc-stub:$grpcVersion")
|
||||||
|
implementation("com.google.protobuf:protobuf-java:$protobufVersion")
|
||||||
|
implementation("javax.annotation:javax.annotation-api:1.3.2")
|
||||||
|
|
||||||
|
implementation("org.slf4j:slf4j-simple:2.0.16")
|
||||||
|
|
||||||
testImplementation(kotlin("test"))
|
testImplementation(kotlin("test"))
|
||||||
|
testImplementation("io.grpc:grpc-testing:$grpcVersion")
|
||||||
|
testImplementation("io.grpc:grpc-inprocess:$grpcVersion")
|
||||||
|
testImplementation("junit:junit:4.13.2")
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.11.3")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.11.3")
|
||||||
|
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.11.3")
|
||||||
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.11.3")
|
||||||
|
}
|
||||||
|
|
||||||
|
protobuf {
|
||||||
|
protoc {
|
||||||
|
artifact = "com.google.protobuf:protoc:$protobufVersion"
|
||||||
|
}
|
||||||
|
plugins {
|
||||||
|
id("grpc") {
|
||||||
|
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
generateProtoTasks {
|
||||||
|
all().forEach { task ->
|
||||||
|
task.plugins {
|
||||||
|
id("grpc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
proto {
|
||||||
|
srcDir(rootProject.file("proto"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass.set("dev.uatu.sidecar.MainKt")
|
mainClass.set("dev.uatu.sidecar.MainKt")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JUnit 4 (vintage) for the gRPC GrpcCleanupRule + JUnit 5 (jupiter)
|
||||||
|
// for the rest. UseJUnitPlatform with the vintage engine handles both.
|
||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user