Skip to content

Commit cd2147b

Browse files
committed
KTL-2962 Fixed classloader used for BTA compilation
1 parent bd1cf86 commit cd2147b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ val buildLambda by tasks.creating(Zip::class) {
129129
from(compilerPluginsForJVMFolder) { into(compilerPluginsForJVM) }
130130
from(libComposeWasmCompilerPluginsFolder) { into(libComposeWasmCompilerPlugins) }
131131
into("lib") {
132-
from(configurations.compileClasspath) { exclude("tomcat-embed-*") }
132+
from(configurations.productionRuntimeClasspath) { exclude("tomcat-embed-*") }
133133
}
134134
}
135135

src/main/kotlin/com/compiler/server/compiler/components/KotlinCompiler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class KotlinCompiler(
134134
.filter { it.name.endsWith(".kt") }
135135
.associate { it.name to mutableListOf() }
136136

137-
val toolchains = KotlinToolchains.loadImplementation(ClassLoader.getSystemClassLoader())
137+
val toolchains = KotlinToolchains.loadImplementation(this::class.java.classLoader)
138138
val jvmToolchain = toolchains.getToolchain(JvmPlatformToolchain::class.java)
139139
val operation = jvmToolchain.createJvmCompilationOperation(sources, outputDir)
140140
operation.compilerArguments.applyArgumentStrings(arguments)

0 commit comments

Comments
 (0)