build.gradle.kts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.apache.dubbo")
  7. module.set("dubbo")
  8. versions.set("[2.7,)")
  9. assertInverse.set(true)
  10. }
  11. }
  12. dependencies {
  13. implementation(project(":instrumentation:apache-dubbo-2.7:library-autoconfigure"))
  14. library("org.apache.dubbo:dubbo:2.7.0")
  15. }
  16. val latestDepTest = findProperty("testLatestDeps") as Boolean
  17. testing {
  18. suites {
  19. // using a test suite to ensure that project(":instrumentation:apache-dubbo-2.7:library-autoconfigure")
  20. // is not available on test runtime class path, otherwise instrumentation from library-autoconfigure
  21. // module would be used instead of the javaagent instrumentation that we want to test
  22. val testDubbo by registering(JvmTestSuite::class) {
  23. dependencies {
  24. implementation(project(":instrumentation:apache-dubbo-2.7:testing"))
  25. if (latestDepTest) {
  26. implementation("org.apache.dubbo:dubbo:+")
  27. implementation("org.apache.dubbo:dubbo-config-api:+")
  28. } else {
  29. implementation("org.apache.dubbo:dubbo:2.7.0")
  30. implementation("org.apache.dubbo:dubbo-config-api:2.7.0")
  31. }
  32. }
  33. }
  34. }
  35. }
  36. tasks.withType<Test>().configureEach {
  37. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  38. // to suppress non-fatal errors on jdk17
  39. jvmArgs("--add-opens=java.base/java.math=ALL-UNNAMED")
  40. // required on jdk17
  41. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  42. }
  43. tasks {
  44. check {
  45. dependsOn(testing.suites)
  46. }
  47. }