build.gradle.kts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  2. plugins {
  3. id("otel.library-instrumentation")
  4. id("org.jetbrains.kotlin.jvm")
  5. }
  6. dependencies {
  7. library("io.ktor:ktor-server-core:1.0.0")
  8. implementation("io.opentelemetry:opentelemetry-extension-kotlin")
  9. compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  10. testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  11. // Note, we do not have a :testing library yet because there doesn't seem to be a way to have the Kotlin classes
  12. // available for use from Spock. We will first need to migrate HttpServerTest to be usable outside of Spock.
  13. testLibrary("io.ktor:ktor-server-netty:1.0.0")
  14. latestDepTestLibrary("io.ktor:ktor-server-core:1.+")
  15. latestDepTestLibrary("io.ktor:ktor-server-netty:1.+")
  16. }
  17. tasks {
  18. withType(KotlinCompile::class).configureEach {
  19. kotlinOptions {
  20. jvmTarget = "1.8"
  21. }
  22. }
  23. val compileTestKotlin by existing(AbstractCompile::class)
  24. named<GroovyCompile>("compileTestGroovy") {
  25. // Note: look like it should be `classpath += files(sourceSets.test.kotlin.classesDirectory)`
  26. // instead, but kotlin plugin doesn't support it (yet?)
  27. classpath = classpath.plus(files(compileTestKotlin.get().destinationDir))
  28. }
  29. }