build.gradle.kts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("io.ratpack")
  7. module.set("ratpack-core")
  8. versions.set("[1.4.0,)")
  9. }
  10. }
  11. dependencies {
  12. library("io.ratpack:ratpack-core:1.4.0")
  13. implementation(project(":instrumentation:netty:netty-4.1:javaagent"))
  14. implementation(project(":instrumentation:netty:netty-4.1:library"))
  15. testImplementation(project(":instrumentation:ratpack:ratpack-1.4:testing"))
  16. // 1.4.0 has a bug which makes tests flaky
  17. // (https://github.com/ratpack/ratpack/commit/dde536ac138a76c34df03a0642c88d64edde688e)
  18. testLibrary("io.ratpack:ratpack-test:1.4.1")
  19. if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
  20. testImplementation("com.sun.activation:jakarta.activation:1.2.2")
  21. }
  22. }
  23. // Requires old Guava. Can't use enforcedPlatform since predates BOM
  24. configurations.testRuntimeClasspath.get().resolutionStrategy.force("com.google.guava:guava:19.0")
  25. // to allow all tests to pass we need to choose a specific netty version
  26. if (!(findProperty("testLatestDeps") as Boolean)) {
  27. configurations.configureEach {
  28. if (!name.contains("muzzle")) {
  29. resolutionStrategy {
  30. eachDependency {
  31. // specifying a fixed version for all libraries with io.netty group
  32. if (requested.group == "io.netty") {
  33. useVersion("4.1.31.Final")
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. tasks {
  41. val testStableSemconv by registering(Test::class) {
  42. filter {
  43. excludeTestsMatching("RatpackRoutesTest")
  44. }
  45. jvmArgs("-Dotel.semconv-stability.opt-in=http")
  46. }
  47. withType<Test>().configureEach {
  48. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  49. }
  50. check {
  51. dependsOn(testStableSemconv)
  52. }
  53. }