build.gradle.kts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. plugins {
  2. id("otel.library-instrumentation")
  3. id("org.graalvm.buildtools.native")
  4. }
  5. dependencies {
  6. compileOnly(project(":muzzle"))
  7. implementation("io.opentelemetry:opentelemetry-api-logs")
  8. // pin the version strictly to avoid overriding by dependencyManagement versions
  9. compileOnly("ch.qos.logback:logback-classic") {
  10. version {
  11. // compiling against newer version than the earliest supported version (1.0.0) to support
  12. // features added in 1.3.0
  13. strictly("1.3.0")
  14. }
  15. }
  16. compileOnly("org.slf4j:slf4j-api") {
  17. version {
  18. strictly("2.0.0")
  19. }
  20. }
  21. if (findProperty("testLatestDeps") as Boolean) {
  22. testImplementation("ch.qos.logback:logback-classic:+")
  23. } else {
  24. testImplementation("ch.qos.logback:logback-classic") {
  25. version {
  26. strictly("1.0.0")
  27. }
  28. }
  29. testImplementation("org.slf4j:slf4j-api") {
  30. version {
  31. strictly("1.6.4")
  32. }
  33. }
  34. }
  35. testImplementation("io.opentelemetry:opentelemetry-sdk-logs")
  36. testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
  37. }
  38. graalvmNative {
  39. binaries.all {
  40. resources.autodetect()
  41. }
  42. toolchainDetection.set(false)
  43. }
  44. // To be able to execute the tests as GraalVM native executables
  45. configurations.configureEach {
  46. exclude("org.apache.groovy", "groovy")
  47. exclude("org.apache.groovy", "groovy-json")
  48. exclude("org.spockframework", "spock-core")
  49. }
  50. val latestDepTest = findProperty("testLatestDeps") as Boolean
  51. testing {
  52. suites {
  53. val slf4j2ApiTest by registering(JvmTestSuite::class) {
  54. dependencies {
  55. implementation(project(":instrumentation:logback:logback-appender-1.0:library"))
  56. implementation("io.opentelemetry:opentelemetry-api-logs")
  57. implementation("io.opentelemetry:opentelemetry-sdk-logs")
  58. implementation("io.opentelemetry:opentelemetry-sdk-testing")
  59. if (latestDepTest) {
  60. implementation("ch.qos.logback:logback-classic:+")
  61. implementation("org.slf4j:slf4j-api:+")
  62. } else {
  63. implementation("ch.qos.logback:logback-classic") {
  64. version {
  65. strictly("1.3.0")
  66. }
  67. }
  68. implementation("org.slf4j:slf4j-api") {
  69. version {
  70. strictly("2.0.0")
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }
  77. }
  78. tasks {
  79. check {
  80. dependsOn(testing.suites)
  81. }
  82. }