I am trying to introduce DDD in kotlin multiplatfo...
# multiplatform
p
I am trying to introduce DDD in kotlin multiplatform mobile project. I have created 2 modules:
infrastructure
that contains repositories, apis, responsesDTO, etc and
domain
that contains usecase interfaces and domain specific data classes. I want ios and android client to know only
domain
, without any idea of
infrastructure
, so in the build.gradle of my
shared
I have:
Copy code
api(project(":domain"))
                implementation(project(":infrastructure"))
The issue I am facing: The ios client do not see any of domain classes if theses are not used in
shared
. Is there any way to force compilation of these? Android client sees all of these classes correctly and can make a use of them.
r
There's an extra export call you have to do to expose dependencies to obj-c/swift. See https://kotlinlang.org/docs/mpp-build-native-binaries.html#export-dependencies-to-binaries
p
thanks! That was exactly what i needed. 🙏
115 Views