build.gradle.kts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  2. plugins {
  3. id("org.jetbrains.kotlin.jvm")
  4. id("otel.javaagent-instrumentation")
  5. }
  6. muzzle {
  7. pass {
  8. group.set("org.jetbrains.kotlinx")
  9. module.set("kotlinx-coroutines-core")
  10. versions.set("[1.0.0,1.3.8)")
  11. }
  12. // 1.3.9 (and beyond?) have changed how artifact names are resolved due to multiplatform variants
  13. pass {
  14. group.set("org.jetbrains.kotlinx")
  15. module.set("kotlinx-coroutines-core-jvm")
  16. versions.set("[1.3.9,)")
  17. }
  18. }
  19. dependencies {
  20. compileOnly("io.opentelemetry:opentelemetry-extension-kotlin")
  21. compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  22. testImplementation("io.opentelemetry:opentelemetry-extension-kotlin")
  23. testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  24. // Use first version with flow support since we have tests for it.
  25. testLibrary("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0")
  26. }
  27. tasks {
  28. withType(KotlinCompile::class).configureEach {
  29. kotlinOptions {
  30. jvmTarget = "1.8"
  31. }
  32. }
  33. val compileTestKotlin by existing(AbstractCompile::class)
  34. named<GroovyCompile>("compileTestGroovy") {
  35. // Note: look like it should be `classpath += files(sourceSets.test.kotlin.classesDirectory)`
  36. // instead, but kotlin plugin doesn't support it (yet?)
  37. classpath = classpath.plus(files(compileTestKotlin.get().destinationDir))
  38. }
  39. }