Не подтверждена Коммит 6e316974 создал по автору Osip Fatkullin's avatar Osip Fatkullin Зафиксировано автором GitHub
Просмотр файлов

KTOR-7743 Make projects isolated (#4740)

* Apply project plugin in project build scripts
* Unify dependencies declaration API
* Remove shared configurations from parent projects
* Remove buildSrc
* Don't publish empty artifacts (KTOR-8336)
* Add ProjectTagsService to remove usage of rootProject.subprojects
* Remove usage of findProperty and rootProject.layout
владелец bbf42373
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
plugins {
id("ktorbuild.project.library")
}
kotlin {
sourceSets {
jsMain {
dependencies {
api(project(":ktor-client:ktor-client-core"))
}
jsMain.dependencies {
api(project(":ktor-client:ktor-client-core"))
}
wasmJsMain {
dependencies {
api(project(":ktor-client:ktor-client-core"))
}
wasmJsMain.dependencies {
api(project(":ktor-client:ktor-client-core"))
}
}
}
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
plugins {
id("ktorbuild.project.library")
id("kotlinx-serialization")
}
kotlin.sourceSets {
commonMain {
dependencies {
kotlin {
sourceSets {
commonMain.dependencies {
api(project(":ktor-http"))
api(project(":ktor-client:ktor-client-core"))
}
}
commonTest {
dependencies {
commonTest.dependencies {
api(project(":ktor-test-dispatcher"))
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
api(libs.kotlinx.serialization.core)
api(project(":ktor-client:ktor-client-plugins:ktor-client-content-negotiation"))
api(project(":ktor-shared:ktor-serialization:ktor-serialization-kotlinx"))
......
/*
* 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.
*/
plugins {
id("ktorbuild.project.library")
id("test-server")
}
kotlin.sourceSets {
jvmMain {
dependencies {
kotlin {
sourceSets {
jvmMain.dependencies {
api(project(":ktor-client:ktor-client-core"))
api(libs.okhttp)
api(libs.okhttp.sse)
api(libs.okio)
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
api(project(":ktor-client:ktor-client-tests"))
}
}
......
/*
* 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 = "Ktor client Auth support"
plugins {
id("ktorbuild.project.client-plugin")
id("test-server")
}
/*
* 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 = "Ktor client Byte Order Mark support"
plugins {
id("ktorbuild.project.client-plugin")
}
/*
* Copyright 2014-2020 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 = "Ktor client CallId support"
plugins {
id("ktorbuild.project.client-plugin")
}
kotlin {
sourceSets {
commonMain {
dependencies {
api(project(":ktor-shared:ktor-call-id"))
}
commonMain.dependencies {
api(project(":ktor-shared:ktor-call-id"))
}
commonTest {
dependencies {
api(project(":ktor-server:ktor-server-test-host"))
api(project(":ktor-server:ktor-server-plugins:ktor-server-call-id"))
}
commonTest.dependencies {
api(project(":ktor-server:ktor-server-test-host"))
api(project(":ktor-server:ktor-server-plugins:ktor-server-call-id"))
}
}
}
......
/*
* Copyright 2014-2020 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 = "Ktor client Content Negotiation support"
plugins {
id("ktorbuild.project.client-plugin")
id("kotlinx-serialization")
}
kotlin {
sourceSets {
commonMain {
dependencies {
api(project(":ktor-shared:ktor-serialization"))
}
commonMain.dependencies {
api(project(":ktor-shared:ktor-serialization"))
}
}
}
......@@ -5,18 +5,21 @@
description = "Common tests for client content negotiation"
plugins {
id("ktorbuild.project.internal")
id("kotlinx-serialization")
}
kotlin.sourceSets.jvmMain {
dependencies {
api(libs.kotlin.test.junit5)
api(project(":ktor-client:ktor-client-plugins:ktor-client-content-negotiation"))
api(project(":ktor-server:ktor-server-cio"))
api(project(":ktor-client:ktor-client-cio"))
api(project(":ktor-client:ktor-client-tests"))
api(project(":ktor-server:ktor-server-test-host"))
api(libs.jackson.annotations)
api(libs.logback.classic)
kotlin {
sourceSets {
jvmMain.dependencies {
api(libs.kotlin.test.junit5)
api(project(":ktor-client:ktor-client-plugins:ktor-client-content-negotiation"))
api(project(":ktor-server:ktor-server-cio"))
api(project(":ktor-client:ktor-client-cio"))
api(project(":ktor-client:ktor-client-tests"))
api(project(":ktor-server:ktor-server-test-host"))
api(libs.jackson.annotations)
api(libs.logback.classic)
}
}
}
/*
* 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.
*/
plugins {
id("ktorbuild.project.client-plugin")
id("test-server")
}
kotlin.sourceSets {
jvmTest {
dependencies {
kotlin {
sourceSets {
jvmTest.dependencies {
api(project(":ktor-server:ktor-server-test-host"))
}
}
......
/*
* 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 = "Ktor client JSON support"
plugins {
id("ktorbuild.project.client-plugin")
id("kotlinx-serialization")
id("test-server")
}
kotlin {
sourceSets {
// This is a workaround for https://youtrack.jetbrains.com/issue/KT-39037
fun excludingSelf(dependency: Any) = project.dependencies.create(dependency).apply {
(this as ModuleDependency).exclude(module = project.name)
commonTest.dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-json:ktor-client-serialization"))
}
commonTest {
dependencies {
api(excludingSelf(project(":ktor-client:ktor-client-plugins:ktor-client-json:ktor-client-serialization"))) // ktlint-disable max-line-length
}
}
jvmTest {
dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-json:ktor-client-gson"))
}
jvmTest.dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-json:ktor-client-gson"))
}
}
}
/*
* Copyright 2014-2021 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.
*/
kotlin.sourceSets {
jvmMain {
dependencies {
plugins {
id("ktorbuild.project.client-plugin")
}
kotlin {
sourceSets {
jvmMain.dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-json"))
api(libs.gson)
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
api(project(":ktor-client:ktor-client-cio"))
api(project(":ktor-shared:ktor-serialization:ktor-serialization-gson"))
}
......
/*
* 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.
*/
plugins {
id("ktorbuild.project.client-plugin")
}
kotlin.sourceSets {
jvmMain {
dependencies {
kotlin {
sourceSets {
jvmMain.dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-json"))
api(libs.jackson.databind)
api(libs.jackson.module.kotlin)
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
api(project(":ktor-client:ktor-client-cio"))
api(project(":ktor-shared:ktor-serialization:ktor-serialization-gson"))
}
......
/*
* Copyright 2014-2021 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.
*/
plugins {
id("ktorbuild.project.client-plugin")
id("kotlinx-serialization")
}
kotlin.sourceSets {
commonMain {
dependencies {
kotlin {
sourceSets {
commonMain.dependencies {
api(libs.kotlinx.serialization.json)
api(project(":ktor-client:ktor-client-plugins:ktor-client-json"))
}
......
/*
* Copyright 2014-2021 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.
*/
kotlin.sourceSets {
jvmMain {
dependencies {
plugins {
id("ktorbuild.project.client-plugin")
}
kotlin {
sourceSets {
jvmMain.dependencies {
compileOnly(libs.slf4j.simple)
api(libs.kotlinx.coroutines.slf4j)
}
}
commonTest {
dependencies {
commonTest.dependencies {
api(project(":ktor-client:ktor-client-mock"))
api(project(":ktor-client:ktor-client-plugins:ktor-client-content-negotiation"))
}
}
jvmMain {
dependencies {
api(libs.kotlinx.coroutines.slf4j)
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
api(project(":ktor-shared:ktor-serialization:ktor-serialization-jackson"))
api(project(":ktor-client:ktor-client-plugins:ktor-client-encoding"))
}
......
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
description = "Client side Resources feature"
plugins {
id("ktorbuild.project.client-plugin")
id("kotlinx-serialization")
}
kotlin.sourceSets {
commonMain {
dependencies {
kotlin {
sourceSets {
commonMain.dependencies {
api(project(":ktor-shared:ktor-resources"))
api(libs.kotlinx.serialization.core)
}
......
kotlin.sourceSets {
commonMain {
dependencies {
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
plugins {
id("ktorbuild.project.client-plugin")
}
kotlin {
sourceSets {
commonMain.dependencies {
api(project(":ktor-client:ktor-client-core"))
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
implementation(project(":ktor-client:ktor-client-cio"))
}
}
......
/*
* 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.
*/
kotlin.sourceSets {
commonTest {
dependencies {
plugins {
id("ktorbuild.project.client-plugin")
}
kotlin {
sourceSets {
commonTest.dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-logging"))
}
}
......
......@@ -4,9 +4,13 @@
description = ""
kotlin.sourceSets {
commonMain {
dependencies {
plugins {
id("ktorbuild.project.internal")
}
kotlin {
sourceSets {
commonMain.dependencies {
api(project(":ktor-client:ktor-client-core"))
api(project(":ktor-shared:ktor-test-base"))
}
......
......@@ -5,19 +5,18 @@
description = "Common tests for client"
plugins {
id("ktorbuild.project.internal")
id("kotlinx-serialization")
id("test-server")
}
kotlin.sourceSets {
commonMain {
dependencies {
kotlin {
sourceSets {
commonMain.dependencies {
api(project(":ktor-client:ktor-client-test-base"))
api(project(":ktor-client:ktor-client-mock"))
}
}
commonTest {
dependencies {
commonTest.dependencies {
api(project(":ktor-client:ktor-client-plugins:ktor-client-json"))
api(project(":ktor-client:ktor-client-plugins:ktor-client-json:ktor-client-serialization"))
api(project(":ktor-client:ktor-client-plugins:ktor-client-logging"))
......@@ -29,9 +28,7 @@ kotlin.sourceSets {
api(project(":ktor-shared:ktor-serialization:ktor-serialization-kotlinx"))
api(project(":ktor-shared:ktor-serialization:ktor-serialization-kotlinx:ktor-serialization-kotlinx-json"))
}
}
jvmMain {
dependencies {
jvmMain.dependencies {
api(libs.kotlinx.serialization.json)
api(project(":ktor-network:ktor-network-tls:ktor-network-tls-certificates"))
api(project(":ktor-server"))
......@@ -42,10 +39,8 @@ kotlin.sourceSets {
api(project(":ktor-shared:ktor-serialization:ktor-serialization-kotlinx"))
api(libs.logback.classic)
}
}
jvmTest {
dependencies {
jvmTest.dependencies {
api(project(":ktor-client:ktor-client-apache"))
api(project(":ktor-client:ktor-client-apache5"))
runtimeOnly(project(":ktor-client:ktor-client-android"))
......@@ -55,36 +50,26 @@ kotlin.sourceSets {
implementation(libs.kotlinx.coroutines.slf4j)
implementation(libs.junit)
}
}
commonTest {
dependencies {
commonTest.dependencies {
api(project(":ktor-client:ktor-client-cio"))
}
}
jsTest {
dependencies {
jsTest.dependencies {
api(project(":ktor-client:ktor-client-js"))
}
}
desktopTest {
dependencies {
desktopTest.dependencies {
api(project(":ktor-client:ktor-client-curl"))
}
}
darwinTest {
dependencies {
api(project(":ktor-client:ktor-client-darwin"))
api(project(":ktor-client:ktor-client-darwin-legacy"))
darwinTest.dependencies {
api(project(":ktor-client:ktor-client-darwin"))
api(project(":ktor-client:ktor-client-darwin-legacy"))
}
}
windowsTest {
dependencies {
api(project(":ktor-client:ktor-client-winhttp"))
windowsTest.dependencies {
api(project(":ktor-client:ktor-client-winhttp"))
}
}
}
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать