Hello, I have 3 modules (A / B / C), B & C dep...
# ios
r
Hello, I have 3 modules (A / B / C), B & C depend on 1 to share classes. But with the export SPM, it rename the class from A to BClass & CClass. Instead of keeping the classe from A. Is it possible to not rename it and keep reference from the module ?
t
I'm not sure I'm following correctly, but have you tried making them an
api(B)
dependency (instead of
implementation(B)
) and then adding
export(B)
in the
framework { }
block in
build.gradle.kts
?
r
Yes, it's still export the class like it's from module B and not A
t
That's weird, that shouldn't be the case
r
I'm asking myself if it's even possible. Maybe I need to make a umbrella framework that contains all framework and export it
t
I'm confused about your module structure
I thought
A
is the umbrella
r
• A: Remote Config & Handling error (Common Result class) • B: API from a service. Depend on A for Result • C: API from another service. Depend on A for Result I want to add B&C in a iOS project, and C in another iOS project Dunno if it's clear 😄
t
Are
A
,
B
,
C
all kotlin modules?
r
Yes
t
Ah I see what's the problem
So you're producing
.framework
in both
B
and
C
?
r
Yes exactly
t
I see, I thought you were talking about a different limitation of Kotlin/Native.
r
No, it's more about exporting with SPM
Dunno if there is method to map a kotlin module to SPM package
t
This is unfortunately something you'll have to create a
BC
umbrella framework. Each
.framework
is separate and has unique symbols. So you can't pass types between
B.framework
and
C.framework
, even though the Kotlin code is the same
There's nothing SKIE can help with here, because this is a Kotlin/Native limitation in how the final
.framework
is being built
r
Arf, okay. I was afraid of this answer. Thank you for helping !