Skip to content

Commit b2af3f8

Browse files
committed
Move test logback config to ktor-server-test-base
1 parent 2a88824 commit b2af3f8

File tree

20 files changed

+37
-78
lines changed

20 files changed

+37
-78
lines changed

build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ subprojects {
5757
configureTargets()
5858
if (CI) configureTestTasksOnCi()
5959

60-
configurations {
61-
maybeCreate("testOutput")
62-
}
63-
6460
kotlin {
6561
if (!internalProjects.contains(project.name)) explicitApi()
6662

buildSrc/src/main/kotlin/JvmConfig.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@ fun Project.configureJvm() {
3434
}
3535
}
3636

37-
tasks.register<Jar>("jarTest") {
38-
dependsOn(tasks.named("jvmTestClasses"))
39-
archiveClassifier = "test"
40-
from(kotlin.jvm().compilations["test"].output)
41-
}
42-
43-
configurations {
44-
val testCompile = findByName("testCompile") ?: return@configurations
45-
46-
val testOutput by creating {
47-
extendsFrom(testCompile)
48-
}
49-
}
50-
5137
val testJdk = project.testJdk
5238
val jvmTest = tasks.named<KotlinJvmTest>("jvmTest") {
5339
maxHeapSize = "2g"

ktor-server/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
description = "Wrapper for ktor-server-core and base plugins"
@@ -34,7 +34,3 @@ kotlin.sourceSets {
3434
}
3535
}
3636
}
37-
38-
artifacts {
39-
add("testOutput", tasks.named("jarTest"))
40-
}

ktor-server/ktor-server-cio/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,4 @@ kotlin.sourceSets {
2020
api(project(":ktor-server:ktor-server-test-base"))
2121
}
2222
}
23-
jvmTest {
24-
dependencies {
25-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
26-
api(libs.logback.classic)
27-
}
28-
}
2923
}

ktor-server/ktor-server-core/build.gradle.kts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
description = ""
@@ -41,14 +41,9 @@ kotlin {
4141
implementation(project(":ktor-server:ktor-server-config-yaml"))
4242
implementation(project(":ktor-server:ktor-server-test-base"))
4343
implementation(project(":ktor-server:ktor-server-test-suites"))
44-
45-
api(libs.logback.classic)
44+
4645
implementation(libs.mockk)
4746
}
4847
}
4948
}
5049
}
51-
52-
artifacts {
53-
add("testOutput", tasks.named("jarTest"))
54-
}

ktor-server/ktor-server-jetty-jakarta/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
description = ""
@@ -26,8 +26,6 @@ kotlin {
2626
api(project(":ktor-server:ktor-server-test-suites"))
2727

2828
api(libs.jetty.servlet.jakarta)
29-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
30-
api(libs.logback.classic)
3129
}
3230
}
3331
}

ktor-server/ktor-server-jetty-jakarta/ktor-server-jetty-test-http2-jakarta/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
@@ -12,9 +12,6 @@ kotlin.sourceSets {
1212
api(libs.jetty.servlet.jakarta)
1313
api(project(":ktor-server:ktor-server-core"))
1414
api(project(":ktor-server:ktor-server-jetty-jakarta"))
15-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
16-
17-
api(libs.logback.classic)
1815
}
1916
}
2017
}

ktor-server/ktor-server-jetty/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
description = ""
@@ -25,8 +25,6 @@ kotlin {
2525
api(project(":ktor-server:ktor-server-test-suites"))
2626

2727
api(libs.jetty.servlet)
28-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
29-
api(libs.logback.classic)
3028
}
3129
}
3230
}

ktor-server/ktor-server-jetty/ktor-server-jetty-test-http2/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
@@ -12,9 +12,6 @@ kotlin.sourceSets {
1212
api(libs.jetty.servlet)
1313
api(project(":ktor-server:ktor-server-core"))
1414
api(project(":ktor-server:ktor-server-jetty"))
15-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
16-
17-
api(libs.logback.classic)
1815
}
1916
}
2017
}

ktor-server/ktor-server-netty/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
@@ -43,9 +43,6 @@ kotlin.sourceSets {
4343
api(libs.netty.tcnative)
4444
api(libs.netty.tcnative.boringssl.static)
4545
api(libs.mockk)
46-
api(libs.logback.classic)
47-
48-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
4946
}
5047
}
5148
}

