I have a set of snippets for iOS, MacOS, WatchOS and TvOS that I would like to embed in a Cocoapod library (possibly supporting also Carthage as well).
The tricky part for me is that I have targets for all the platforms (iOS, MacOS TvOS etc...) but some of the files are targeted only in a subset of them.
In my Xcode project I divided the code in folders like:
Library_Common
(target all)Library_iOS
(target iOS)Library_WatchOS
(target WatchOS)Library_MacOS
(target MacOS)
This because, for example, the iOS part of the library may need UIKit
and the MacOS
may need other frameworks not available for iOS.
How can I setup the podspec in such a way that this library can be embedded in all the platforms?
Is there a way to do it or is better to split it in different libraries? The problem of this approach would be that the Library_Common
part would be repeated for each one.