piotrch
(PiotrCh)
1
Hi,
I have a PackageA that uses swift code and has a dependency on a PackageB that also uses swift code only.
In the main hosting app, I would like to just import PackageA and use the classes of PackageA and also PackageB. Is this possible somehow?
I did set the proper access levels (public) in both of the packages. but importing PackagaA in my main app does not let me use the classes from PackageB. I have to import the PackageB to make it work
note: packages are local.
Any help appreciated.
piotrch
(PiotrCh)
3
Hi @George !
Thanks for the reply.
The type aliases could be okay-ish if my codebase would be small. I was reading also about the @_exported, but as you say, the underscore explicitly marks that it's not finished. Don't want to build on top of that as a 'hack' .
I was also thinking about the 3rd option that you suggested, but again, for small API could be okay, it depends on codebase size and complexity.
I was thinking if there is some SPM. Project setting or a headers "hack", allowing us to expose the lower packages to the main app where the the parent package is utilised.
I am not sure if this is by the design or such feature will come to the SPM later?
@George once again, thanks for your reply and input 
piotrch
(PiotrCh)
4
I have found that Firebase in their swift package are exporting underlying modules through one import Firebase in the containing app.
https://github.com/firebase/firebase-ios-sdk.git
When I open the import Firebase in Xcode, I can see it imports:
import FirebaseCore
import FirebaseCrashlytics
import FirebaseInstallations
import FirebaseRemoteConfigInternal
so it looks like they have solved to include couple of swift PM targets into a single one. But I yet don't understand how. I tried to reproduce it on my own, but failed to do so. The classes are unreachable just by import PackageA in my example.