bazel-xcode / PodToBUILD

An easy way to integrate CocoaPods into Bazel
Apache License 2.0
323 stars 69 forks source link

First pass at mixed module swift support #153

Closed jerrymarino closed 4 years ago

jerrymarino commented 4 years ago

This PR adds mixed module swift support with the constraints that Xcode and the PodSpec supports. An objc library may depend on a swiftmodule and the swift module implicitly imports the public objc module. Currently, all sources are propagated to a single swift_library to produce a single swiftc invocation. The swift interface header is included in a public module map, while the public headers are exposed to the swiftc invocation through a private module map

Additionally, it cleans up the rule for module map to be simpler and more easily used in this context. The BazelTarget for this rule additionally passes named arguments to improve readability.

Note: because we reduce sources into a single swift library, it must consider subspecs that are included, otherwise, it would pull in sources from the entire podspec. Currently it uses Default subspecs. As a followup, we need to add an option to new_pod_repository to select subspecs. Additionally, I'll follow up to fix the ad-hoc targets in ObjcLibrary

It also adds FBSDK as a build test.

jerrymarino commented 4 years ago

I'm going to land what's here as a first pass, I think we can issue some followups to keep scope down ( and I'm running up against deadlines ) So far I've tested it with a handful of permutations of Swift sources:

I'm planning to run this against a broader set of Pods.