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

Konstantin Petrukhnov

09/16/2019, 9:19 AM
I have project 'FW' that have api dependencies 'LibA' and 'LibC'. When I build framework(cocoapods) for iOS, classes from LibA and LibC are not available top ios app. Only classes that explicitly mentioned (e.g. as return types) appears in header. How do i export all classes from api dependencies?
a

alex009

09/16/2019, 9:24 AM
if you want export all classes of all libraries - use
transitiveExport = true
. If you want only specific modules - use
Copy code
export(project(":LibA"))
export(project(":LibC"))
https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#exporting-dependencies-in-frameworks
k

Konstantin Petrukhnov

09/16/2019, 10:02 AM
transitiveExport = true almost works
Two libraries have same class name (different package), and in header one of them have '_' suffix. I don't see any way to distinguish from which library to import. Is there way to specify some package or prefix for exported dependency?
E.g. com.liba.MyClass -> MyClass com.libc.MyClass -> MyClass_
but I want something like: com.liba.MyClass -> LibAMyClass com.libc.MyClass -> LibCMyClass
a

alex009

09/16/2019, 10:08 AM
by default in objective c all classes prefixed by name of gradle module. but in swift prefixes deleted...maybe it can be disabled
@olonho can we control prefix of dependency generated for swift code?
s

svyatoslav.scherbina

09/16/2019, 10:24 AM
No.
😞 1
k

Konstantin Petrukhnov

09/16/2019, 10:25 AM
Any plans for future for such configuration?
hm... will it give suffix to other class, if e.g. order of dependencies changed?
s

svyatoslav.scherbina

09/16/2019, 10:38 AM
Any plans for future for such configuration?
We consider improving the situation eventually. No particular details (including ETA) available currently.
hm... will it give suffix to other class, if e.g. order of dependencies changed?
It depends.
k

Konstantin Petrukhnov

09/16/2019, 10:39 AM
ok, thank you!
5 Views