build.gradle.kts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. val scalaVersion = "2.11"
  5. val playVersion = "2.6.0"
  6. muzzle {
  7. pass {
  8. group.set("com.typesafe.play")
  9. module.set("play_$scalaVersion")
  10. versions.set("[$playVersion,)")
  11. assertInverse.set(true)
  12. // versions 2.3.9 and 2.3.10 depends on com.typesafe.netty:netty-http-pipelining:1.1.2
  13. // which does not exist
  14. skip("2.3.9", "2.3.10")
  15. }
  16. pass {
  17. group.set("com.typesafe.play")
  18. module.set("play_2.12")
  19. versions.set("[$playVersion,)")
  20. assertInverse.set(true)
  21. }
  22. pass {
  23. group.set("com.typesafe.play")
  24. module.set("play_2.13")
  25. versions.set("[$playVersion,)")
  26. assertInverse.set(true)
  27. }
  28. }
  29. otelJava {
  30. // Play doesn't work with Java 9+ until 2.6.12
  31. maxJavaVersionForTests.set(JavaVersion.VERSION_1_8)
  32. }
  33. dependencies {
  34. // TODO(anuraaga): Something about library configuration doesn't work well with scala compilation
  35. // here.
  36. compileOnly("com.typesafe.play:play_$scalaVersion:$playVersion")
  37. testInstrumentation(project(":instrumentation:netty:netty-4.0:javaagent"))
  38. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  39. testInstrumentation(project(":instrumentation:akka:akka-actor-2.3:javaagent"))
  40. testInstrumentation(project(":instrumentation:akka:akka-http-10.0:javaagent"))
  41. testImplementation("com.typesafe.play:play-java_$scalaVersion:$playVersion")
  42. testImplementation("com.typesafe.play:play-test_$scalaVersion:$playVersion")
  43. }
  44. testing {
  45. suites {
  46. val latestDepTest by registering(JvmTestSuite::class) {
  47. dependencies {
  48. implementation("com.typesafe.play:play-java_2.13:2.8.+")
  49. implementation("com.typesafe.play:play-test_2.13:2.8.+")
  50. implementation("com.typesafe.play:play-akka-http-server_2.13:2.8.+")
  51. }
  52. }
  53. }
  54. }
  55. tasks {
  56. if (findProperty("testLatestDeps") as Boolean) {
  57. // disable regular test running and compiling tasks when latest dep test task is run
  58. named("test") {
  59. enabled = false
  60. }
  61. named("compileTestGroovy") {
  62. enabled = false
  63. }
  64. check {
  65. dependsOn(testing.suites)
  66. }
  67. }
  68. val testStableSemconv by registering(Test::class) {
  69. jvmArgs("-Dotel.semconv-stability.opt-in=http")
  70. }
  71. check {
  72. dependsOn(testStableSemconv)
  73. }
  74. }
  75. // play-test depends on websocket-client
  76. configurations.configureEach {
  77. exclude("org.eclipse.jetty.websocket", "websocket-client")
  78. }
  79. // com.fasterxml.jackson.module:jackson-module-scala_2.13:2.15.2 is missing force using jackson 2.15.1
  80. // remove this when a new version of jackson is released
  81. configurations.configureEach {
  82. resolutionStrategy {
  83. eachDependency {
  84. if (requested.group == "com.fasterxml.jackson" && requested.name == "jackson-bom" && requested.version == "2.15.2") {
  85. useVersion("2.15.1")
  86. }
  87. }
  88. }
  89. }