diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 640730fb..ea1df330 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -2,6 +2,9 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ +import util.KOTLINX_RPC_PREFIX +import util.isPublicModule + plugins { `java-platform` `maven-publish` @@ -11,7 +14,7 @@ plugins { dependencies { constraints { rootProject.subprojects.filter { - it.name.startsWith(KOTLINX_RPC_PREFIX) && it != project + it.isPublicModule && it != project }.forEach { project -> api(project) } @@ -20,9 +23,9 @@ dependencies { publishing { publications { - create("kotlinxRpcPlatform") { + create("bom") { groupId = project.group.toString() - artifactId = project.name + artifactId = "$KOTLINX_RPC_PREFIX-${project.name}" version = project.version.toString() from(components["javaPlatform"]) diff --git a/build.gradle.kts b/build.gradle.kts index c88808d3..18a76b87 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,8 +26,8 @@ apiValidation { listOf( "codegen-tests-jvm", "codegen-tests-mpp", - "kotlinx-rpc-runtime-test", - "kotlinx-rpc-utils", + "runtime-test", + "utils", ) ) diff --git a/compiler-plugin/settings.gradle.kts b/compiler-plugin/settings.gradle.kts index 8845e20e..b24e1cc2 100644 --- a/compiler-plugin/settings.gradle.kts +++ b/compiler-plugin/settings.gradle.kts @@ -2,7 +2,9 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -rootProject.name = "kotlinx-rpc-compiler-plugin" +rootProject.name = "compiler-plugin" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { includeBuild("../gradle-conventions") @@ -13,3 +15,5 @@ plugins { id("settings-conventions") id("compiler-specific-modules") } + +includeRootAsPublic() diff --git a/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicModule.kt b/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicModule.kt new file mode 100644 index 00000000..2ac02bc5 --- /dev/null +++ b/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicModule.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package util + +import org.gradle.api.Project +import org.gradle.kotlin.dsl.extra + +/** + * See gradle-settings-conventions/src/main/kotlin/includePublic.kt + */ +val Project.isPublicModule: Boolean get() { + return extra.has("isPublicModule") && extra["isPublicModule"] == true +} diff --git a/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicationUtils.kt b/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicationUtils.kt index 5b40f180..a8b97305 100644 --- a/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicationUtils.kt +++ b/gradle-conventions/conventions-utils/src/main/kotlin/util/PublicationUtils.kt @@ -7,8 +7,17 @@ package util import org.gradle.api.Project import org.gradle.api.artifacts.dsl.RepositoryHandler import org.gradle.api.provider.Property +import org.gradle.api.publish.maven.MavenPublication import org.gradle.kotlin.dsl.maven +const val KOTLINX_RPC_PREFIX = "kotlinx-rpc" + +fun MavenPublication.setPublicArtifactId(project: Project) { + artifactId = "$KOTLINX_RPC_PREFIX-$artifactId" + + project.logger.info("Altered artifactId for $name publication: $artifactId") +} + infix fun Property.by(value: T) { set(value) } diff --git a/gradle-conventions/conventions-utils/src/main/kotlin/util/TargetUtils.kt b/gradle-conventions/conventions-utils/src/main/kotlin/util/TargetUtils.kt index 2cd0c8bc..af76fda5 100644 --- a/gradle-conventions/conventions-utils/src/main/kotlin/util/TargetUtils.kt +++ b/gradle-conventions/conventions-utils/src/main/kotlin/util/TargetUtils.kt @@ -41,6 +41,7 @@ private fun isIncluded(targetName: String, kotlinVersion: String, lookupTable: M } private fun KotlinMultiplatformExtension.configureTargets( + project: Project, kotlinVersion: String, targetsLookup: Map, jvm: Boolean = true, @@ -95,6 +96,12 @@ private fun KotlinMultiplatformExtension.configureTargets( }.also { targets.add(it) } } + targets.forEach { target -> + target.mavenPublication { + setPublicArtifactId(project) + } + } + return targets } @@ -120,7 +127,7 @@ fun Project.configureKotlin( } kotlin { - val includedTargets = configureTargets(kotlinVersion, lookupTable, jvm, js, native) + val includedTargets = configureTargets(project, kotlinVersion, lookupTable, jvm, js, native) configureDetekt(includedTargets) diff --git a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts index 6a36b5e8..878a6cb5 100644 --- a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts +++ b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts @@ -2,15 +2,13 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -import util.by -import util.configureRepository -import util.getSensitiveProperty +import util.* val isGradlePlugin = project.properties["kotlinx.rpc.gradle.plugin"] == "true" val publishingExtension = project.extensions.findByType() val globalRootDir: String by extra -if (name.startsWith("kotlinx-rpc")) { // only public modules +if (isPublicModule) { if (publishingExtension == null) { apply(plugin = "maven-publish") } @@ -48,6 +46,9 @@ fun PublishingExtension.configurePublication() { if (javadocJar != null) { publication.artifact(javadocJar) } + + publication.setPublicArtifactId(project) + logger.info("Project ${project.name} -> Publication configured: ${publication.name}") } diff --git a/gradle-plugin/gradle-plugin-all/build.gradle.kts b/gradle-plugin/gradle-plugin-all/build.gradle.kts index 6981b29c..d3923214 100644 --- a/gradle-plugin/gradle-plugin-all/build.gradle.kts +++ b/gradle-plugin/gradle-plugin-all/build.gradle.kts @@ -5,15 +5,15 @@ description = "kotlinx.rpc Gradle Plugin" dependencies { - implementation(project(":kotlinx-rpc-gradle-plugin-api")) - implementation(project(":kotlinx-rpc-gradle-plugin-platform")) + implementation(projects.gradlePluginApi) + implementation(projects.gradlePluginPlatform) compileOnly(libs.kotlin.gradle.plugin) } gradlePlugin { plugins { - create("kotlinxRpcPlugin") { + create("plugin") { id = "org.jetbrains.kotlinx.rpc.plugin" displayName = "kotlinx.rpc Gradle Plugin" diff --git a/gradle-plugin/gradle-plugin-api/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt b/gradle-plugin/gradle-plugin-api/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt index 27c1f098..1a5d203a 100644 --- a/gradle-plugin/gradle-plugin-api/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt +++ b/gradle-plugin/gradle-plugin-api/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt @@ -11,8 +11,8 @@ import org.jetbrains.kotlin.gradle.utils.loadPropertyFromResources object RPCPluginConst { const val GROUP_ID = "org.jetbrains.kotlinx" - const val COMPILER_PLUGIN_MODULE = "${GROUP_ID}:kotlinx-rpc-compiler-plugin" - const val KSP_PLUGIN_MODULE = "${GROUP_ID}:kotlinx-rpc-ksp-plugin" + const val COMPILER_PLUGIN_MODULE = "${GROUP_ID}:compiler-plugin" + const val KSP_PLUGIN_MODULE = "${GROUP_ID}:ksp-plugin" const val KSP_PLUGIN_ID = "com.google.devtools.ksp" diff --git a/gradle-plugin/gradle-plugin-platform/build.gradle.kts b/gradle-plugin/gradle-plugin-platform/build.gradle.kts index bc6fd542..cd36e184 100644 --- a/gradle-plugin/gradle-plugin-platform/build.gradle.kts +++ b/gradle-plugin/gradle-plugin-platform/build.gradle.kts @@ -5,12 +5,12 @@ description = "kotlinx.rpc Platform Plugin" dependencies { - implementation(project(":kotlinx-rpc-gradle-plugin-api")) + implementation(projects.gradlePluginApi) } gradlePlugin { plugins { - create("kotlinxRpcPlatform") { + create("platform") { id = "org.jetbrains.kotlinx.rpc.platform" displayName = "kotlinx.rpc Platform Plugin" diff --git a/gradle-plugin/settings.gradle.kts b/gradle-plugin/settings.gradle.kts index c825ca9a..c638b77c 100644 --- a/gradle-plugin/settings.gradle.kts +++ b/gradle-plugin/settings.gradle.kts @@ -2,7 +2,9 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -rootProject.name = "kotlinx-rpc-gradle-plugin" +rootProject.name = "gradle-plugin" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { includeBuild("../gradle-conventions") diff --git a/gradle-settings-conventions/src/main/kotlin/compiler-specific-modules.settings.gradle.kts b/gradle-settings-conventions/src/main/kotlin/compiler-specific-modules.settings.gradle.kts index 26865db2..8b1c7cb7 100644 --- a/gradle-settings-conventions/src/main/kotlin/compiler-specific-modules.settings.gradle.kts +++ b/gradle-settings-conventions/src/main/kotlin/compiler-specific-modules.settings.gradle.kts @@ -47,15 +47,15 @@ val kotlinVersion = extra[CSM.KOTLIN_VERSION_EXTRA] as? String // IMPORTANT: it is expected that the root submodule is already included to the project, // otherwise the exception will be thrown fun includeCSM(dir: File, files: Array) { - val rootProjectDirName = dir.name + val rootProjectName = dir.name val submodules = files.filter { - it.isDirectory && it.name.startsWith(rootProjectDirName) + it.isDirectory && it.name.startsWith(rootProjectName) }.toMutableSet() - val core = submodules.singleOrNull { it.name == "$rootProjectDirName-core" } + val core = submodules.singleOrNull { it.name == "$rootProjectName-core" } if (core == null) { - error("Compiler Specific Module $rootProjectDirName should have `-core` module defined") + error("Compiler Specific Module $rootProjectName should have `-core` module defined") } val compilerSubmodules = submodules - core @@ -64,9 +64,9 @@ fun includeCSM(dir: File, files: Array) { .replace(File.separator, ":") .takeIf { it.isNotEmpty() }?.let { ":$it" } ?: "" - includePublic("$basePath:$rootProjectDirName-core") + includePublic("$basePath:$rootProjectName-core") - val prefix = "$rootProjectDirName-" + val prefix = "$rootProjectName-" val currentCompilerModuleDirName = compilerSubmodules .map { it.name to CompilerModuleSemVer(it.name, prefix) } @@ -76,13 +76,12 @@ fun includeCSM(dir: File, files: Array) { kotlinVersion.startsWith(semVer.version) }?.first ?: error(""" - Unable to find compiler specific submodule for $rootProjectDirName and Kotlin $kotlinVersion. + Unable to find compiler specific submodule for $rootProjectName and Kotlin $kotlinVersion. Available modules: ${compilerSubmodules.joinToString { it.name }} """.trimIndent()) includePublic("$basePath:$currentCompilerModuleDirName") - val rootProjectName = "$KOTLINX_RPC_PREFIX$rootProjectDirName" gradle.projectsLoaded { if (rootProject.name == rootProjectName) { return@projectsLoaded diff --git a/gradle-settings-conventions/src/main/kotlin/includePublic.kt b/gradle-settings-conventions/src/main/kotlin/includePublic.kt index 229cffea..25215601 100644 --- a/gradle-settings-conventions/src/main/kotlin/includePublic.kt +++ b/gradle-settings-conventions/src/main/kotlin/includePublic.kt @@ -5,31 +5,29 @@ @file:Suppress("unused", "detekt.MissingPackageDeclaration") import org.gradle.api.initialization.Settings -import java.io.File -import java.io.File.separator - -const val KOTLINX_RPC_PREFIX = "kotlinx-rpc-" +import org.gradle.kotlin.dsl.extra /** - * Includes a project by the given Gradle path and sets proper public name. - * - * Adds mandatory "kotlinx-rpc-" prefix to the project name, keeping the path as is. - * Example: - * ```kotlin - * // this declaration - * includePublic(":bom") - * - * // is the short form for this - * include(":kotlinx-rpc-bom") - * project(":kotlinx-rpc-bom").projectDir = file("./bom") - * ``` + * Includes a project by the given Gradle path and marks it as a public. */ fun Settings.includePublic(projectPath: String) { - require(projectPath.startsWith(":")) { "Project name should start with a colon: $projectPath" } + include(projectPath) - val fullProjectName = projectPath.replace(":", ":$KOTLINX_RPC_PREFIX") - val fullProjectPath = "." + projectPath.replace(":", separator) + val projectName = projectPath.substringAfterLast(":") + gradle.rootProject { + allprojects { + if (name == projectName) { + extra["isPublicModule"] = true + } + } + } +} - include(fullProjectName) - project(fullProjectName).projectDir = File(fullProjectPath) +/** + * Marks root project as public + */ +fun Settings.includeRootAsPublic() { + gradle.rootProject { + extra["isPublicModule"] = true + } } diff --git a/ksp-plugin/settings.gradle.kts b/ksp-plugin/settings.gradle.kts index 071bafb1..7220216d 100644 --- a/ksp-plugin/settings.gradle.kts +++ b/ksp-plugin/settings.gradle.kts @@ -2,7 +2,9 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -rootProject.name = "kotlinx-rpc-ksp-plugin" +rootProject.name = "ksp-plugin" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { includeBuild("../gradle-conventions") @@ -12,3 +14,5 @@ pluginManagement { plugins { id("settings-conventions") } + +includeRootAsPublic() diff --git a/runtime/api/kotlinx-rpc-runtime.api b/runtime/api/runtime.api similarity index 100% rename from runtime/api/kotlinx-rpc-runtime.api rename to runtime/api/runtime.api diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts index 09153c0b..19bf8937 100644 --- a/runtime/build.gradle.kts +++ b/runtime/build.gradle.kts @@ -18,23 +18,23 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-api")) + api(projects.runtime.runtimeApi) - implementation(project(":kotlinx-rpc-utils")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + implementation(projects.utils) + implementation(projects.runtime.runtimeSerialization) api(libs.coroutines.core) implementation(libs.serialization.core) implementation(libs.kotlin.reflect) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-logging")) + implementation(projects.runtime.runtimeLogging) } } commonTest { dependencies { - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-client")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-server")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + implementation(projects.runtime.runtimeClient) + implementation(projects.runtime.runtimeServer) + implementation(projects.runtime.runtimeSerialization) implementation(libs.kotlin.test) implementation(libs.coroutines.test) @@ -49,10 +49,10 @@ kotlin { val jvmTest by getting { dependencies { - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-test")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization:kotlinx-rpc-runtime-serialization-json")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization:kotlinx-rpc-runtime-serialization-cbor")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization:kotlinx-rpc-runtime-serialization-protobuf")) + implementation(projects.runtime.runtimeTest) + implementation(projects.runtime.runtimeSerialization.runtimeSerializationJson) + implementation(projects.runtime.runtimeSerialization.runtimeSerializationCbor) + implementation(projects.runtime.runtimeSerialization.runtimeSerializationProtobuf) implementation(libs.logback.classic) } @@ -92,10 +92,10 @@ tasks.create("moveToGold") { } } -evaluationDependsOn(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-test") +evaluationDependsOn(":runtime:runtime-test") // otherwise it complains and fails the build on 1.8.* -val jsProductionLibraryCompileSync: TaskProvider = project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-test") +val jsProductionLibraryCompileSync: TaskProvider = project(":runtime:runtime-test") .tasks.named("jsProductionLibraryCompileSync") tasks.named("jsBrowserTest") { diff --git a/runtime/runtime-api/api/kotlinx-rpc-runtime-api.api b/runtime/runtime-api/api/runtime-api.api similarity index 100% rename from runtime/runtime-api/api/kotlinx-rpc-runtime-api.api rename to runtime/runtime-api/api/runtime-api.api diff --git a/runtime/runtime-client/api/kotlinx-rpc-runtime-client.api b/runtime/runtime-client/api/runtime-client.api similarity index 100% rename from runtime/runtime-client/api/kotlinx-rpc-runtime-client.api rename to runtime/runtime-client/api/runtime-client.api diff --git a/runtime/runtime-client/build.gradle.kts b/runtime/runtime-client/build.gradle.kts index dfaf4e93..e96c32ad 100644 --- a/runtime/runtime-client/build.gradle.kts +++ b/runtime/runtime-client/build.gradle.kts @@ -12,15 +12,15 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime")) - implementation(project(":kotlinx-rpc-utils")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + api(projects.runtime) + implementation(projects.utils) + implementation(projects.runtime.runtimeSerialization) implementation(libs.coroutines.core) implementation(libs.serialization.core) implementation(libs.kotlin.reflect) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-logging")) + implementation(projects.runtime.runtimeLogging) } } } diff --git a/runtime/runtime-logging/api/kotlinx-rpc-runtime-logging.api b/runtime/runtime-logging/api/runtime-logging.api similarity index 100% rename from runtime/runtime-logging/api/kotlinx-rpc-runtime-logging.api rename to runtime/runtime-logging/api/runtime-logging.api diff --git a/runtime/runtime-logging/build.gradle.kts b/runtime/runtime-logging/build.gradle.kts index ef2caaa1..5b7f8148 100644 --- a/runtime/runtime-logging/build.gradle.kts +++ b/runtime/runtime-logging/build.gradle.kts @@ -11,7 +11,7 @@ kotlin { commonMain { dependencies { implementation(libs.kotlin.logging) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-api")) + implementation(projects.runtime.runtimeApi) } } } diff --git a/runtime/runtime-serialization/api/kotlinx-rpc-runtime-serialization.api b/runtime/runtime-serialization/api/runtime-serialization.api similarity index 100% rename from runtime/runtime-serialization/api/kotlinx-rpc-runtime-serialization.api rename to runtime/runtime-serialization/api/runtime-serialization.api diff --git a/runtime/runtime-serialization/build.gradle.kts b/runtime/runtime-serialization/build.gradle.kts index a5cc5262..89a7a2d2 100644 --- a/runtime/runtime-serialization/build.gradle.kts +++ b/runtime/runtime-serialization/build.gradle.kts @@ -12,7 +12,7 @@ kotlin { dependencies { api(libs.serialization.core) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-api")) + implementation(projects.runtime.runtimeApi) } } } diff --git a/runtime/runtime-serialization/runtime-serialization-cbor/api/kotlinx-rpc-runtime-serialization-cbor.api b/runtime/runtime-serialization/runtime-serialization-cbor/api/runtime-serialization-cbor.api similarity index 100% rename from runtime/runtime-serialization/runtime-serialization-cbor/api/kotlinx-rpc-runtime-serialization-cbor.api rename to runtime/runtime-serialization/runtime-serialization-cbor/api/runtime-serialization-cbor.api diff --git a/runtime/runtime-serialization/runtime-serialization-cbor/build.gradle.kts b/runtime/runtime-serialization/runtime-serialization-cbor/build.gradle.kts index 27ce2434..bac4c375 100644 --- a/runtime/runtime-serialization/runtime-serialization-cbor/build.gradle.kts +++ b/runtime/runtime-serialization/runtime-serialization-cbor/build.gradle.kts @@ -10,7 +10,7 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + api(projects.runtime.runtimeSerialization) api(libs.serialization.cbor) } } diff --git a/runtime/runtime-serialization/runtime-serialization-json/api/kotlinx-rpc-runtime-serialization-json.api b/runtime/runtime-serialization/runtime-serialization-json/api/runtime-serialization-json.api similarity index 100% rename from runtime/runtime-serialization/runtime-serialization-json/api/kotlinx-rpc-runtime-serialization-json.api rename to runtime/runtime-serialization/runtime-serialization-json/api/runtime-serialization-json.api diff --git a/runtime/runtime-serialization/runtime-serialization-json/build.gradle.kts b/runtime/runtime-serialization/runtime-serialization-json/build.gradle.kts index f80bcc0c..972bf781 100644 --- a/runtime/runtime-serialization/runtime-serialization-json/build.gradle.kts +++ b/runtime/runtime-serialization/runtime-serialization-json/build.gradle.kts @@ -10,7 +10,7 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + api(projects.runtime.runtimeSerialization) api(libs.serialization.json) } } diff --git a/runtime/runtime-serialization/runtime-serialization-protobuf/api/kotlinx-rpc-runtime-serialization-protobuf.api b/runtime/runtime-serialization/runtime-serialization-protobuf/api/runtime-serialization-protobuf.api similarity index 100% rename from runtime/runtime-serialization/runtime-serialization-protobuf/api/kotlinx-rpc-runtime-serialization-protobuf.api rename to runtime/runtime-serialization/runtime-serialization-protobuf/api/runtime-serialization-protobuf.api diff --git a/runtime/runtime-serialization/runtime-serialization-protobuf/build.gradle.kts b/runtime/runtime-serialization/runtime-serialization-protobuf/build.gradle.kts index e68d3c67..b7b7e2fd 100644 --- a/runtime/runtime-serialization/runtime-serialization-protobuf/build.gradle.kts +++ b/runtime/runtime-serialization/runtime-serialization-protobuf/build.gradle.kts @@ -10,7 +10,7 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + api(projects.runtime.runtimeSerialization) api(libs.serialization.protobuf) } } diff --git a/runtime/runtime-server/api/kotlinx-rpc-runtime-server.api b/runtime/runtime-server/api/runtime-server.api similarity index 100% rename from runtime/runtime-server/api/kotlinx-rpc-runtime-server.api rename to runtime/runtime-server/api/runtime-server.api diff --git a/runtime/runtime-server/build.gradle.kts b/runtime/runtime-server/build.gradle.kts index f6cf6d06..90627ae8 100644 --- a/runtime/runtime-server/build.gradle.kts +++ b/runtime/runtime-server/build.gradle.kts @@ -12,11 +12,11 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime")) + api(projects.runtime) - implementation(project(":kotlinx-rpc-utils")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-logging")) + implementation(projects.utils) + implementation(projects.runtime.runtimeSerialization) + implementation(projects.runtime.runtimeLogging) implementation(libs.coroutines.core) implementation(libs.serialization.core) diff --git a/runtime/runtime-test/build.gradle.kts b/runtime/runtime-test/build.gradle.kts index f05496af..14f53f31 100644 --- a/runtime/runtime-test/build.gradle.kts +++ b/runtime/runtime-test/build.gradle.kts @@ -15,11 +15,11 @@ kotlin { sourceSets { val jvmMain by getting { dependencies { - api(project(":kotlinx-rpc-runtime")) - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-server")) - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-client")) + api(projects.runtime) + api(projects.runtime.runtimeServer) + api(projects.runtime.runtimeClient) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization:kotlinx-rpc-runtime-serialization-json")) + implementation(projects.runtime.runtimeSerialization.runtimeSerializationJson) implementation(libs.coroutines.core) implementation(libs.serialization.core) diff --git a/settings.gradle.kts b/settings.gradle.kts index 22e6e98c..41253581 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,6 +2,10 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ +rootProject.name = "kotlinx-rpc" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + pluginManagement { includeBuild("gradle-settings-conventions") includeBuild("gradle-conventions") @@ -32,8 +36,6 @@ dependencyResolutionManagement { includeBuild("ksp-plugin") } -rootProject.name = "kotlinx-rpc" - includePublic(":bom") includePublic(":utils") diff --git a/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts b/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts index d320ff8d..8dbccce9 100644 --- a/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts +++ b/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts @@ -12,10 +12,10 @@ plugins { } dependencies { - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-client")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-server")) + implementation(projects.runtime.runtimeClient) + implementation(projects.runtime.runtimeServer) - implementation(project(":tests:codegen-tests:codegen-tests-mpp")) + implementation(projects.tests.codegenTests.codegenTestsMpp) implementation(libs.kotlin.stdlib) implementation(libs.kotlin.reflect) diff --git a/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts b/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts index d918d9ab..c6d080a5 100644 --- a/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts +++ b/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts @@ -18,9 +18,9 @@ kotlin { implementation(libs.serialization.core) implementation(libs.kotlin.reflect) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-logging")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-client")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-server")) + implementation(projects.runtime.runtimeLogging) + implementation(projects.runtime.runtimeClient) + implementation(projects.runtime.runtimeServer) } } diff --git a/transport/transport-ktor/api/kotlinx-rpc-transport-ktor.api b/transport/transport-ktor/api/transport-ktor.api similarity index 100% rename from transport/transport-ktor/api/kotlinx-rpc-transport-ktor.api rename to transport/transport-ktor/api/transport-ktor.api diff --git a/transport/transport-ktor/build.gradle.kts b/transport/transport-ktor/build.gradle.kts index bc206e99..1585fb58 100644 --- a/transport/transport-ktor/build.gradle.kts +++ b/transport/transport-ktor/build.gradle.kts @@ -13,8 +13,8 @@ kotlin { sourceSets { commonMain { dependencies { - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-server")) - implementation(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization:kotlinx-rpc-runtime-serialization-json")) + implementation(projects.runtime.runtimeServer) + implementation(projects.runtime.runtimeSerialization.runtimeSerializationJson) implementation(libs.ktor.websockets) implementation(libs.coroutines.core) @@ -24,8 +24,8 @@ kotlin { } val jvmTest by getting { dependencies { - implementation(project(":kotlinx-rpc-transport:kotlinx-rpc-transport-ktor:kotlinx-rpc-transport-ktor-server")) - implementation(project(":kotlinx-rpc-transport:kotlinx-rpc-transport-ktor:kotlinx-rpc-transport-ktor-client")) + implementation(projects.transport.transportKtor.transportKtorServer) + implementation(projects.transport.transportKtor.transportKtorClient) implementation(libs.kotlin.test) implementation(libs.ktor.server.netty) diff --git a/transport/transport-ktor/transport-ktor-client/api/kotlinx-rpc-transport-ktor-client.api b/transport/transport-ktor/transport-ktor-client/api/transport-ktor-client.api similarity index 100% rename from transport/transport-ktor/transport-ktor-client/api/kotlinx-rpc-transport-ktor-client.api rename to transport/transport-ktor/transport-ktor-client/api/transport-ktor-client.api diff --git a/transport/transport-ktor/transport-ktor-client/build.gradle.kts b/transport/transport-ktor/transport-ktor-client/build.gradle.kts index 3e9e448d..128e953b 100644 --- a/transport/transport-ktor/transport-ktor-client/build.gradle.kts +++ b/transport/transport-ktor/transport-ktor-client/build.gradle.kts @@ -10,9 +10,9 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-client")) - api(project(":kotlinx-rpc-transport:kotlinx-rpc-transport-ktor")) - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + api(projects.runtime.runtimeClient) + api(projects.runtime.runtimeSerialization) + api(projects.transport.transportKtor) api(libs.ktor.client.core) api(libs.ktor.client.websockets) diff --git a/transport/transport-ktor/transport-ktor-server/api/kotlinx-rpc-transport-ktor-server.api b/transport/transport-ktor/transport-ktor-server/api/transport-ktor-server.api similarity index 100% rename from transport/transport-ktor/transport-ktor-server/api/kotlinx-rpc-transport-ktor-server.api rename to transport/transport-ktor/transport-ktor-server/api/transport-ktor-server.api diff --git a/transport/transport-ktor/transport-ktor-server/build.gradle.kts b/transport/transport-ktor/transport-ktor-server/build.gradle.kts index 050ac80a..7a91d2a0 100644 --- a/transport/transport-ktor/transport-ktor-server/build.gradle.kts +++ b/transport/transport-ktor/transport-ktor-server/build.gradle.kts @@ -10,9 +10,9 @@ kotlin { sourceSets { val jvmMain by getting { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-server")) - api(project(":kotlinx-rpc-transport:kotlinx-rpc-transport-ktor")) - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-serialization")) + api(projects.runtime.runtimeServer) + api(projects.runtime.runtimeSerialization) + api(projects.transport.transportKtor) api(libs.ktor.server.core) api(libs.ktor.server.websockets) diff --git a/utils/build.gradle.kts b/utils/build.gradle.kts index b9429e6a..03d65476 100644 --- a/utils/build.gradle.kts +++ b/utils/build.gradle.kts @@ -13,7 +13,7 @@ kotlin { sourceSets { commonMain { dependencies { - api(project(":kotlinx-rpc-runtime:kotlinx-rpc-runtime-api")) + api(projects.runtime.runtimeApi) implementation(libs.serialization.core) implementation(libs.coroutines.core)