Luis Munoz
10/13/2020, 3:11 PMWukongRework.exe
10/27/2020, 10:30 PMAnthony Dahanne
10/30/2020, 7:10 PMRepository
annotations does not support authentication ? everybody only pulling public artifacts ?! ^
😣bjonnh
10/30/2020, 8:33 PMbjonnh
10/30/2020, 8:34 PMkenkyee
11/06/2020, 2:26 PMSrSouza
11/08/2020, 8:05 PMfwilhe
11/20/2020, 7:26 AMmain.kts
script without the filename ending in .main.kts
? My use-case is that I want to use Kotlin as a script interpreter on GitHub Actions.
So would it be possible to make the kotlin foo
line work without control of the file name? Is there some --run-as-script
flag?
~$ cat foo.main.kts
#!/usr/bin/env kotlin
println("hello")
~$ kotlin foo.main.kts
hello
~$ mv foo.main.kts foo
~$ kotlin foo
error: could not find or load main class foo
I've described details of what the issue is here https://github.com/actions/runner/issues/813Slackbot
11/23/2020, 1:17 PMSamuel Michael
12/06/2020, 3:48 AM--P plugin:serialization
kenkyee
12/06/2020, 3:54 AMRedTahr1
12/08/2020, 3:17 PMException in thread "main" java.lang.NoClassDefFoundError: com/intellij/openapi/util/Disposer
at org.jetbrains.kotlin.scripting.compiler.plugin.impl.ScriptJvmCompilerIsolated.compile(ScriptJvmCompilerImpls.kt:237)
at kotlin.script.experimental.jvmhost.JvmScriptCompiler.invoke$suspendImpl(jvmScriptCompilation.kt:30)
at kotlin.script.experimental.jvmhost.JvmScriptCompiler.invoke(jvmScriptCompilation.kt)
at kotlin.script.experimental.host.BasicScriptingHost$eval$1.invokeSuspend(BasicScriptingHost.kt:46)
at kotlin.script.experimental.host.BasicScriptingHost$eval$1.invoke(BasicScriptingHost.kt)
at kotlin.script.experimental.host.BasicScriptingHost$runInCoroutineContext$1.invokeSuspend(BasicScriptingHost.kt:35)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at org.jetbrains.kotlin.kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at org.jetbrains.kotlin.kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
at org.jetbrains.kotlin.kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
at org.jetbrains.kotlin.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at org.jetbrains.kotlin.kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at org.jetbrains.kotlin.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at org.jetbrains.kotlin.kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at kotlin.script.experimental.host.BasicScriptingHost.runInCoroutineContext(BasicScriptingHost.kt:35)
at kotlin.script.experimental.host.BasicScriptingHost.eval(BasicScriptingHost.kt:45)
at <com.masking.my.class>.AtsRunner.loadAtsTest(AtsRunner.kt:543)
at <com.masking.my.class>.AtsRunner.runTests(AtsRunner.kt:258)
at <com.masking.my.class>.AtsRunner$Companion.main(AtsRunner.kt:168)
at <com.masking.my.class>.AtsRunner.main(AtsRunner.kt)
Caused by: java.lang.ClassNotFoundException: com.intellij.openapi.util.Disposer
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 20 more
RedTahr1
12/16/2020, 3:41 PMscriptingHost.eval(
sourceCode, scriptCompilationConfiguration, scriptEvaluationConfiguration
)
Any hint how to debug java.lang.NoClassDefFoundError
or move forward?Vampire
01/08/2021, 1:48 PMreturn
but it is a syntax violation. 😕Miguel Guilherme
01/12/2021, 2:00 PMZeganstyl
01/16/2021, 8:01 AMAnimesh Sahu
01/17/2021, 3:02 PMjava.lang.NoClassDefFoundError: kotlinx/atomicfu/AtomicFU
blob thinking upside downvineethraj49
01/25/2021, 7:26 AMlaht
01/26/2021, 8:58 AMlaht
02/01/2021, 1:36 PMkotlin-script-examples
jvm-embeddable-host
. Why is that? The latter is able to resolve dependencies fully, whereas main.kts does not (even with runtime option). E.g. lwjgl3 (opengl) will fail during runtime with main.kts, but not using the jvm-embeddable-hostmbonnin
02/02/2021, 12:42 PM@file:DependsOn("com.google.cloud:libraries-bom:16.3.0")
@file:DependsOn("com.google.cloud:google-cloud-speech")
Looks like I can't but I'm curious if there's a way to make this work?pgreze
02/04/2021, 8:07 AMif __file__ == "__main__": hello("sample")
My use case is when using the @\Import feature.
Let’s imagine script1.main.kts:
@file:Import("script2.main.kts")
hello("john")
and script2.main.kts:
fun hello(name: String) = TODO(...)
// MAIN start
hello("sample") // executed even when imported
// MAIN end
Rodrigo Graciano
02/07/2021, 8:49 PMval engine = ScriptEngineManager().getEngineByExtension("main.kts")!!
engine.put("jdbcTemplate",jdbcTemplate)
engine.eval("""@file:Import("/test.kts")""".trimIndent())
From the test.kts script
val template = bindings.get("jdbcTemplate")
mbonnin
02/09/2021, 10:02 AM@file:DependsOn()
annotations ? I have some weird cases where it looks like it doesn't.igor.wojda
02/23/2021, 12:45 PMigor.wojda
02/23/2021, 12:46 PMRodrigo Graciano
02/23/2021, 11:54 PMgianluz
03/01/2021, 9:39 PM.main.kts
script with a compiled jar runtime locally inside IntelliJ and in CI.
More in specific:
• i have a project where i compile a module with this jar that is going into: build/libs/myJar.jar
• then i have a MyScript.main.kts
where i use the library:
@file:DependsOn("./build/libs/test-jar-main-kts-0.1.jar")
import com.test.jar.TestJar
print(TestJar.iAmTestJar())
If i run the script from IntelliJ works but the script gives an error : File build/libs/myJar.jar
not found and i cannot benefit the autocomplete.
By using the /absolute/path/to/myJar.jar
it works well in IntelliJ with autocomplete and locally in general, but the path will be different whiles running on CI or another machine.
Is there a way to have this working well both locally and on CI/other machine just using relative paths?
Alternatively, how i can contribute to fix that? attached a screenshotaltavir
03/09/2021, 6:23 AMJakub Gwóźdź
03/11/2021, 6:31 PM➜ local git:(develop) ✗ kotlinc
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Welcome to Kotlin version 1.4.31 (JRE 15.0.1+9-18)
Type :help for help, :quit for quit
-nowarn
does not change a thing. How do I mute these warnings? I'm running my scripts with #!/usr/bin/env kotlinc -script
shebang
I don't really care if the warnings stays or are solved, I just don't want to see them on the screen