build.gradle.kts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Instrumentation for Hibernate between 3.5 and 4.
  3. * Has the same logic as the Hibernate 4+ instrumentation, but is copied rather than sharing a codebase. This is because
  4. * the root interface for Session/StatelessSession - SharedSessionContract - isn't present before version 4. So the
  5. * instrumentation isn't able to reference it.
  6. */
  7. plugins {
  8. id("otel.javaagent-instrumentation")
  9. }
  10. muzzle {
  11. pass {
  12. group.set("org.hibernate")
  13. module.set("hibernate-core")
  14. versions.set("[3.3.0.GA,4.0.0.Final)")
  15. assertInverse.set(true)
  16. }
  17. }
  18. dependencies {
  19. library("org.hibernate:hibernate-core:3.3.0.GA")
  20. implementation(project(":instrumentation:hibernate:hibernate-common:javaagent"))
  21. testInstrumentation(project(":instrumentation:jdbc:javaagent"))
  22. // Added to ensure cross compatibility:
  23. testInstrumentation(project(":instrumentation:hibernate:hibernate-4.0:javaagent"))
  24. testInstrumentation(project(":instrumentation:hibernate:hibernate-procedure-call-4.3:javaagent"))
  25. testLibrary("org.hibernate:hibernate-core:3.3.0.SP1")
  26. testImplementation("org.hibernate:hibernate-annotations:3.4.0.GA")
  27. testImplementation("javassist:javassist:+")
  28. testImplementation("com.h2database:h2:1.4.197")
  29. testImplementation("javax.xml.bind:jaxb-api:2.2.11")
  30. testImplementation("com.sun.xml.bind:jaxb-core:2.2.11")
  31. testImplementation("com.sun.xml.bind:jaxb-impl:2.2.11")
  32. testImplementation("javax.activation:activation:1.1.1")
  33. latestDepTestLibrary("org.hibernate:hibernate-core:3.+") // see hibernate-4.0 module
  34. }
  35. if (findProperty("testLatestDeps") as Boolean) {
  36. configurations {
  37. // Needed for test, but for latestDepTest this would otherwise bundle a second incompatible version of hibernate-core.
  38. testImplementation {
  39. exclude("org.hibernate", "hibernate-annotations")
  40. }
  41. }
  42. }
  43. tasks.withType<Test>().configureEach {
  44. // TODO run tests both with and without experimental span attributes
  45. jvmArgs("-Dotel.instrumentation.hibernate.experimental-span-attributes=true")
  46. // required on jdk17
  47. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  48. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  49. }