ktor-server/ktor-server-plugins/build.gradle.kts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
subprojects {
@@ -18,11 +18,7 @@ subprojects {
1818

1919
jvmTest {
2020
dependencies {
21-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
22-
23-
// Version catalogs aren't accessible directly inside subprojects block
24-
// https://github.com/gradle/gradle/issues/16634#issuecomment-809345790
25-
api(rootProject.libs.logback.classic)
21+
implementation(project(":ktor-server:ktor-server-test-base"))
2622
}
2723
}
2824
}

ktor-server/ktor-server-servlet-jakarta/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
description = ""
26

37
kotlin.sourceSets {
@@ -11,7 +15,6 @@ kotlin.sourceSets {
1115

1216
jvmTest {
1317
dependencies {
14-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
1518
api(project(":ktor-server:ktor-server-config-yaml"))
1619
implementation(libs.mockk)
1720
implementation(libs.jakarta.servlet)

ktor-server/ktor-server-servlet/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
description = ""
26

37
kotlin.sourceSets {
@@ -10,7 +14,6 @@ kotlin.sourceSets {
1014

1115
jvmTest {
1216
dependencies {
13-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
1417
api(project(":ktor-server:ktor-server-config-yaml"))
1518
implementation(libs.mockk)
1619
implementation(libs.javax.servlet)

ktor-server/ktor-server-test-base/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ kotlin.sourceSets {
1919
api(project(":ktor-client:ktor-client-apache"))
2020
api(project(":ktor-network:ktor-network-tls:ktor-network-tls-certificates"))
2121
api(project(":ktor-server:ktor-server-plugins:ktor-server-call-logging"))
22+
23+
api(libs.logback.classic)
2224
}
2325
}
2426
}

ktor-server/ktor-server-core/jvm/test-resources/logback-test.xml renamed to ktor-server/ktor-server-test-base/jvm/resources/logback-test.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
~ Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
-->
4+
15
<configuration>
26
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
37
<encoder>

ktor-server/ktor-server-test-host/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
description = ""
@@ -34,7 +34,6 @@ kotlin.sourceSets {
3434

3535
jvmTest {
3636
dependencies {
37-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
3837
api(project(":ktor-server:ktor-server-config-yaml"))
3938
api(libs.kotlin.test)
4039
}

ktor-server/ktor-server-test-suites/build.gradle.kts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,4 @@ kotlin.sourceSets {
2525
implementation(project(":ktor-server:ktor-server-plugins:ktor-server-request-validation"))
2626
}
2727
}
28-
29-
jvmTest {
30-
dependencies {
31-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
32-
33-
api(libs.logback.classic)
34-
}
35-
}
3628
}

ktor-server/ktor-server-tests/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
description = ""
26

37
plugins {
@@ -16,8 +20,6 @@ kotlin.sourceSets {
1620
dependencies {
1721
implementation(libs.jansi)
1822
implementation(project(":ktor-client:ktor-client-plugins:ktor-client-encoding"))
19-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
20-
api(libs.logback.classic)
2123
api(project(":ktor-server:ktor-server-plugins:ktor-server-sse"))
2224
}
2325
}

ktor-server/ktor-server-tomcat-jakarta/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
description = ""
26

37
kotlin.sourceSets {
@@ -14,8 +18,6 @@ kotlin.sourceSets {
1418
api(project(":ktor-server:ktor-server-test-base"))
1519
api(project(":ktor-server:ktor-server-test-suites"))
1620
api(project(":ktor-server:ktor-server-core"))
17-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
18-
api(libs.logback.classic)
1921
}
2022
}
2123
}

ktor-server/ktor-server-tomcat/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
description = ""
26

37
kotlin.sourceSets {
@@ -14,8 +18,6 @@ kotlin.sourceSets {
1418
api(project(":ktor-server:ktor-server-test-base"))
1519
api(project(":ktor-server:ktor-server-test-suites"))
1620
api(project(":ktor-server:ktor-server-core"))
17-
api(project(":ktor-server:ktor-server-core", configuration = "testOutput"))
18-
api(libs.logback.classic)
1921
}
2022
}
2123
}

0 commit comments

Comments
 (0)