Set thread context classloader in preloader
#KT-33529 fixed
This commit is contained in:
@@ -63,6 +63,8 @@ public class Preloader {
|
|||||||
Class<?> mainClass = preloaded.loadClass(options.mainClass);
|
Class<?> mainClass = preloaded.loadClass(options.mainClass);
|
||||||
Method mainMethod = mainClass.getMethod("main", String[].class);
|
Method mainMethod = mainClass.getMethod("main", String[].class);
|
||||||
|
|
||||||
|
Thread.currentThread().setContextClassLoader(preloaded);
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(
|
Runtime.getRuntime().addShutdownHook(
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
println("Hello!")
|
||||||
@@ -79,6 +79,15 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testKotlincJvmSimpleScript() {
|
||||||
|
runProcess(
|
||||||
|
"kotlinc-jvm",
|
||||||
|
"-script",
|
||||||
|
"$testDataDirectory/helloWorld.kts",
|
||||||
|
expectedStdout = "Hello!\n"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun testKotlincJsSimple() {
|
fun testKotlincJsSimple() {
|
||||||
runProcess(
|
runProcess(
|
||||||
"kotlinc-js",
|
"kotlinc-js",
|
||||||
|
|||||||
Reference in New Issue
Block a user