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:
Ilya Chernikov
2020-04-01 14:14:18 +02:00
parent 278f77713d
commit c64ba50655
6 changed files with 14 additions and 13 deletions
@@ -15,6 +15,10 @@ interface KJvmCompiledModule {
fun createClassLoader(baseClassLoader: ClassLoader?): ClassLoader
}
interface KJvmCompiledModuleInMemory : KJvmCompiledModule {
val compilerOutputFiles: Map<String, ByteArray>
}
class KJvmCompiledModuleFromClassPath(val classpath: Collection<File>) : KJvmCompiledModule {
override fun createClassLoader(baseClassLoader: ClassLoader?): ClassLoader =