diff --git a/sentry-ktor-client/build.gradle.kts b/sentry-ktor-client/build.gradle.kts index a28c11eab8..3775963403 100644 --- a/sentry-ktor-client/build.gradle.kts +++ b/sentry-ktor-client/build.gradle.kts @@ -44,6 +44,38 @@ dependencies { testImplementation(libs.okhttp.mockwebserver) } +testing { + suites { + register("testKtor300") { + useJUnit() + sources { + java.setSrcDirs(listOf("src/test/java")) + resources.setSrcDirs(listOf("src/test/resources")) + } + } + } +} + +configurations.named("testKtor300Implementation") { + extendsFrom(configurations.testImplementation.get()) +} + +listOf("testKtor300CompileClasspath", "testKtor300RuntimeClasspath").forEach { + configurations.named(it) { + resolutionStrategy.eachDependency { + if (requested.group == "io.ktor") { + useVersion("3.0.0") + } + } + } +} + +kotlin.target.compilations.named("testKtor300") { + associateWith(kotlin.target.compilations.getByName("main")) +} + +tasks.check { dependsOn(testing.suites.named("testKtor300")) } + buildConfig { useJavaOutput() packageName("io.sentry.ktorClient")