diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1912598e..177f8b5f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ env: ALGOLIA_INDEX_NAME: 'prod_kotlin_rpc' ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}' CONFIG_JSON_PRODUCT: 'kotlinx-rpc' - CONFIG_JSON_VERSION: '0.1.0' + CONFIG_JSON_VERSION: '0.2.1' jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e418525c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +# 0.2.1 +> Published 1 July 2024 + +### Breaking changes +Release contains breaking changes, see the [migration guide](https://kotlin.github.io/kotlinx-rpc/0-2-0.html) + +* Update the project structure to use a new versioning by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/92 +* Consistent module structure by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/114 +* KRPC-63 Reorganize modules into a logical structure by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/110 + +### Features +* KRPC-62 WebSocketSession KtorRPCClient by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/107 + +### Bug fixes +* Fix typo by @fatalistt in https://github.com/Kotlin/kotlinx-rpc/pull/76 +* Fix README by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/79 +* Remove todos from repo links by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/85 +* Fix typo in README.md by @zhelenskiy in https://github.com/Kotlin/kotlinx-rpc/pull/87 +* Fix KDoc reference by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/103 +* Fix native targets compiler plugins (#93) by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/112 + +### Deprecations +* KRPC-59 streamScoped has internal package by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/104 + +### Documentation +* Updated links on the docs website by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/71 +* Added search indexes publication to Algolia action by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/73 +* Fix algolia artifact in GH Actions by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/80 +* Docs: Add structure to existing content by @vnikolova in https://github.com/Kotlin/kotlinx-rpc/pull/86 +* Added build and test docs on PR by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/97 +* Fixed GH Actions for docs by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/99 +* Disable docs website autoupdate by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/108 +* KRPC-60 Update docs to match the new versioning scheme by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/109 + +### Infra +* Update version to 0.1.1-SNAPSHOT by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/64 +* Version updates by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/72 +* Signing and Publication by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/74 +* IDEA. Issue links by @turansky in https://github.com/Kotlin/kotlinx-rpc/pull/96 +* IDEA. Vector icon by @turansky in https://github.com/Kotlin/kotlinx-rpc/pull/98 +* KRPC-71 Type-safe project accessors by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/106 + +## New Contributors +* @jvmusin made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/69 +* @fatalistt made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/76 +* @zhelenskiy made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/87 +* @turansky made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/96 +* @vnikolova made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/86 + +**Full Changelog**: https://github.com/Kotlin/kotlinx-rpc/compare/0.1.0...0.2.1 diff --git a/README.md b/README.md index 05514512..f06551ce 100644 --- a/README.md +++ b/README.md @@ -88,15 +88,6 @@ Check out our [getting started guide](https://kotlin.github.io/kotlinx-rpc) for and some of them will contain service declarations, thus using code generation, while others will only consume them. - The `com.google.devtools.ksp` is required by the library. Corresponding configurations will be set up automatically by `org.jetbrains.kotlinx.rpc.plugin` plugin. -To use the `kotlinx.rpc` Gradle plugins, you need to add the following repositories in the `settings.gradle.kts` file: -```kotlin -pluginManagement { - repositories { - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") - gradlePluginPortal() - } -} -``` Example of plugins setup in a project's `build.gradle.kts`: ```kotlin // build.gradle.kts @@ -104,30 +95,29 @@ plugins { kotlin("jvm") version "1.9.24" kotlin("plugin.serialization") version "1.9.24" id("com.google.devtools.ksp") version "1.9.24-1.0.20" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.1.0" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.1" } ``` ### Runtime dependencies -To use `kotlinx.rpc` runtime dependencies, you need to add our Space repository to the list of project repositories: +To use `kotlinx.rpc` runtime dependencies, add Maven Central to the list of your repositories: ```kotlin repositories { - maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") - mavenCentral() // for other dependencies, e.g. Ktor + mavenCentral() } ``` And now you can add dependencies to your project: ```kotlin dependencies { // client API - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client") // server API - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server") // serialization module. also, protobuf and cbor are available - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-serialization-json") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json") // transport implementation for Ktor - implementation("org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-client") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server") // Ktor API implementation("io.ktor:ktor-client-cio-jvm:$ktor_version") @@ -164,17 +154,17 @@ based on the project's Kotlin version: ```kotlin plugins { kotlin("jvm") version "1.9.24" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.1.0" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.1" } dependencies { - // version 0.1.0 is set by the Gradle plugin - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime") + // version 0.2.1 is set by the Gradle plugin + implementation("org.jetbrains.kotlinx:kotlinx-rpc-core") } ``` For a full compatibility checklist, -see [Releases](https://kotlin.github.io/kotlinx-rpc/releases.html). +see [Versions](https://kotlin.github.io/kotlinx-rpc/versions.html). ## JetBrains Product diff --git a/docs/pages/kotlinx-rpc/help-versions.json b/docs/pages/kotlinx-rpc/help-versions.json index e81277ce..e94ef1cb 100644 --- a/docs/pages/kotlinx-rpc/help-versions.json +++ b/docs/pages/kotlinx-rpc/help-versions.json @@ -1,3 +1,3 @@ [ - {"version":"0.1.0","url":"/kotlinx-rpc/0.1.0/","isCurrent":true} + {"version":"0.2.1","url":"/kotlinx-rpc/0.2.1/","isCurrent":true} ] diff --git a/docs/pages/kotlinx-rpc/rpc.tree b/docs/pages/kotlinx-rpc/rpc.tree index da487e1e..78de9b6b 100644 --- a/docs/pages/kotlinx-rpc/rpc.tree +++ b/docs/pages/kotlinx-rpc/rpc.tree @@ -24,5 +24,8 @@ - + + + + \ No newline at end of file diff --git a/docs/pages/kotlinx-rpc/topics/0-2-1.topic b/docs/pages/kotlinx-rpc/topics/0-2-1.topic new file mode 100644 index 00000000..316bbfe3 --- /dev/null +++ b/docs/pages/kotlinx-rpc/topics/0-2-1.topic @@ -0,0 +1,142 @@ + + + + + + +

