Abstract script compiled module implementation used in saving/caching
removes classloading problem when main-kts is loaded from a CL without scripting compiler. Also relax dependencies collection on saving to a jar and hide redundant logging. Running main.kts script via a run configuration works now. #KT-37765 fixed
This commit is contained in:
+2
-2
@@ -6,9 +6,9 @@
|
||||
package org.jetbrains.kotlin.scripting.compiler.plugin.impl
|
||||
|
||||
import java.io.Serializable
|
||||
import kotlin.script.experimental.jvm.impl.KJvmCompiledModule
|
||||
import kotlin.script.experimental.jvm.impl.KJvmCompiledModuleInMemory
|
||||
|
||||
class KJvmCompiledModuleInMemory(val compilerOutputFiles: Map<String, ByteArray>) : KJvmCompiledModule,
|
||||
class KJvmCompiledModuleInMemoryImpl(override val compilerOutputFiles: Map<String, ByteArray>) : KJvmCompiledModuleInMemory,
|
||||
Serializable {
|
||||
|
||||
override fun createClassLoader(baseClassLoader: ClassLoader?): ClassLoader =
|
||||
+1
-1
@@ -28,7 +28,7 @@ import kotlin.script.experimental.host.getMergedScriptText
|
||||
import kotlin.script.experimental.jvm.impl.KJvmCompiledScript
|
||||
|
||||
internal fun makeCompiledModule(generationState: GenerationState) =
|
||||
KJvmCompiledModuleInMemory(
|
||||
KJvmCompiledModuleInMemoryImpl(
|
||||
generationState.factory.asList()
|
||||
.associateTo(sortedMapOf<String, ByteArray>()) { it.relativePath to it.asByteArray() }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user