Skip to content

Commit 203e966

Browse files
authored
Update for IDE configs (#272)
1 parent 9c50ec0 commit 203e966

File tree

8 files changed

+37
-14
lines changed

8 files changed

+37
-14
lines changed

build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
@@ -22,13 +22,14 @@ configureNpm()
2222
configureApiValidation()
2323

2424
val kotlinVersion = rootProject.libs.versions.kotlin.lang.get()
25+
val kotlinCompiler = rootProject.libs.versions.kotlin.compiler.get()
2526

2627
allprojects {
2728
group = "org.jetbrains.kotlinx"
2829
version = rootProject.libs.versions.kotlinx.rpc.get()
2930
}
3031

31-
println("kotlinx.rpc project version: $version, Kotlin version: $kotlinVersion")
32+
println("[Core] kotlinx.rpc project version: $version, Kotlin version: $kotlinVersion, Compiler: $kotlinCompiler")
3233

3334
// If the prefix of the kPRC version is not Kotlin gradle plugin version – you have a problem :)
3435
// Probably some dependency brings kotlin with the later version.

compiler-plugin/build.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import util.otherwise
@@ -22,3 +22,13 @@ allprojects {
2222
version = "$kotlinLangVersion-$rpcVersion"
2323
}
2424
}
25+
26+
println(
27+
"[Compiler Plugin] kotlinx.rpc project version: $version, " +
28+
"Kotlin version: $kotlinLangVersion, " +
29+
"Compiler version: $kotlinCompilerVersion"
30+
)
31+
32+
whenForIde {
33+
println("For-ide project mode enabled")
34+
}

compiler-plugin/compiler-plugin-k2/build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
@@ -50,6 +50,15 @@ val shadowJar = tasks.named<ShadowJar>("shadowJar") {
5050
exclude("org/**")
5151

5252
archiveFileName.set("plugin-k2-for-tests.jar")
53+
54+
/**
55+
* Same problem as above, but in IDE
56+
*/
57+
whenForIde {
58+
archiveClassifier.set("for-ide")
59+
} otherwise {
60+
archiveClassifier.set("tests")
61+
}
5362
}
5463

5564
tasks.jar {

compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import org.jetbrains.kotlin.diagnostics.error2
1313
import org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory
1414
import org.jetbrains.kotlin.fir.types.ConeKotlinType
1515
import org.jetbrains.kotlin.name.Name
16-
import org.jetbrains.kotlin.psi.KtAnnotationEntry
16+
import org.jetbrains.kotlin.psi.KtAnnotated
1717

1818
object FirRpcDiagnostics {
19-
val MISSING_RPC_ANNOTATION by error0<KtAnnotationEntry>()
20-
val MISSING_SERIALIZATION_MODULE by error0<KtAnnotationEntry>()
21-
val WRONG_RPC_ANNOTATION_TARGET by error1<KtAnnotationEntry, ConeKotlinType>()
22-
val CHECKED_ANNOTATION_VIOLATION by error1<KtAnnotationEntry, ConeKotlinType>()
19+
val MISSING_RPC_ANNOTATION by error0<KtAnnotated>()
20+
val MISSING_SERIALIZATION_MODULE by error0<KtAnnotated>()
21+
val WRONG_RPC_ANNOTATION_TARGET by error1<KtAnnotated, ConeKotlinType>()
22+
val CHECKED_ANNOTATION_VIOLATION by error1<KtAnnotated, ConeKotlinType>()
2323
val NON_SUSPENDING_REQUEST_WITHOUT_STREAMING_RETURN_TYPE by error0<PsiElement>()
2424
val AD_HOC_POLYMORPHISM_IN_RPC_SERVICE by error2<PsiElement, Int, Name>()
2525
val TYPE_PARAMETERS_IN_RPC_FUNCTION by error0<PsiElement>(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST)

gradle-conventions-settings/src/main/kotlin/conventions-version-resolution.settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ fun VersionCatalogBuilder.resolveKotlinVersion(versionCatalog: Map<String, Strin
157157
}
158158

159159
if (kotlinCompilerVersion != null) {
160+
logger.info("Resolved Kotlin compiler version: $kotlinCompilerVersion")
160161
version(SettingsConventions.KOTLIN_COMPILER_VERSION_ALIAS, kotlinCompilerVersion)
161162
} else {
162163
version(SettingsConventions.KOTLIN_COMPILER_VERSION_ALIAS, kotlinCatalogVersion!!)

gradle-conventions/common/src/main/kotlin/util/forIde.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package util
66

77
import org.gradle.api.Project
88

99
fun Project.whenForIde(block: () -> Unit): ActionApplied {
10-
val forIdeBuild by optionalProperty()
10+
val forIdeBuild by rootProject.optionalProperty()
1111

1212
if (forIdeBuild) {
1313
block()

gradle-conventions/src/main/kotlin/conventions-publishing.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import util.*
@@ -53,7 +53,7 @@ fun PublishingExtension.configurePublication() {
5353
fixModuleMetadata(project)
5454
}
5555

56-
logger.info("Project ${project.name} -> Publication configured: $name")
56+
logger.info("Project ${project.name} -> Publication configured: $name, $version")
5757
}
5858

5959
tasks.withType<PublishToMavenRepository>().configureEach {

gradle-plugin/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
@@ -76,3 +76,5 @@ kotlin {
7676
}
7777
}
7878
}
79+
80+
println("[Gradle Plugin] kotlinx.rpc project version: $version")

0 commit comments

Comments
 (0)