diff --git a/build.gradle.kts b/build.gradle.kts index 2570a4f9..a1112d53 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion @@ -22,13 +22,14 @@ configureNpm() configureApiValidation() val kotlinVersion = rootProject.libs.versions.kotlin.lang.get() +val kotlinCompiler = rootProject.libs.versions.kotlin.compiler.get() allprojects { group = "org.jetbrains.kotlinx" version = rootProject.libs.versions.kotlinx.rpc.get() } -println("kotlinx.rpc project version: $version, Kotlin version: $kotlinVersion") +println("[Core] kotlinx.rpc project version: $version, Kotlin version: $kotlinVersion, Compiler: $kotlinCompiler") // If the prefix of the kPRC version is not Kotlin gradle plugin version – you have a problem :) // Probably some dependency brings kotlin with the later version. diff --git a/compiler-plugin/build.gradle.kts b/compiler-plugin/build.gradle.kts index 00c18576..6ae1c6c6 100644 --- a/compiler-plugin/build.gradle.kts +++ b/compiler-plugin/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import util.otherwise @@ -22,3 +22,13 @@ allprojects { version = "$kotlinLangVersion-$rpcVersion" } } + +println( + "[Compiler Plugin] kotlinx.rpc project version: $version, " + + "Kotlin version: $kotlinLangVersion, " + + "Compiler version: $kotlinCompilerVersion" +) + +whenForIde { + println("For-ide project mode enabled") +} diff --git a/compiler-plugin/compiler-plugin-k2/build.gradle.kts b/compiler-plugin/compiler-plugin-k2/build.gradle.kts index c17c72a9..b560b434 100644 --- a/compiler-plugin/compiler-plugin-k2/build.gradle.kts +++ b/compiler-plugin/compiler-plugin-k2/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar @@ -50,6 +50,15 @@ val shadowJar = tasks.named("shadowJar") { exclude("org/**") archiveFileName.set("plugin-k2-for-tests.jar") + + /** + * Same problem as above, but in IDE + */ + whenForIde { + archiveClassifier.set("for-ide") + } otherwise { + archiveClassifier.set("tests") + } } tasks.jar { diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt index 55758c8f..8289d194 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt @@ -13,13 +13,13 @@ import org.jetbrains.kotlin.diagnostics.error2 import org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.psi.KtAnnotationEntry +import org.jetbrains.kotlin.psi.KtAnnotated object FirRpcDiagnostics { - val MISSING_RPC_ANNOTATION by error0() - val MISSING_SERIALIZATION_MODULE by error0() - val WRONG_RPC_ANNOTATION_TARGET by error1() - val CHECKED_ANNOTATION_VIOLATION by error1() + val MISSING_RPC_ANNOTATION by error0() + val MISSING_SERIALIZATION_MODULE by error0() + val WRONG_RPC_ANNOTATION_TARGET by error1() + val CHECKED_ANNOTATION_VIOLATION by error1() val NON_SUSPENDING_REQUEST_WITHOUT_STREAMING_RETURN_TYPE by error0() val AD_HOC_POLYMORPHISM_IN_RPC_SERVICE by error2() val TYPE_PARAMETERS_IN_RPC_FUNCTION by error0(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST) diff --git a/gradle-conventions-settings/src/main/kotlin/conventions-version-resolution.settings.gradle.kts b/gradle-conventions-settings/src/main/kotlin/conventions-version-resolution.settings.gradle.kts index 65511c09..3bd4a9f1 100644 --- a/gradle-conventions-settings/src/main/kotlin/conventions-version-resolution.settings.gradle.kts +++ b/gradle-conventions-settings/src/main/kotlin/conventions-version-resolution.settings.gradle.kts @@ -157,6 +157,7 @@ fun VersionCatalogBuilder.resolveKotlinVersion(versionCatalog: Map Unit): ActionApplied { - val forIdeBuild by optionalProperty() + val forIdeBuild by rootProject.optionalProperty() if (forIdeBuild) { block() diff --git a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts index 5b181a9c..75bd4979 100644 --- a/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts +++ b/gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import util.* @@ -53,7 +53,7 @@ fun PublishingExtension.configurePublication() { fixModuleMetadata(project) } - logger.info("Project ${project.name} -> Publication configured: $name") + logger.info("Project ${project.name} -> Publication configured: $name, $version") } tasks.withType().configureEach { diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 61ec1f9f..a12f2f7a 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode @@ -76,3 +76,5 @@ kotlin { } } } + +println("[Gradle Plugin] kotlinx.rpc project version: $version")