build.gradle.kts 2.1 KB

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