build.gradle.kts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import org.jetbrains.kotlin.gradle.dsl.JvmTarget
  2. plugins {
  3. id("org.jetbrains.kotlin.jvm")
  4. id("otel.javaagent-instrumentation")
  5. }
  6. muzzle {
  7. pass {
  8. group.set("io.opentelemetry")
  9. module.set("opentelemetry-extension-kotlin")
  10. versions.set("[0.17.0,)")
  11. assertInverse.set(true)
  12. skip("0.13.0") // has a bad dependency on non-alpha api-metric 0.13.0
  13. extraDependency("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0")
  14. }
  15. }
  16. dependencies {
  17. compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  18. library("io.opentelemetry:opentelemetry-extension-kotlin")
  19. // see the comment in opentelemetry-api-1.0.gradle for more details
  20. compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "shadow"))
  21. implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent"))
  22. testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  23. testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0")
  24. }
  25. if (!(findProperty("testLatestDeps") as Boolean)) {
  26. // run tests against an early version of opentelemetry-extension-kotlin, latest dep tests will use
  27. // the current version
  28. configurations.configureEach {
  29. if (!name.contains("muzzle")) {
  30. resolutionStrategy {
  31. eachDependency {
  32. if (requested.group == "io.opentelemetry" && requested.name == "opentelemetry-extension-kotlin") {
  33. useVersion("1.0.0")
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. kotlin {
  41. compilerOptions {
  42. jvmTarget.set(JvmTarget.JVM_1_8)
  43. }
  44. }