https://kotlinlang.org logo
Title
y

Yan Pujante

04/20/2022, 5:53 PM
Just created an empty compose-desktop project with latest IDEA/Utlimate (2022.1) and trying to add a dependency:
sourceSets {
        val jvmMain by getting {
            dependencies {
                implementation(compose.desktop.currentOs)
                implementation(files("external/libs/luaj-jse-3.0.2.jar"))
            }
        }
but the dependency is not being picked up. If I replace the path with
/foo.jar
nothing happens either, not even an error message. Any idea what is wrong?
k

Kirill Grouchnikov

04/20/2022, 5:57 PM
Which one, compose or this luaj-jse?
y

Yan Pujante

04/20/2022, 5:58 PM
luaj (the wizard generated the compose.desktop.currentOs line)
if I move the
dependencies
section outside like in one of the official example (https://github.com/JetBrains/compose-jb/blob/master/examples/notepad/build.gradle.kts) I get
Unresolved reference: implementation
error
d

Dragos Rachieru

04/21/2022, 11:33 AM
Well, if you use
sourceSets
and
jvmMain
you are using the
multiplatform
plugin. The notepad example uses the
jvm
plugin. That's why it's not working, You can go with
jvm
if you target
desktop
only About the jar, make sure the file is in the specified folder relative to the
build.gradle.kts
file
y

Yan Pujante

04/21/2022, 12:52 PM
I guess that would explain it (although I explicitely selected a desktop single application, not a multiplatform one in the IDEA wizard). And yes the file is there...
> ls -la build.gradle.kts
-rw-r--r--  1 ypujante  staff  1143 Apr 20 10:58 build.gradle.kts
> ls -la external/libs/luaj-jse-3.0.2.jar
-rw-r--r--@ 1 ypujante  staff  354944 Apr 20 10:39 external/libs/luaj-jse-3.0.2.jar