build.gradle.kts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. // We have two independent covariants, so we have to test them independently.
  6. pass {
  7. group.set("org.springframework.data")
  8. module.set("spring-data-commons")
  9. versions.set("[1.8.0.RELEASE,]")
  10. extraDependency("org.springframework:spring-aop:1.2")
  11. assertInverse.set(true)
  12. }
  13. pass {
  14. group.set("org.springframework")
  15. module.set("spring-aop")
  16. versions.set("[1.2,]")
  17. extraDependency("org.springframework.data:spring-data-commons:1.8.0.RELEASE")
  18. assertInverse.set(true)
  19. }
  20. }
  21. // DQH - API changes that impact instrumentation occurred in spring-data-commons in March 2014.
  22. // For now, that limits support to spring-data-commons 1.9.0 (maybe 1.8.0).
  23. // For testing, chose a couple spring-data modules that are old enough to work with 1.9.0.
  24. dependencies {
  25. library("org.springframework.data:spring-data-commons:1.8.0.RELEASE")
  26. compileOnly("org.springframework:spring-aop:1.2")
  27. compileOnly(project(":instrumentation-annotations-support"))
  28. testInstrumentation(project(":instrumentation:jdbc:javaagent"))
  29. testImplementation(project(":instrumentation:spring:spring-data:spring-data-common:testing"))
  30. testLibrary("org.hibernate:hibernate-entitymanager:4.3.0.Final")
  31. testLibrary("org.springframework.data:spring-data-jpa:1.8.0.RELEASE")
  32. testLibrary("org.springframework:spring-test:3.0.0.RELEASE")
  33. testImplementation("org.hsqldb:hsqldb:2.0.0")
  34. // limit to spring 5; spring 6 is tested in its separate module
  35. latestDepTestLibrary("org.hibernate:hibernate-entitymanager:5.+")
  36. latestDepTestLibrary("org.springframework.data:spring-data-commons:2.+")
  37. latestDepTestLibrary("org.springframework.data:spring-data-jpa:2.+")
  38. latestDepTestLibrary("org.springframework:spring-test:5.+")
  39. }
  40. tasks {
  41. test {
  42. jvmArgs("--add-opens=java.base/java.lang.invoke=ALL-UNNAMED")
  43. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  44. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  45. jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
  46. }
  47. }