Exclude platform-specific resources in Package.swift

Viewed 194

I have an SDK for which I want to add SPM support. The SDK can be compiled for iOS and macOS. Most of the source files are common to both platforms but it has a few platform-specific source files that deal with UI and a couple of xib files for the macOS target. I'm using #if canImport(...) in the source files to compile files only for their intended platform. But I can't find a way to exclude .xib files from the iOS version of the SDK. I can't exclude them in the .target(...) statement, because then I would exclude them for both platforms. I can't make a separate target for each platform.

Any idea if this is currently possible?

0 Answers
Related