Im trying my weird compose-jb in kotlin scripting ...
# scripting
z
Im trying my weird compose-jb in kotlin scripting experiment once more and I'm encountering a rather strange error. Using kotlin 1.8.20 error: somewhere in file test.main.kts: java.lang.IllegalArgumentException: source must not be null (test.main.kts): org.jetbrains.kotlin.util.FileAnalysisException: Somewhere in file test.main.kts: java.lang.IllegalArgumentException: source must not be null This is my script
Copy code
#!/usr/bin/env -S kotlinc -script -language-version 2.0 -Xplugin=/home/nick/.local/share/gradle/caches/modules-2/files-2.1/org.jetbrains.compose/compose-gradle-plugin/1.4.0-rc03/7216fdad9334b0b609fc67a36ba6416a7253cea4/compose-gradle-plugin-1.4.0-rc03.jar --

@file:Repository("<https://maven.google.com>")
@file:Repository("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
@file:Repository("<https://repo.maven.apache.org/maven2>")

@file:DependsOn("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
@file:DependsOn("org.jetbrains.compose.runtime:runtime-desktop:1.4.0-rc03")
@file:DependsOn("org.jetbrains.compose.desktop:desktop-jvm:1.4.0-rc03")
@file:DependsOn("org.jetbrains.compose.material:material-desktop:1.4.0-rc03")

//runBlocking {
//    application {
//        Window(onCloseRequest = ::exitApplication) {
//            Text("Hello world!")
//        }
//    }
//}
a
I think you need to add a
-jvm
suffix to most of those dependencies. Scripting is JVM only, and because it’s not using Gradle to resolve the dependencies you need to be explicit about the required multiplatform variant
z
ok so the error only happens when i have
-language-version 2.0
i
Please file an issue in YT https://kotl.in/issue