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