build.gradle.kts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("io.netty")
  7. module.set("netty")
  8. versions.set("[3.8.0.Final,4)")
  9. assertInverse.set(true)
  10. }
  11. fail {
  12. group.set("io.netty")
  13. module.set("netty-all")
  14. versions.set("[,]")
  15. excludeDependency("io.netty:netty-tcnative")
  16. }
  17. }
  18. dependencies {
  19. compileOnly("com.google.auto.value:auto-value-annotations")
  20. annotationProcessor("com.google.auto.value:auto-value")
  21. implementation(project(":instrumentation:netty:netty-common:library"))
  22. compileOnly("io.netty:netty:3.8.0.Final")
  23. testInstrumentation(project(":instrumentation:netty:netty-4.0:javaagent"))
  24. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  25. testLibrary("io.netty:netty:3.8.0.Final")
  26. testLibrary("com.ning:async-http-client:1.8.0")
  27. latestDepTestLibrary("io.netty:netty:3.+") // see netty-4.0 module
  28. latestDepTestLibrary("com.ning:async-http-client:1.9.+")
  29. }
  30. tasks {
  31. val testStableSemconv by registering(Test::class) {
  32. jvmArgs("-Dotel.semconv-stability.opt-in=http")
  33. }
  34. check {
  35. dependsOn(testStableSemconv)
  36. }
  37. }
  38. // We need to force the dependency to the earliest supported version because other libraries declare newer versions.
  39. if (!(findProperty("testLatestDeps") as Boolean)) {
  40. configurations.configureEach {
  41. if (!name.contains("muzzle")) {
  42. resolutionStrategy {
  43. eachDependency {
  44. // specifying a fixed version for all libraries with io.netty' group
  45. if (requested.group == "io.netty") {
  46. useVersion("3.8.0.Final")
  47. }
  48. }
  49. }
  50. }
  51. }
  52. }