Skip to content

Commit

Permalink
Add guava to compile classpath for proto generated code. Force standa…
Browse files Browse the repository at this point in the history
…rd-jvm variant of guava. Remove netty gRPC dep from server module.

Signed-off-by: Finn Carroll <[email protected]>
  • Loading branch information
finnegancarroll committed Nov 14, 2024
1 parent 120c209 commit 5038cf3
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,32 @@ dependencies {
// reactor
api "io.projectreactor:reactor-core:${versions.reactor}"
api "org.reactivestreams:reactive-streams:${versions.reactivestreams}"

// protobuf
// protobuf java utils
api "com.google.protobuf:protobuf-java:${versions.protobuf}"
api "com.google.protobuf:protobuf-java-util:${versions.protobuf}"
api "jakarta.annotation:jakarta.annotation-api:${versions.jakarta_annotation}"

// gRPC
// gRPC generated service code
api "io.grpc:grpc-protobuf-lite:${versions.grpc}"
api "io.grpc:grpc-api:${versions.grpc}"
api "io.grpc:grpc-stub:${versions.grpc}"
api "io.grpc:grpc-protobuf:${versions.grpc}"
api "io.grpc:grpc-core:${versions.grpc}"
api "io.grpc:grpc-api:${versions.grpc}"
api "io.perfmark:perfmark-api:${versions.perfmark_api}"

// protobuf/gRPC annotations
compileOnly "javax.annotation:javax.annotation-api:${versions.javax_annotations}"
compileOnly "jakarta.annotation:jakarta.annotation-api:${versions.jakarta_annotation}"
compileOnly "com.google.code.findbugs:jsr305:${versions.jsr305}"
compileOnly "com.google.errorprone:error_prone_annotations:${versions.error_prone_annotations}"

// Guava (explicit standard-jvm variant)
api "com.google.guava:failureaccess:${versions.failureaccess}"
api("com.google.guava:guava:${versions.guava}") {
attributes {
attribute(org.gradle.api.attributes.java.TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
objects.named(org.gradle.api.attributes.java.TargetJvmEnvironment, 'standard-jvm'))
}
}

// https://mvnrepository.com/artifact/org.roaringbitmap/RoaringBitmap
implementation 'org.roaringbitmap:RoaringBitmap:1.3.0'
Expand All @@ -145,6 +160,15 @@ dependencies {
}
}

// Ensure Guava is available at compile time for protobuf-generated sources
configurations {
compileOnlyWithGuava {
extendsFrom compileOnly
canBeResolved = true
}
}
sourceSets.main.compileClasspath += configurations.compileOnlyWithGuava

tasks.withType(JavaCompile).configureEach {
options.compilerArgs -= '-Xlint:cast'
options.compilerArgs -= '-Xlint:rawtypes'
Expand Down

0 comments on commit 5038cf3

Please sign in to comment.