Skip to content

Commit e809f4a

Browse files
committed
Fix Symlinks and Develocity (#361)
1 parent 08434d8 commit e809f4a

File tree

83 files changed

+512
-869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+512
-869
lines changed

.idea/kotlinx-rpc.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bom/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import util.KOTLINX_RPC_PREFIX
6-
import util.isPublicModule
6+
import util.other.isPublicModule
77

88
plugins {
99
`java-platform`

build.gradle.kts

Lines changed: 2 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,87 +3,16 @@
33
*/
44

55
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
6-
import util.asDokkaVersion
7-
import util.configureNpm
8-
import util.configureProjectReport
9-
import util.registerDumpPlatformTableTask
10-
import util.registerChangelogTask
11-
import util.libs
12-
import util.registerVerifyPlatformTableTask
13-
import java.time.Year
146

157
plugins {
168
alias(libs.plugins.serialization) apply false
179
alias(libs.plugins.kotlinx.rpc) apply false
10+
alias(libs.plugins.atomicfu) apply false
1811
alias(libs.plugins.conventions.kover)
1912
alias(libs.plugins.conventions.gradle.doctor)
20-
alias(libs.plugins.dokka)
21-
alias(libs.plugins.atomicfu)
22-
id("build-util")
13+
alias(libs.plugins.conventions.root)
2314
}
2415

25-
dokka {
26-
val libDokkaVersion = libs.versions.kotlinx.rpc.get().asDokkaVersion()
27-
28-
moduleVersion.set(libDokkaVersion)
29-
30-
val pagesDirectory = layout.projectDirectory
31-
.dir("docs")
32-
.dir("pages")
33-
34-
val dokkaVersionsDirectory = pagesDirectory
35-
.dir("api")
36-
.asFile
37-
38-
val templatesDirectory = pagesDirectory
39-
.dir("templates")
40-
41-
pluginsConfiguration {
42-
html {
43-
customAssets.from(
44-
"docs/pages/assets/logo-icon.svg",
45-
"docs/pages/assets/homepage.svg", // Doesn't work due to https://github.com/Kotlin/dokka/issues/4007
46-
)
47-
48-
footerMessage = "© ${Year.now()} JetBrains s.r.o and contributors. Apache License 2.0"
49-
homepageLink = "https://kotlin.github.io/kotlinx-rpc/get-started.html"
50-
51-
// replace with homepage.svg once the mentioned issue is resolved
52-
templatesDir.set(templatesDirectory)
53-
}
54-
55-
// enable versioning for stable
56-
// versioning {
57-
// version = libDokkaVersion
58-
// olderVersionsDir = dokkaVersionsDirectory
59-
// }
60-
}
61-
62-
dokkaPublications.html {
63-
outputDirectory = dokkaVersionsDirectory
64-
}
65-
66-
tasks.clean {
67-
delete(dokkaVersionsDirectory)
68-
}
69-
70-
dokkaGeneratorIsolation = ProcessIsolation {
71-
// Configures heap size, use if start to fail with OOM on CI
72-
// maxHeapSize = "4g"
73-
}
74-
}
75-
76-
dependencies {
77-
dokkaPlugin(libs.dokka.rpc.plugin)
78-
}
79-
80-
configureProjectReport()
81-
configureNpm()
82-
83-
registerDumpPlatformTableTask()
84-
registerVerifyPlatformTableTask()
85-
registerChangelogTask()
86-
8716
val kotlinVersion = rootProject.libs.versions.kotlin.lang.get()
8817
val kotlinCompiler = rootProject.libs.versions.kotlin.compiler.get()
8918

compiler-plugin/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import util.whenForIde
66

77
plugins {
88
alias(libs.plugins.conventions.gradle.doctor)
9-
id("build-util")
109
}
1110

1211
val rpcVersion: String = libs.versions.kotlinx.rpc.get()
@@ -30,5 +29,5 @@ println(
3029
)
3130

3231
whenForIde {
33-
println("For-ide project mode enabled")
32+
println("[Compiler Plugin] For-ide project mode enabled")
3433
}

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

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

5-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
65
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
76
import util.enableContextParameters
8-
import util.otherwise
97
import util.whenForIde
108
import util.whenKotlinCompilerIsAtLeast
119

1210
plugins {
1311
alias(libs.plugins.conventions.jvm)
1412
alias(libs.plugins.compiler.specific.module)
15-
alias(libs.plugins.shadow.jar)
1613
}
1714

18-
/*
19-
This is a hack to solve the next problem:
20-
21-
There is PsiElement class that is used in compiler and plugin.
22-
23-
If we use kotlin-compiler-embeddable.jar to compile the module,
24-
PsiElement is org.jetbrains.kotlin.com.jetbrains.intellij.PsiElement.
25-
And it works ok in the user projects!
26-
27-
But.
28-
29-
If we run tests, which use kotlin-compiler.jar, we run into ClassNotFoundException.
30-
Because the class it has in th classpath is com.jetbrains.intellij.PsiElement
31-
32-
- Alright, we can use kotlin-compiler.jar to compile the plugin.
33-
- No, because the same error now will occur in the user projects,
34-
but it is com.jetbrains.intellij.PsiElement that is not found.
35-
36-
- Ok, we can use kotlin-compiler-embeddable.jar to compile tests.
37-
- Then we ran into java.lang.VerifyError: Bad type on operand stack, which I have no idea how to fix.
38-
39-
This solution replaces org.jetbrains.kotlin.com.jetbrains.intellij.PsiElement usages in plugin
40-
with com.jetbrains.intellij.PsiElement only for the tests, fixing both use cases.
41-
It is basically a reverse engineering of what Kotlin does for the embedded jar.
42-
*/
43-
val shadowJar = tasks.named<ShadowJar>("shadowJar") {
44-
configurations = listOf(project.configurations.compileClasspath.get())
45-
relocate("org.jetbrains.kotlin.com.intellij.psi", "com.intellij.psi")
46-
47-
exclude("javaslang/**")
48-
exclude("kotlin/**")
49-
exclude("messages/**")
50-
exclude("misc/**")
51-
exclude("org/**")
52-
53-
archiveFileName.set("plugin-k2-for-tests.jar")
54-
55-
/**
56-
* Same problem as above, but in IDE
57-
*/
15+
tasks.jar {
16+
// important for IDEA plugin
5817
whenForIde {
5918
archiveClassifier.set("for-ide")
60-
} otherwise {
61-
archiveClassifier.set("tests")
6219
}
6320
}
6421

65-
tasks.jar {
66-
finalizedBy(shadowJar)
67-
}
68-
6922
kotlin {
7023
explicitApi = ExplicitApiMode.Disabled
7124

core/build.gradle.kts

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

5-
import util.applyAtomicfuPlugin
6-
75
plugins {
86
alias(libs.plugins.conventions.kmp)
97
alias(libs.plugins.kotlinx.rpc)
8+
alias(libs.plugins.atomicfu)
109
}
1110

12-
applyAtomicfuPlugin()
13-
1411
kotlin {
1512
sourceSets {
1613
commonMain {

docs/Multiple-Kotlin-Versions-Support.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

dokka-plugin/build.gradle.kts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44

55
plugins {
66
alias(libs.plugins.conventions.gradle.doctor)
7-
id("build-util")
87
alias(libs.plugins.kotlin.jvm)
98
}
109

11-
val rpcVersion: String = libs.versions.kotlinx.rpc.get()
12-
val kotlinLangVersion = libs.versions.kotlin.lang.get()
13-
1410
group = "org.jetbrains.kotlinx"
15-
version = rpcVersion
11+
version = libs.versions.kotlinx.rpc.get()
1612

17-
println("[Dokka Plugin] kotlinx.rpc project version: $version, Kotlin version: $kotlinLangVersion")
13+
println("[Dokka Plugin] kotlinx.rpc project version: $version, Kotlin version: ${libs.versions.kotlin.lang.get()}")
1814

1915
kotlin {
2016
jvmToolchain(8)
@@ -26,7 +22,7 @@ dependencies {
2622

2723
testImplementation(kotlin("test"))
2824
testImplementation(libs.dokka.base)
29-
testImplementation("org.jetbrains.dokka:dokka-test-api:${libs.versions.dokka.get()}")
30-
testImplementation("org.jetbrains.dokka:dokka-base-test-utils:${libs.versions.dokka.get()}")
31-
testImplementation("org.jetbrains.dokka:analysis-kotlin-symbols:${libs.versions.dokka.get()}")
25+
testImplementation(libs.dokka.test.api)
26+
testImplementation(libs.dokka.base.test.utils)
27+
testImplementation(libs.dokka.analysis.kotlin.symbols)
3228
}

dokka-plugin/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gradle.properties

gradle-conventions-settings/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
plugins {
6-
alias(libs.plugins.gradle.kotlin.dsl)
6+
`kotlin-dsl`
77
}
88

99
dependencies {

gradle-conventions-settings/develocity/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
*/
44

55
plugins {
6-
alias(libs.plugins.gradle.kotlin.dsl)
6+
`kotlin-dsl`
77
}
88

99
dependencies {
10-
implementation("com.gradle:develocity-gradle-plugin:3.17")
11-
implementation("com.gradle:common-custom-user-data-gradle-plugin:2.2.1")
10+
implementation(libs.develocity)
11+
implementation(libs.common.custom.user.data)
1212
}

gradle-conventions-settings/empty/build.gradle.kts

Lines changed: 0 additions & 36 deletions
This file was deleted.

gradle-conventions-settings/empty/src/main/kotlin/empty-settings.settings.gradle.kts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)