https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

Piotr Prus

10/25/2021, 11:58 AM
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

russhwolf

10/25/2021, 12:19 PM
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

Piotr Prus

10/25/2021, 1:10 PM
thanks! That was exactly what i needed. 🙏
106 Views