+ Version 0.2.1 introduces changes that are not compatible with the previous 0.1.0 release. + This guide contains a full list of all incompatible changes. +

+ + + Most of the artifacts were renamed and restructured to + properly reflect what parts of the library they contain. + Below is the complete list of new names and changes. + Note that only artifactId is shown; the groupId remains unchanged: + +
  • + kotlinx-rpc-runtime +

    Renamed to kotlinx-rpc-core

    +
  • +
  • + kotlinx-rpc-runtime +

    Declarations moved to kotlinx-rpc-utils

    +
  • +
  • + kotlinx-rpc-runtime-client +

    Renamed to kotlinx-rpc-krpc-client

    +
  • +
  • + kotlinx-rpc-runtime-server +

    Renamed to kotlinx-rpc-krpc-server

    +
  • +
  • + kotlinx-rpc-runtime-logging +

    Renamed to kotlinx-rpc-krpc-logging

    +
  • +
  • + kotlinx-rpc-runtime-test +

    Renamed to kotlinx-rpc-krpc-test

    +
  • +
  • + kotlinx-rpc-runtime-serialization +

    Renamed to kotlinx-rpc-krpc-serialization-core

    +
  • +
  • + kotlinx-rpc-runtime-serialization-json +

    Renamed to kotlinx-rpc-krpc-serialization-json

    +
  • +
  • + kotlinx-rpc-runtime-serialization-cbor +

    Renamed to kotlinx-rpc-krpc-serialization-cbor

    +
  • +
  • + kotlinx-rpc-runtime-serialization-protobuf +

    Renamed to kotlinx-rpc-krpc-serialization-protobuf

    +
  • +
  • + kotlinx-rpc-transport-ktor +

    Renamed to kotlinx-rpc-krpc-ktor-core

    +
  • +
  • + kotlinx-rpc-transport-ktor-client +

    Renamed to kotlinx-rpc-krpc-ktor-client

    +
  • +
  • + kotlinx-rpc-transport-ktor-server +

    Renamed to kotlinx-rpc-krpc-ktor-server

    +
  • +
    +
    + + +

    + Our version scheme has changed. + Prior to this release, all artifacts were versioned with the Kotlin prefix for multiple versions of Kotlin: +

    + + org.jetbrains.kotlinx.kotlinx-rpc-runtime:1.9.24-0.1.0 + +

    + This approach proved challenging for the third-party library developers, + as it was not clear which version they should use for their artifacts. +

    +

    + From now on, only code-generation artifacts will contain the explicit Kotlin version. + All other artifacts will use a simplified versioning format like this: +

    + + org.jetbrains.kotlinx.kotlinx-rpc-core:0.2.1 + +

    + Our gradle plugin is still capable of including proper versions of artifacts for you. + Code-generation artifacts are added automatically and should not be referred to directly. +

    +

    + To know more about versioning, see . +

    +
    + + +

    + Version 0.2.1 is being released to the Maven Central repository instead of Space, like it was previously. + In your gradle build scripts (build.gradle.kts) you need to update the repository to ensure you consume the correct artifacts. +

    +

    Old configuration:

    + + repositories { + maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") + } + +

    New configuration:

    + + repositories { + mavenCentral() + } + +

    + This also affects Gradle plugins. + Now they are being published to the Gradle Plugin Portal. + That means that the old configuration block in settings.gradle.kts + is no longer needed. +

    +

    You can remove this block:

    + + pluginManagement { + repositories { + maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") + } + } + + + If you also had gradlePluginPortal() defined in pluginManagement + repositories, you still can remove the whole block completely, as the plugin portal repository is enabled by default. + +
    +
    diff --git a/docs/pages/kotlinx-rpc/topics/get-started.topic b/docs/pages/kotlinx-rpc/topics/get-started.topic index 67e37924..1b2652ec 100644 --- a/docs/pages/kotlinx-rpc/topics/get-started.topic +++ b/docs/pages/kotlinx-rpc/topics/get-started.topic @@ -52,32 +52,13 @@ href="https://docs.gradle.org/current/userguide/declaring_repositories.html">repository from which they will be consumed.

    - Add the following repositories in your build.gradle.kts file: + Add the following repository in your build.gradle.kts file:

    repositories { - // for kotlinx.rpc dependencies - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") - // for other dependencies, like Ktor mavenCentral() } - -

    In your settings.gradle.kts file, specify a - repository for - plugins - to be consumed from:

    - - - pluginManagement { - repositories { - // kotlinx.rpc plugins will be downloaded from here - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") - // other plugins, like Kotlin, will be downloaded from here - gradlePluginPortal() - } - } -

    kotlinx.rpc provides you with @@ -90,8 +71,8 @@ dependencies { // example kotlinx.rpc artifacts - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client:%kotlinx-rpc-version%") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server:%kotlinx-rpc-version%") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:%kotlinx-rpc-version%") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:%kotlinx-rpc-version%") }

    This adds the APIs needed to work with both client and server code using kotlinx.rpc.

    @@ -106,12 +87,12 @@ sourceSets { iosMain { // let's say that we have code for the client in iosMain sources set - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client:%kotlinx-rpc-version%") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:%kotlinx-rpc-version%") } jvmMain { // let's say that we have code for the server in jvmMain sources set - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server:%kotlinx-rpc-version%") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:%kotlinx-rpc-version%") } } } @@ -151,7 +132,7 @@ id("org.jetbrains.kotlinx.rpc.plugin") version "%kotlinx-rpc-version%" } -

    To learn more about versioning, see .

    +

    To learn more about versioning, see .

    diff --git a/docs/pages/kotlinx-rpc/topics/plugins.topic b/docs/pages/kotlinx-rpc/topics/plugins.topic index 9c4d1279..b9ccb15d 100644 --- a/docs/pages/kotlinx-rpc/topics/plugins.topic +++ b/docs/pages/kotlinx-rpc/topics/plugins.topic @@ -42,8 +42,8 @@ dependencies { // versions are set automatically to %kotlinx-rpc-version% - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server") }

    Using this plugin with version catalogs, your code can be rewritten like this:

    @@ -54,7 +54,7 @@ kotlinx-rpc-core = "%kotlinx-rpc-version%"; [libraries] - kotlinx-rpc-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-client" } + kotlinx-rpc-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-client" } [plugins] kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform"; version.ref = "kotlinx-rpc-core"; } @@ -96,8 +96,8 @@ } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server") }
    diff --git a/docs/pages/kotlinx-rpc/topics/releases.topic b/docs/pages/kotlinx-rpc/topics/versions.topic similarity index 97% rename from docs/pages/kotlinx-rpc/topics/releases.topic rename to docs/pages/kotlinx-rpc/topics/versions.topic index 3fba126a..104679eb 100644 --- a/docs/pages/kotlinx-rpc/topics/releases.topic +++ b/docs/pages/kotlinx-rpc/topics/versions.topic @@ -7,7 +7,7 @@ SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd"> + title="Versions" id="versions">

    As kotlinx.rpc uses Kotlin compiler plugin and KSP plugins, we rely on internal functionality that may change over time with any new Kotlin version. To prevent the library from breaking with an incompatible Kotlin version, @@ -56,8 +56,8 @@ dependencies { // for kotlinx.rpc runtime dependencies, // Gradle plugin sets version %kotlinx-rpc-version% - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server") } diff --git a/docs/pages/kotlinx-rpc/v.list b/docs/pages/kotlinx-rpc/v.list index 938df289..d5f4fcd4 100644 --- a/docs/pages/kotlinx-rpc/v.list +++ b/docs/pages/kotlinx-rpc/v.list @@ -14,7 +14,7 @@ - + diff --git a/docs/pages/kotlinx-rpc/writerside.cfg b/docs/pages/kotlinx-rpc/writerside.cfg index aebbd79e..a4ad3435 100644 --- a/docs/pages/kotlinx-rpc/writerside.cfg +++ b/docs/pages/kotlinx-rpc/writerside.cfg @@ -12,5 +12,5 @@ - + \ No newline at end of file diff --git a/gradle-conventions/conventions-utils/src/main/kotlin/util/metaTask.kt b/gradle-conventions/conventions-utils/src/main/kotlin/util/metaTask.kt index 6077cf47..b8a52557 100644 --- a/gradle-conventions/conventions-utils/src/main/kotlin/util/metaTask.kt +++ b/gradle-conventions/conventions-utils/src/main/kotlin/util/metaTask.kt @@ -6,15 +6,19 @@ package util import org.gradle.api.Project -fun Project.configureMetaTasks(vararg taskNames: String) { - configureMetaTasks(taskNames.toList()) +fun Project.configureMetaTasks(vararg taskNames: String, excludeSubprojects: List = emptyList()) { + configureMetaTasks(taskNames.toList(), excludeSubprojects) } -fun Project.configureMetaTasks(taskNames: List) { +fun Project.configureMetaTasks(taskNames: List, excludeSubprojects: List = emptyList()) { val root = this val metaSet = taskNames.toSet() subprojects.forEach { + if (it.name in excludeSubprojects) { + return@forEach + } + it.tasks.all { val subtask = this diff --git a/gradle-conventions/src/main/kotlin/conventions-jvm.gradle.kts b/gradle-conventions/src/main/kotlin/conventions-jvm.gradle.kts index ff2d4026..e1866acb 100644 --- a/gradle-conventions/src/main/kotlin/conventions-jvm.gradle.kts +++ b/gradle-conventions/src/main/kotlin/conventions-jvm.gradle.kts @@ -11,6 +11,10 @@ plugins { id("conventions-kotlin-version-jvm") } +java { + withSourcesJar() +} + configure { jvmToolchain { languageVersion.set(JavaLanguageVersion.of(8)) diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 2ff91bba..3dd39f18 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -3,49 +3,91 @@ */ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode -import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension -import util.configureMetaTasks plugins { - alias(libs.plugins.conventions.jvm) apply false - alias(libs.plugins.conventions.gradle.publish) apply false - alias(libs.plugins.gradle.kotlin.dsl) apply false - alias(libs.plugins.gradle.plugin.publish) apply false + alias(libs.plugins.conventions.jvm) + alias(libs.plugins.conventions.gradle.publish) + alias(libs.plugins.gradle.kotlin.dsl) + alias(libs.plugins.gradle.plugin.publish) } -subprojects { - group = "org.jetbrains.kotlinx" - version = rootProject.libs.versions.kotlinx.rpc.get() +group = "org.jetbrains.kotlinx" +version = rootProject.libs.versions.kotlinx.rpc.get() - fun alias(notation: Provider): String { - return notation.get().pluginId +kotlin { + explicitApi = ExplicitApiMode.Disabled +} + +dependencies { + compileOnly(libs.kotlin.gradle.plugin) +} + +// This block is needed to show plugin tasks on --dry-run +// and to not run task actions on ":plugin:task --dry-run". +// The bug is known since June 2017 and still not fixed. +// The workaround used below is described here: https://github.com/gradle/gradle/issues/2517#issuecomment-437490287 +if (gradle.parent != null && gradle.parent!!.startParameter.isDryRun) { + gradle.startParameter.isDryRun = true +} + +gradlePlugin { + plugins { + create("plugin") { + id = "org.jetbrains.kotlinx.rpc.plugin" + + displayName = "kotlinx.rpc Gradle Plugin" + implementationClass = "kotlinx.rpc.RPCGradlePlugin" + description = """ + The plugin ensures correct RPC configurations for your project, that will allow proper code generation. + + Additionally, it enforces proper artifacts versions for your project, depending on your Kotlin version. + Resulting versions of the kotlinx.rpc dependencies will be 'kotlinVersion-kotlinxRpcVersion', for example '1.9.24-0.2.1', where '0.2.1' is the kotlinx.rpc version. + """.trimIndent() + } } - afterEvaluate { - plugins.apply(alias(rootProject.libs.plugins.conventions.jvm)) + plugins { + create("platform") { + id = "org.jetbrains.kotlinx.rpc.platform" - configure { - explicitApi = ExplicitApiMode.Disabled + displayName = "kotlinx.rpc Platform Plugin" + implementationClass = "kotlinx.rpc.RPCPlatformPlugin" + description = """ + The plugin enforces proper artifacts versions for your project, depending on your Kotlin version. + Resulting versions of the kotlinx.rpc dependencies will be 'kotlinVersion-kotlinxRpcVersion', for example '1.9.24-0.2.1', where '0.2.1' is the kotlinx.rpc version. + """.trimIndent() } } - plugins.apply(alias(rootProject.libs.plugins.gradle.kotlin.dsl)) - plugins.apply(alias(rootProject.libs.plugins.conventions.gradle.publish)) - - // This block is needed to show plugin tasks on --dry-run - // and to not run task actions on ":plugin:task --dry-run". - // The bug is known since June 2017 and still not fixed. - // The workaround used below is described here: https://github.com/gradle/gradle/issues/2517#issuecomment-437490287 - if (gradle.parent != null && gradle.parent!!.startParameter.isDryRun) { - gradle.startParameter.isDryRun = true +} + +abstract class GeneratePluginVersionTask @Inject constructor( + @get:Input val pluginVersion: String, + @get:OutputDirectory val sourcesDir: File +) : DefaultTask() { + @TaskAction + fun generate() { + val sourceFile = File(sourcesDir, "PluginVersion.kt") + + sourceFile.writeText( + """ + package kotlinx.rpc + + const val PLUGIN_VERSION = "$pluginVersion" + + """.trimIndent() + ) } } -configureMetaTasks( - "publishAllPublicationsToBuildRepoRepository", // publish to locally (to the build/repo folder) - "publishAllPublicationsToSpaceRepository", // publish to Space - "publishPlugins", // publish to Gradle Plugin Portal - "publishToMavenLocal", // for local plugin development - "validatePlugins", // plugin validation - "detekt", // run Detekt tasks - "clean", -) +val sourcesDir = File(project.layout.buildDirectory.asFile.get(), "generated-sources/pluginVersion") + +val generatePluginVersionTask = + tasks.register("generatePluginVersion", version.toString(), sourcesDir) + +kotlin { + sourceSets { + main { + kotlin.srcDir(generatePluginVersionTask.map { it.sourcesDir }) + } + } +} diff --git a/gradle-plugin/gradle-plugin-all/build.gradle.kts b/gradle-plugin/gradle-plugin-all/build.gradle.kts deleted file mode 100644 index d3923214..00000000 --- a/gradle-plugin/gradle-plugin-all/build.gradle.kts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -description = "kotlinx.rpc Gradle Plugin" - -dependencies { - implementation(projects.gradlePluginApi) - implementation(projects.gradlePluginPlatform) - - compileOnly(libs.kotlin.gradle.plugin) -} - -gradlePlugin { - plugins { - create("plugin") { - id = "org.jetbrains.kotlinx.rpc.plugin" - - displayName = "kotlinx.rpc Gradle Plugin" - implementationClass = "kotlinx.rpc.RPCGradlePlugin" - description = """ - The plugin ensures correct RPC configurations for your project, that will allow proper code generation. - - Additionally, it enforces proper artifacts versions for your project, depending on your Kotlin version. - Resulting versions of the kotlinx.rpc dependencies will be 'kotlinVersion-kotlinxRpcVersion', for example '1.9.24-0.1.0', where '0.1.0' is the kotlinx.rpc version. - """.trimIndent() - } - } -} diff --git a/gradle-plugin/gradle-plugin-api/build.gradle.kts b/gradle-plugin/gradle-plugin-api/build.gradle.kts deleted file mode 100644 index f2ee44b6..00000000 --- a/gradle-plugin/gradle-plugin-api/build.gradle.kts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -dependencies { - compileOnly(libs.kotlin.gradle.plugin) -} - -abstract class GeneratePluginVersionTask @Inject constructor( - @get:Input val pluginVersion: String, - @get:OutputDirectory val sourcesDir: File -) : DefaultTask() { - @TaskAction - fun generate() { - val sourceFile = File(sourcesDir, "PluginVersion.kt") - - sourceFile.writeText( - """ - package kotlinx.rpc - - const val PLUGIN_VERSION = "$pluginVersion" - - """.trimIndent() - ) - } -} - -val sourcesDir = File(project.layout.buildDirectory.asFile.get(), "generated-sources/pluginVersion") - -val generatePluginVersionTask = - tasks.register("generatePluginVersion", version.toString(), sourcesDir) - -kotlin { - sourceSets { - main { - kotlin.srcDir(generatePluginVersionTask.map { it.sourcesDir }) - } - } -} diff --git a/gradle-plugin/gradle-plugin-platform/build.gradle.kts b/gradle-plugin/gradle-plugin-platform/build.gradle.kts deleted file mode 100644 index cd36e184..00000000 --- a/gradle-plugin/gradle-plugin-platform/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -description = "kotlinx.rpc Platform Plugin" - -dependencies { - implementation(projects.gradlePluginApi) -} - -gradlePlugin { - plugins { - create("platform") { - id = "org.jetbrains.kotlinx.rpc.platform" - - displayName = "kotlinx.rpc Platform Plugin" - implementationClass = "kotlinx.rpc.RPCPlatformPlugin" - description = """ - The plugin enforces proper artifacts versions for your project, depending on your Kotlin version. - Resulting versions of the kotlinx.rpc dependencies will be 'kotlinVersion-kotlinxRpcVersion', for example '1.9.24-0.1.0', where '0.1.0' is the kotlinx.rpc version. - """.trimIndent() - } - } -} diff --git a/gradle-plugin/settings.gradle.kts b/gradle-plugin/settings.gradle.kts index c638b77c..15cb99db 100644 --- a/gradle-plugin/settings.gradle.kts +++ b/gradle-plugin/settings.gradle.kts @@ -15,6 +15,4 @@ plugins { id("settings-conventions") } -includePublic(":gradle-plugin-api") -includePublic(":gradle-plugin-all") -includePublic(":gradle-plugin-platform") +includeRootAsPublic() diff --git a/gradle-plugin/gradle-plugin-all/src/main/kotlin/kotlinx/rpc/KotlinCompilerPluginBuilder.kt b/gradle-plugin/src/main/kotlin/kotlinx/rpc/KotlinCompilerPluginBuilder.kt similarity index 100% rename from gradle-plugin/gradle-plugin-all/src/main/kotlin/kotlinx/rpc/KotlinCompilerPluginBuilder.kt rename to gradle-plugin/src/main/kotlin/kotlinx/rpc/KotlinCompilerPluginBuilder.kt diff --git a/gradle-plugin/gradle-plugin-all/src/main/kotlin/kotlinx/rpc/RPCGradlePlugin.kt b/gradle-plugin/src/main/kotlin/kotlinx/rpc/RPCGradlePlugin.kt similarity index 100% rename from gradle-plugin/gradle-plugin-all/src/main/kotlin/kotlinx/rpc/RPCGradlePlugin.kt rename to gradle-plugin/src/main/kotlin/kotlinx/rpc/RPCGradlePlugin.kt diff --git a/gradle-plugin/gradle-plugin-platform/src/main/kotlin/kotlinx/rpc/RPCPlatformPlugin.kt b/gradle-plugin/src/main/kotlin/kotlinx/rpc/RPCPlatformPlugin.kt similarity index 100% rename from gradle-plugin/gradle-plugin-platform/src/main/kotlin/kotlinx/rpc/RPCPlatformPlugin.kt rename to gradle-plugin/src/main/kotlin/kotlinx/rpc/RPCPlatformPlugin.kt diff --git a/gradle-plugin/gradle-plugin-api/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt b/gradle-plugin/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt similarity index 100% rename from gradle-plugin/gradle-plugin-api/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt rename to gradle-plugin/src/main/kotlin/kotlinx/rpc/RPCPluginConst.kt diff --git a/gradle-plugin/gradle-plugin-all/src/main/kotlin/kotlinx/rpc/compilerPlugins.kt b/gradle-plugin/src/main/kotlin/kotlinx/rpc/compilerPlugins.kt similarity index 100% rename from gradle-plugin/gradle-plugin-all/src/main/kotlin/kotlinx/rpc/compilerPlugins.kt rename to gradle-plugin/src/main/kotlin/kotlinx/rpc/compilerPlugins.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 32c453a9..1a66f82b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # core library version -kotlinx-rpc = "0.1.1-SNAPSHOT" +kotlinx-rpc = "0.2.1" # kotlin kotlin-lang = "1.9.24" diff --git a/samples/ktor-all-platforms-app/composeApp/build.gradle.kts b/samples/ktor-all-platforms-app/composeApp/build.gradle.kts index 7532a5ef..47087793 100644 --- a/samples/ktor-all-platforms-app/composeApp/build.gradle.kts +++ b/samples/ktor-all-platforms-app/composeApp/build.gradle.kts @@ -48,9 +48,9 @@ kotlin { implementation(compose.components.resources) implementation(projects.shared) - implementation(libs.kotlinx.rpc.runtime.client) - implementation(libs.kotlinx.rpc.runtime.serialization.json) - implementation(libs.kotlinx.rpc.transport.ktor.client) + implementation(libs.kotlinx.rpc.krpc.client) + implementation(libs.kotlinx.rpc.krpc.serialization.json) + implementation(libs.kotlinx.rpc.krpc.ktor.client) implementation(libs.ktor.client.cio) implementation(libs.ktor.client.core) implementation(libs.ktor.client.websockets) diff --git a/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt b/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt index dd3f6395..700b074f 100644 --- a/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt +++ b/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt @@ -15,8 +15,8 @@ import androidx.compose.ui.Modifier import io.ktor.client.* import io.ktor.http.* import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.streamScoped import kotlinx.rpc.serialization.json +import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC import kotlinx.rpc.transport.ktor.client.rpc import kotlinx.rpc.transport.ktor.client.rpcConfig diff --git a/samples/ktor-all-platforms-app/gradle/libs.versions.toml b/samples/ktor-all-platforms-app/gradle/libs.versions.toml index c041c088..b3230c88 100644 --- a/samples/ktor-all-platforms-app/gradle/libs.versions.toml +++ b/samples/ktor-all-platforms-app/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] -kotlin = "1.9.23" -ksp = "1.9.23-1.0.19" +kotlin = "1.9.24" +ksp = "1.9.24-1.0.20" agp = "8.2.0" android-compileSdk = "34" @@ -13,14 +13,14 @@ androidx-core-ktx = "1.12.0" androidx-espresso-core = "3.5.1" androidx-material = "1.11.0" androidx-test-junit = "1.1.5" -compose = "1.6.1" -compose-plugin = "1.6.1" +compose = "1.6.8" +compose-plugin = "1.6.11" junit = "4.13.2" ktor = "2.3.11" logback = "1.5.6" kotlinx-serialization-json = "1.6.3" kotlinx-coroutines-core = "1.8.1" -kotlinx-rpc = "0.1.0" +kotlinx-rpc = "0.2.1" [libraries] # kotlin @@ -58,12 +58,12 @@ ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.re ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } # kotlinx-rpc -kotlinx-rpc-runtime = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime" } -kotlinx-rpc-runtime-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-client" } -kotlinx-rpc-runtime-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-server" } -kotlinx-rpc-transport-ktor-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-client" } -kotlinx-rpc-transport-ktor-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-server" } -kotlinx-rpc-runtime-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-serialization-json" } +kotlinx-rpc-core = { module = "org.jetbrains.kotlinx:kotlinx-rpc-core" } +kotlinx-rpc-krpc-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-client" } +kotlinx-rpc-krpc-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-server" } +kotlinx-rpc-krpc-ktor-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client" } +kotlinx-rpc-krpc-ktor-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server" } +kotlinx-rpc-krpc-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json" } # other logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } diff --git a/samples/ktor-all-platforms-app/server/build.gradle.kts b/samples/ktor-all-platforms-app/server/build.gradle.kts index 6052b1c8..36da35ac 100644 --- a/samples/ktor-all-platforms-app/server/build.gradle.kts +++ b/samples/ktor-all-platforms-app/server/build.gradle.kts @@ -25,11 +25,11 @@ dependencies { implementation(libs.ktor.server.cors.jvm) implementation(libs.ktor.server.websockets.jvm) implementation(libs.ktor.server.host.common.jvm) - implementation(libs.kotlinx.rpc.runtime.server) - implementation(libs.kotlinx.rpc.runtime.serialization.json) - implementation(libs.kotlinx.rpc.transport.ktor.server) + implementation(libs.kotlinx.rpc.krpc.server) + implementation(libs.kotlinx.rpc.krpc.serialization.json) + implementation(libs.kotlinx.rpc.krpc.ktor.server) testImplementation(libs.ktor.server.tests) - testImplementation(libs.kotlinx.rpc.runtime.client) - testImplementation(libs.kotlinx.rpc.transport.ktor.client) + testImplementation(libs.kotlinx.rpc.krpc.client) + testImplementation(libs.kotlinx.rpc.krpc.ktor.client) testImplementation(libs.kotlin.test.junit) } diff --git a/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt b/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt index 1e134e1f..2244d79d 100644 --- a/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt +++ b/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt @@ -9,8 +9,8 @@ import UserService import io.ktor.server.testing.* import kotlinx.coroutines.flow.toList import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.streamScoped import kotlinx.rpc.serialization.json +import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC import kotlinx.rpc.transport.ktor.client.rpc import kotlinx.rpc.transport.ktor.client.rpcConfig diff --git a/samples/ktor-all-platforms-app/settings.gradle.kts b/samples/ktor-all-platforms-app/settings.gradle.kts index 0c6162cb..e538d5e3 100644 --- a/samples/ktor-all-platforms-app/settings.gradle.kts +++ b/samples/ktor-all-platforms-app/settings.gradle.kts @@ -8,7 +8,6 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { repositories { maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") google() gradlePluginPortal() mavenCentral() @@ -20,7 +19,6 @@ dependencyResolutionManagement { google() mavenCentral() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") } } diff --git a/samples/ktor-all-platforms-app/shared/build.gradle.kts b/samples/ktor-all-platforms-app/shared/build.gradle.kts index 7c4b2845..f24339af 100644 --- a/samples/ktor-all-platforms-app/shared/build.gradle.kts +++ b/samples/ktor-all-platforms-app/shared/build.gradle.kts @@ -29,7 +29,7 @@ kotlin { commonMain.dependencies { api(libs.kotlinx.coroutines.core) - implementation(libs.kotlinx.rpc.runtime) + implementation(libs.kotlinx.rpc.core) implementation(libs.kotlinx.serialization.json) } } diff --git a/samples/ktor-android-app/app/build.gradle.kts b/samples/ktor-android-app/app/build.gradle.kts index b502824c..a84fcd95 100644 --- a/samples/ktor-android-app/app/build.gradle.kts +++ b/samples/ktor-android-app/app/build.gradle.kts @@ -65,12 +65,12 @@ android { dependencies { implementation(project(":common")) - testImplementation(libs.kotlinx.rpc.runtime.client) - testImplementation(libs.kotlinx.rpc.runtime.server) - implementation(libs.kotlinx.rpc.runtime.serialization.json) + testImplementation(libs.kotlinx.rpc.krpc.client) + testImplementation(libs.kotlinx.rpc.krpc.server) + implementation(libs.kotlinx.rpc.krpc.serialization.json) - implementation(libs.kotlinx.rpc.transport.ktor.client) - implementation(libs.kotlinx.rpc.transport.ktor.server) + implementation(libs.kotlinx.rpc.krpc.ktor.client) + implementation(libs.kotlinx.rpc.krpc.ktor.server) implementation(libs.ktor.server.cio) implementation(libs.ktor.server.core.jvm) diff --git a/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt b/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt index a21a7a5f..ef9eef12 100644 --- a/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt +++ b/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt @@ -15,7 +15,7 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import kotlinx.rpc.RPCClient -import kotlinx.rpc.internal.streamScoped +import kotlinx.rpc.streamScoped import kotlinx.rpc.client.withService import kotlinx.rpc.sample.MyService import kotlinx.rpc.sample.UserData diff --git a/samples/ktor-android-app/common/build.gradle.kts b/samples/ktor-android-app/common/build.gradle.kts index 5fa8a988..176a9d92 100644 --- a/samples/ktor-android-app/common/build.gradle.kts +++ b/samples/ktor-android-app/common/build.gradle.kts @@ -15,6 +15,6 @@ dependencies { implementation(libs.ktor.server.core.jvm) implementation(libs.ktor.server.websockets.jvm) implementation(libs.kotlinx.serialization.json) - implementation(libs.kotlinx.rpc.transport.ktor.server) - implementation(libs.kotlinx.rpc.runtime.serialization.json) + implementation(libs.kotlinx.rpc.krpc.ktor.server) + implementation(libs.kotlinx.rpc.krpc.serialization.json) } \ No newline at end of file diff --git a/samples/ktor-android-app/gradle/libs.versions.toml b/samples/ktor-android-app/gradle/libs.versions.toml index 5100dc1d..8821effd 100644 --- a/samples/ktor-android-app/gradle/libs.versions.toml +++ b/samples/ktor-android-app/gradle/libs.versions.toml @@ -1,20 +1,20 @@ [versions] agp = "8.1.3" -kotlin = "1.9.22" +kotlin = "1.9.24" androidx-activityCompose = "1.8.2" androidx-appcompat = "1.6.1" androidx-constraintlayout = "2.1.4" androidx-core-ktx = "1.12.0" androidx-test-junit = "1.1.5" -compose = "1.6.0" +compose = "1.6.11" material3 = "1.2.0" junit = "4.13.2" ktor = "2.3.11" kotlinx-serialization-json = "1.6.1" kotlinx-coroutines-core = "1.8.1" logback = "1.5.6" -kotlinx-rpc = "0.1.0" -ksp = "1.9.22-1.0.17" +kotlinx-rpc = "0.2.1" +ksp = "1.9.24-1.0.20" [libraries] # kotlin @@ -64,12 +64,12 @@ junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" } # kotlinx-rpc -kotlinx-rpc-runtime = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime" } -kotlinx-rpc-runtime-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-client" } -kotlinx-rpc-runtime-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-server" } -kotlinx-rpc-transport-ktor-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-client" } -kotlinx-rpc-transport-ktor-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-server" } -kotlinx-rpc-runtime-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-serialization-json" } +kotlinx-rpc-core = { module = "org.jetbrains.kotlinx:kotlinx-rpc-core" } +kotlinx-rpc-krpc-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-client" } +kotlinx-rpc-krpc-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-server" } +kotlinx-rpc-krpc-ktor-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client" } +kotlinx-rpc-krpc-ktor-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server" } +kotlinx-rpc-krpc-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json" } [plugins] androidApplication = { id = "com.android.application", version.ref = "agp" } diff --git a/samples/ktor-android-app/server/build.gradle.kts b/samples/ktor-android-app/server/build.gradle.kts index b2173a6e..a07fd9b9 100644 --- a/samples/ktor-android-app/server/build.gradle.kts +++ b/samples/ktor-android-app/server/build.gradle.kts @@ -31,11 +31,11 @@ dependencies { implementation(libs.kotlinx.coroutines.core.jvm) implementation(libs.logback.classic) - implementation(libs.kotlinx.rpc.transport.ktor.server) - implementation(libs.kotlinx.rpc.runtime.serialization.json) + implementation(libs.kotlinx.rpc.krpc.ktor.server) + implementation(libs.kotlinx.rpc.krpc.serialization.json) - testImplementation(libs.kotlinx.rpc.runtime.client) - testImplementation(libs.kotlinx.rpc.transport.ktor.client) + testImplementation(libs.kotlinx.rpc.krpc.client) + testImplementation(libs.kotlinx.rpc.krpc.ktor.client) testImplementation(libs.kotlin.test) testImplementation(libs.ktor.server.test.host) } \ No newline at end of file diff --git a/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt b/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt index f6744767..470b973b 100644 --- a/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt +++ b/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt @@ -11,10 +11,10 @@ import io.ktor.server.routing.* import io.ktor.server.testing.* import kotlinx.coroutines.flow.toList import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.streamScoped import kotlinx.rpc.sample.MyService import kotlinx.rpc.sample.UserData import kotlinx.rpc.serialization.json +import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC import kotlinx.rpc.transport.ktor.client.rpc import kotlinx.rpc.transport.ktor.client.rpcConfig diff --git a/samples/ktor-android-app/settings.gradle.kts b/samples/ktor-android-app/settings.gradle.kts index 229994e9..6ab42830 100644 --- a/samples/ktor-android-app/settings.gradle.kts +++ b/samples/ktor-android-app/settings.gradle.kts @@ -6,14 +6,12 @@ pluginManagement { repositories { google() mavenCentral() - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") gradlePluginPortal() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") google() mavenCentral() } diff --git a/samples/ktor-web-app/build.gradle.kts b/samples/ktor-web-app/build.gradle.kts index d264a0e6..cb370c7a 100644 --- a/samples/ktor-web-app/build.gradle.kts +++ b/samples/ktor-web-app/build.gradle.kts @@ -13,7 +13,6 @@ allprojects { version = "0.1" repositories { - maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") mavenCentral() } } diff --git a/samples/ktor-web-app/common/build.gradle.kts b/samples/ktor-web-app/common/build.gradle.kts index b3b1cdae..9e34b692 100644 --- a/samples/ktor-web-app/common/build.gradle.kts +++ b/samples/ktor-web-app/common/build.gradle.kts @@ -22,5 +22,5 @@ dependencies { commonMainApi(libs.kotlinx.serialization.json) commonMainApi(libs.ktor.client.core) commonMainApi(libs.kotlinx.coroutines.core) - commonMainApi(libs.kotlinx.rpc.runtime) + commonMainApi(libs.kotlinx.rpc.core) } diff --git a/samples/ktor-web-app/frontend/build.gradle.kts b/samples/ktor-web-app/frontend/build.gradle.kts index 5928f422..41051805 100644 --- a/samples/ktor-web-app/frontend/build.gradle.kts +++ b/samples/ktor-web-app/frontend/build.gradle.kts @@ -37,8 +37,8 @@ kotlin { implementation(libs.kotlin.stdlib.js) implementation(libs.ktor.client.js) implementation(libs.ktor.client.websockets.js) - implementation(libs.kotlinx.rpc.transport.ktor.client) - implementation(libs.kotlinx.rpc.runtime.serialization.json) + implementation(libs.kotlinx.rpc.krpc.ktor.client) + implementation(libs.kotlinx.rpc.krpc.serialization.json) implementation(project.dependencies.platform(libs.kotlin.wrappers.bom)) implementation(libs.react) diff --git a/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt b/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt index c62842fc..1f474b03 100644 --- a/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt +++ b/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt @@ -5,7 +5,7 @@ import kotlinx.coroutines.flow.flow import kotlinx.rpc.RPCClient import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.streamScoped +import kotlinx.rpc.streamScoped import react.FC import react.Props import react.dom.html.ReactHTML.div diff --git a/samples/ktor-web-app/gradle/libs.versions.toml b/samples/ktor-web-app/gradle/libs.versions.toml index 95e7db0b..da94e7cb 100644 --- a/samples/ktor-web-app/gradle/libs.versions.toml +++ b/samples/ktor-web-app/gradle/libs.versions.toml @@ -5,7 +5,7 @@ ktor = "2.3.11" kotlinx-serialization-json = "1.6.1" kotlinx-coroutines-core = "1.8.1" logback = "1.5.6" -krpc = "0.1.0" +kotlinx-rpc = "0.2.1" ksp = "1.9.24-1.0.20" [libraries] @@ -42,17 +42,17 @@ ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" } logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } # krpc -kotlinx-rpc-runtime = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime" } -kotlinx-rpc-runtime-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-client" } -kotlinx-rpc-runtime-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-server" } -kotlinx-rpc-transport-ktor-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-client" } -kotlinx-rpc-transport-ktor-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-server" } -kotlinx-rpc-runtime-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-rpc-runtime-serialization-json" } +kotlinx-rpc-core = { module = "org.jetbrains.kotlinx:kotlinx-rpc-core" } +kotlinx-rpc-krpc-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-client" } +kotlinx-rpc-krpc-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-server" } +kotlinx-rpc-krpc-ktor-client = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client" } +kotlinx-rpc-krpc-ktor-server = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server" } +kotlinx-rpc-krpc-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json" } [plugins] kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -kotlinx-rpc = { id = "org.jetbrains.kotlinx.rpc.plugin", version.ref = "krpc" } -kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform", version.ref = "krpc" } +kotlinx-rpc = { id = "org.jetbrains.kotlinx.rpc.plugin", version.ref = "kotlinx-rpc" } +kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform", version.ref = "kotlinx-rpc" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } diff --git a/samples/ktor-web-app/server/build.gradle.kts b/samples/ktor-web-app/server/build.gradle.kts index 580b5abc..d2f1e627 100644 --- a/samples/ktor-web-app/server/build.gradle.kts +++ b/samples/ktor-web-app/server/build.gradle.kts @@ -28,11 +28,11 @@ dependencies { implementation(libs.kotlinx.coroutines.core.jvm) implementation(libs.logback.classic) - implementation(libs.kotlinx.rpc.transport.ktor.server) - implementation(libs.kotlinx.rpc.runtime.serialization.json) + implementation(libs.kotlinx.rpc.krpc.ktor.server) + implementation(libs.kotlinx.rpc.krpc.serialization.json) - testImplementation(libs.kotlinx.rpc.runtime.client) - testImplementation(libs.kotlinx.rpc.transport.ktor.client) + testImplementation(libs.kotlinx.rpc.krpc.client) + testImplementation(libs.kotlinx.rpc.krpc.ktor.client) testImplementation(libs.kotlin.test) testImplementation(libs.ktor.server.test.host) } diff --git a/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt b/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt index 9a099d76..7ccf4fdd 100644 --- a/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt +++ b/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt @@ -5,8 +5,8 @@ import io.ktor.server.testing.* import kotlinx.coroutines.flow.toList import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.streamScoped import kotlinx.rpc.serialization.json +import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC import kotlinx.rpc.transport.ktor.client.rpc import kotlinx.rpc.transport.ktor.client.rpcConfig diff --git a/samples/ktor-web-app/settings.gradle.kts b/samples/ktor-web-app/settings.gradle.kts index 2a8508c4..0eb0ca64 100644 --- a/samples/ktor-web-app/settings.gradle.kts +++ b/samples/ktor-web-app/settings.gradle.kts @@ -4,11 +4,4 @@ rootProject.name = "ktor-web-app" -pluginManagement { - repositories { - maven("https://maven.pkg.jetbrains.space/public/p/krpc/maven") - gradlePluginPortal() - } -} - include("common", "frontend", "server") diff --git a/samples/simple-ktor-app/build.gradle.kts b/samples/simple-ktor-app/build.gradle.kts index 844a8008..5c6d4dae 100644 --- a/samples/simple-ktor-app/build.gradle.kts +++ b/samples/simple-ktor-app/build.gradle.kts @@ -7,7 +7,7 @@ plugins { kotlin("plugin.serialization") version "1.9.24" id("io.ktor.plugin") version "2.3.11" id("com.google.devtools.ksp") version "1.9.24-1.0.20" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.1.0" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.1" } val kotlin_version: String by project @@ -24,7 +24,6 @@ application { } repositories { - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") mavenCentral() } @@ -33,12 +32,12 @@ kotlin { } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-client") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-server") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-runtime-serialization-json") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-client") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-transport-ktor-server") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server") implementation("io.ktor:ktor-client-cio-jvm") implementation("io.ktor:ktor-server-netty-jvm") diff --git a/samples/simple-ktor-app/settings.gradle.kts b/samples/simple-ktor-app/settings.gradle.kts index 911c4ed5..defdac52 100644 --- a/samples/simple-ktor-app/settings.gradle.kts +++ b/samples/simple-ktor-app/settings.gradle.kts @@ -3,10 +3,3 @@ */ rootProject.name = "simple-ktor-app" - -pluginManagement { - repositories { - maven(url = "https://maven.pkg.jetbrains.space/public/p/krpc/maven") - gradlePluginPortal() - } -} diff --git a/samples/simple-ktor-app/src/main/kotlin/Client.kt b/samples/simple-ktor-app/src/main/kotlin/Client.kt index ce068274..111220a4 100644 --- a/samples/simple-ktor-app/src/main/kotlin/Client.kt +++ b/samples/simple-ktor-app/src/main/kotlin/Client.kt @@ -10,8 +10,8 @@ import kotlinx.coroutines.flow.flow import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.streamScoped import kotlinx.rpc.serialization.json +import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.rpc import kotlinx.rpc.transport.ktor.client.rpcConfig