build.gradle.kts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. id("otel.scala-conventions")
  4. id("org.unbroken-dome.test-sets")
  5. }
  6. testSets {
  7. // We need separate test sources to compile against latest Finatra.
  8. create("latestDepTest")
  9. }
  10. muzzle {
  11. // There are some weird library issues below 2.9 so can't assert inverse
  12. pass {
  13. group.set("com.twitter")
  14. module.set("finatra-http_2.11")
  15. versions.set("[2.9.0,]")
  16. excludeDependency("io.netty:netty-transport-native-epoll")
  17. }
  18. pass {
  19. group.set("com.twitter")
  20. module.set("finatra-http_2.12")
  21. versions.set("[2.9.0,]")
  22. excludeDependency("io.netty:netty-transport-native-epoll")
  23. }
  24. }
  25. dependencies {
  26. // TODO(anuraaga): Something about library configuration doesn't work well with scala compilation
  27. // here.
  28. compileOnly("com.twitter:finatra-http_2.11:2.9.0")
  29. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  30. if (!(findProperty("testLatestDeps") as Boolean)) {
  31. // Requires old version of Jackson
  32. testImplementation(enforcedPlatform("com.fasterxml.jackson:jackson-bom:2.9.10"))
  33. }
  34. testImplementation("com.twitter:finatra-http_2.11:19.12.0") {
  35. // Finatra POM references linux-aarch64 version of this which we don't need. Including it
  36. // prevents us from managing Netty version because the classifier name changed to linux-aarch_64
  37. // in recent releases. So we exclude and force the linux-x86_64 classifier instead.
  38. exclude("io.netty", "netty-transport-native-epoll")
  39. }
  40. testImplementation("io.netty:netty-transport-native-epoll:4.1.51.Final:linux-x86_64")
  41. // Required for older versions of finatra on JDKs >= 11
  42. testImplementation("com.sun.activation:javax.activation:1.2.0")
  43. add("latestDepTestImplementation", "com.twitter:finatra-http_2.13:+") {
  44. exclude("io.netty", "netty-transport-native-epoll")
  45. }
  46. }
  47. tasks {
  48. if (findProperty("testLatestDeps") as Boolean) {
  49. // Separate task
  50. named("test") {
  51. enabled = false
  52. }
  53. named("compileTestScala") {
  54. enabled = false
  55. }
  56. }
  57. }
  58. tasks.withType<Test>().configureEach {
  59. // required on jdk17
  60. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  61. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  62. }
  63. if (findProperty("testLatestDeps") as Boolean) {
  64. configurations {
  65. // finatra artifact name is different for regular and latest tests
  66. testImplementation {
  67. exclude("com.twitter", "finatra-http_2.11")
  68. }
  69. }
  70. }