https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
s

SrSouza

01/27/2023, 2:49 AM
Hi folks, i have a Compose multiplatform projects that is modular, each module can have it own resources in commonMain/resources, but at the final desktop module (the application one), when running, the resources files is not transitive being add to the application jar file to be used. How can I make all resource files for all modules be available in the desktop app?
1
c

CLOVIS

01/27/2023, 8:29 AM
This should work for JVM targets 🤔 I know it currently doesn't with JS
d

Dima Avdeev

01/27/2023, 9:21 AM
I made a sample, how you can share resources between different jvm modules and commonMain and jvmMain sourcesets. https://github.com/dima-avdeev-jb/jvm-share-multimodule-resources Also, for multiplatform modules, you can look at an experimental library here: https://github.com/JetBrains/compose-jb/tree/master/components/resources
j

Javier

01/27/2023, 10:53 AM
I thought that the
res
merging is an Android feature that is not on normal
resources
m

Michael Paus

01/27/2023, 12:32 PM
Is that experimental library not yet included in the current build of the compose libraries? I could not get the package resolved in 1.3.0-rc05.
c

Cicero

02/07/2023, 7:48 PM
Thank you @Dima Avdeev, but I only saw the resource being pulled into the desktop app!
Man, @Javier, I actually found your library by accident, did you created a solution based on the jetbrains source? I was thinking about doing something like this instead of having some side module in my project. Do you need help?
j

Javier

02/07/2023, 8:15 PM
do you mean compose resources? the expect actual part is one line if I remember correctly
Ok, there was no explanation on the README and I already spent a reasonable time digging into the JB source, thought better just ask 🙂
You say for KMM the solution is a one liner?
j

Javier

02/07/2023, 8:23 PM
I think the solution I have there was put in moko resources too
I haven't added iOS support
c

Cicero

02/07/2023, 8:28 PM
I'm just interested in the Android/Desktop stuff! Thank you very much.
j

Javier

02/07/2023, 8:49 PM
my plugin only allow using different drawables based on the theme, but the real utilities are on moko at the end
92 Views