https://kotlinlang.org logo
Title
s

spierce7

11/10/2020, 1:20 PM
In all of the desktop examples, the targets seem to be split into a separate gradle module (i.e. Desktop), that just runs the application, while the core application is in a common module. Why not just run the application from the core module for these small applications? There isn’t much gained by just having
main
in a separate module is there?
o

olonho

11/10/2020, 1:25 PM
please see https://github.com/JetBrains/compose-jb/tree/master/templates/desktop-template for such simple cases, all examples have Android and Desktop versions
i

Igor Demin

11/10/2020, 1:44 PM
We separate multiplatform project into common/android/desktop modules because we had issues with plugin compatibility ("application" plugin doesn't compatible with "com.android.application"). But now we don't use "application" plugin, so maybe we can rewrite most of our examples with single module. I just tried to move all sources into single module, and it worked.
👍 1
g

Giorgos Neokleous

11/10/2020, 2:15 PM
I agree that there isn't much to gain by creating different modules for small applications, I think it's a good practise. People often look up to official samples for best practises, so why not keeping them multi-module ?
s

spierce7

11/10/2020, 2:20 PM
Creating small modules can be good, especially when they are in the middle layers of your application, but just having a module where you have main, apply some theming, and then delegate to common code, I’m not sure is super valuable, and I’d be interested in it’s build performance impact.
i

Igor Demin

11/18/2020, 3:42 PM