mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-20 00:21:29 +00:00
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);
|
||||
Method mainMethod = mainClass.getMethod("main", String[].class);
|
||||
|
||||
Thread.currentThread().setContextClassLoader(preloaded);
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
|
||||
3
compiler/testData/launcher/helloWorld.kts
vendored
Normal file
3
compiler/testData/launcher/helloWorld.kts
vendored
Normal file
@@ -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() {
|
||||
runProcess(
|
||||
"kotlinc-js",
|
||||
|
||||
Reference in New Issue
Block a user