build.gradle.kts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. plugins {
  2. id("otel.library-instrumentation")
  3. id("otel.animalsniffer-conventions")
  4. }
  5. val grpcVersion = "1.6.0"
  6. dependencies {
  7. library("io.grpc:grpc-core:$grpcVersion")
  8. testLibrary("io.grpc:grpc-netty:$grpcVersion")
  9. testLibrary("io.grpc:grpc-protobuf:$grpcVersion")
  10. testLibrary("io.grpc:grpc-services:$grpcVersion")
  11. testLibrary("io.grpc:grpc-stub:$grpcVersion")
  12. testImplementation(project(":instrumentation:grpc-1.6:testing"))
  13. }
  14. tasks {
  15. test {
  16. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  17. jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
  18. // latest dep test occasionally fails because network type is ipv6 instead of the expected ipv4
  19. // and peer address is 0:0:0:0:0:0:0:1 instead of 127.0.0.1
  20. jvmArgs("-Djava.net.preferIPv4Stack=true")
  21. }
  22. }
  23. if (!(findProperty("testLatestDeps") as Boolean)) {
  24. configurations.testRuntimeClasspath {
  25. resolutionStrategy {
  26. eachDependency {
  27. // early versions of grpc are not compatible with netty 4.1.101.Final
  28. if (requested.group == "io.netty") {
  29. useVersion("4.1.100.Final")
  30. }
  31. }
  32. }
  33. }
  34. }