diff --git a/build.gradle.kts b/build.gradle.kts index 83407d7185c..f259be05e3a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -57,10 +57,6 @@ subprojects { configureTargets() if (CI) configureTestTasksOnCi() - configurations { - maybeCreate("testOutput") - } - kotlin { if (!internalProjects.contains(project.name)) explicitApi() diff --git a/buildSrc/src/main/kotlin/JvmConfig.kt b/buildSrc/src/main/kotlin/JvmConfig.kt index 2513ebc0c65..dc555407f29 100644 --- a/buildSrc/src/main/kotlin/JvmConfig.kt +++ b/buildSrc/src/main/kotlin/JvmConfig.kt @@ -34,22 +34,6 @@ fun Project.configureJvm() { } } - tasks.register("jarTest") { - dependsOn(tasks.named("jvmTestClasses")) - archiveClassifier = "test" - from(kotlin.jvm().compilations["test"].output) - } - - configurations { - val testCompile = findByName("testCompile") ?: return@configurations - - val testOutput by creating { - extendsFrom(testCompile) - } - val boot by creating { - } - } - val testJdk = project.testJdk val jvmTest = tasks.named("jvmTest") { maxHeapSize = "2g" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c42e0754f45..4f5f5db1042 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,6 @@ netty-tcnative = "2.0.69.Final" jetty = "9.4.57.v20241219" jetty-jakarta = "11.0.24" jetty-alpn-api = "1.1.3.v20160715" -jetty-alpn-boot = "8.1.13.v20181017" jetty-alpn-openjdk8 = "9.4.57.v20241219" tomcat = "9.0.98" @@ -156,7 +155,6 @@ jetty-alpn-java-server = { module = "org.eclipse.jetty:jetty-alpn-java-server", jetty-alpn-java-client = { module = "org.eclipse.jetty:jetty-alpn-java-client", version.ref = "jetty" } jetty-alpn-api = { module = "org.eclipse.jetty.alpn:alpn-api", version.ref = "jetty-alpn-api" } -jetty-alpn-boot = { module = "org.mortbay.jetty.alpn:alpn-boot", version.ref = "jetty-alpn-boot" } jetty-alpn-openjdk8-server = { module = "org.eclipse.jetty:jetty-alpn-openjdk8-server", version.ref = "jetty-alpn-openjdk8" } jetty-alpn-openjdk8-client = { module = "org.eclipse.jetty:jetty-alpn-openjdk8-client", version.ref = "jetty-alpn-openjdk8" } diff --git a/ktor-server/build.gradle.kts b/ktor-server/build.gradle.kts index fd3410a4791..b7472dcd243 100644 --- a/ktor-server/build.gradle.kts +++ b/ktor-server/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ description = "Wrapper for ktor-server-core and base plugins" @@ -34,7 +34,3 @@ kotlin.sourceSets { } } } - -artifacts { - add("testOutput", tasks.named("jarTest")) -} diff --git a/ktor-server/ktor-server-cio/build.gradle.kts b/ktor-server/ktor-server-cio/build.gradle.kts index a8509fae372..7b08bb94888 100644 --- a/ktor-server/ktor-server-cio/build.gradle.kts +++ b/ktor-server/ktor-server-cio/build.gradle.kts @@ -20,10 +20,4 @@ kotlin.sourceSets { api(project(":ktor-server:ktor-server-test-base")) } } - jvmTest { - dependencies { - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - api(libs.logback.classic) - } - } } diff --git a/ktor-server/ktor-server-core/build.gradle.kts b/ktor-server/ktor-server-core/build.gradle.kts index e12ecb52dbe..80f269cdd7c 100644 --- a/ktor-server/ktor-server-core/build.gradle.kts +++ b/ktor-server/ktor-server-core/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ description = "" @@ -41,14 +41,9 @@ kotlin { implementation(project(":ktor-server:ktor-server-config-yaml")) implementation(project(":ktor-server:ktor-server-test-base")) implementation(project(":ktor-server:ktor-server-test-suites")) - - api(libs.logback.classic) + implementation(libs.mockk) } } } } - -artifacts { - add("testOutput", tasks.named("jarTest")) -} diff --git a/ktor-server/ktor-server-jetty-jakarta/build.gradle.kts b/ktor-server/ktor-server-jetty-jakarta/build.gradle.kts index ff8be93a183..84653e25afe 100644 --- a/ktor-server/ktor-server-jetty-jakarta/build.gradle.kts +++ b/ktor-server/ktor-server-jetty-jakarta/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ description = "" @@ -26,17 +26,7 @@ kotlin { api(project(":ktor-server:ktor-server-test-suites")) api(libs.jetty.servlet.jakarta) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - api(libs.logback.classic) } } } } - -val jetty_alpn_boot_version: String? by extra - -dependencies { - if (jetty_alpn_boot_version != null) { - add("boot", libs.jetty.alpn.boot) - } -} diff --git a/ktor-server/ktor-server-jetty-jakarta/ktor-server-jetty-test-http2-jakarta/build.gradle.kts b/ktor-server/ktor-server-jetty-jakarta/ktor-server-jetty-test-http2-jakarta/build.gradle.kts index 25c645859a2..88c3ff2406f 100644 --- a/ktor-server/ktor-server-jetty-jakarta/ktor-server-jetty-test-http2-jakarta/build.gradle.kts +++ b/ktor-server/ktor-server-jetty-jakarta/ktor-server-jetty-test-http2-jakarta/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest @@ -12,25 +12,10 @@ kotlin.sourceSets { api(libs.jetty.servlet.jakarta) api(project(":ktor-server:ktor-server-core")) api(project(":ktor-server:ktor-server-jetty-jakarta")) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - - api(libs.logback.classic) } } } -val jetty_alpn_boot_version: String? by extra -dependencies { - if (jetty_alpn_boot_version != null) { - add("boot", libs.jetty.alpn.boot) - } -} - tasks.named("jvmTest") { systemProperty("enable.http2", "true") - - if (jetty_alpn_boot_version != null && JavaVersion.current() == JavaVersion.VERSION_1_8) { - val bootClasspath = configurations.named("boot").get().files - jvmArgs(bootClasspath.map { "-Xbootclasspath/p:${it.absolutePath}" }.iterator()) - } } diff --git a/ktor-server/ktor-server-jetty/build.gradle.kts b/ktor-server/ktor-server-jetty/build.gradle.kts index 8550d5dbd80..9e39fd393ce 100644 --- a/ktor-server/ktor-server-jetty/build.gradle.kts +++ b/ktor-server/ktor-server-jetty/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + description = "" kotlin { @@ -21,17 +25,7 @@ kotlin { api(project(":ktor-server:ktor-server-test-suites")) api(libs.jetty.servlet) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - api(libs.logback.classic) } } } } - -val jetty_alpn_boot_version: String? by extra - -dependencies { - if (jetty_alpn_boot_version != null) { - add("boot", libs.jetty.alpn.boot) - } -} diff --git a/ktor-server/ktor-server-jetty/ktor-server-jetty-test-http2/build.gradle.kts b/ktor-server/ktor-server-jetty/ktor-server-jetty-test-http2/build.gradle.kts index 8f510fde5ef..a58bbc4de19 100644 --- a/ktor-server/ktor-server-jetty/ktor-server-jetty-test-http2/build.gradle.kts +++ b/ktor-server/ktor-server-jetty/ktor-server-jetty-test-http2/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest @@ -12,25 +12,10 @@ kotlin.sourceSets { api(libs.jetty.servlet) api(project(":ktor-server:ktor-server-core")) api(project(":ktor-server:ktor-server-jetty")) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - - api(libs.logback.classic) } } } -val jetty_alpn_boot_version: String? by extra -dependencies { - if (jetty_alpn_boot_version != null) { - add("boot", libs.jetty.alpn.boot) - } -} - tasks.named("jvmTest") { systemProperty("enable.http2", "true") - - if (jetty_alpn_boot_version != null && JavaVersion.current() == JavaVersion.VERSION_1_8) { - val bootClasspath = configurations.named("boot").get().files - jvmArgs(bootClasspath.map { "-Xbootclasspath/p:${it.absolutePath}" }.iterator()) - } } diff --git a/ktor-server/ktor-server-netty/build.gradle.kts b/ktor-server/ktor-server-netty/build.gradle.kts index 1b57fdad89e..1b2d777fd61 100644 --- a/ktor-server/ktor-server-netty/build.gradle.kts +++ b/ktor-server/ktor-server-netty/build.gradle.kts @@ -1,13 +1,11 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest description = "" -val jetty_alpn_api_version: String by extra - val enableAlpnProp = project.hasProperty("enableAlpn") val osName = System.getProperty("os.name").lowercase() val nativeClassifier: String? = if (enableAlpnProp) { @@ -45,9 +43,6 @@ kotlin.sourceSets { api(libs.netty.tcnative) api(libs.netty.tcnative.boringssl.static) api(libs.mockk) - api(libs.logback.classic) - - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) } } } diff --git a/ktor-server/ktor-server-plugins/build.gradle.kts b/ktor-server/ktor-server-plugins/build.gradle.kts index 9aaff437fc9..91792b7eba7 100644 --- a/ktor-server/ktor-server-plugins/build.gradle.kts +++ b/ktor-server/ktor-server-plugins/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ subprojects { @@ -18,11 +18,7 @@ subprojects { jvmTest { dependencies { - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - - // Version catalogs aren't accessible directly inside subprojects block - // https://github.com/gradle/gradle/issues/16634#issuecomment-809345790 - api(rootProject.libs.logback.classic) + implementation(project(":ktor-server:ktor-server-test-base")) } } } diff --git a/ktor-server/ktor-server-servlet-jakarta/build.gradle.kts b/ktor-server/ktor-server-servlet-jakarta/build.gradle.kts index 3e29eca3039..ffb78ed086b 100644 --- a/ktor-server/ktor-server-servlet-jakarta/build.gradle.kts +++ b/ktor-server/ktor-server-servlet-jakarta/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + description = "" kotlin.sourceSets { @@ -11,7 +15,6 @@ kotlin.sourceSets { jvmTest { dependencies { - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) api(project(":ktor-server:ktor-server-config-yaml")) implementation(libs.mockk) implementation(libs.jakarta.servlet) diff --git a/ktor-server/ktor-server-servlet/build.gradle.kts b/ktor-server/ktor-server-servlet/build.gradle.kts index cc3035d6acc..283194f6c51 100644 --- a/ktor-server/ktor-server-servlet/build.gradle.kts +++ b/ktor-server/ktor-server-servlet/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + description = "" kotlin.sourceSets { @@ -10,7 +14,6 @@ kotlin.sourceSets { jvmTest { dependencies { - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) api(project(":ktor-server:ktor-server-config-yaml")) implementation(libs.mockk) implementation(libs.javax.servlet) diff --git a/ktor-server/ktor-server-test-base/build.gradle.kts b/ktor-server/ktor-server-test-base/build.gradle.kts index 33f6b5f1558..f7fc1fc6be4 100644 --- a/ktor-server/ktor-server-test-base/build.gradle.kts +++ b/ktor-server/ktor-server-test-base/build.gradle.kts @@ -4,8 +4,6 @@ description = "" -val jetty_alpn_boot_version: String? by extra - kotlin.sourceSets { commonMain { dependencies { @@ -22,9 +20,7 @@ kotlin.sourceSets { api(project(":ktor-network:ktor-network-tls:ktor-network-tls-certificates")) api(project(":ktor-server:ktor-server-plugins:ktor-server-call-logging")) - if (jetty_alpn_boot_version != null) { - api(libs.jetty.alpn.boot) - } + api(libs.logback.classic) } } } diff --git a/ktor-server/ktor-server-core/jvm/test-resources/logback-test.xml b/ktor-server/ktor-server-test-base/jvm/resources/logback-test.xml similarity index 82% rename from ktor-server/ktor-server-core/jvm/test-resources/logback-test.xml rename to ktor-server/ktor-server-test-base/jvm/resources/logback-test.xml index ddaedaeb222..87f2a8e871b 100644 --- a/ktor-server/ktor-server-core/jvm/test-resources/logback-test.xml +++ b/ktor-server/ktor-server-test-base/jvm/resources/logback-test.xml @@ -1,3 +1,7 @@ + + diff --git a/ktor-server/ktor-server-test-host/build.gradle.kts b/ktor-server/ktor-server-test-host/build.gradle.kts index b1cdc615b55..5056c17ca82 100644 --- a/ktor-server/ktor-server-test-host/build.gradle.kts +++ b/ktor-server/ktor-server-test-host/build.gradle.kts @@ -1,11 +1,9 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ description = "" -val jetty_alpn_boot_version: String? by extra - kotlin.sourceSets { commonMain { dependencies { @@ -28,10 +26,6 @@ kotlin.sourceSets { // so shouldn"t increase the size of the final artifact. api(project(":ktor-server:ktor-server-plugins:ktor-server-websockets")) - if (jetty_alpn_boot_version != null) { - api(libs.jetty.alpn.boot) - } - api(libs.kotlin.test) api(libs.junit) implementation(libs.kotlinx.coroutines.debug) @@ -40,7 +34,6 @@ kotlin.sourceSets { jvmTest { dependencies { - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) api(project(":ktor-server:ktor-server-config-yaml")) api(libs.kotlin.test) } diff --git a/ktor-server/ktor-server-test-suites/build.gradle.kts b/ktor-server/ktor-server-test-suites/build.gradle.kts index 1ac033c7604..9a6892573fc 100644 --- a/ktor-server/ktor-server-test-suites/build.gradle.kts +++ b/ktor-server/ktor-server-test-suites/build.gradle.kts @@ -25,12 +25,4 @@ kotlin.sourceSets { implementation(project(":ktor-server:ktor-server-plugins:ktor-server-request-validation")) } } - - jvmTest { - dependencies { - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - - api(libs.logback.classic) - } - } } diff --git a/ktor-server/ktor-server-tests/build.gradle.kts b/ktor-server/ktor-server-tests/build.gradle.kts index 2f7e66c2917..2bf1458ec84 100644 --- a/ktor-server/ktor-server-tests/build.gradle.kts +++ b/ktor-server/ktor-server-tests/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + description = "" plugins { @@ -16,8 +20,6 @@ kotlin.sourceSets { dependencies { implementation(libs.jansi) implementation(project(":ktor-client:ktor-client-plugins:ktor-client-encoding")) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - api(libs.logback.classic) api(project(":ktor-server:ktor-server-plugins:ktor-server-sse")) } } diff --git a/ktor-server/ktor-server-tomcat-jakarta/build.gradle.kts b/ktor-server/ktor-server-tomcat-jakarta/build.gradle.kts index 3b0a81e9df5..a6124b13e8d 100644 --- a/ktor-server/ktor-server-tomcat-jakarta/build.gradle.kts +++ b/ktor-server/ktor-server-tomcat-jakarta/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + description = "" kotlin.sourceSets { @@ -14,8 +18,6 @@ kotlin.sourceSets { api(project(":ktor-server:ktor-server-test-base")) api(project(":ktor-server:ktor-server-test-suites")) api(project(":ktor-server:ktor-server-core")) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - api(libs.logback.classic) } } } diff --git a/ktor-server/ktor-server-tomcat/build.gradle.kts b/ktor-server/ktor-server-tomcat/build.gradle.kts index 36ecff8a64f..91ae0818ae6 100644 --- a/ktor-server/ktor-server-tomcat/build.gradle.kts +++ b/ktor-server/ktor-server-tomcat/build.gradle.kts @@ -1,3 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + description = "" kotlin.sourceSets { @@ -14,8 +18,6 @@ kotlin.sourceSets { api(project(":ktor-server:ktor-server-test-base")) api(project(":ktor-server:ktor-server-test-suites")) api(project(":ktor-server:ktor-server-core")) - api(project(":ktor-server:ktor-server-core", configuration = "testOutput")) - api(libs.logback.classic) } } }