Hi guys I’ve created my project using the KMP Wiza...
# multiplatform
a
Hi guys I’ve created my project using the KMP Wizard, and it includes two modules:
:composeApp
and
:shared
I want to structure my code following the Clean Architecture principles, which involves additional
core
,
domain
and
data
modules Can you suggest the best way to implement this in a KMP project? Specifically, where and how should I define these modules? Thank you
p
You are wrong. data, domain and presentation are not modules. They are just the packages. You should have your packages inside your shared module and also inside composeApp if needed
a
Is there any way to limit visibility of specific package? For example, I don’t want my
core
package knows about
data
and
domain
packages
p
Can't do that way. But You can think like that 😀
😂 1
a
Yeah 😄
p
I like to have feature wise data, domain and presentation packages instead
l
@Andrey Larionov you can use submodules, like this:
Copy code
// shared/a/build.gradle.kts
dependencies {
    runtimeOnly(":shared:b")
}
a
@Laxystem can you share any sample project to see how it works? It seems like it doesn’t work
l
Well, you don't have to necessarily use
runtimeOnly
(you're probably better off using
implementation
, actually). I don't have a sample project, actually.
a
@Pamela Hill Hello. Does JetBrains have any plans to support modularization? If they exist, could you please share links to relevant issues for us to follow?
y
@Andrey Larionov if you want we can hop on a quick call and i will show you how to structure it the right way, i sent u a dm
a
You are wrong. data, domain and presentation are not modules. They are just the packages
Sadly, you are wrong too 😔 , they can be structured into different packages yes, but also they can be structured into their own respective modules, and we are already doing this
1
p
@Andrey Larionov we already support modularisation. You can have a look at here how you can configure your projects. Please note the umbrella module that's mentioned in the document.
b
hi @Pamela Hill, That would be awesome, if there is example GitHub repository to see implementation.🙌