Skip to content

Commit cc20cda

Browse files
committed
Add new jar dependencies needed for incremental compilation
1 parent 5404a17 commit cc20cda

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/main/kotlin/io/bazel/kotlin/builder/cmd/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ kt_bootstrap_binary(
2727
"//src/main/kotlin/io/bazel/kotlin/compiler:compiler.jar",
2828
"@com_github_jetbrains_kotlin//:home",
2929
"@kotlin_build_tools_impl//jar",
30+
"@kotlin_compiler_embeddable//jar",
31+
"@kotlin_rules_maven//:org_jetbrains_kotlin_kotlin_daemon_client",
3032
"@kotlinx_serialization_core_jvm//jar",
3133
"@kotlinx_serialization_json//jar",
3234
"@kotlinx_serialization_json_jvm//jar",
@@ -36,10 +38,12 @@ kt_bootstrap_binary(
3638
"-D@com_github_jetbrains_kotlinx...serialization-json=$(rlocationpath @kotlinx_serialization_json//jar)",
3739
"-D@com_github_jetbrains_kotlinx...serialization-json-jvm=$(rlocationpath @kotlinx_serialization_json_jvm//jar)",
3840
"-D@com_github_jetbrains_kotlin...build-tools-impl=$(rlocationpath @kotlin_build_tools_impl//jar)",
41+
"-D@kotlin_compiler_embeddable...kotlin-embedded=$(rlocationpath @kotlin_compiler_embeddable//jar)",
3942
"-D@com_github_jetbrains_kotlin...jvm-abi-gen=$(rlocationpath //kotlin/compiler:jvm-abi-gen)",
4043
"-D@com_github_jetbrains_kotlin...kotlin-compiler=$(rlocationpath //kotlin/compiler:kotlin-compiler)",
4144
"-D@com_github_jetbrains_kotlin...kapt=$(rlocationpath //kotlin/compiler:kotlin-annotation-processing)",
4245
"-D@rules_kotlin...jdeps-gen=$(rlocationpath //src/main/kotlin:jdeps-gen)",
46+
"-D@com_github_jetbrains_kotlin...daemon-client=$(rlocationpath @kotlin_rules_maven//:org_jetbrains_kotlin_kotlin_daemon_client)",
4347
"-D@rules_kotlin...skip-code-gen=$(rlocationpath //src/main/kotlin:skip-code-gen)",
4448
"-D@rules_kotlin...compiler=$(rlocationpath //src/main/kotlin/io/bazel/kotlin/compiler:compiler.jar)",
4549
"-D@com_github_google_ksp...symbol-processing-api=$(rlocationpath //kotlin/compiler:symbol-processing-api)",

src/main/kotlin/io/bazel/kotlin/builder/toolchain/KotlinToolchain.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ class KotlinToolchain private constructor(
132132
).toPath()
133133
}
134134

135+
private val KOTLIN_EMBEDDED by lazy {
136+
BazelRunFiles
137+
.resolveVerifiedFromProperty(
138+
"@kotlin_compiler_embeddable...kotlin-embedded",
139+
).toPath()
140+
}
141+
142+
private val KOTLIN_DAEMON by lazy {
143+
BazelRunFiles
144+
.resolveVerifiedFromProperty(
145+
"@com_github_jetbrains_kotlin...daemon-client",
146+
).toPath()
147+
}
148+
135149
private val JAVA_HOME by lazy {
136150
FileSystems
137151
.getDefault()
@@ -161,6 +175,8 @@ class KotlinToolchain private constructor(
161175
KOTLINX_SERIALIZATION_CORE_JVM.toFile(),
162176
KOTLINX_SERIALIZATION_JSON.toFile(),
163177
KOTLINX_SERIALIZATION_JSON_JVM.toFile(),
178+
KOTLIN_EMBEDDED.toFile(),
179+
KOTLIN_DAEMON.toFile(),
164180
)
165181

166182
@JvmStatic
@@ -178,6 +194,8 @@ class KotlinToolchain private constructor(
178194
kotlinxSerializationCoreJvm: File,
179195
kotlinxSerializationJson: File,
180196
kotlinxSerializationJsonJvm: File,
197+
kotlinEmbedded: File,
198+
kotlinDaemon: File,
181199
): KotlinToolchain =
182200
KotlinToolchain(
183201
listOf(
@@ -195,6 +213,8 @@ class KotlinToolchain private constructor(
195213
kotlinxSerializationCoreJvm,
196214
kotlinxSerializationJson,
197215
kotlinxSerializationJsonJvm,
216+
kotlinEmbedded,
217+
kotlinDaemon,
198218
),
199219
jvmAbiGen =
200220
CompilerPlugin(

0 commit comments

Comments
 (0)